<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>PyMRM Gallery</title>
<link>https://computational-chemical-engineering.github.io/pymrm-gallery/gallery.html</link>
<atom:link href="https://computational-chemical-engineering.github.io/pymrm-gallery/gallery.xml" rel="self" type="application/rss+xml"/>
<description>Important phenomenological models from the chemical engineering literature, reproduced with pymrm and shown against their original experimental data.
</description>
<generator>quarto-1.10.18</generator>
<lastBuildDate>Mon, 17 Aug 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Five fixed-bed models on one reactor: what each rung of Froment’s ladder buys</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/D1.1-froment-fixed-bed-ladder/</link>
  <description><![CDATA[ 




<section id="five-fixed-bed-models-on-one-reactor-what-each-rung-of-froments-ladder-buys" class="level1">
<h1>Five fixed-bed models on one reactor: what each rung of Froment’s ladder buys</h1>
<p><strong>Catalog ID:</strong> <code>D1.1</code> (covering <code>D1.2</code>, <code>D1.3</code>, <code>D1.4</code>, <code>D1.5</code>) · <strong>Structures:</strong> <code>S2</code> <code>S4</code> <code>S6</code> <code>S7</code> <code>S8</code> · <strong>Tier:</strong> T0</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>Table 11.4-1 of Froment, De Wilde &amp; Bischoff (2011), on book page 505, is not a ladder. It is a <strong>2 x 3 classification</strong>: pseudohomogeneous models (<img src="https://latex.codecogs.com/png.latex?T%20=%20T_s">, <img src="https://latex.codecogs.com/png.latex?C%20=%20C_s">) against heterogeneous ones, crossed with one-dimensional basic, one-dimensional with mixing, and two-dimensional. Read from the book’s own table:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>A - pseudohomogeneous, <img src="https://latex.codecogs.com/png.latex?T%20=%20T_s">; <img src="https://latex.codecogs.com/png.latex?C%20=%20C_s"></th>
<th>B - heterogeneous, <img src="https://latex.codecogs.com/png.latex?T%20%5Cne%20T_s">; <img src="https://latex.codecogs.com/png.latex?C%20%5Cne%20C_s"></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>one-dimensional</td>
<td>I sec.&nbsp;11.5 &nbsp; basic, ideal</td>
<td>I sec.&nbsp;11.8 &nbsp; + interfacial gradients</td>
</tr>
<tr class="even">
<td></td>
<td>II sec.&nbsp;11.6 &nbsp; + axial mixing</td>
<td>II sec.&nbsp;11.9 &nbsp; + intraparticle gradients</td>
</tr>
<tr class="odd">
<td>two-dimensional</td>
<td>III sec.&nbsp;11.7 &nbsp; + radial mixing</td>
<td>III sec.&nbsp;11.10 &nbsp; + radial mixing</td>
</tr>
</tbody>
</table>
<p><strong>The ordering this page uses, and why.</strong> The five cases the gallery catalogue calls <code>D1.1</code>-<code>D1.5</code> are five of those six cells. The book presents them in the order 11.5, 11.6, 11.7, 11.8, 11.9 - reading the table <strong>down each column</strong>, so that the two-dimensional pseudohomogeneous model (11.7) sits between the two one-dimensional heterogeneous ones. This page instead orders them by <strong>how much each one adds to the transport description of the previous</strong>:</p>
<ol type="1">
<li><strong>11.5</strong> basic one-dimensional plug flow (<code>S2</code>) - convection only,</li>
<li><strong>11.6</strong> + axial dispersion of heat and mass, Danckwerts inlet (<code>S4</code>),</li>
<li><strong>11.8</strong> + a solid phase separated from the gas by a film (<code>S7</code>),</li>
<li><strong>11.9</strong> + concentration profiles inside the particle (<code>S8</code>),</li>
<li><strong>11.7</strong> + a radial coordinate in the tube (<code>S6</code>).</li>
</ol>
<p>That puts 11.7 last rather than third, for one reason that is arithmetic rather than taste: <strong>rung 1’s wall coefficient and rung 5’s two radial parameters are the same measurement.</strong> Section 11.7.4’s equation (11.7.4-1) collapses the two-dimensional pair <img src="https://latex.codecogs.com/png.latex?(%5Calpha_w,%20%5Clambda_%7Ber%7D)"> into the single <img src="https://latex.codecogs.com/png.latex?%5Calpha_i"> that rung 1 uses, and the notebook reproduces section 11.5.2’s printed <img src="https://latex.codecogs.com/png.latex?U%20=%200.096"> kJ/(m<img src="https://latex.codecogs.com/png.latex?%5E2"> s K) from section 11.7.3’s printed <img src="https://latex.codecogs.com/png.latex?%5Calpha_w%20=%200.156"> and <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Ber%7D%20=%200.78%20%5Ctimes%2010%5E%7B-3%7D"> <strong>to both of the digits it prints</strong>.</p>
<p>That is a consistency check, and it is stated as one. It is <strong>not</strong> evidence that the book derived the 0.096 that way: Van Welsenaere &amp; Froment’s own <img src="https://latex.codecogs.com/png.latex?U%20=%2082.7"> kcal/(m<img src="https://latex.codecogs.com/png.latex?%5E2"> h K), converted to kJ/(m<img src="https://latex.codecogs.com/png.latex?%5E2"> s K), also rounds to 0.096 at the two significant figures actually printed, and section 11.5.2 is otherwise their parameter set throughout. What the identity <em>does</em> decide, discriminatingly, is the tube radius: (11.7.4-1) returns 0.096 at <img src="https://latex.codecogs.com/png.latex?R_t%20=%200.0125"> m and a value that rounds to 0.095 at the 0.0127 m the printed 2.54 cm diameter implies (both computed in <em>Parameters and assumptions</em>). Rung 1 and rung 5 are therefore entangled whichever way the number was obtained, which is the reason for reading the table in this order rather than the book’s.</p>
<p><strong>The point of the page is the comparison.</strong> Five restatements of five equation sets would be five-sixths of a chapter retyped. What is worth measuring is <em>where the simpler model already suffices and where it misleads</em>, and the comparison is only meaningful if all five rungs run on the <strong>same reactor with the same chemistry</strong>. Section 11.5.2’s hydrocarbon-oxidation design case is the one the book itself carries furthest: 11.5.2 designs it, 11.5.3 works its runaway criteria, 11.7.3 puts a fuller kinetic scheme for it in two dimensions, and 11.8.2 runs its startup with a solid phase. So that is the reactor here, with the pseudo-first-order rate of 11.5.2 held fixed across all five rungs.</p>
<p><strong>What this page does not own.</strong> The chapter overlaps six published pages, and this page loads their numbers rather than restating them:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>the chapter’s content</th>
<th>the page that owns it</th>
<th>what is done here</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Van Welsenaere &amp; Froment’s runaway criteria, which 11.5.3 applies</td>
<td><code>D2.2</code></td>
<td>both its CSVs are loaded; Example 11.5.3.A is checked <em>against the original</em>, and the criteria are not rebuilt</td>
</tr>
<tr class="even">
<td>Froment (1967)’s o-xylene network and its 1-D/2-D runaway pair, which 11.7.3/11.7.4 restate</td>
<td><code>C2.10</code> (which absorbed <code>D3.4</code>)</td>
<td>its parameter and stated-result CSVs are loaded and reconciled with the book’s restatement; the 1967 case is <strong>not</strong> re-run</td>
</tr>
<tr class="odd">
<td>Danckwerts’ inlet and outlet conditions, which 11.6 needs</td>
<td><code>A2.1</code></td>
<td>its boundary-condition dicts are used as published, with its outlet-sign blind spot cited, not rediscovered</td>
</tr>
<tr class="even">
<td>the isothermal effectiveness factor, which 11.9.1 needs</td>
<td><code>B1.1</code></td>
<td>its exact-<img src="https://latex.codecogs.com/png.latex?%5Ceta"> CSV is loaded as the reference for eq. (11.9.1-11)</td>
</tr>
<tr class="odd">
<td>the Ergun friction factor of eq. (11.5.1-13)</td>
<td><code>A1.1</code></td>
<td>its printed-constant CSV is loaded; Example 11.5.1.A’s <em>equivalent particle diameter</em> is the part <code>A1.1</code> does not carry</td>
</tr>
<tr class="even">
<td>Sh <img src="https://latex.codecogs.com/png.latex?=%202%20+%201.1%5C,Sc%5E%7B1/3%7DRe%5E%7B0.6%7D"> for the film</td>
<td><code>A3.4</code></td>
<td>used as published for <img src="https://latex.codecogs.com/png.latex?k_g">, with the analogous Nu for <img src="https://latex.codecogs.com/png.latex?h_f"></td>
</tr>
<tr class="odd">
<td>Mears’ interphase temperature criterion, printed on book p.&nbsp;588</td>
<td><code>B1.7</code></td>
<td>evaluated here on this reactor; the criterion family is <code>B1.7</code>’s</td>
</tr>
<tr class="even">
<td>Gunn’s axial and radial dispersion correlations, cited by 11.6 and 11.7.1</td>
<td><code>A2.6</code></td>
<td>the book’s own “Pe<img src="https://latex.codecogs.com/png.latex?_a"> between 1 and 2” is used; Gunn’s forms are <code>A2.6</code>’s</td>
</tr>
</tbody>
</table>
<p><strong>Provenance.</strong> Tier 6. Chapter 11 reports <strong>no experiment</strong>. Every comparison on this page is against a number the book computed itself or a sentence it asserts, so what follows is a reproduction of the book’s arithmetic and of its claims about its own models - never a validation against data. Said again in <em>Validation</em>.</p>
<div id="1a02673d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:11.748556Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:11.748340Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:41:11.763404Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:41:11.762467Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D1.1-froment-fixed-bed-ladder"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="1eecb9db" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:11.765547Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:11.765310Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:41:12.616418Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:41:12.615345Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> inspect</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> dataclasses <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> replace</span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, load_claims, Claims</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (KCAL, Reactor, film, eta_sphere, phi_prime, Ladder, Pellet, hotspot,</span>
<span id="cb2-10">                   solve_robust, T_max_safe, CTL_JUMP, CTL_STATS, NotACrossing,</span>
<span id="cb2-11">                   crossing_control, p0_critical, cross_scan, ode_reference,</span>
<span id="cb2-12">                   p0_critical_ode, richardson)</span>
<span id="cb2-13"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> _shift_or_none</span>
<span id="cb2-14"></span>
<span id="cb2-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: nothing on this page is stochastic - no sampling, no bootstrap, no</span></span>
<span id="cb2-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># random initial guess.  Every fixed-inlet solve starts from a guess that is a fixed</span></span>
<span id="cb2-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># function of the inputs, and every threshold is followed along its branch from one</span></span>
<span id="cb2-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># such start inside a single call, so no state crosses from one call to the next.</span></span>
<span id="cb2-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Two consecutive executions give identical content and agreement.json.</span></span>
<span id="cb2-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A pandas Styler's text/plain repr is a memory address and its HTML carries a</span></span>
<span id="cb2-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># random id, so Stylers go through to_html() with a PINNED uuid; and ipykernel</span></span>
<span id="cb2-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># flushes stdout on a timer, so the flush interval is disabled.</span></span>
<span id="cb2-23"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb2-24">    sys.stdout.flush_interval <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span></span>
<span id="cb2-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>:</span>
<span id="cb2-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb2-27"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> HTML, display</span>
<span id="cb2-28"></span>
<span id="cb2-29"></span>
<span id="cb2-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> show(styler):</span>
<span id="cb2-31">    display(HTML(styler.to_html()))</span>
<span id="cb2-32"></span>
<span id="cb2-33"></span>
<span id="cb2-34">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-35">C_BLUE, C_ORANGE, C_GREEN, C_PURPLE, C_RED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span>,</span>
<span id="cb2-36">                                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#8B0000"</span>)</span>
<span id="cb2-37">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb2-38"></span>
<span id="cb2-39">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D1.1-froment-fixed-bed-ladder"</span></span>
<span id="cb2-40">D22 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D2.2-van-welsenaere-froment-runaway"</span></span>
<span id="cb2-41">C210 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C2.10-o-xylene-phthalic-anhydride"</span></span>
<span id="cb2-42">B11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B1.1-thiele-weisz-hicks"</span></span>
<span id="cb2-43">A11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A1.1-ergun-pressure-drop"</span></span>
<span id="cb2-44"></span>
<span id="cb2-45">BK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-2011-ch11-printed.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb2-46">BKMETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-2011-ch11-printed.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb2-47"></span>
<span id="cb2-48"></span>
<span id="cb2-49"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bk(key, field<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>):</span>
<span id="cb2-50">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A number or sentence from Chapter 11, looked up - never retyped in a cell."""</span></span>
<span id="cb2-51">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BK.loc[key, field]</span>
<span id="cb2-52">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> field <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(v)</span>
<span id="cb2-53"></span>
<span id="cb2-54"></span>
<span id="cb2-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this page's own dataset :"</span>, BKMETA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>,</span>
<span id="cb2-56">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BK), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows read from Chapter 11"</span>)</span>
<span id="cb2-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, BK.kind.value_counts().to_dict())</span>
<span id="cb2-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"borrowed, and each source page read:"</span>)</span>
<span id="cb2-59">VWF_PAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van-welsenaere-froment-1970-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D22).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"symbol"</span>)</span>
<span id="cb2-60">VWF_EX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van-welsenaere-froment-1970-examples.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D22)</span>
<span id="cb2-61">F67_PAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-1967-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C210).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"symbol"</span>)</span>
<span id="cb2-62">F67_RES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-1967-stated-results.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C210)</span>
<span id="cb2-63">ETA_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"isothermal-exact.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>B11)</span>
<span id="cb2-64">ERG_PAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun-1952-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A11)</span>
<span id="cb2-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, pg, df <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van-welsenaere-froment-1970-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D22)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], D22, VWF_PAR),</span>
<span id="cb2-66">                   (load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van-welsenaere-froment-1970-examples.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D22)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], D22, VWF_EX),</span>
<span id="cb2-67">                   (load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-1967-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C210)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], C210, F67_PAR),</span>
<span id="cb2-68">                   (load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-1967-stated-results.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C210)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], C210, F67_RES),</span>
<span id="cb2-69">                   (load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"isothermal-exact.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>B11)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], B11, ETA_REF),</span>
<span id="cb2-70">                   (load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun-1952-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A11)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], A11, ERG_PAR)):</span>
<span id="cb2-71">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(df)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows   from pages/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/"</span>)</span>
<span id="cb2-72"></span>
<span id="cb2-73"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what the four source pages establish about these rows, read from their own</span></span>
<span id="cb2-74"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># committed claims rather than retyped; The data, below, says what each affects</span></span>
<span id="cb2-75">D22_C, C210_C, B11_C, A11_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (load_claims(pg) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (D22, C210, B11, A11))</span>
<span id="cb2-76">C210_U_WORST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(C210_C[k]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_ref_identity_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_lam075_identity_rel"</span>,</span>
<span id="cb2-77">                                             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_aw150_identity_rel"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>this page's own dataset : froment-2011-ch11-printed - 113 rows read from Chapter 11
   {'parameter': 56, 'stated_result': 40, 'claim': 17}
borrowed, and each source page read:
   van-welsenaere-froment-1970-parameters    12 rows   from pages/D2.2-van-welsenaere-froment-runaway/
   van-welsenaere-froment-1970-examples    30 rows   from pages/D2.2-van-welsenaere-froment-runaway/
   froment-1967-parameters               23 rows   from pages/C2.10-o-xylene-phthalic-anhydride/
   froment-1967-stated-results           19 rows   from pages/C2.10-o-xylene-phthalic-anhydride/
   thiele-isothermal-exact              180 rows   from pages/B1.1-thiele-weisz-hicks/
   ergun-1952-parameters                  7 rows   from pages/A1.1-ergun-pressure-drop/</code></pre>
</div>
</div>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>All five rungs are transcribed from <strong>renders</strong> of the book’s own pages, not from its text layer. <code>docs/papers-inventory.yaml</code> records why: every Symbol-font operator in this file extracts as an unmappable Private-Use-Area glyph (U+F02D minus, U+F03D equals, U+F02B plus) in all three <code>pdftotext</code> modes, so an extracted equation <em>looks complete and has no operators at all</em>. Two things were caught on the render during this transcription that the text layer had silently dropped: the leading <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> of eq. (11.6-1), and the Haughey–Beveridge amplitude, which extracted as 0.0731 and is printed 0.073.</p>
<p><strong>Rung 1 - section 11.5.1, basic one-dimensional pseudohomogeneous (<code>S2</code>).</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?-%5Cfrac%7Bd(u_s%20C_A)%7D%7Bdz%7D%20=%20r_A%20%5Crho_B%20%5Ctag%7B11.5.1-1%7D"> <img src="https://latex.codecogs.com/png.latex?u_s%20%5Crho_g%20c_p%20%5Cfrac%7BdT%7D%7Bdz%7D%20=%20(-%5CDelta%20H)%20r_A%20%5Crho_B%20-%204%5Cfrac%7BU%7D%7Bd_t%7D(T%20-%20T_r)%20%5Ctag%7B11.5.1-2%7D"> <img src="https://latex.codecogs.com/png.latex?-%5Cfrac%7Bdp_t%7D%7Bdz%7D%20=%20f%5Cfrac%7B%5Crho_g%20u_s%5E2%7D%7Bd_p%7D%20%5Ctag%7B11.5.1-3%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?C_A%20=%20C_%7BA0%7D">, <img src="https://latex.codecogs.com/png.latex?T%20=%20T_0">, <img src="https://latex.codecogs.com/png.latex?p_t%20=%20p_%7Bt0%7D"> at <img src="https://latex.codecogs.com/png.latex?z%20=%200">. Note <img src="https://latex.codecogs.com/png.latex?r_A"> is the rate of <em>disappearance</em>, positive. Section 11.5.2 writes the same pair in partial pressures for the design case, which fixes the constant-density conversion the whole page uses, <img src="https://latex.codecogs.com/png.latex?C_A%20=%20%5Crho_g%20p_A%20/%20(M_m%20p_t)">:</p>
<p><img src="https://latex.codecogs.com/png.latex?u_s%5Cfrac%7Bdp_A%7D%7Bdz%7D%20+%20%5Cfrac%7BM_m%20p_t%7D%7B%5Crho_g%7D%5Crho_B%5C,k%5C,p_B%5E0%20p_A%20=%200%20%5Ctag%7B11.5.2-1%7D"> <img src="https://latex.codecogs.com/png.latex?u_s%5Crho_g%20c_p%5Cfrac%7BdT%7D%7Bdz%7D%20-%20(-%5CDelta%20H)%5Crho_B%20k%20p_B%5E0%20p_A%20+%20%5Cfrac%7B4U%7D%7Bd_t%7D(T%20-%20T_r)%20=%200%20%5Ctag%7B11.5.2-2%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?r_A%20=%20k%5C,p_B%5E0%5C,p_A,%20%5Cqquad%20%5Cln%20k%20=%2019.837%20-%20%5Cfrac%7B13%7B,%7D636%7D%7BT%7D"></p>
<p><strong>Rung 2 - section 11.6, + axial mixing (<code>S4</code>).</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20D_%7Bea%7D%5Cfrac%7Bd%5E2C_A%7D%7Bdz%5E2%7D%20-%20u_s%5Cfrac%7BdC_A%7D%7Bdz%7D%20-%20r_A%5Crho_B%20=%200%20%5Ctag%7B11.6-1%7D"> <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bea%7D%5Cfrac%7Bd%5E2T%7D%7Bdz%5E2%7D%20-%20%5Crho_g%20u_s%20c_P%5Cfrac%7BdT%7D%7Bdz%7D%20+%20(-%5CDelta%20H)r_A%5Crho_B%20-%20%5Cfrac%7B4U%7D%7Bd_t%7D(T-T_r)%20=%200%20%5Ctag%7B11.6-2%7D"></p>
<p>with the conditions the book calls “those generally used”, verbatim:</p>
<p><img src="https://latex.codecogs.com/png.latex?u_s(C_%7BA0%7D%20-%20C_A)%20=%20-%5Cvarepsilon%20D_%7Bea%7D%5Cfrac%7BdC_A%7D%7Bdz%7D,%20%5Cqquad%0A%20%20%5Crho_g%20u_s%20c_p%20(T_0%20-%20T)%20=%20-%5Clambda_%7Bea%7D%5Cfrac%7BdT%7D%7Bdz%7D%20%5Cquad%20%5Ctext%7Bfor%20%7D%20z%20=%200"> <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdC_A%7D%7Bdz%7D%20=%20%5Cfrac%7BdT%7D%7Bdz%7D%20=%200%20%5Cquad%20%5Ctext%7Bfor%20%7D%20z%20=%20L"></p>
<p>These are the Danckwerts conditions of published <code>A2.1</code>, and its dict form is used unchanged. The notation list defines <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_a%20=%20u_i%20d_p%20/%20D_%7Bea%7D"> on the <em>interstitial</em> velocity, so <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20D_%7Bea%7D%20=%20u_s%20d_p%20/%20%5Cmathrm%7BPe%7D_a"> and the dispersion coefficient of (11.6-1), divided by <img src="https://latex.codecogs.com/png.latex?u_s">, is simply the <strong>length</strong> <img src="https://latex.codecogs.com/png.latex?d_p/%5Cmathrm%7BPe%7D_%7Bma%7D">. Section 11.6 says <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_a"> “may be considered to lie between 1 and 2”, and of the thermal analogue that “little information is available”.</p>
<p><strong>Rung 3 - section 11.8.1, + interfacial gradients (<code>S7</code>).</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?-u_s%5Cfrac%7BdC%7D%7Bdz%7D%20=%20k_g%20a_v%20(C%20-%20C_s%5Es)%20%5Ctag%7B11.8.1-1%7D"> <img src="https://latex.codecogs.com/png.latex?u_s%5Crho_g%20c_p%5Cfrac%7BdT%7D%7Bdz%7D%20=%20h_f%20a_v%20(T_s%5Es%20-%20T)%20-%204%5Cfrac%7BU%7D%7Bd_t%7D(T%20-%20T_r)%20%5Ctag%7B11.8.1-2%7D"> <img src="https://latex.codecogs.com/png.latex?%5Crho_B%20r_A%20=%20k_g%20a_v%20(C%20-%20C_s%5Es)%20%5Ctag%7B11.8.1-3%7D"> <img src="https://latex.codecogs.com/png.latex?(-%5CDelta%20H)%5Crho_B%20r_A%20=%20h_f%20a_v%20(T_s%5Es%20-%20T)%20%5Ctag%7B11.8.1-4%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?r_A"> evaluated at <img src="https://latex.codecogs.com/png.latex?(C_s%5Es,%20T_s%5Es)">, and <img src="https://latex.codecogs.com/png.latex?C%20=%20C_0">, <img src="https://latex.codecogs.com/png.latex?T%20=%20T_0"> at <img src="https://latex.codecogs.com/png.latex?z%20=%200">. Section 11.8.1 states that it carries “the restrictions already mentioned in Section 11.5.1 for the basic case”, which includes constant <img src="https://latex.codecogs.com/png.latex?u_s">, <img src="https://latex.codecogs.com/png.latex?%5Crho_g">, <img src="https://latex.codecogs.com/png.latex?c_p">.</p>
<p><strong>Rung 4 - section 11.9.1, + intraparticle gradients (<code>S8</code>).</strong> (11.9.1-1) and (11.9.1-2) repeat (11.8.1-1) and (11.8.1-2); the particle adds</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BD_e%7D%7B%5Cxi'%5E2%7D%5Cfrac%7Bd%7D%7Bd%5Cxi'%7D%5C!%5Cleft(%5Cxi'%5E2%5Cfrac%7BdC_s%7D%7Bd%5Cxi'%7D%5Cright)%20-%20%5Crho_s%20r_A(C_s,%20T_s)%20=%200%20%5Ctag%7B11.9.1-3%7D"> <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Clambda_e%7D%7B%5Cxi'%5E2%7D%5Cfrac%7Bd%7D%7Bd%5Cxi'%7D%5C!%5Cleft(%5Cxi'%5E2%5Cfrac%7BdT_s%7D%7Bd%5Cxi'%7D%5Cright)%20+%20%5Crho_s(-%5CDelta%20H)%20r_A(C_s,%20T_s)%20=%200%20%5Ctag%7B11.9.1-4%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdC_s%7D%7Bd%5Cxi'%7D%20=%20%5Cfrac%7BdT_s%7D%7Bd%5Cxi'%7D%20=%200%20%5C%20%5Ctext%7B%20at%20%7D%20%5Cxi'%20=%200;%20%5Cqquad%0A%20%20k_g(C_s%5Es%20-%20C)%20=%20-D_e%5Cfrac%7BdC_s%7D%7Bd%5Cxi'%7D,%20%5Cquad%0A%20%20h_f(T_s%5Es%20-%20T)%20=%20-%5Clambda_e%5Cfrac%7BdT_s%7D%7Bd%5Cxi'%7D%20%5C%20%5Ctext%7B%20at%20%7D%20%5Cxi'%20=%20%5Ctfrac%7Bd_p%7D%7B2%7D"></p>
<p>The book’s own footnote to (11.9.1-4) is worth quoting because it removes the commonest sign trap in this equation: <em>“The signs in (11.9.1-3) and (11.9.1-4) are those obtained when the rate is defined for first order as <img src="https://latex.codecogs.com/png.latex?r_A%20=%20kC_A">. Many books define <img src="https://latex.codecogs.com/png.latex?r_A%20=%20-kC_A">.”</em> It then offers the reduction this page uses for the ladder, <img src="https://latex.codecogs.com/png.latex?%5Ceta"> multiplying the surface rate,</p>
<p><img src="https://latex.codecogs.com/png.latex?k_g%20a_v%20(C%20-%20C_s%5Es)%20=%20%5Ceta%5C,%5Crho_B%20r_A(C_s%5Es,%20T_s%5Es)%20%5Ctag%7B11.9.1-9%7D"> <img src="https://latex.codecogs.com/png.latex?h_f%20a_v%20(T_s%5Es%20-%20T)%20=%20%5Ceta%5C,%5Crho_B(-%5CDelta%20H)%20r_A(C_s%5Es,%20T_s%5Es)%20%5Ctag%7B11.9.1-10%7D"> <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%20%5Cfrac%7B3%7D%7B%5Cphi''%5E2%7D%5Cleft%5B%5Cphi''%5Ccoth%5Cphi''%20-%201%5Cright%5D,%5Cqquad%0A%20%20%5Cphi''%20=%20%5Cfrac%7Bd_p%7D%7B2%7D%5Csqrt%7B%5Cfrac%7Bk(T_s%5Es)%5Crho_s%7D%7BD_e%7D%7D%20%5Ctag%7B11.9.1-11%7D"></p>
<p><strong>Rung 5 - section 11.7.2, two-dimensional pseudohomogeneous (<code>S6</code>).</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?(D_%7Ber%7D)_s%5C!%5Cleft(%5Cfrac%7B%5Cpartial%5E2%20C%7D%7B%5Cpartial%20r%5E2%7D%20+%20%5Cfrac%7B1%7D%7Br%7D%5Cfrac%7B%5Cpartial%20C%7D%7B%5Cpartial%20r%7D%5Cright)%20-%20u_s%5Cfrac%7B%5Cpartial%20C%7D%7B%5Cpartial%20z%7D%20-%20%5Crho_B%20r_A%20=%200%20%5Ctag%7B11.7.2-1%7D"> <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Ber%7D%5C!%5Cleft(%5Cfrac%7B%5Cpartial%5E2%20T%7D%7B%5Cpartial%20r%5E2%7D%20+%20%5Cfrac%7B1%7D%7Br%7D%5Cfrac%7B%5Cpartial%20T%7D%7B%5Cpartial%20r%7D%5Cright)%20-%20u_s%5Crho_g%20c_p%5Cfrac%7B%5Cpartial%20T%7D%7B%5Cpartial%20z%7D%20+%20%5Crho_B(-%5CDelta%20H)%20r_A%20=%200"></p>
<p><img src="https://latex.codecogs.com/png.latex?C%20=%20C_0,%5C%20T%20=%20T_0%20%5C%20%5Ctext%7B%20at%20%7D%20z=0;%20%5Cqquad%0A%20%20%5Cfrac%7B%5Cpartial%20C%7D%7B%5Cpartial%20r%7D%20=%200%20%5C%20%5Ctext%7B%20at%20%7D%20r%20=%200%20%5Ctext%7B%20and%20%7D%20r%20=%20R_t;%20%5Cqquad%0A%20%20%5Cfrac%7B%5Cpartial%20T%7D%7B%5Cpartial%20r%7D%20=%200%20%5C%20%5Ctext%7B%20at%20%7D%20r%20=%200"> <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cpartial%20T%7D%7B%5Cpartial%20r%7D%20=%20-%5Cfrac%7B%5Calpha_w%7D%7B%5Clambda_%7Ber%7D%7D(T_R%20-%20T_w)%20%5C%20%5Ctext%7B%20at%20%7D%20r%20=%20R_t"></p>
<p>There is <strong>no</strong> <img src="https://latex.codecogs.com/png.latex?4U/d_t"> term here: the wall coefficient <img src="https://latex.codecogs.com/png.latex?%5Calpha_w"> of eq. (11.7.1-1) replaces it, and eq. (11.7.4-1) is how the book converts between them,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B%5Calpha_i%7D%20=%20%5Cfrac%7B1%7D%7B%5Calpha_w%7D%20+%20%5Cfrac%7BR_t%7D%7B4%5Clambda_%7Ber%7D%7D%20%5Ctag%7B11.7.4-1%7D"></p>
<p><strong>A printed inconsistency in rung 5’s own groups, reported and not repaired.</strong> Book page 574 prints <img src="https://latex.codecogs.com/png.latex?a_1%20=%20(D_%7Ber%7D)_s/(u_i%20d_p)%20=%201/%5Cmathrm%7BPe%7D_%7Bmr%7D">, and book page 572 prints, two pages earlier, that <img src="https://latex.codecogs.com/png.latex?(D_%7Ber%7D)_s"> “equals <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20D_%7Ber%7D">, with <img src="https://latex.codecogs.com/png.latex?D_%7Ber%7D"> based upon the interstitial flow velocity <img src="https://latex.codecogs.com/png.latex?u_i">”. Those two statements are inconsistent by a factor <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon">: with <img src="https://latex.codecogs.com/png.latex?(D_%7Ber%7D)_s%20=%20%5Cvarepsilon%20D_%7Ber%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_%7Bmr%7D%20=%20u_i%20d_p%20/%20D_%7Ber%7D">, <img src="https://latex.codecogs.com/png.latex?(D_%7Ber%7D)_s/(u_i%20d_p)%20=%20%5Cvarepsilon/%5Cmathrm%7BPe%7D_%7Bmr%7D">, while <img src="https://latex.codecogs.com/png.latex?(D_%7Ber%7D)_s/(u_s%20d_p)%20=%201/%5Cmathrm%7BPe%7D_%7Bmr%7D"> exactly. The denominator should be <img src="https://latex.codecogs.com/png.latex?u_s">, matching <img src="https://latex.codecogs.com/png.latex?a_2%20=%20%5Clambda_%7Ber%7D/(G%20c_p%20d_p)"> which is built on <img src="https://latex.codecogs.com/png.latex?G%20=%20%5Crho_g%20u_s"> in the very next line. Taken literally the printed group scales radial mass dispersion by <img src="https://latex.codecogs.com/png.latex?1/%5Cvarepsilon"> on this reactor (printed in the crossover cell). The page uses <img src="https://latex.codecogs.com/png.latex?(D_%7Ber%7D)_s/u_s%20=%20d_p/%5Cmathrm%7BPe%7D_%7Bmr%7D">, states that as the repair-by-inference it is, and measures what the literal reading would cost - which is where the book’s own sentence that “the computed results are not very sensitive with respect to <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_%7Bmr%7D">” gets tested rather than quoted.</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p>Section 11.5.2’s parameters are <strong>Van Welsenaere &amp; Froment’s (1970), restated in SI</strong>, and the restatement is a unit conversion. Published <code>D2.2</code> carries their printed originals, so the conversion can be audited row by row rather than assumed - which is what the next cell does. Two of its findings decide numbers the rest of the page depends on:</p>
<ul>
<li><strong>the tube radius.</strong> Section 11.5.2 says the internal diameter is 2.54 cm, but the printed <img src="https://latex.codecogs.com/png.latex?U%20=%200.096"> kJ/(m<img src="https://latex.codecogs.com/png.latex?%5E2"> s K) is eq. (11.7.4-1) evaluated at <img src="https://latex.codecogs.com/png.latex?R_t%20=%200.0125"> m, and Example 11.5.3.A uses <img src="https://latex.codecogs.com/png.latex?R_t%20=%200.0125"> m throughout. At 0.0127 m the hot spot at the book’s own <img src="https://latex.codecogs.com/png.latex?p_%7BA0%7D%20=%200.018"> is far outside the operating range the same page states; at 0.0125 m it is just inside. Both numbers are computed and printed in <em>Validation</em> below - none is typed here. Arithmetic decides the radius, not the printed diameter.</li>
<li><strong>the specific heat.</strong> 0.992 kJ/(kg K) is printed. Groups later in the same chapter require more. The page uses the volumetric <img src="https://latex.codecogs.com/png.latex?%5Crho_g%20c_p%20=%200.323"> kcal/(m<img src="https://latex.codecogs.com/png.latex?%5E3"> K) that they agree on, and reports the printed value as a defect rather than repairing it. The deviation is computed below.</li>
</ul>
<p><strong>Which pressure unit this page is in, and why it is not the one printed.</strong> Section 11.5.2 prints <em>“the total pressure … equal to 1 <strong>bar</strong>”</em> and <em>“<img src="https://latex.codecogs.com/png.latex?p_B%5E0%20=%200.211"> <strong>bar</strong>”</em>, and its design point as <em>“0.018 <strong>bar</strong>”</em>. The model this page runs is in <strong>atm</strong>, and that is a deliberate reading with four reasons, each of which the notebook either prints or transcribes:</p>
<ol type="1">
<li>the rate constant. <img src="https://latex.codecogs.com/png.latex?%5Cln%20k%20=%2019.837%20-%2013%7B,%7D636/T"> is Van Welsenaere &amp; Froment’s, printed by them for <img src="https://latex.codecogs.com/png.latex?r_A%20=%20k%5C,p_B%5E0%20p_A"> with the pressures in <strong>atm</strong>. Section 11.5.2 restates it <em>unchanged</em> while relabelling the pressures bar. Converting the pressures without converting <img src="https://latex.codecogs.com/png.latex?k"> is a partial conversion, and the self-consistent model is the unconverted one;</li>
<li>the book’s own figure. Fig. 11.5.2-1’s ordinate label reads <strong>“<img src="https://latex.codecogs.com/png.latex?p_0">, atm”</strong> (read on a 300 ppi crop of book page 512; that unit word is the only thing this page takes from any figure, and no curve, tick or point is read from any of them). Page 513’s own text ties the design pressures to that figure - it discusses <img src="https://latex.codecogs.com/png.latex?p_%7BA0%7D"> = 0.0181, 0.0182 and 0.019 as “the upper part of the curves … (Figs. 11.5.2-1 and 11.5.2-2)”;</li>
<li>Example 11.5.3.A’s group <img src="https://latex.codecogs.com/png.latex?A">, printed in the same chapter, uses <strong>0.208</strong> - the same oxygen pressure in atm, unconverted - where 11.5.2 prints 0.211 bar, and the audit cell below shows 0.211 is 0.208 converted;</li>
<li>it is measurable, and the measurement is one-sided. Both readings are solved in <em>Validation</em> below by the same grid-free Radau integration with one constant changed: in atm the sensitivity sentence reproduces and its design point sits just inside the ceiling the facing page states, while in the printed bar the same sentence misses by tens of times more and its design point lands hundreds of kelvin <strong>above</strong> that ceiling. Every one of those numbers is printed by the code, none is typed here.</li>
</ol>
<p>So <strong>every pressure this page reports is in atm</strong>, including <img src="https://latex.codecogs.com/png.latex?p_%7BA0%7D%5E*">, the figure axes and section 11.7.3’s 0.00924 - which book page 574 prints as a <em>mole fraction</em>, “corresponding to 44 g/m<img src="https://latex.codecogs.com/png.latex?%5E3">”, and which is a partial pressure of 0.00924 atm only because <img src="https://latex.codecogs.com/png.latex?p_t%20=%201"> atm. It is Froment (1967)’s <img src="https://latex.codecogs.com/png.latex?N_%7BA0%7D">, and <code>C2.10</code> has found that the 44 is g per <em>normal</em> m<img src="https://latex.codecogs.com/png.latex?%5E3">; the cell below prints its value beside the printed one. The book’s own strings are quoted verbatim with the unit it prints; nothing in the CSV is repaired.</p>
<p><strong>What the chapter does not print, per rung.</strong> This is the asymmetry the ladder turns out to have, and it is stated here before any of it is used:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>rung</th>
<th>new coefficients it needs</th>
<th>printed for <em>this</em> reactor?</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1 <code>S2</code></td>
<td><img src="https://latex.codecogs.com/png.latex?U"></td>
<td><strong>yes</strong>, 0.096 kJ/(m<img src="https://latex.codecogs.com/png.latex?%5E2"> s K) - and reproduced by eq. (11.7.4-1) from rung 5’s pair</td>
</tr>
<tr class="even">
<td>2 <code>S4</code></td>
<td><img src="https://latex.codecogs.com/png.latex?D_%7Bea%7D">, <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bea%7D"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_a"> “between 1 and 2”; of <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bea%7D">, “little information is available”, and <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_%7Bha%7D"> is used in (11.6-3)/(11.6-4) without being defined anywhere in the book</td>
</tr>
<tr class="odd">
<td>3 <code>S7</code></td>
<td><img src="https://latex.codecogs.com/png.latex?k_g">, <img src="https://latex.codecogs.com/png.latex?h_f"></td>
<td><strong>no</strong> - the reader is sent to Chapter 3’s correlation charts</td>
</tr>
<tr class="even">
<td>4 <code>S8</code></td>
<td><img src="https://latex.codecogs.com/png.latex?D_e">, <img src="https://latex.codecogs.com/png.latex?%5Clambda_e"></td>
<td><strong>no</strong> - the reader is sent to Satterfield [1970] and Weisz &amp; Hicks [1962], neither on disk</td>
</tr>
<tr class="odd">
<td>5 <code>S6</code></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Ber%7D">, <img src="https://latex.codecogs.com/png.latex?%5Calpha_w"></td>
<td><strong>yes</strong>, both, to two figures</td>
</tr>
</tbody>
</table>
<p>So the two ends of the ladder are pinned by the book and the middle is not.</p>
<div id="ccdafd1f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:12.618702Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:12.618559Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:41:12.688788Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:41:12.688039Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Van Welsenaere &amp; Froment's printed parameters, from D2.2's CSV -----------</span></span>
<span id="cb4-2">V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(VWF_PAR.index, VWF_PAR.value))</span>
<span id="cb4-3">P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M"</span>], p_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>], rho_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>], rho_g<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>],</span>
<span id="cb4-4">         minus_dH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>], cp_vol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p"</span>], u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>], U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U"</span>], R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>],</span>
<span id="cb4-5">         p_B0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>], a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>], b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>])</span>
<span id="cb4-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># c_p is ALREADY VOLUMETRIC, kcal/(m3 degC) - that trap is D2.2's finding, and</span></span>
<span id="cb4-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># D2.2's own unit column is what says so.  It is not rediscovered here.</span></span>
<span id="cb4-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> VWF_PAR.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kcal/(m3 degC)"</span>, VWF_PAR.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unit"</span>]</span>
<span id="cb4-9"></span>
<span id="cb4-10">L_BED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tube_length"</span>)</span>
<span id="cb4-11">D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tube_id"</span>)</span>
<span id="cb4-12">D_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"particle_diameter"</span>)</span>
<span id="cb4-13">T_R0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"coolant_temperature"</span>)                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 352 C</span></span>
<span id="cb4-14">T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"temp_range_high"</span>)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 415 C, the printed ceiling</span></span>
<span id="cb4-15">R_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>]                                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 0.0125 m; justified below</span></span>
<span id="cb4-16">EPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voidage_a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voidage_b"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb4-17">    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (11.5.1-16)</span></span>
<span id="cb4-18">LAM_ER, ALPHA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam_er"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_w"</span>)</span>
<span id="cb4-19">PE_MR, PE_HR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_mr"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_hr"</span>)</span>
<span id="cb4-20"></span>
<span id="cb4-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the design case of model.py: every rung, pellet and reference solve reads it</span></span>
<span id="cb4-22">RX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Reactor(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>P, length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>L_BED, d_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_P, T_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_R0, T_perm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_PERM, eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>EPS,</span>
<span id="cb4-23">             lam_er<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAM_ER, alpha_w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ALPHA_W, pe_mr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_MR, pe_hr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_HR,</span>
<span id="cb4-24">             re_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_1173"</span>))</span>
<span id="cb4-25">A_G, B_G <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RX.A, RX.B                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the groups of (11.5.2-1/2)</span></span>
<span id="cb4-26">THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RX.theta                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kmol/(m3 atm), from (11.5.2-1)</span></span>
<span id="cb4-27">CP_MASS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RX.cp_mass                               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kJ/(kg K)</span></span>
<span id="cb4-28">RHO_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RX.rho_s</span>
<span id="cb4-29">A_V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> EPS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_P</span>
<span id="cb4-30">C_G, kexp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RX.C, RX.kexp</span>
<span id="cb4-31"></span>
<span id="cb4-32"></span>
<span id="cb4-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ================= the atm -&gt; bar audit of section 11.5.2 =====================</span></span>
<span id="cb4-34">ATM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01325</span></span>
<span id="cb4-35">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb4-36"></span>
<span id="cb4-37"></span>
<span id="cb4-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> add(what, book_key, orig, factor, note):</span>
<span id="cb4-39">    b_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(book_key)</span>
<span id="cb4-40">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(quantity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>what, VWF_1970<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>orig, book_11_5_2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b_,</span>
<span id="cb4-41">                     ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> orig, vs_atm_to_bar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (orig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> factor) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb4-42">                     reading<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>note))</span>
<span id="cb4-43"></span>
<span id="cb4-44"></span>
<span id="cb4-45">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen partial pressure p_B0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen_pressure"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>], ATM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"converted"</span>)</span>
<span id="cb4-46">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat of reaction (-dH)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_of_reaction"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kcal -&gt; kJ"</span>)</span>
<span id="cb4-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_lower_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a p0_lower"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_upper_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a p0_upper"</span>),</span>
<span id="cb4-48">             (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_mean_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a p0_mean"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_backint_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a p0_critical"</span>)):</span>
<span id="cb4-49">    ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> q.split()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])]</span>
<span id="cb4-50">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ex.value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb4-51">    add(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 11.5.3.A-2 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>split()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, k, o, ATM,</span>
<span id="cb4-52">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"converted"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> q <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NOT converted"</span>)</span>
<span id="cb4-53">AUDIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb4-54">show(AUDIT.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11audit"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb4-55">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VWF_1970"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_11_5_2"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb4-56">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs_atm_to_bar"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb4-57"></span>
<span id="cb4-58">CONV_WORST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(AUDIT.vs_atm_to_bar.iloc[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb4-59">BACKINT_RESIDUAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AUDIT.vs_atm_to_bar.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb4-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The first five rows are Van Welsenaere &amp; Froment's atm values multiplied by"</span></span>
<span id="cb4-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">1 atm / 1 bar = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ATM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, reproduced to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CONV_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative - so section 11.5.2"</span></span>
<span id="cb4-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">IS their parameter set converted, and the conversion is not in doubt."</span>)</span>
<span id="cb4-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The last row is not: the back-integrated critical inlet pressure is printed as"</span></span>
<span id="cb4-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_p0_backint_625'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar' and is Van Welsenaere &amp; Froment's"</span></span>
<span id="cb4-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VWF_EX[(VWF_EX.example<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'1a'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>(VWF_EX.quantity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p0_critical'</span>)]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>value<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ATM"</span></span>
<span id="cb4-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">left unconverted (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BACKINT_RESIDUAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the converted value)."</span>)</span>
<span id="cb4-67">_mean_bar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_mean_625"</span>)</span>
<span id="cb4-68">_bi_atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_critical"</span>)].value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb4-69">AGREE_AS_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _mean_bar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _bi_atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb4-70">AGREE_CONSISTENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _mean_bar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (_bi_atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ATM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb4-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The book calls the two 'in excellent agreement'. As printed they differ by"</span></span>
<span id="cb4-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AGREE_AS_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %;"</span></span>
<span id="cb4-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">converted consistently, by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AGREE_CONSISTENT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % - the claim is BETTER than"</span></span>
<span id="cb4-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the numbers beside it."</span>)</span>
<span id="cb4-75"></span>
<span id="cb4-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># =================== what the chapter's own groups require ====================</span></span>
<span id="cb4-77">route <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb4-78">route.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"group B of Example 11.5.3.A = 257e6"</span>,</span>
<span id="cb4-79">              bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>), P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_vol"</span>],</span>
<span id="cb4-80">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0 rho_b (-dH) / (rho_g c_p)"</span>))</span>
<span id="cb4-81">route.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"group A of Example 11.5.3.A = 6150"</span>,</span>
<span id="cb4-82">              bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_A"</span>), A_G, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M p_t p_B0 rho_b / rho_g, the formula printed above it"</span>))</span>
<span id="cb4-83">_dTad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT_ad"</span>)].value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb4-84">route.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A implied by dT_ad = 312.6 K at p0 = 0.0075 atm"</span>,</span>
<span id="cb4-85">              bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_A"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (_dTad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0075</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B / (dT_ad / p0)"</span>))</span>
<span id="cb4-86">GRP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(route, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the book prints"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recomputed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"from"</span>])</span>
<span id="cb4-87">GRP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GRP.recomputed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GRP.printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb4-88">show(GRP.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11groups"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb4-89">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recomputed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.7g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb4-90">A_PRINTED_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(GRP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb4-91">B_PRINTED_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(GRP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb4-92"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">B is reproduced to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(GRP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel. dev.'</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which pins (-dH), rho_b, p_B0"</span></span>
<span id="cb4-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the volumetric c_p together. A is not: the printed 6150 is"</span></span>
<span id="cb4-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A_PRINTED_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from"</span></span>
<span id="cb4-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">its own printed formula, and the example's own dT_ad = 312.6 K at 0.0075 needs"</span></span>
<span id="cb4-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>recomputed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb4-97"></span>
<span id="cb4-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># c_p: three independent routes against the printed 0.992 kJ/(kg K)</span></span>
<span id="cb4-99">G_FLUX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kg/(m2 s)</span></span>
<span id="cb4-100">cp_routes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb4-101">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volumetric c_p of D2.2's CSV / rho_g"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_vol"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>]),</span>
<span id="cb4-102">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B = 257e6 with (-dH), rho_b, p_B0 as printed"</span>,</span>
<span id="cb4-103">     P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>]),</span>
<span id="cb4-104">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pe_hr = 5.25 with lambda_er = 0.78e-3, G, d_p"</span>,</span>
<span id="cb4-105">     PE_HR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_ER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (G_FLUX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P)),</span>
<span id="cb4-106">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Froment (1967) p. 19, loaded from C2.10"</span>, F67_PAR.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL),</span>
<span id="cb4-107">], columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p [kJ/(kg K)]"</span>])</span>
<span id="cb4-108">cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs printed 0.992"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p [kJ/(kg K)]"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"specific_heat"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb4-109">show(cp_routes.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11cp"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb4-110">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p [kJ/(kg K)]"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs printed 0.992"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb4-111">CP_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p [kJ/(kg K)]"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p [kJ/(kg K)]"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb4-112">CP_PRINTED_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs printed 0.992"</span>].mean())</span>
<span id="cb4-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Four routes, three of them inside Chapter 11 and the fourth Froment's own 1967"</span></span>
<span id="cb4-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">paper loaded from C2.10: they span </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CP_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and sit"</span></span>
<span id="cb4-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CP_PRINTED_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from the 0.992 kJ/(kg K)"</span></span>
<span id="cb4-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">section 11.5.2 prints. The printed value is recorded as a defect and is used"</span></span>
<span id="cb4-117">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" nowhere."</span>)</span>
<span id="cb4-118"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">BUT THE FOUR ARE NOT FOUR INDEPENDENT DETERMINATIONS, and the spread must not be"</span></span>
<span id="cb4-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">read as one. Route 2 reproduces route 1 to"</span></span>
<span id="cb4-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'c_p [kJ/(kg K)]'</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>cp_routes[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'c_p [kJ/(kg K)]'</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> BY CONSTRUCTION: B is printed as"</span></span>
<span id="cb4-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(-dH) rho_b p_B0 / (rho_g c_p) and route 1 is the same c_p divided by the same"</span></span>
<span id="cb4-122">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rho_g.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Route 4 is route 1 rounded -"</span></span>
<span id="cb4-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cp_vol'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KCAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rho_g'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KCAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/(kg C) printed as"</span></span>
<span id="cb4-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67_PAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'c_p'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - and C2.10's own CSV note says its"</span></span>
<span id="cb4-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">0.25 is pinned on that page by the printed Pe_hR = 5.25, which is route 3. So the"</span></span>
<span id="cb4-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">four trace to ONE printed determination plus route 3 evaluated exactly against the"</span></span>
<span id="cb4-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">same number rounded. What survives is the CONCLUSION - the printed 0.992 is"</span></span>
<span id="cb4-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inconsistent with the chapter's own groups - not an agreement among four witnesses."</span></span>
<span id="cb4-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">That is why cp_route_spread carries a caveat in the break table."</span>)</span>
<span id="cb4-130"></span>
<span id="cb4-131"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the mean-density units error, provable from the same sentence</span></span>
<span id="cb4-132">RHO_FROM_SENTENCE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_flux"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial_velocity"</span>)</span>
<span id="cb4-133"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Same sentence, same defect class: 'a mean fluid density of"</span></span>
<span id="cb4-134">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mean_density'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/m3'"</span></span>
<span id="cb4-135">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">with G = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mass_flux'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/(m2 h) and u_s ="</span></span>
<span id="cb4-136">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'superficial_velocity'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m/h, whose ratio is"</span></span>
<span id="cb4-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_FROM_SENTENCE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/m3.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D2.2's CSV gives Van Welsenaere &amp; Froment's"</span></span>
<span id="cb4-138">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rho_g'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/m3; the printed value is out by 10^3."</span>)</span>
<span id="cb4-139"></span>
<span id="cb4-140"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- eq. (11.7.4-1): rung 1's U is rung 5's pair ----------------------------</span></span>
<span id="cb4-141">ALPHA_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ALPHA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> R_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_ER))</span>
<span id="cb4-142">U_VWF_SI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span></span>
<span id="cb4-143">ALPHA_I_PRINTED_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ALPHA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_ER))</span>
<span id="cb4-144"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eq. (11.7.4-1) at R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, alpha_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, lambda_er = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAM_ER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span></span>
<span id="cb4-145">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  alpha_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_I<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kJ/(m2 s K)   against the printed"</span></span>
<span id="cb4-146">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'overall_U'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, equal to round-off (within"</span></span>
<span id="cb4-147">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1e-12; here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'overall_U'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb4-148">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Van Welsenaere &amp; Froment's U = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'U'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/(m2 h K) ="</span></span>
<span id="cb4-149">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_VWF_SI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kJ/(m2 s K)  -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_VWF_SI<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ALPHA_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-150">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">At R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_T_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m (the printed 2.54 cm diameter) it would be"</span></span>
<span id="cb4-151">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_I_PRINTED_R<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_I_PRINTED_R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'overall_U'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-152">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">from the printed 0.096 - and it ROUNDS TO </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_I_PRINTED_R<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, not to"</span></span>
<span id="cb4-153">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'overall_U'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C2.10 recomputes U from this pair for the 1967 case, to"</span></span>
<span id="cb4-154">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>C210_U_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at worst (its own claims);"</span></span>
<span id="cb4-155">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this is that check with the BOOK's SI values, and it is what fixes R_t = 0.0125 m."</span></span>
<span id="cb4-156">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT IT IS NOT: proof that the book DERIVED 0.096 from (11.7.4-1). VWF's own"</span></span>
<span id="cb4-157">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">U = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_VWF_SI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rounds to the same 0.096 at the two significant figures printed,"</span></span>
<span id="cb4-158">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">so the identity discriminates the RADIUS, which is what it is used for here, and"</span></span>
<span id="cb4-159">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">not the provenance of the number."</span>)</span>
<span id="cb4-160">U_FROM_2D_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ALPHA_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overall_U"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb4-161">U_PRINTED_R_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ALPHA_I_PRINTED_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overall_U"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb4-162"></span>
<span id="cb4-163"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the unit the model is in, and the one the section prints ----------------</span></span>
<span id="cb4-164">Y_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y_A0_1173"</span>)</span>
<span id="cb4-165">M_IMPLIED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y_A0_mass_1173"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Y_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M"</span>])</span>
<span id="cb4-166"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">UNITS. This page runs on Van Welsenaere &amp; Froment's parameter set as D2.2 carries"</span></span>
<span id="cb4-167">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">it: p_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_t'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ATM and p_B0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_B0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ATM, with ln k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'b'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/T"</span></span>
<span id="cb4-168">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">as printed for those units. Section 11.5.2 prints"</span></span>
<span id="cb4-169">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'total_pressure'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar' and"</span></span>
<span id="cb4-170">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'oxygen_pressure'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar' for the same two quantities - and the audit"</span></span>
<span id="cb4-171">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" above shows the second</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">IS the first converted - while restating k unchanged, which is"</span></span>
<span id="cb4-172">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the partial</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">conversion. Its own Fig. 11.5.2-1 labels the ordinate"</span></span>
<span id="cb4-173">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig1152_1_ordinate_unit'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' (book page"</span></span>
<span id="cb4-174">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BK.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig1152_1_ordinate_unit'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">that unit word is the only thing"</span></span>
<span id="cb4-175">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" this page takes from any figure in the chapter).</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Every pressure reported below is"</span></span>
<span id="cb4-176">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" therefore in ATM. What the other reading costs is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">measured in Validation."</span>)</span>
<span id="cb4-177"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And section 11.7.3's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Y_A0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is a MOLE FRACTION, not a pressure: page 574 prints it"</span></span>
<span id="cb4-178">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'corresponding to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'y_A0_mass_1173'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/m3', which needs a molar mass of"</span></span>
<span id="cb4-179">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/kmol - an aromatic C8,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">not the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'M'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/kmol mean. At p_t ="</span></span>
<span id="cb4-180">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_t'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm its partial pressure is numerically the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">same number, which is why it can"</span></span>
<span id="cb4-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" be used as one."</span>)</span>
<span id="cb4-182"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same 0.00924 is Froment (1967)'s N_A0, which C2.10 has already audited</span></span>
<span id="cb4-183">NA0_F67 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(F67_PAR.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_A0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb4-184"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> NA0_F67 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> Y_A0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.7.3's inlet mole fraction is not C2.10's N_A0"</span></span>
<span id="cb4-185">NA0_C210 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NA0_F67 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> C210_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"na0_from_44gnm3_rel"</span>])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># C2.10's 44 g/Nm3 reading</span></span>
<span id="cb4-186">C_NORMAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">101325.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.314462618</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kmol/m3 at 0 C and 1 atm</span></span>
<span id="cb4-187">M_OXYLENE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.011</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.008</span>                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># C8H10, kg/kmol</span></span>
<span id="cb4-188">M_NORMAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y_A0_mass_1173"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Y_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> C_NORMAL)</span>
<span id="cb4-189"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C2.10 HAS READ THE SAME NUMBER, as Froment (1967)'s N_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NA0_F67<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and its CSV"</span></span>
<span id="cb4-190">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" records</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">that the 44 is g per NORMAL m3 (the paper's Figure 11 axis is g/Nm3):"</span></span>
<span id="cb4-191">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 44 g/Nm3 of o-xylene</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is N_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NA0_C210<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>C210_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'na0_from_44gnm3_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb4-192">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" from the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NA0_F67<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (C2.10's claim).</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/kmol above divides by"</span></span>
<span id="cb4-193">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rho_g/M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rho_g'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'M'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kmol/m3; the molar density at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">0 C and 1 atm is"</span></span>
<span id="cb4-194">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_NORMAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and with it the molar mass is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_NORMAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/kmol, against"</span></span>
<span id="cb4-195">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" o-xylene's</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_OXYLENE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The rest of the gap is the printed 0.00924 against"</span></span>
<span id="cb4-196">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NA0_C210<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_NORMAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Y_A0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NA0_C210<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_NORMAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Y_A0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NA0_C210<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb4-197">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" The page uses the printed mole fraction, as the chapter does."</span>)</span>
<span id="cb4-198"></span>
<span id="cb4-199"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">derived: eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from (11.5.1-16) at d_t/d_p ="</span></span>
<span id="cb4-200">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_T_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  rho_s = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kg/m3;"</span></span>
<span id="cb4-201">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a_v = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_V<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/m3</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">         theta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kmol/(m3 atm);"</span></span>
<span id="cb4-202">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_G<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  B = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_G<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  C = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_G()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11audit" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11audit_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">quantity</th>
<th id="T_d11audit_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">VWF_1970</th>
<th id="T_d11audit_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">book_11_5_2</th>
<th id="T_d11audit_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">ratio</th>
<th id="T_d11audit_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">vs_atm_to_bar</th>
<th id="T_d11audit_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">reading</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11audit_row0_col0" class="data row0 col0">oxygen partial pressure p_B0</td>
<td id="T_d11audit_row0_col1" class="data row0 col1">0.208</td>
<td id="T_d11audit_row0_col2" class="data row0 col2">0.211</td>
<td id="T_d11audit_row0_col3" class="data row0 col3">1.014423</td>
<td id="T_d11audit_row0_col4" class="data row0 col4">+1.16e-03</td>
<td id="T_d11audit_row0_col5" class="data row0 col5">converted</td>
</tr>
<tr class="even">
<td id="T_d11audit_row1_col0" class="data row1 col0">heat of reaction (-dH)</td>
<td id="T_d11audit_row1_col1" class="data row1 col1">1.28535e+06</td>
<td id="T_d11audit_row1_col2" class="data row1 col2">1.28541e+06</td>
<td id="T_d11audit_row1_col3" class="data row1 col3">1.000048</td>
<td id="T_d11audit_row1_col4" class="data row1 col4">+4.78e-05</td>
<td id="T_d11audit_row1_col5" class="data row1 col5">kcal -&gt; kJ</td>
</tr>
<tr class="odd">
<td id="T_d11audit_row2_col0" class="data row2 col0">Table 11.5.3.A-2 p0_lower</td>
<td id="T_d11audit_row2_col1" class="data row2 col1">0.01353</td>
<td id="T_d11audit_row2_col2" class="data row2 col2">0.01371</td>
<td id="T_d11audit_row2_col3" class="data row2 col3">1.013304</td>
<td id="T_d11audit_row2_col4" class="data row2 col4">+5.31e-05</td>
<td id="T_d11audit_row2_col5" class="data row2 col5">converted</td>
</tr>
<tr class="even">
<td id="T_d11audit_row3_col0" class="data row3 col0">Table 11.5.3.A-2 p0_upper</td>
<td id="T_d11audit_row3_col1" class="data row3 col1">0.01976</td>
<td id="T_d11audit_row3_col2" class="data row3 col2">0.02002</td>
<td id="T_d11audit_row3_col3" class="data row3 col3">1.013158</td>
<td id="T_d11audit_row3_col4" class="data row3 col4">-9.09e-05</td>
<td id="T_d11audit_row3_col5" class="data row3 col5">converted</td>
</tr>
<tr class="odd">
<td id="T_d11audit_row4_col0" class="data row4 col0">Table 11.5.3.A-2 p0_mean</td>
<td id="T_d11audit_row4_col1" class="data row4 col1">0.01665</td>
<td id="T_d11audit_row4_col2" class="data row4 col2">0.01687</td>
<td id="T_d11audit_row4_col3" class="data row4 col3">1.013213</td>
<td id="T_d11audit_row4_col4" class="data row4 col4">-3.63e-05</td>
<td id="T_d11audit_row4_col5" class="data row4 col5">converted</td>
</tr>
<tr class="even">
<td id="T_d11audit_row5_col0" class="data row5 col0">Table 11.5.3.A-2 p0_critical</td>
<td id="T_d11audit_row5_col1" class="data row5 col1">0.01651</td>
<td id="T_d11audit_row5_col2" class="data row5 col2">0.01651</td>
<td id="T_d11audit_row5_col3" class="data row5 col3">1.000000</td>
<td id="T_d11audit_row5_col4" class="data row5 col4">-1.31e-02</td>
<td id="T_d11audit_row5_col5" class="data row5 col5">NOT converted</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
The first five rows are Van Welsenaere &amp; Froment's atm values multiplied by
1 atm / 1 bar = 1.01325, reproduced to 1.2e-03 relative - so section 11.5.2
IS their parameter set converted, and the conversion is not in doubt.
The last row is not: the back-integrated critical inlet pressure is printed as
'0.01651 bar' and is Van Welsenaere &amp; Froment's 0.01651 ATM
left unconverted (-1.31e-02 against the converted value).

The book calls the two 'in excellent agreement'. As printed they differ by +2.18 %;
converted consistently, by +0.84 % - the claim is BETTER than the numbers beside it.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11groups" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11groups_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">the book prints</th>
<th id="T_d11groups_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">printed</th>
<th id="T_d11groups_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">recomputed</th>
<th id="T_d11groups_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">from</th>
<th id="T_d11groups_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">rel. dev.</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11groups_row0_col0" class="data row0 col0">group B of Example 11.5.3.A = 257e6</td>
<td id="T_d11groups_row0_col1" class="data row0 col1">2.57e+08</td>
<td id="T_d11groups_row0_col2" class="data row0 col2">2.570056e+08</td>
<td id="T_d11groups_row0_col3" class="data row0 col3">p_B0 rho_b (-dH) / (rho_g c_p)</td>
<td id="T_d11groups_row0_col4" class="data row0 col4">+2.168e-05</td>
</tr>
<tr class="even">
<td id="T_d11groups_row1_col0" class="data row1 col0">group A of Example 11.5.3.A = 6150</td>
<td id="T_d11groups_row1_col1" class="data row1 col1">6150</td>
<td id="T_d11groups_row1_col2" class="data row1 col2">6165.036</td>
<td id="T_d11groups_row1_col3" class="data row1 col3">M p_t p_B0 rho_b / rho_g, the formula printed above it</td>
<td id="T_d11groups_row1_col4" class="data row1 col4">+2.445e-03</td>
</tr>
<tr class="odd">
<td id="T_d11groups_row2_col0" class="data row2 col0">A implied by dT_ad = 312.6 K at p0 = 0.0075 atm</td>
<td id="T_d11groups_row2_col1" class="data row2 col1">6150</td>
<td id="T_d11groups_row2_col2" class="data row2 col2">6166.027</td>
<td id="T_d11groups_row2_col3" class="data row2 col3">B / (dT_ad / p0)</td>
<td id="T_d11groups_row2_col4" class="data row2 col4">+2.606e-03</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
B is reproduced to 2.2e-05, which pins (-dH), rho_b, p_B0
and the volumetric c_p together. A is not: the printed 6150 is +0.244 % from
its own printed formula, and the example's own dT_ad = 312.6 K at 0.0075 needs 6166.0.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11cp" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11cp_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">route</th>
<th id="T_d11cp_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">c_p [kJ/(kg K)]</th>
<th id="T_d11cp_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">vs printed 0.992</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11cp_row0_col0" class="data row0 col0">volumetric c_p of D2.2's CSV / rho_g</td>
<td id="T_d11cp_row0_col1" class="data row0 col1">1.045890</td>
<td id="T_d11cp_row0_col2" class="data row0 col2">+0.0543</td>
</tr>
<tr class="even">
<td id="T_d11cp_row1_col0" class="data row1 col0">B = 257e6 with (-dH), rho_b, p_B0 as printed</td>
<td id="T_d11cp_row1_col1" class="data row1 col1">1.045913</td>
<td id="T_d11cp_row1_col2" class="data row1 col2">+0.0543</td>
</tr>
<tr class="odd">
<td id="T_d11cp_row2_col0" class="data row2 col0">Pe_hr = 5.25 with lambda_er = 0.78e-3, G, d_p</td>
<td id="T_d11cp_row2_col1" class="data row2 col1">1.055684</td>
<td id="T_d11cp_row2_col2" class="data row2 col2">+0.0642</td>
</tr>
<tr class="even">
<td id="T_d11cp_row3_col0" class="data row3 col0">Froment (1967) p. 19, loaded from C2.10</td>
<td id="T_d11cp_row3_col1" class="data row3 col1">1.046700</td>
<td id="T_d11cp_row3_col2" class="data row3 col2">+0.0551</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Four routes, three of them inside Chapter 11 and the fourth Froment's own 1967
paper loaded from C2.10: they span 9.36e-03 and sit +5.7 % from the 0.992 kJ/(kg K)
section 11.5.2 prints. The printed value is recorded as a defect and is used nowhere.

BUT THE FOUR ARE NOT FOUR INDEPENDENT DETERMINATIONS, and the spread must not be
read as one. Route 2 reproduces route 1 to 2.2e-05 BY CONSTRUCTION: B is printed as
(-dH) rho_b p_B0 / (rho_g c_p) and route 1 is the same c_p divided by the same rho_g.
Route 4 is route 1 rounded - 0.2498 kcal/(kg C) printed as 0.25 - and C2.10's own CSV note says its
0.25 is pinned on that page by the printed Pe_hR = 5.25, which is route 3. So the
four trace to ONE printed determination plus route 3 evaluated exactly against the
same number rounded. What survives is the CONCLUSION - the printed 0.992 is
inconsistent with the chapter's own groups - not an agreement among four witnesses.
That is why cp_route_spread carries a caveat in the break table.

Same sentence, same defect class: 'a mean fluid density of 1293 kg/m3'
with G = 4684 kg/(m2 h) and u_s = 3600 m/h, whose ratio is 1.3011 kg/m3.
D2.2's CSV gives Van Welsenaere &amp; Froment's 1.293 kg/m3; the printed value is out by 10^3.

eq. (11.7.4-1) at R_t = 0.0125 m, alpha_w = 0.156, lambda_er = 0.00078:
  alpha_i = 0.096000 kJ/(m2 s K)   against the printed 0.096, equal to round-off (within 1e-12; here -1.1e-16)
  Van Welsenaere &amp; Froment's U = 82.7 kcal/(m2 h K) = 0.096180 kJ/(m2 s K)  -&gt; +1.876e-03
At R_t = 0.0127 m (the printed 2.54 cm diameter) it would be 0.095413, i.e. -6.116e-03
from the printed 0.096 - and it ROUNDS TO 0.095, not to 0.096.
C2.10 recomputes U from this pair for the 1967 case, to 0.29 % at worst (its own claims);
this is that check with the BOOK's SI values, and it is what fixes R_t = 0.0125 m.
WHAT IT IS NOT: proof that the book DERIVED 0.096 from (11.7.4-1). VWF's own
U = 0.09618 rounds to the same 0.096 at the two significant figures printed,
so the identity discriminates the RADIUS, which is what it is used for here, and
not the provenance of the number.

UNITS. This page runs on Van Welsenaere &amp; Froment's parameter set as D2.2 carries
it: p_t = 1.0 ATM and p_B0 = 0.208 ATM, with ln k = 19.837 - 13636/T
as printed for those units. Section 11.5.2 prints '1 bar' and
'0.211 bar' for the same two quantities - and the audit above shows the second
IS the first converted - while restating k unchanged, which is the partial
conversion. Its own Fig. 11.5.2-1 labels the ordinate 'p0, atm' (book page 512;
that unit word is the only thing this page takes from any figure in the chapter).
Every pressure reported below is therefore in ATM. What the other reading costs is
measured in Validation.

And section 11.7.3's 0.00924 is a MOLE FRACTION, not a pressure: page 574 prints it
'corresponding to 44 g/m3', which needs a molar mass of 108.6 kg/kmol - an aromatic C8,
not the 29.48 kg/kmol mean. At p_t = 1.0 atm its partial pressure is numerically the
same number, which is why it can be used as one.

C2.10 HAS READ THE SAME NUMBER, as Froment (1967)'s N_A0 = 0.00924, and its CSV records
that the 44 is g per NORMAL m3 (the paper's Figure 11 axis is g/Nm3): 44 g/Nm3 of o-xylene
is N_A0 = 0.00929, +0.52 % from the printed 0.00924 (C2.10's claim).
The 108.6 kg/kmol above divides by rho_g/M = 0.04386 kmol/m3; the molar density at
0 C and 1 atm is 0.04462, and with it the molar mass is 106.73 kg/kmol, against o-xylene's
106.17. The rest of the gap is the printed 0.00924 against 0.00929:
106.73 x 0.00924/0.00929 = 106.18. The page uses the printed mole fraction, as the chapter does.

derived: eps = 0.495585 from (11.5.1-16) at d_t/d_p = 8.4667;  rho_s = 2577.2 kg/m3;  a_v = 1008.83 m2/m3
         theta = 0.043860 kmol/(m3 atm);  A = 6165.0363;  B = 2.570056e+08;  C = 40965.94 1/h</code></pre>
</div>
</div>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>There is no measurement anywhere on this page. Chapter 11 reports none, and the sources it draws on report none either, so the provenance tier is 6 throughout.</p>
<p><strong>This page’s own dataset.</strong> <code>froment-2011-ch11-printed.csv</code> is every model constant, stated result and quantitative claim read out of Chapter 11 (the first code cell prints how many rows), each with the book page it came from and a <code>kind</code> of <code>parameter</code>, <code>stated_result</code> or <code>claim</code>. Its sidecar records that several rows are transcribed <em>because they are wrong</em> and lists them; none is repaired anywhere. <code>as_printed</code> keeps the character string, thousands separators and all, so that a defect can be quoted verbatim.</p>
<p><strong>Six borrowed datasets from four pages, and what each source page already establishes about the rows used here.</strong> The first code cell lists the six with their row counts; the cell below prints every number quoted here from the source page’s own committed claims, so none is retyped.</p>
<ul>
<li><code>D2.2</code>, <code>van-welsenaere-froment-1970-parameters.csv</code> and <code>-examples.csv</code>. <code>D2.2</code> establishes: <strong>the printed <code>c_p</code> is already volumetric</strong>, kcal/(m<img src="https://latex.codecogs.com/png.latex?%5E3"> <img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc">C), so multiplying it by <img src="https://latex.codecogs.com/png.latex?%5Crho_g"> would shift the wall group by the gas density - that finding is the reason the audit above can be run at all, and it is asserted against <code>D2.2</code>’s own unit column rather than restated. <code>D2.2</code> also establishes that the Elsevier full-text API drops the 1970 paper’s mid-dot decimal separators, how wide its criterion brackets are, and how much hot-spot error its own first-order upwind leaves at <img src="https://latex.codecogs.com/png.latex?n_z%20=%201500"> - the last of which <strong>does</strong> affect this page, and is why every number reported here is Richardson-extrapolated. Its Section-6 values are used here only as the <em>originals</em> against which the book’s Example 11.5.3.A is checked; none of its criteria is rebuilt.</li>
<li><code>C2.10</code>, <code>froment-1967-parameters.csv</code> and <code>froment-1967-stated-results.csv</code>. <code>C2.10</code> establishes: the 1967 paper’s own gas constant is <strong>1.98</strong> cal/(mol K), not 1.987, which is what makes 27,000/1.98 = 13,636 the number section 11.5.2 prints; that <img src="https://latex.codecogs.com/png.latex?G"> = 4684 is printed “4.684” on the paper’s p.&nbsp;24; that <img src="https://latex.codecogs.com/png.latex?-%5CDelta%20H_3"> is printed “1.090”; where the 1-D and 2-D runaway limits of the 1967 case lie, located by bisection; and how closely <img src="https://latex.codecogs.com/png.latex?U"> recomputed from <img src="https://latex.codecogs.com/png.latex?%5Clambda_R"> and <img src="https://latex.codecogs.com/png.latex?%5Calpha_w"> agrees with the printed one; and that the inlet mole fraction <img src="https://latex.codecogs.com/png.latex?N_%7BA0%7D"> = 0.00924, the same number section 11.7.3 prints, is stated to correspond to 44 g per <em>normal</em> m<img src="https://latex.codecogs.com/png.latex?%5E3">, which gives a different mole fraction (affects this page only as a reading of the 44: the page uses the printed 0.00924, and <em>Parameters and assumptions</em> prints C2.10’s value beside it). All five matter here and all five are printed beside the book’s restatement. <code>C2.10</code> also warns that <img src="https://latex.codecogs.com/png.latex?U"> = 82.7 is a <strong>shared source</strong> with <code>D2.2</code>, not a second witness - so the audit above never treats it as one.</li>
<li><code>B1.1</code>, <code>isothermal-exact.csv</code> (<code>dataset_id: thiele-isothermal-exact</code>). <code>B1.1</code> establishes the exact isothermal <img src="https://latex.codecogs.com/png.latex?%5Ceta"> for slab, cylinder and sphere; how closely its own pymrm pellet matches it; and - load-bearing here - that <strong><code>NumJac</code> must be given <code>(n_r, 1)</code>, never a bare <code>(n_r,)</code></strong>. Its sphere rows are the reference for eq. (11.9.1-11) below. Its fold at <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.6">, <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20=%2020"> is <em>not</em> touched: the pellet here runs at a far smaller Prater number, computed and printed.</li>
<li><code>A1.1</code>, <code>ergun-1952-parameters.csv</code>. <code>A1.1</code> establishes that a refit of Ergun’s own markers gives constants different from 150 and 1.75, and what the line Ergun labels Kozeny-Carman measures. Neither changes anything here, because Example 11.5.1.A is arithmetic <em>on the printed constants</em>; the refit is printed beside them and is a break row. <code>A1.1</code> carries <strong>no</strong> McDonald and no Hicks constants and does not discuss the equivalent-diameter definition, so those parts of Example 11.5.1.A are new here.</li>
</ul>
<p>No figure is digitised, no page image exists anywhere in this directory, and every figure-only content of Chapter 11 - Figs. 11.5.2-1/2, 11.6-1, 11.7.1-1/2/3, all six 11.7.3 figures, 11.8.1-1..4, 11.8.2-1 and the whole of Fig. 11.5.3-1’s runaway band - is <strong>out of scope</strong> and never traced or read off. The one exception, and it is a unit rather than a datum: <code>fig1152_1_ordinate_unit</code> is the <em>label</em> on Fig. 11.5.2-1’s ordinate, read on a 300 ppi crop as “<img src="https://latex.codecogs.com/png.latex?p_0">, atm”. It decides which unit the whole page is in, so it is transcribed as a row like everything else and named here.</p>
<div id="1adadf39" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:12.690521Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:12.690330Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:41:12.694221Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:41:12.693550Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"What the source pages establish about the rows used here, from their claims:"</span>)</span>
<span id="cb8-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   D2.2 : criterion-1 brackets </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D22_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket_width_c1_min_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to"</span></span>
<span id="cb8-3">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D22_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket_width_c1_max_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % wide; first-order upwind leaves"</span></span>
<span id="cb8-4">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D22_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hotspot_error_n1500_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K of hot-spot error at n_z = 1500"</span>)</span>
<span id="cb8-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   C2.10: runaway limits </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C210_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t0crit_1d_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C (1-D) and"</span></span>
<span id="cb8-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C210_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t0crit_2d_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C (2-D); U from lambda_R and alpha_w within"</span></span>
<span id="cb8-7">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>C210_U_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb8-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   B1.1 : its pymrm pellet against the exact table, worst"</span></span>
<span id="cb8-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'isothermal_max_rel_error_phi_le_30'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for phi &lt;= 30 and"</span></span>
<span id="cb8-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'isothermal_max_rel_error_all_phi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over all phi"</span>)</span>
<span id="cb8-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   A1.1 : refit k1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k1_refit_all_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb8-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" k2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k2_refit_all_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; Kozeny-Carman line"</span></span>
<span id="cb8-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ergun_b'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kozeny_carman_line_over_k1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>What the source pages establish about the rows used here, from their claims:
   D2.2 : criterion-1 brackets 27 to 66 % wide; first-order upwind leaves 0.04 K of hot-spot error at n_z = 1500
   C2.10: runaway limits 363.93 C (1-D) and 360.01 C (2-D); U from lambda_R and alpha_w within 0.29 %
   B1.1 : its pymrm pellet against the exact table, worst 2.2e-04 for phi &lt;= 30 and 6.5e-03 over all phi
   A1.1 : refit k1 = 151.9, k2 = 1.697; Kozeny-Carman line 149.2</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>One class, five configurations: <code>Ladder</code> in this page’s <code>model.py</code>, beside the pellet (<code>Pellet</code>), the threshold search (<code>p0_critical</code> with its <code>crossing_control</code>) and the grid-free rung-1 route (<code>ode_reference</code>). The state is <code>(n_z, n_f)</code> with the axial index first and fields last, except for rung 5 which is <code>(n_z, n_r, 2)</code> - spatial axes first, fields last, one layout throughout. Every constant operator is assembled once per solve in <code>_ops</code>, printed below, never inside a Newton iteration. Each solve is <code>pymrm.newton</code> with its default damping and direct sparse LU, on a Jacobian whose source part is <code>NumJac</code>’s finite differences.</p>
<p>Three things are worth reading before the code:</p>
<ul>
<li><strong>the divergence geometry differs between the two second axes.</strong> Rung 5’s radial axis is a tube, so <code>construct_div(..., nu=1, axis=1)</code> is cylindrical; the pellet of rung 4 is a sphere, so <code>nu=2</code>. Rung 1’s and rung 2’s axial axis is <code>nu=0</code>, Cartesian. Getting these wrong is silent: the profile stays smooth.</li>
<li><strong>the two boundary conditions that carry physics</strong> are written with the outward normal spelt out in a comment, because the sign of <code>a</code> means opposite things at the two ends. The Danckwerts inlet is <code>A2.1</code>’s published dict, scaled: the dispersion coefficient divided by <img src="https://latex.codecogs.com/png.latex?u_s"> is a length, so <code>a</code> is <img src="https://latex.codecogs.com/png.latex?d_p/%5Cmathrm%7BPe%7D"> and <code>b</code> is 1. The wall condition of rung 5 is <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Ber%7D%5C,%5Cpartial%20T/%5Cpartial%20n%20+%20%5Calpha_w%20T%20=%20%5Calpha_w%20T_w"> at <img src="https://latex.codecogs.com/png.latex?r%20=%20R_t">, where the outward normal is <img src="https://latex.codecogs.com/png.latex?+r">.</li>
<li><strong>the film balances are scaled to the units of their own unknown.</strong> Written as the book writes them, (11.8.1-3) is in atm/h and (11.8.1-4) in kcal/(m<img src="https://latex.codecogs.com/png.latex?%5E3"> h), rows of very different size, so the absolute residual test in <code>Ladder.solve</code> would mean something different in each. Dividing each by its own transfer coefficient puts the two algebraic rows in atm and K, the units of the surface unknowns they determine.</li>
</ul>
<div id="0e12711c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:12.695913Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:12.695794Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:41:12.699460Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:41:12.698761Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The five rungs are model.py's `Ladder`; its operator assembly, printed here, is</span></span>
<span id="cb10-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># where the rungs differ.  The bisection, the crossing control and the</span></span>
<span id="cb10-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid-free rung-1 route are `p0_critical`, `crossing_control` and</span></span>
<span id="cb10-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `ode_reference` in the same file.</span></span>
<span id="cb10-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(inspect.getsource(Ladder._ops))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>    def _ops(self, p0, T0):
        """The constant linear operator and its boundary vector, for inlet ``(p0, T0)``.

        Assembled once per solve, never inside a Newton iteration.
        """
        d_p = self.rx.d_p
        nf = self.shape[-1]
        din = np.zeros(nf); din[0], din[1] = p0, T0
        bin_ = np.zeros(nf); bin_[0] = bin_[1] = 1.0
        if self.rung == 2:
            # eps*D_ea/u_s = d_p/Pe_ma and lambda_ea/(rho_g c_p u_s) = d_p/Pe_ha
            # are LENGTHS.  Danckwerts inlet, A2.1's published dict:
            #   u_s(c_in - c) = -D dc/dz at z=0; n = -z so dc/dn = -dc/dz,
            #   giving (D/u_s) dc/dn + c = c_in  -&gt;  a = d_p/Pe, b = 1, d = c_in.
            # Outlet dc/dz = 0 with n = +z  -&gt;  a = 1, b = 0, d = 0.
            Dv = np.array([d_p / self.pe_ma, d_p / self.pe_ha])
            bc = ({"a": Dv, "b": bin_, "d": din},
                  {"a": np.ones(nf), "b": np.zeros(nf), "d": np.zeros(nf)})
            grad, dgrad = construct_grad(self.shape, self.z_f, self.z_c, bc, axis=0)
            conv, dconv = construct_convflux_upwind(self.shape, self.z_f, self.z_c,
                                                    bc, v=1.0, axis=0)
            Dm = construct_coefficient_matrix(Dv, shape=(self.n_z + 1, 2))
            div = construct_div(self.shape, self.z_f, nu=0, axis=0)     # Cartesian
            return div @ (conv - Dm @ grad), div @ (dconv - Dm @ dgrad)
        if self.rung == 5:
            # z = 0: p = p0, T = T0 (a = 0, b = 1, d = inlet); z = L: dc/dz = 0, n = +z.
            bcz = ({"a": np.zeros(2), "b": np.ones(2), "d": np.array([p0, T0])},
                   {"a": np.ones(2), "b": np.zeros(2), "d": np.zeros(2)})
            conv, dconv = construct_convflux_upwind(self.shape, self.z_f, self.z_c,
                                                    bcz, v=1.0, axis=0)
            divz = construct_div(self.shape, self.z_f, nu=0, axis=0)     # Cartesian
            Dr = np.array([d_p / self.pe_mr, d_p / self.pe_hr])          # m
            # r = 0: symmetry, dc/dn = 0 for both fields (n = -r there).
            # r = R_t: p is impermeable; for T, eq. (11.7.1-1) with n = +r,
            #   lambda_er dT/dn + alpha_w T = alpha_w T_w, scaled by 1/(rho_g c_p u_s)
            #   so that a keeps the same units as the operator's diffusivity.
            bcr = ({"a": np.ones(2), "b": np.zeros(2), "d": np.zeros(2)},
                   {"a": np.array([1.0, Dr[1]]),
                    "b": np.array([0.0, Dr[1] * self.wall_ratio]),
                    "d": np.array([0.0, Dr[1] * self.wall_ratio * self.T_r])})
            gradr, dgradr = construct_grad(self.shape, self.r_f, self.r_c, bcr, axis=1)
            divr = construct_div(self.shape, self.r_f, nu=1, axis=1)     # cylindrical
            Dm = construct_coefficient_matrix(Dr, shape=(self.n_z, self.n_r + 1, 2))
            return (divz @ conv - divr @ (Dm @ gradr),
                    divz @ dconv - divr @ (Dm @ dgradr))
        # z = 0: fixed inlet values (a = 0, b = 1); z = L: dc/dz = 0, n = +z.
        bc = ({"a": np.zeros(nf), "b": bin_, "d": din},
              {"a": np.ones(nf), "b": np.zeros(nf), "d": np.zeros(nf)})
        conv, dconv = construct_convflux_upwind(self.shape, self.z_f, self.z_c,
                                                bc, v=1.0, axis=0)
        div = construct_div(self.shape, self.z_f, nu=0, axis=0)          # Cartesian
        if nf == 2:
            return div @ conv, div @ dconv
        # rungs 3 and 4: fields 2 and 3 are ALGEBRAIC, so the divergence must not
        # reach them.  A coefficient matrix is the mask.
        mask = construct_coefficient_matrix(np.array([1.0, 1.0, 0.0, 0.0]),
                                            shape=self.shape)
        return mask @ (div @ conv), mask @ (div @ dconv)
</code></pre>
</div>
</div>
<div id="b07c5dc2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:12.701417Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:12.701300Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:41:12.709674Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:41:12.709089Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">P0_BOOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"runaway_p0_safe"</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 0.018, section 11.5.2's own design point, in atm</span></span>
<span id="cb12-2">P0_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y_A0_1173"</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 0.00924, section 11.7.3's own inlet mole fraction</span></span>
<span id="cb12-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#                                 # for the SAME reactor, hence its partial pressure</span></span>
<span id="cb12-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#                                 # in atm at p_t = 1 atm.</span></span>
<span id="cb12-5">NS_RUNG1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4800</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the ONE rung-1 refinement chain</span></span>
<span id="cb12-6">_RUNG1_CACHE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb12-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The order fit is only meaningful if the finest grid's error is far above the</span></span>
<span id="cb12-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># thresholds' own noise floor (claims-design section 3).  That floor is NOT the 1e-12</span></span>
<span id="cb12-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bisection bracket: a threshold moves by about 1e-8 relative when only its starting</span></span>
<span id="cb12-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># guess changes, so 1e-8 is the floor used here.</span></span>
<span id="cb12-11">START_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span></span>
<span id="cb12-12"></span>
<span id="cb12-13"></span>
<span id="cb12-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rung1_chain(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NS_RUNG1):</span>
<span id="cb12-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Rung 1's threshold and hot spot on a refinement chain, its observed orders,</span></span>
<span id="cb12-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the Richardson limits, and the same two numbers from the grid-free ODE route.</span></span>
<span id="cb12-17"></span>
<span id="cb12-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    THIS IS THE ONLY PLACE rung 1's reported numbers are computed.  The Validation</span></span>
<span id="cb12-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    cell below DISPLAYS this function's return value, `h_rung1` RETURNS its metric</span></span>
<span id="cb12-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    subset, and the break rows call it with a perturbed R or ceiling - so the</span></span>
<span id="cb12-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    displayed number and the agreement.json number are the same object, not two</span></span>
<span id="cb12-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    computations that happen to agree.</span></span>
<span id="cb12-23"></span>
<span id="cb12-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Memoised on its own arguments only, which is a pure function of them, so it</span></span>
<span id="cb12-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    changes nothing about determinism.</span></span>
<span id="cb12-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb12-27">    R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R_T <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> R <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> R</span>
<span id="cb12-28">    ceiling <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_PERM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ceiling <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ceiling</span>
<span id="cb12-29">    key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R, ceiling, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(ns))</span>
<span id="cb12-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _RUNG1_CACHE:</span>
<span id="cb12-31">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _RUNG1_CACHE[key]</span>
<span id="cb12-32">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb12-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ns:</span>
<span id="cb12-34">        lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R)</span>
<span id="cb12-35">        Tm, zm, _edge <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hotspot(lad.z_c, lad.solve(P0_BOOK)[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb12-36">        rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, T_hot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Tm, z_hot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zm,</span>
<span id="cb12-37">                         p0_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p0_critical(lad, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling)))</span>
<span id="cb12-38">    tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb12-39">    ordT, limT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(tab.T_hot, tab.n_z)</span>
<span id="cb12-40">    ordP, limP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(tab.p0_star, tab.n_z)</span>
<span id="cb12-41">    ordZ, limZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(tab.z_hot, tab.n_z)</span>
<span id="cb12-42">    T_ode, z_ode, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ode_reference(RX, P0_BOOK, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R)</span>
<span id="cb12-43">    p0_ode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical_ode(RX, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling)</span>
<span id="cb12-44">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tab, order_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ordZ, limit_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>limZ, limit_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>limT, limit_p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>limP,</span>
<span id="cb12-45">               T_ode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_ode, z_ode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>z_ode, p0_ode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p0_ode,</span>
<span id="cb12-46">               metrics<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rung1_p0_star_extrapolated<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>limP, rung1_order_p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ordP,</span>
<span id="cb12-47">                            rung1_order_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ordT,</span>
<span id="cb12-48">                            ode_vs_pymrm_p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(limP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p0_ode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb12-49">                            ode_vs_pymrm_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(limT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T_ode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb12-50">                            p0_star_vs_printed_0018<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p0_ode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0_BOOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb12-51">                            rung1_finest_err_over_start_floor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb12-52">                                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab.p0_star.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> limP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> START_FLOOR))</span>
<span id="cb12-53">    _RUNG1_CACHE[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out</span>
<span id="cb12-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb12-55"></span>
<span id="cb12-56"></span>
<span id="cb12-57">_CROSS_R_CACHE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb12-58"></span>
<span id="cb12-59"></span>
<span id="cb12-60"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> shift_rung5(R, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>):</span>
<span id="cb12-61">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""rung 5 against rung 1 AT THE SAME RADIUS - both thresholds move with R_t."""</span></span>
<span id="cb12-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R), hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>)</span>
<span id="cb12-63">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R), hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb12-64"></span>
<span id="cb12-65"></span>
<span id="cb12-66">R_SWEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R_T, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0120</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0115</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0110</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0105</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0100</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0098</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0096</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0094</span>,</span>
<span id="cb12-67">           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0090</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0085</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P)</span>
<span id="cb12-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#          ^ from the chapter's own tube outward, down to d_t/d_p = 5, which is</span></span>
<span id="cb12-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            where section 11.5.1 says the Ergun constants "drastically change".</span></span>
<span id="cb12-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            The sweep runs until the target is straddled by two VALIDATED points</span></span>
<span id="cb12-71"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            and stops there - each evaluation is two threshold bisections, one of</span></span>
<span id="cb12-72"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            them two-dimensional, so the points past the bracket are not spent.</span></span>
<span id="cb12-73"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            What happens on narrower tubes is measured separately, below the</span></span>
<span id="cb12-74"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            crossover table, where it is the question being asked.</span></span>
<span id="cb12-75"></span>
<span id="cb12-76"></span>
<span id="cb12-77"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cross_R(target, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, iters<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>):</span>
<span id="cb12-78">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The tube radius at which rung 5's shift crosses `target`, from the same</span></span>
<span id="cb12-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    controlled scan as every other row.  Memoised on its own arguments so that the</span></span>
<span id="cb12-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    display cell and the break-table helper are ONE computation: each evaluation is</span></span>
<span id="cb12-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    two full threshold bisections, one of them two-dimensional, so this is the most</span></span>
<span id="cb12-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    expensive search on the page.</span></span>
<span id="cb12-83"></span>
<span id="cb12-84"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ITERS IS A BRACKET TOLERANCE AND NOT AN ACCURACY: four refinement levels of the 0.5 mm straddling pair</span></span>
<span id="cb12-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    is about 2e-6 m, while the GRID moves the shift by about 0.1 percentage points,</span></span>
<span id="cb12-86"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    which on the local slope of the sweep is some 3e-5 m of R_t*.  The display cell</span></span>
<span id="cb12-87"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    computes that from the page's own two grids and prints R_t* with it."""</span></span>
<span id="cb12-88">    key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (target, n_z, n_r, iters)</span>
<span id="cb12-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _CROSS_R_CACHE:</span>
<span id="cb12-90">        _CROSS_R_CACHE[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(</span>
<span id="cb12-91">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: shift_rung5(R, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r), R_SWEEP, target,</span>
<span id="cb12-92">            levels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>iters)</span>
<span id="cb12-93">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _CROSS_R_CACHE[key]</span>
<span id="cb12-94"></span>
<span id="cb12-95"></span>
<span id="cb12-96"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> unit_reading(p_B0, p_t, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R_T, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_PERM):</span>
<span id="cb12-97">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Rung 1's threshold and its hot spot at the printed 0.018, on a stated</span></span>
<span id="cb12-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    reading of section 11.5.2's pressure unit: the design case with p_B0 and p_t</span></span>
<span id="cb12-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    replaced.  Grid-free (Radau) throughout, so the comparison between the two</span></span>
<span id="cb12-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    readings carries no discretisation at all."""</span></span>
<span id="cb12-101">    rx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(RX, p_B0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p_B0, p_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p_t)</span>
<span id="cb12-102">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(p0_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p0_critical_ode(rx, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling),</span>
<span id="cb12-103">                T_at_book_p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ode_reference(rx, P0_BOOK, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb12-104"></span>
<span id="cb12-105"></span>
<span id="cb12-106">G_FLUX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RX.mass_flux</span>
<span id="cb12-107">FILM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> film(RX)</span>
<span id="cb12-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film coefficients from Wakao &amp; Funazkri (page A3.4), at the chapter's printed Re:"</span>)</span>
<span id="cb12-109"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sc"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sh"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu"</span>):</span>
<span id="cb12-110">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   k_g = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k_g'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m/s      h_f = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'h_f'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kJ/(m2 s K)"</span></span>
<span id="cb12-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      a_v = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a_v'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/m3"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>film coefficients from Wakao &amp; Funazkri (page A3.4), at the chapter's printed Re:
    Re =   121.0000
    Sc =     2.4793
    Pr =     0.7059
    Sh =    28.4551
    Nu =    19.4036
   k_g = 0.094850 m/s      h_f = 0.307224 kJ/(m2 s K)      a_v = 1008.83 m2/m3</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<p>The comparison metric is <strong>the inlet partial pressure at which the hot spot reaches 415 <img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc">C</strong>, root-found on each rung. 415 <img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc">C is not a choice: section 11.5.2 states the operating temperature range of this catalyst as “335<img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc"> to 415<img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc">C”, so the ceiling is the book’s own, and the quantity is a threshold rather than a sampled maximum. Call it <img src="https://latex.codecogs.com/png.latex?p_%7BA0%7D%5E*">.</p>
<p>Reported alongside are the hot spot and its location at the book’s own <img src="https://latex.codecogs.com/png.latex?p_%7BA0%7D%20=%200.018"> atm, so that both a fixed-input and a fixed-output comparison are on the page.</p>
<div id="e2d26a97" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:41:12.711609Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:41:12.711490Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:42:17.897787Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:42:17.896969Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">N_Z, N_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span></span>
<span id="cb14-2">RUNGS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"basic 1-D plug flow"</span>),</span>
<span id="cb14-3">         (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+ axial dispersion"</span>),</span>
<span id="cb14-4">         (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+ film resistance"</span>),</span>
<span id="cb14-5">         (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+ intraparticle profiles"</span>),</span>
<span id="cb14-6">         (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D radial dispersion"</span>)]</span>
<span id="cb14-7">HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0200</span>}</span>
<span id="cb14-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The profiles are compared at P0_REF rather than at 0.018 for a reason that is itself</span></span>
<span id="cb14-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a result: 0.018 is above the threshold of some of the rungs (the count is COMPUTED and</span></span>
<span id="cb14-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed below, not asserted here), so their "hot spot" there is a runaway state rather</span></span>
<span id="cb14-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># than an operating point.  P0_REF is subcritical on all five, and the chapter prints it</span></span>
<span id="cb14-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for this reactor.</span></span>
<span id="cb14-13"></span>
<span id="cb14-14">SOL, LAD, ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}, []</span>
<span id="cb14-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, sec, st, what <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS:</span>
<span id="cb14-16">    lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_Z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_R)</span>
<span id="cb14-17">    LAD[r] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lad</span>
<span id="cb14-18">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_robust(lad, P0_REF)</span>
<span id="cb14-19">    SOL[r] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c</span>
<span id="cb14-20">    Tm, zm, edge <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hotspot(lad.z_c, lad.bulk_T(c))</span>
<span id="cb14-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> edge, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rung </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: hot spot at a grid edge, not an interior root"</span></span>
<span id="cb14-22">    pc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(lad, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HI[r])</span>
<span id="cb14-23">    ROWS.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r, section<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sec, structure<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>st, adds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>what,</span>
<span id="cb14-24">                     T_hot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Tm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>, z_hot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zm,</span>
<span id="cb14-25">                     p_exit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].mean(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb14-26">                     p0_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pc, newton_residual<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lad.last_residual))</span>
<span id="cb14-27">LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(ROWS)</span>
<span id="cb14-28">LADDER[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs_rung1_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (LADDER.p0_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> LADDER.p0_star.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb14-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The hot spot at 0.018 atm is reported only for rungs still BELOW their threshold</span></span>
<span id="cb14-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># there.  Past it, the fixed-inlet solve starts cold from the rung-1 profile, which is</span></span>
<span id="cb14-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># then a runaway guess, and which state Newton reaches (or whether it converges) is</span></span>
<span id="cb14-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># decided by round-off (see the note on locating thresholds in Validation); branch</span></span>
<span id="cb14-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># following settles this for thresholds but not for a fixed-inlet solve above one.</span></span>
<span id="cb14-34">LADDER[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_hot_at_0018"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_max_safe(LAD[r], P0_BOOK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-35">                            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> LADDER.p0_star[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> P0_BOOK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"past threshold"</span>)</span>
<span id="cb14-36">                           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, (r, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(RUNGS)]</span>
<span id="cb14-37"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> (LADDER.newton_residual <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a ladder solve did not reach 1e-8"</span></span>
<span id="cb14-38">show(LADDER.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11ladder"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb14-39">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_hot"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z_hot"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_exit"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-40">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.7f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs_rung1_pct"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-41">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton_residual"</span>: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt; 1e-8"</span>}))</span>
<span id="cb14-42"></span>
<span id="cb14-43">P0S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LADDER.rung, LADDER.p0_star))</span>
<span id="cb14-44">SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LADDER.rung, LADDER.vs_rung1_pct))</span>
<span id="cb14-45">R34_LIKE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rung 3 -&gt; rung 4, against RUNG 3</span></span>
<span id="cb14-46">R34_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R34_LIKE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb14-47">N_SUPERCRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((LADDER.p0_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> P0_BOOK).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb14-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">All pressures are in ATM (see Parameters). T_hot and z_hot are at"</span></span>
<span id="cb14-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" p_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(section 11.7.3's own mole fraction for this reactor, at"</span></span>
<span id="cb14-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" p_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_t'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm); T_hot_at_0018 is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at section 11.5.2's design point."</span></span>
<span id="cb14-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'past threshold' MARKS A RUNG WHOSE OWN p0* IS BELOW 0.018 atm. Its hot spot"</span></span>
<span id="cb14-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" there is a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">runaway state reached by a cold-started fixed-inlet solve, and which"</span></span>
<span id="cb14-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" state that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">solve reaches is decided by round-off (see the note on locating"</span></span>
<span id="cb14-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" thresholds in Validation), so</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">no temperature is printed for it. Newton residuals are all below"</span></span>
<span id="cb14-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1e-8 (asserted)."</span></span>
<span id="cb14-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AT 0.018 ATM, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SUPERCRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> OF THE FIVE RUNGS ARE ALREADY PAST THEIR OWN"</span></span>
<span id="cb14-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" THRESHOLD - rungs"</span></span>
<span id="cb14-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(r) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LADDER.rung[LADDER.p0_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> P0_BOOK])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - which is why"</span></span>
<span id="cb14-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">profile comparison is made at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm and not there."</span>)</span>
<span id="cb14-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Each rung, as a shift in the safe inlet partial pressure of the SAME reactor,"</span></span>
<span id="cb14-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">measured against RUNG 1:"</span>)</span>
<span id="cb14-62"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, sec, st, what <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]:</span>
<span id="cb14-63">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>what<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;26s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (sec. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sec<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>st<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[r]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb14-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The two heterogeneous rungs pull in OPPOSITE directions. Like for like - rung 4"</span></span>
<span id="cb14-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">against RUNG 3, which is the model it corrects, not against rung 1 -"</span></span>
<span id="cb14-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rung 1 -&gt; rung 3 : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %   (of rung 1's threshold)"</span></span>
<span id="cb14-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rung 3 -&gt; rung 4 : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R34_LIKE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %   (of rung 3's threshold)"</span></span>
<span id="cb14-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">so the second correction is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R34_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the size of the first. Against the"</span></span>
<span id="cb14-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" common</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rung-1 baseline the same pair reads </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, a"</span></span>
<span id="cb14-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" difference of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">PERCENTAGE POINTS - a different quantity, and"</span></span>
<span id="cb14-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not a percentage of anything.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Either way: stopping at rung 3 leaves you further from"</span></span>
<span id="cb14-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rung 4"</span></span>
<span id="cb14-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">than rung 1 was"</span></span>
<span id="cb14-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm)."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11ladder" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11ladder_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">rung</th>
<th id="T_d11ladder_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">section</th>
<th id="T_d11ladder_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">structure</th>
<th id="T_d11ladder_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">adds</th>
<th id="T_d11ladder_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">T_hot</th>
<th id="T_d11ladder_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">z_hot</th>
<th id="T_d11ladder_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">p_exit</th>
<th id="T_d11ladder_level0_col7" class="col_heading level0 col7" data-quarto-table-cell-role="th">p0_star</th>
<th id="T_d11ladder_level0_col8" class="col_heading level0 col8" data-quarto-table-cell-role="th">newton_residual</th>
<th id="T_d11ladder_level0_col9" class="col_heading level0 col9" data-quarto-table-cell-role="th">vs_rung1_pct</th>
<th id="T_d11ladder_level0_col10" class="col_heading level0 col10" data-quarto-table-cell-role="th">T_hot_at_0018</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11ladder_row0_col0" class="data row0 col0">1</td>
<td id="T_d11ladder_row0_col1" class="data row0 col1">11.5</td>
<td id="T_d11ladder_row0_col2" class="data row0 col2">S2</td>
<td id="T_d11ladder_row0_col3" class="data row0 col3">basic 1-D plug flow</td>
<td id="T_d11ladder_row0_col4" class="data row0 col4">362.05</td>
<td id="T_d11ladder_row0_col5" class="data row0 col5">0.3921</td>
<td id="T_d11ladder_row0_col6" class="data row0 col6">3.774e-03</td>
<td id="T_d11ladder_row0_col7" class="data row0 col7">0.0180238</td>
<td id="T_d11ladder_row0_col8" class="data row0 col8">&lt; 1e-8</td>
<td id="T_d11ladder_row0_col9" class="data row0 col9">+0.00</td>
<td id="T_d11ladder_row0_col10" class="data row0 col10">412.9</td>
</tr>
<tr class="even">
<td id="T_d11ladder_row1_col0" class="data row1 col0">2</td>
<td id="T_d11ladder_row1_col1" class="data row1 col1">11.6</td>
<td id="T_d11ladder_row1_col2" class="data row1 col2">S4</td>
<td id="T_d11ladder_row1_col3" class="data row1 col3">+ axial dispersion</td>
<td id="T_d11ladder_row1_col4" class="data row1 col4">362.02</td>
<td id="T_d11ladder_row1_col5" class="data row1 col5">0.3941</td>
<td id="T_d11ladder_row1_col6" class="data row1 col6">3.776e-03</td>
<td id="T_d11ladder_row1_col7" class="data row1 col7">0.0180537</td>
<td id="T_d11ladder_row1_col8" class="data row1 col8">&lt; 1e-8</td>
<td id="T_d11ladder_row1_col9" class="data row1 col9">+0.17</td>
<td id="T_d11ladder_row1_col10" class="data row1 col10">410.7</td>
</tr>
<tr class="odd">
<td id="T_d11ladder_row2_col0" class="data row2 col0">3</td>
<td id="T_d11ladder_row2_col1" class="data row2 col1">11.8</td>
<td id="T_d11ladder_row2_col2" class="data row2 col2">S7</td>
<td id="T_d11ladder_row2_col3" class="data row2 col3">+ film resistance</td>
<td id="T_d11ladder_row2_col4" class="data row2 col4">362.23</td>
<td id="T_d11ladder_row2_col5" class="data row2 col5">0.3905</td>
<td id="T_d11ladder_row2_col6" class="data row2 col6">3.740e-03</td>
<td id="T_d11ladder_row2_col7" class="data row2 col7">0.0171693</td>
<td id="T_d11ladder_row2_col8" class="data row2 col8">&lt; 1e-8</td>
<td id="T_d11ladder_row2_col9" class="data row2 col9">-4.74</td>
<td id="T_d11ladder_row2_col10" class="data row2 col10">past threshold</td>
</tr>
<tr class="even">
<td id="T_d11ladder_row3_col0" class="data row3 col0">4</td>
<td id="T_d11ladder_row3_col1" class="data row3 col1">11.9</td>
<td id="T_d11ladder_row3_col2" class="data row3 col2">S8</td>
<td id="T_d11ladder_row3_col3" class="data row3 col3">+ intraparticle profiles</td>
<td id="T_d11ladder_row3_col4" class="data row3 col4">361.11</td>
<td id="T_d11ladder_row3_col5" class="data row3 col5">0.3893</td>
<td id="T_d11ladder_row3_col6" class="data row3 col6">4.066e-03</td>
<td id="T_d11ladder_row3_col7" class="data row3 col7">0.0208483</td>
<td id="T_d11ladder_row3_col8" class="data row3 col8">&lt; 1e-8</td>
<td id="T_d11ladder_row3_col9" class="data row3 col9">+15.67</td>
<td id="T_d11ladder_row3_col10" class="data row3 col10">382.5</td>
</tr>
<tr class="odd">
<td id="T_d11ladder_row4_col0" class="data row4 col0">5</td>
<td id="T_d11ladder_row4_col1" class="data row4 col1">11.7</td>
<td id="T_d11ladder_row4_col2" class="data row4 col2">S6</td>
<td id="T_d11ladder_row4_col3" class="data row4 col3">2-D radial dispersion</td>
<td id="T_d11ladder_row4_col4" class="data row4 col4">362.40</td>
<td id="T_d11ladder_row4_col5" class="data row4 col5">0.4186</td>
<td id="T_d11ladder_row4_col6" class="data row4 col6">3.746e-03</td>
<td id="T_d11ladder_row4_col7" class="data row4 col7">0.0164314</td>
<td id="T_d11ladder_row4_col8" class="data row4 col8">&lt; 1e-8</td>
<td id="T_d11ladder_row4_col9" class="data row4 col9">-8.84</td>
<td id="T_d11ladder_row4_col10" class="data row4 col10">past threshold</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
All pressures are in ATM (see Parameters). T_hot and z_hot are at p_A0 = 0.00924 atm
(section 11.7.3's own mole fraction for this reactor, at p_t = 1.0 atm); T_hot_at_0018 is
at section 11.5.2's design point.

'past threshold' MARKS A RUNG WHOSE OWN p0* IS BELOW 0.018 atm. Its hot spot there is a
runaway state reached by a cold-started fixed-inlet solve, and which state that
solve reaches is decided by round-off (see the note on locating thresholds in Validation), so
no temperature is printed for it. Newton residuals are all below 1e-8 (asserted).

AT 0.018 ATM, 2 OF THE FIVE RUNGS ARE ALREADY PAST THEIR OWN THRESHOLD - rungs 3, 5 - which is why the
profile comparison is made at 0.00924 atm and not there.

Each rung, as a shift in the safe inlet partial pressure of the SAME reactor,
measured against RUNG 1:
   + axial dispersion         (sec. 11.6, S4)     +0.17 %
   + film resistance          (sec. 11.8, S7)     -4.74 %
   + intraparticle profiles   (sec. 11.9, S8)    +15.67 %
   2-D radial dispersion      (sec. 11.7, S6)     -8.84 %

The two heterogeneous rungs pull in OPPOSITE directions. Like for like - rung 4
against RUNG 3, which is the model it corrects, not against rung 1 -
   rung 1 -&gt; rung 3 : -4.74 %   (of rung 1's threshold)
   rung 3 -&gt; rung 4 : +21.43 %   (of rung 3's threshold)
so the second correction is 4.5 times the size of the first. Against the common
rung-1 baseline the same pair reads -4.74 and +15.67 %, a difference of +20.41
PERCENTAGE POINTS - a different quantity, and not a percentage of anything.
Either way: stopping at rung 3 leaves you further from rung 4 (0.003679 atm)
than rung 1 was (0.002825 atm).</code></pre>
</div>
</div>
<div id="4622bd52" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:42:17.899894Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:42:17.899760Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:42:18.407807Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:42:18.407078Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>))</span>
<span id="cb16-2">COL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>: C_BLUE, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>: C_GREEN, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>: C_ORANGE, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>: C_PURPLE, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>: C_RED}</span>
<span id="cb16-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, sec, st, what <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS:</span>
<span id="cb16-4">    lad, c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> LAD[r], SOL[r]</span>
<span id="cb16-5">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(lad.z_c, lad.bulk_T(c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>COL[r], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>,</span>
<span id="cb16-6">               label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sec<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>st<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>what<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-7">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(lad.z_c, (c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].mean(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb16-8">               color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>COL[r], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>)</span>
<span id="cb16-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(LAD[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>].z_c, LAD[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>].axis_T(SOL[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_RED, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>,</span>
<span id="cb16-10">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5. axis temperature"</span>)</span>
<span id="cb16-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.35"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)</span>
<span id="cb16-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_PERM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> $^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">circ$C, top of the printed operating range"</span>,</span>
<span id="cb16-13">               (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.25"</span>)</span>
<span id="cb16-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z [m]"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"temperature [$^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">circ$C]"</span>)</span>
<span id="cb16-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"five models, one reactor, $p_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm"</span>)</span>
<span id="cb16-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.2</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper right"</span>)</span>
<span id="cb16-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z [m]"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$p_A$ [atm]"</span>)</span>
<span id="cb16-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hydrocarbon partial pressure"</span>)</span>
<span id="cb16-19">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb16-20"></span>
<span id="cb16-21">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6</span>))</span>
<span id="cb16-22">ax.barh([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. sec. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, s, t, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS], LADDER.vs_rung1_pct,</span>
<span id="cb16-23">        color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[COL[r] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS], height<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>)</span>
<span id="cb16-24">ax.axvline(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.3"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb16-25">ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift in the safe inlet partial pressure $p_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{A0}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">^*$ [%] vs rung 1"</span></span>
<span id="cb16-26">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">($p_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{A0}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">^*$ in atm; see Parameters)"</span>)</span>
<span id="cb16-27">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what each rung buys, on the same reactor"</span>)</span>
<span id="cb16-28">ax.invert_yaxis()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/D1.1-froment-fixed-bed-ladder/index_files/figure-html/cell-9-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/D1.1-froment-fixed-bed-ladder/index_files/figure-html/cell-9-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Ranked by strength, and the ranking is the honest one: the chapter reports no experiment, so nothing below is a validation against data.</p>
<ol type="1">
<li><strong>Example 11.5.1.A’s pressure drop is fully printed arithmetic</strong> - three friction factors and three pressure drops from stated inputs. Reproducible to the digit, and the strongest check available in the chapter. It is also where a contradiction with eq. (11.5.1-9) shows up.</li>
<li><strong>Section 11.5.2’s parametric-sensitivity sentence</strong> is a root-findable threshold with a printed ceiling, and it tests the whole of rung 1 - equations, constants, wall group - in one number.</li>
<li><strong>Example 11.5.3.A</strong> is Van Welsenaere &amp; Froment’s own worked example recopied, so the book’s transcription can be checked against <code>D2.2</code>’s CSV of the originals. This checks the <em>transcription</em>, not the model - and, as the cell below shows, a row-by-row transcription check is not enough on its own: it is the <strong>cross-column</strong> test the table imposes on itself, <img src="https://latex.codecogs.com/png.latex?%5CDelta%20T_%7Bad%7D%20=%20(B/A)%5C,p_0">, that finds the larger defect.</li>
<li><strong>Equation (11.9.1-11)</strong> is an analytical solution of (11.9.1-3), so the pellet grid solve can be checked against it and against <code>B1.1</code>’s exact table.</li>
<li><strong>Sections 11.8.2, 11.7.3 and 11.7.4 state results without arithmetic</strong> - “of the order of 1 <img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc">C”, “about 30”, “less than 360”, “365”. Checkable to a figure or two, no better.</li>
<li><strong>Grid convergence and a second solver family</strong> are internal, not validation of the book - but they are what makes the rung-to-rung differences meaningful, because two of them are smaller than the discretisation error of a single 1200-cell solve.</li>
</ol>
<p><strong>Locating a threshold.</strong> <code>p0_critical</code> makes one cold solve at the bottom of the bracket and starts every later solve from the converged state at the current lower end, so it follows the branch the reactor is on as the feed is raised. Cold-starting every solve from the rung-1 profile at the same <img src="https://latex.codecogs.com/png.latex?p_%7BA0%7D"> would not be neutral: between rung 1’s threshold and a higher one that guess is already a runaway profile, and whether Newton then reaches the ignited state or fails (and the fallback ramp finds the lower state) is decided by round-off. Direct starts on rung 2 at <img src="https://latex.codecogs.com/png.latex?n_z%20=%20900"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_a%20=%200.24">, at four inlet pressures <img src="https://latex.codecogs.com/png.latex?10%5E%7B-5%7D"> atm apart just below 0.0182 atm, reached the ignited state far above the ceiling, the lower state or no convergence, in no monotone order; nothing on this page recomputes them, because by this argument the outcome differs between machines. With the branch followed, the rung-2 crossover is 0.24883, inside the grid-set error bar the crossover cell prints, and every point of every scan passes the control, on three BLAS kernels. <strong>What branch following does not cover:</strong> a fixed-inlet solve <em>above</em> a threshold starts cold from the rung-1 profile. The page therefore prints no hot spot at 0.018 atm for a rung already past its threshold, states rung 5’s coarse-grid state at 0.018 atm only as a bound, and does not say which rungs brentq survives.</p>
<div id="47e5bf20" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:42:18.410070Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:42:18.409865Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:42:18.429393Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:42:18.428661Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ============ 1. Example 11.5.1.A, and the two equivalent diameters ==========</span></span>
<span id="cb17-2">E <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_length"</span>), d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_cylinder"</span>), eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_voidage"</span>),</span>
<span id="cb17-3">         G<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_mass_flux"</span>), mu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_viscosity"</span>),</span>
<span id="cb17-4">         rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_density"</span>))</span>
<span id="cb17-5">E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho"</span>]</span>
<span id="cb17-6">ERG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(ERG_PAR.quantity, ERG_PAR.value))</span>
<span id="cb17-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ergun's constants, loaded from A1.1 rather than retyped:"</span>)</span>
<span id="cb17-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ERG_PAR.quantity:</span>
<span id="cb17-9">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ERG[q]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   and A1.1's own refit of Ergun's markers gives"</span></span>
<span id="cb17-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" k1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k1_refit_all_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, k2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k2_refit_all_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (its claims),</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   which is A1.1's finding and changes nothing here: Example 11.5.1.A is"</span></span>
<span id="cb17-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   arithmetic ON the printed constants."</span>)</span>
<span id="cb17-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ERG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k1_viscous_constant"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_b"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ERG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k2_kinetic_constant"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_a"</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A1.1's Ergun constants and the book's printed a, b disagree"</span></span>
<span id="cb17-16"></span>
<span id="cb17-17"></span>
<span id="cb17-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_ergun(dp, a, b):</span>
<span id="cb17-19">    Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu"</span>]</span>
<span id="cb17-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Re, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Re)</span>
<span id="cb17-21"></span>
<span id="cb17-22"></span>
<span id="cb17-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_hicks(dp):</span>
<span id="cb17-24">    Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu"</span>]</span>
<span id="cb17-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Re, (bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_coefficient"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_exponent_eps"</span>)</span>
<span id="cb17-26">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_exponent_Re"</span>))</span>
<span id="cb17-27"></span>
<span id="cb17-28"></span>
<span id="cb17-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dP(f, dp):</span>
<span id="cb17-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L"</span>]          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (11.5.1-3)</span></span>
<span id="cb17-31"></span>
<span id="cb17-32"></span>
<span id="cb17-33">DP_AREA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>]      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sphere of equal surface AREA - what is printed</span></span>
<span id="cb17-34">DP_SV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>]                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (11.5.1-9), 6 V_p/S_p, for a cylinder d = h</span></span>
<span id="cb17-35">DP_ROUNDED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp"</span>)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed 0.0037, used by the book downstream</span></span>
<span id="cb17-36">tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb17-37"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, dp <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as printed, 0.0037 m"</span>, DP_ROUNDED),</span>
<span id="cb17-38">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sqrt(1.5) x 0.003, unrounded"</span>, DP_AREA),</span>
<span id="cb17-39">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (11.5.1-9): 6 V/S = d"</span>, DP_SV)):</span>
<span id="cb17-40">    Re, fe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_ergun(dp, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_a"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_b"</span>))</span>
<span id="cb17-41">    _, fm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_ergun(dp, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_a"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_b"</span>))</span>
<span id="cb17-42">    _, fh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_hicks(dp)</span>
<span id="cb17-43">    tab.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(d_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dp, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nm, Re<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Re, f_Ergun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fe, dP_Ergun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dP(fe, dp),</span>
<span id="cb17-44">                    f_McDonald<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fm, dP_McDonald<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dP(fm, dp),</span>
<span id="cb17-45">                    f_Hicks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fh, dP_Hicks_bar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dP(fh, dp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>))</span>
<span id="cb17-46">EX1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(tab)</span>
<span id="cb17-47">EX1.loc[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EX1)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(d_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>DP_ROUNDED, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"THE BOOK PRINTS"</span>, Re<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_Re"</span>),</span>
<span id="cb17-48">                         f_Ergun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_ergun"</span>), dP_Ergun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_ergun"</span>),</span>
<span id="cb17-49">                         f_McDonald<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_mcdonald"</span>),</span>
<span id="cb17-50">                         dP_McDonald<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_mcdonald"</span>),</span>
<span id="cb17-51">                         f_Hicks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_hicks"</span>), dP_Hicks_bar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_hicks"</span>))</span>
<span id="cb17-52">show(EX1.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11ex1151a"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb17-53">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f_Ergun"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dP_Ergun"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.0f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb17-54">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f_McDonald"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dP_McDonald"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.0f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f_Hicks"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb17-55">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dP_Hicks_bar"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb17-56"></span>
<span id="cb17-57">EX1151A_ERGUN_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(EX1.dP_Ergun.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_ergun"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-58">EX1151A_MCD_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(EX1.dP_McDonald.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_mcdonald"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-59">EX1151A_HICKS_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(EX1.dP_Hicks_bar.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_hicks"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-60">EX1151A_WORST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(EX1151A_ERGUN_DEV, EX1151A_MCD_DEV, EX1151A_HICKS_DEV)</span>
<span id="cb17-61">DP_DEFINITION_COST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX1.dP_Ergun.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> EX1.dP_Ergun.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb17-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">On the printed d_p = 0.0037 m the three pressure drops come back to"</span></span>
<span id="cb17-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EX1151A_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">relative, i.e. to every digit the example prints."</span></span>
<span id="cb17-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">But the printed d_p is NOT the chapter's own definition. Eq. (11.5.1-9) reads"</span></span>
<span id="cb17-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d_p = 6(1-eps)/a_v, i.e. 6 V_p/S_p, and the text calls it 'the diameter of a"</span></span>
<span id="cb17-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sphere with the same surface area PER UNIT VOLUME as the actual particle'. For a"</span></span>
<span id="cb17-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cylinder with d = h = 3 mm, S_p/V_p = 6/d exactly, so eq. (11.5.1-9) gives"</span></span>
<span id="cb17-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DP_SV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m. The example instead uses sqrt(1.5) x 0.003 ="</span></span>
<span id="cb17-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DP_AREA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, which is the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sphere of equal surface AREA (pi d_s^2 = 1.5 pi d^2)"</span></span>
<span id="cb17-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - a different definition.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">On the chapter's own definition the Ergun pressure drop"</span></span>
<span id="cb17-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EX1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dP_Ergun<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar against</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the printed"</span></span>
<span id="cb17-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ex1151a_dp_ergun'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>DP_DEFINITION_COST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. Reported, not"</span></span>
<span id="cb17-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" repaired."</span>)</span>
<span id="cb17-74"></span>
<span id="cb17-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and: no single Reynolds number produces all three printed friction factors</span></span>
<span id="cb17-76">implied <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb17-77">implied[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ergun"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb17-78">    bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_b"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_ergun"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>)</span>
<span id="cb17-79">implied[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"McDonald"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb17-80">    bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_b"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_mcdonald"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>)</span>
<span id="cb17-81">implied[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hicks"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_coefficient"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> bk(</span>
<span id="cb17-82">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_exponent_eps"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_exponent_Re"</span>)</span>
<span id="cb17-83">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_hicks"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>)</span>
<span id="cb17-84">RE_IMPLIED_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(implied.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(implied.values())</span>
<span id="cb17-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A third, smaller printed inconsistency in the same example. Inverting each"</span></span>
<span id="cb17-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed friction factor for the Reynolds number it needs, at the printed"</span></span>
<span id="cb17-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" eps = 0.38:"</span>)</span>
<span id="cb17-88"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> implied.items():</span>
<span id="cb17-89">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   f_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ex1151a_f_'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k.lower())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  requires  Re = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   the example prints  Re = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ex1151a_Re'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and d_p = 0.0037 m gives"</span></span>
<span id="cb17-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DP_ROUNDED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb17-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The Ergun and Hicks branches were evaluated at Re ~= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>implied[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Ergun'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and the"</span></span>
<span id="cb17-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">McDonald branch at Re ~= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>implied[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'McDonald'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the spread is"</span></span>
<span id="cb17-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE_IMPLIED_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A1.1 carries neither the McDonald nor the"</span></span>
<span id="cb17-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Hicks constants, so this branch of the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">example is not covered anywhere else."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Ergun's constants, loaded from A1.1 rather than retyped:
   k1_viscous_constant                150.0
   k2_kinetic_constant                1.75
   n_experiments_fitted               640.0
   kozeny_carman_line_fv_measured     149.2
   kozeny_carman_line_fv_uncertainty  0.5
   carman_kozeny_constant_k           5.0
   carman_kozeny_fv                   180.0
   and A1.1's own refit of Ergun's markers gives k1 = 151.9, k2 = 1.697 (its claims),
   which is A1.1's finding and changes nothing here: Example 11.5.1.A is
   arithmetic ON the printed constants.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11ex1151a" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11ex1151a_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">d_p</th>
<th id="T_d11ex1151a_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">basis</th>
<th id="T_d11ex1151a_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">Re</th>
<th id="T_d11ex1151a_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">f_Ergun</th>
<th id="T_d11ex1151a_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">dP_Ergun</th>
<th id="T_d11ex1151a_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">f_McDonald</th>
<th id="T_d11ex1151a_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">dP_McDonald</th>
<th id="T_d11ex1151a_level0_col7" class="col_heading level0 col7" data-quarto-table-cell-role="th">f_Hicks</th>
<th id="T_d11ex1151a_level0_col8" class="col_heading level0 col8" data-quarto-table-cell-role="th">dP_Hicks_bar</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11ex1151a_row0_col0" class="data row0 col0">0.003700</td>
<td id="T_d11ex1151a_row0_col1" class="data row0 col1">as printed, 0.0037 m</td>
<td id="T_d11ex1151a_row0_col2" class="data row0 col2">155.16</td>
<td id="T_d11ex1151a_row0_col3" class="data row0 col3">26.5457</td>
<td id="T_d11ex1151a_row0_col4" class="data row0 col4">31951</td>
<td id="T_d11ex1151a_row0_col5" class="data row0 col5">28.4651</td>
<td id="T_d11ex1151a_row0_col6" class="data row0 col6">34262</td>
<td id="T_d11ex1151a_row0_col7" class="data row0 col7">25.4608</td>
<td id="T_d11ex1151a_row0_col8" class="data row0 col8">0.3065</td>
</tr>
<tr class="even">
<td id="T_d11ex1151a_row1_col0" class="data row1 col0">0.003674</td>
<td id="T_d11ex1151a_row1_col1" class="data row1 col1">sqrt(1.5) x 0.003, unrounded</td>
<td id="T_d11ex1151a_row1_col2" class="data row1 col2">154.08</td>
<td id="T_d11ex1151a_row1_col3" class="data row1 col3">26.5931</td>
<td id="T_d11ex1151a_row1_col4" class="data row1 col4">32233</td>
<td id="T_d11ex1151a_row1_col5" class="data row1 col5">28.5221</td>
<td id="T_d11ex1151a_row1_col6" class="data row1 col6">34571</td>
<td id="T_d11ex1151a_row1_col7" class="data row1 col7">25.4964</td>
<td id="T_d11ex1151a_row1_col8" class="data row1 col8">0.3090</td>
</tr>
<tr class="odd">
<td id="T_d11ex1151a_row2_col0" class="data row2 col0">0.003000</td>
<td id="T_d11ex1151a_row2_col1" class="data row2 col1">eq. (11.5.1-9): 6 V/S = d</td>
<td id="T_d11ex1151a_row2_col2" class="data row2 col2">125.81</td>
<td id="T_d11ex1151a_row2_col3" class="data row2 col3">28.1259</td>
<td id="T_d11ex1151a_row2_col4" class="data row2 col4">41753</td>
<td id="T_d11ex1151a_row2_col5" class="data row2 col5">30.3613</td>
<td id="T_d11ex1151a_row2_col6" class="data row2 col6">45071</td>
<td id="T_d11ex1151a_row2_col7" class="data row2 col7">26.5514</td>
<td id="T_d11ex1151a_row2_col8" class="data row2 col8">0.3942</td>
</tr>
<tr class="even">
<td id="T_d11ex1151a_row3_col0" class="data row3 col0">0.003700</td>
<td id="T_d11ex1151a_row3_col1" class="data row3 col1">THE BOOK PRINTS</td>
<td id="T_d11ex1151a_row3_col2" class="data row3 col2">155.00</td>
<td id="T_d11ex1151a_row3_col3" class="data row3 col3">26.5300</td>
<td id="T_d11ex1151a_row3_col4" class="data row3 col4">31918</td>
<td id="T_d11ex1151a_row3_col5" class="data row3 col5">28.4700</td>
<td id="T_d11ex1151a_row3_col6" class="data row3 col6">34253</td>
<td id="T_d11ex1151a_row3_col7" class="data row3 col7">25.4500</td>
<td id="T_d11ex1151a_row3_col8" class="data row3 col8">0.3060</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
On the printed d_p = 0.0037 m the three pressure drops come back to 1.5e-03
relative, i.e. to every digit the example prints.

But the printed d_p is NOT the chapter's own definition. Eq. (11.5.1-9) reads
d_p = 6(1-eps)/a_v, i.e. 6 V_p/S_p, and the text calls it 'the diameter of a
sphere with the same surface area PER UNIT VOLUME as the actual particle'. For a
cylinder with d = h = 3 mm, S_p/V_p = 6/d exactly, so eq. (11.5.1-9) gives
d_p = 0.0030 m. The example instead uses sqrt(1.5) x 0.003 = 0.003674 m, which is the
sphere of equal surface AREA (pi d_s^2 = 1.5 pi d^2) - a different definition.
On the chapter's own definition the Ergun pressure drop is 0.4175 bar against
the printed 0.319 bar: +30.7 %. Reported, not repaired.

A third, smaller printed inconsistency in the same example. Inverting each
printed friction factor for the Reynolds number it needs, at the printed eps = 0.38:
   f_Ergun     =   26.53  requires  Re = 155.52
   f_McDonald  =   28.47  requires  Re = 155.07
   f_Hicks     =   25.45  requires  Re = 155.49
   the example prints  Re = 155, and d_p = 0.0037 m gives 155.16.
The Ergun and Hicks branches were evaluated at Re ~= 155.5 and the
McDonald branch at Re ~= 155.07; the spread is 0.45.
A1.1 carries neither the McDonald nor the Hicks constants, so this branch of the
example is not covered anywhere else.</code></pre>
</div>
</div>
<div id="3e6a670b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:42:18.431723Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:42:18.431550Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:43:24.702123Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:43:24.701049Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ===== 2. the parametric-sensitivity sentence, and every axis that carries error</span></span>
<span id="cb20-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"section 11.5.2, book page 513, verbatim:"</span>)</span>
<span id="cb20-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"runaway_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>))</span>
<span id="cb20-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   and the operating range on page 511 is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'temp_range_low'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-5">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'temp_range_high'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, which is what</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   'permissible limits'"</span></span>
<span id="cb20-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" means.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-7"></span>
<span id="cb20-8">R1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rung1_chain()               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE one rung-1 computation; agreement.json reads it</span></span>
<span id="cb20-9">CONV1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table"</span>]</span>
<span id="cb20-10">ORD_T, LIM_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_T"</span>], R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limit_T"</span>]</span>
<span id="cb20-11">ORD_P, LIM_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_p0"</span>], R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limit_p0"</span>]</span>
<span id="cb20-12">ORD_Z, LIM_Z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_z"</span>], R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limit_z"</span>]</span>
<span id="cb20-13">show(CONV1.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11conv1"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb20-14">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_hot"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z_hot"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.8f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb20-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed orders  T_hot </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   z_hot </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   p0* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (first-order upwind)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Richardson limits  T_hot </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K ="</span></span>
<span id="cb20-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C   z_hot </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m   p0* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm"</span>)</span>
<span id="cb20-18">R1_FINEST_OVER_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_finest_err_over_start_floor"</span>]</span>
<span id="cb20-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The finest grid's threshold error against that limit is"</span></span>
<span id="cb20-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R1_FINEST_OVER_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>START_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by which a threshold moves"</span></span>
<span id="cb20-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" when only its starting guess changes, so the order fit is not</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">fitted to that noise."</span>)</span>
<span id="cb20-22"></span>
<span id="cb20-23">T_ODE, Z_ODE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_ode"</span>], R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z_ode"</span>]</span>
<span id="cb20-24">P0_ODE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_ode"</span>]</span>
<span id="cb20-25">ODE_T_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_T"</span>]</span>
<span id="cb20-26">ODE_P_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_p0"</span>]</span>
<span id="cb20-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">SECOND, INDEPENDENT ROUTE - adaptive Radau on the two ODEs, no grid, no pymrm"</span></span>
<span id="cb20-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">operator, no Newton, sharing only the constants:"</span></span>
<span id="cb20-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   T_hot  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_ODE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_ODE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C   vs the extrapolated pymrm"</span></span>
<span id="cb20-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C   -&gt;  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ODE_T_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   z_hot  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Z_ODE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m                     vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m"</span></span>
<span id="cb20-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   p0*    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_ODE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm                 vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm     -&gt;  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ODE_P_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A break row perturbs an input; this catches a wrong baseline, and it is the"</span></span>
<span id="cb20-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reason the reported p0* is the extrapolated one and not the 1200-cell value"</span></span>
<span id="cb20-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>LIM_P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)."</span></span>
<span id="cb20-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">EVERY rung-1 number in agreement.json is an entry of the dict this cell is"</span></span>
<span id="cb20-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">displaying - one computation, not two that agree."</span>)</span>
<span id="cb20-38"></span>
<span id="cb20-39">T_AT_BOOK_P0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_ODE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span></span>
<span id="cb20-40">_p0_plus <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P0_BOOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"runaway_p0_increment"</span>)</span>
<span id="cb20-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So, on the book's own constants with R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, IN ATM:"</span></span>
<span id="cb20-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   p_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_BOOK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm          -&gt;  hot spot </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_AT_BOOK_P0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, "</span></span>
<span id="cb20-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_PERM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_AT_BOOK_P0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C BELOW the printed ceiling"</span></span>
<span id="cb20-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   p_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_p0_plus<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm (+</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_p0_increment'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)  -&gt;  hot spot"</span></span>
<span id="cb20-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ode_reference(RX, _p0_plus)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, far above it"</span></span>
<span id="cb20-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   the ceiling is crossed at p_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_ODE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm,"</span></span>
<span id="cb20-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(P0_ODE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P0_BOOK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from the printed 0.018."</span></span>
<span id="cb20-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The sentence is right, to one part in"</span></span>
<span id="cb20-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P0_ODE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P0_BOOK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb20-50"></span>
<span id="cb20-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- WHAT THE SENTENCE IS AN AGREEMENT *WITH*: the two unit readings, measured ----</span></span>
<span id="cb20-52">UNIT_ATM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unit_reading(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_t"</span>])</span>
<span id="cb20-53">UNIT_BAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unit_reading(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen_pressure"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"total_pressure"</span>))</span>
<span id="cb20-54">P0_STAR_BAR_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> UNIT_BAR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0_BOOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb20-55">T_0018_BAR_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> UNIT_BAR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_at_book_p0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span></span>
<span id="cb20-56">UNITS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb20-57">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(reading<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"VWF's set, p_B0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_B0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm, p_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_t'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm  (THIS PAGE)"</span>,</span>
<span id="cb20-58">         p0_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>UNIT_ATM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>], vs_printed_0018<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>UNIT_ATM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0_BOOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb20-59">         T_hot_at_0018_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>UNIT_ATM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_at_book_p0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>),</span>
<span id="cb20-60">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(reading<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"11.5.2 as printed, p_B0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'oxygen_pressure'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar,"</span></span>
<span id="cb20-61">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" p_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'total_pressure'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar"</span>,</span>
<span id="cb20-62">         p0_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>UNIT_BAR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>], vs_printed_0018<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P0_STAR_BAR_DEV,</span>
<span id="cb20-63">         T_hot_at_0018_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_0018_BAR_C),</span>
<span id="cb20-64">])</span>
<span id="cb20-65">show(UNITS.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11units"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb20-66">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vs_printed_0018"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_hot_at_0018_C"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.1f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb20-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Both rows are the same grid-free Radau solve with one constant changed, so the"</span></span>
<span id="cb20-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">difference is a PARAMETER-SET difference and carries no discretisation at all."</span></span>
<span id="cb20-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The +</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>UNIT_ATM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p0_star'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P0_BOOK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % reproduction of section 11.5.2's"</span></span>
<span id="cb20-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" sensitivity sentence is an agreement with"</span></span>
<span id="cb20-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Van Welsenaere &amp; Froment's 0.018 ATM, obtained with THEIR atm parameter set. Read"</span></span>
<span id="cb20-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">in the bar that section 11.5.2 itself prints, the same sentence is out by"</span></span>
<span id="cb20-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P0_STAR_BAR_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and its own design point sits at"</span></span>
<span id="cb20-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_0018_BAR_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C -"</span></span>
<span id="cb20-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_0018_BAR_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(T_PERM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K ABOVE the ceiling the facing page"</span></span>
<span id="cb20-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">states, which no reading of the chapter can be right about. That is why the atm"</span></span>
<span id="cb20-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reading is the one used, and it is stated rather than assumed:"</span></span>
<span id="cb20-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Fig. 11.5.2-1's own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ordinate label reads"</span></span>
<span id="cb20-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig1152_1_ordinate_unit'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'."</span>)</span>
<span id="cb20-80"></span>
<span id="cb20-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">At R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_T_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m - the radius the printed 2.54 cm diameter implies -"</span></span>
<span id="cb20-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the same</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inlet pressure gives a hot spot of"</span></span>
<span id="cb20-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ode_reference(RX, P0_BOOK, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_T_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, outside the operating range"</span></span>
<span id="cb20-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the same page</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">states, and p0* falls to"</span></span>
<span id="cb20-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p0_critical_ode(RX, R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_T_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm. The figures of section 11.5.2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cannot have"</span></span>
<span id="cb20-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" been computed at that radius; R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m is what reproduces them, and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">it is also"</span></span>
<span id="cb20-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" what eq. (11.7.4-1) needs to return the printed U. Two independent</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">constraints, same"</span></span>
<span id="cb20-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" answer."</span>)</span>
<span id="cb20-89"></span>
<span id="cb20-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- IS THE THRESHOLD A CEILING CROSSING OR A NEWTON-CONVERGENCE BOUNDARY? -------</span></span>
<span id="cb20-91"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">CONTROL: p0_critical bisects and treats a non-converged solve as"</span></span>
<span id="cb20-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" supercritical, so</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the number it returns COULD be a Newton-convergence boundary"</span></span>
<span id="cb20-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rather than a crossing</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_PERM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C ceiling. It is checked, on"</span></span>
<span id="cb20-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" EVERY call this page makes - not</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">only on these five rungs:"</span></span>
<span id="cb20-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" `p0_critical` runs `crossing_control`"</span></span>
<span id="cb20-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" itself and RAISES if it fails, so a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold that is not a ceiling crossing"</span></span>
<span id="cb20-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" cannot reach a table, a sweep or a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bisection. What follows is that same check,"</span></span>
<span id="cb20-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" displayed for the five reported rungs."</span>)</span>
<span id="cb20-99">ctl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb20-100"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, sec, st, what <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS:</span>
<span id="cb20-101">    lad, pc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> LAD[r], P0S[r]</span>
<span id="cb20-102">    lo_, hi_, ok_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> crossing_control(lad, pc)</span>
<span id="cb20-103">    ctl.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r, p0_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pc, T_just_below_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>,</span>
<span id="cb20-104">                    T_just_above_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>, jump_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo_, crossing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ok_))</span>
<span id="cb20-105">CTL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(ctl)</span>
<span id="cb20-106">show(CTL.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11ctl"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb20-107">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.7f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_just_below_C"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_just_above_C"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb20-108">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"jump_K"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}, na_rep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Newton did not converge"</span>))</span>
<span id="cb20-109">CROSSING_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(CTL.crossing.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>())</span>
<span id="cb20-110"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> CROSSING_OK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a rung's threshold is NOT a ceiling crossing"</span></span>
<span id="cb20-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"All five cross the ceiling, and cross it CONTINUOUSLY: the widest jump between"</span></span>
<span id="cb20-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">two solves is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>jump_K<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K, against the"</span></span>
<span id="cb20-113">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL_JUMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K the control allows and the hundreds of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">kelvin an ignition"</span></span>
<span id="cb20-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" discontinuity gives. So no rung's p0* is set by a convergence</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">failure. Above"</span></span>
<span id="cb20-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the threshold the Newton may give up - the situation bisection exists to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">survive -"</span></span>
<span id="cb20-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and that is NOT an absence of a steady state: the grid-free Radau route</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">returns a"</span></span>
<span id="cb20-117">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" bounded one at the top of the bracket,"</span></span>
<span id="cb20-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ode_reference(RX, HI[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C at p_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HI[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb20-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Brentq on the identical bracket, on ALL FIVE rungs at the n_z = 600 the break"</span></span>
<span id="cb20-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rows</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">use - this is what licenses bisection, so it is measured on every rung"</span></span>
<span id="cb20-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rather than</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">on the two it is cheapest to show:"</span>)</span>
<span id="cb20-122">_BRENT_OK, _BRENT_FAIL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb20-123"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>):</span>
<span id="cb20-124">    _bs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HI[r])   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># always, first</span></span>
<span id="cb20-125">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb20-126">        _rt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: T_max_safe(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_PERM,</span>
<span id="cb20-127">                     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.004</span>, HI[r], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb20-128">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_rt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _bs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rung </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: brentq and bisection disagree"</span></span>
<span id="cb20-129">        _BRENT_OK.append(r)</span>
<span id="cb20-130">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb20-131">        _BRENT_FAIL.append(r)</span>
<span id="cb20-132">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   rung </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: bisection </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bs<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-133"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _BRENT_FAIL, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brentq survived on every rung, so the text below is not what ran"</span></span>
<span id="cb20-134"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Brentq raises on a NaN on at least one rung, and on every rung where it survives it"</span></span>
<span id="cb20-135">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">returns the bisection root to better than 1e-10 (asserted). WHICH rungs it survives"</span></span>
<span id="cb20-136">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is decided by round-off, not by the rung: its points above the threshold are"</span></span>
<span id="cb20-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cold-started fixed-inlet solves, whose convergence is the round-off-decided"</span></span>
<span id="cb20-138">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" event the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">note on locating thresholds describes (here it fails on rungs"</span></span>
<span id="cb20-139">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">map</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, _BRENT_FAIL))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). So brentq is not wrong</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">where it survives;"</span></span>
<span id="cb20-140">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" it simply cannot be relied on."</span>)</span>
<span id="cb20-141">_T5_COARSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_max_safe(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>), P0_BOOK)</span>
<span id="cb20-142"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.isfinite(_T5_COARSE) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _T5_COARSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">900.0</span>, (</span>
<span id="cb20-143">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 5 at 0.018 atm on (600, 10) is not the bounded runaway state the text says"</span>)</span>
<span id="cb20-144"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And rung 5 at p_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_BOOK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm, past its own threshold: on the coarser (600, 10)"</span></span>
<span id="cb20-145">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">grid the cold-started solve reaches a bounded runaway state above 900 C (asserted),"</span></span>
<span id="cb20-146">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">more than 480 K past the ceiling (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_T5_COARSE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C), so the reactor HAS"</span></span>
<span id="cb20-147">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" a steady</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">state there. Its exact temperature, and whether the (1200, 20) grid"</span></span>
<span id="cb20-148">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" converges at all,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is decided by round-off: this is a fixed-inlet solve above a"</span></span>
<span id="cb20-149">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" threshold, started</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cold, which branch following does not cover."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>section 11.5.2, book page 513, verbatim:
   If the partial pressure of the hydrocarbon were 0.018 bar, an increase of 0.0002 bar would raise the hot spot temperature beyond permissible limits.
   and the operating range on page 511 is 335 to 415 C, which is what
   'permissible limits' means.
</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11conv1" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11conv1_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">n_z</th>
<th id="T_d11conv1_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">T_hot</th>
<th id="T_d11conv1_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">z_hot</th>
<th id="T_d11conv1_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">p0_star</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11conv1_row0_col0" class="data row0 col0">150</td>
<td id="T_d11conv1_row0_col1" class="data row0 col1">678.066174</td>
<td id="T_d11conv1_row0_col2" class="data row0 col2">0.603268</td>
<td id="T_d11conv1_row0_col3" class="data row0 col3">0.01815345</td>
</tr>
<tr class="even">
<td id="T_d11conv1_row1_col0" class="data row1 col0">300</td>
<td id="T_d11conv1_row1_col1" class="data row1 col1">682.090550</td>
<td id="T_d11conv1_row1_col2" class="data row1 col2">0.632286</td>
<td id="T_d11conv1_row1_col3" class="data row1 col3">0.01807966</td>
</tr>
<tr class="odd">
<td id="T_d11conv1_row2_col0" class="data row2 col0">600</td>
<td id="T_d11conv1_row2_col1" class="data row2 col1">684.624111</td>
<td id="T_d11conv1_row2_col2" class="data row2 col2">0.649241</td>
<td id="T_d11conv1_row2_col3" class="data row2 col3">0.01804248</td>
</tr>
<tr class="even">
<td id="T_d11conv1_row3_col0" class="data row3 col0">1200</td>
<td id="T_d11conv1_row3_col1" class="data row3 col1">686.075787</td>
<td id="T_d11conv1_row3_col2" class="data row3 col2">0.658512</td>
<td id="T_d11conv1_row3_col3" class="data row3 col3">0.01802381</td>
</tr>
<tr class="odd">
<td id="T_d11conv1_row4_col0" class="data row4 col0">2400</td>
<td id="T_d11conv1_row4_col1" class="data row4 col1">686.858148</td>
<td id="T_d11conv1_row4_col2" class="data row4 col2">0.663381</td>
<td id="T_d11conv1_row4_col3" class="data row4 col3">0.01801446</td>
</tr>
<tr class="even">
<td id="T_d11conv1_row5_col0" class="data row5 col0">4800</td>
<td id="T_d11conv1_row5_col1" class="data row5 col1">687.265086</td>
<td id="T_d11conv1_row5_col2" class="data row5 col2">0.665878</td>
<td id="T_d11conv1_row5_col3" class="data row5 col3">0.01800977</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>observed orders  T_hot 0.943   z_hot 0.963   p0* 0.998   (first-order upwind)
Richardson limits  T_hot 687.70619 K = 414.556 C   z_hot 0.66851 m   p0* 0.01800508 atm
The finest grid's threshold error against that limit is 26072 times the 1e-08
by which a threshold moves when only its starting guess changes, so the order fit is not
fitted to that noise.

SECOND, INDEPENDENT ROUTE - adaptive Radau on the two ODEs, no grid, no pymrm
operator, no Newton, sharing only the constants:
   T_hot  687.683240 K = 414.5332 C   vs the extrapolated pymrm 414.5562 C   -&gt;  3.3e-05
   z_hot  0.668419 m                     vs 0.668506 m
   p0*    0.01800509 atm                 vs 0.01800508 atm     -&gt;  4.0e-07
A break row perturbs an input; this catches a wrong baseline, and it is the
reason the reported p0* is the extrapolated one and not the 1200-cell value (+0.104 %).
EVERY rung-1 number in agreement.json is an entry of the dict this cell is
displaying - one computation, not two that agree.

So, on the book's own constants with R_t = 0.0125 m, IN ATM:
   p_A0 = 0.0180 atm          -&gt;  hot spot 414.53 C, 0.47 C BELOW the printed ceiling
   p_A0 = 0.0182 atm (+0.0002)  -&gt;  hot spot 634.9 C, far above it
   the ceiling is crossed at p_A0 = 0.018005 atm, +0.028 % from the printed 0.018.
The sentence is right, to one part in 3539.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11units" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11units_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">reading</th>
<th id="T_d11units_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">p0_star</th>
<th id="T_d11units_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">vs_printed_0018</th>
<th id="T_d11units_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">T_hot_at_0018_C</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11units_row0_col0" class="data row0 col0">VWF's set, p_B0 = 0.208 atm, p_t = 1.0 atm (THIS PAGE)</td>
<td id="T_d11units_row0_col1" class="data row0 col1">0.018005</td>
<td id="T_d11units_row0_col2" class="data row0 col2">+0.00028</td>
<td id="T_d11units_row0_col3" class="data row0 col3">414.5</td>
</tr>
<tr class="even">
<td id="T_d11units_row1_col0" class="data row1 col0">11.5.2 as printed, p_B0 = 0.211 bar, p_t = 1 bar</td>
<td id="T_d11units_row1_col1" class="data row1 col1">0.017801</td>
<td id="T_d11units_row1_col2" class="data row1 col2">-0.01105</td>
<td id="T_d11units_row1_col3" class="data row1 col3">627.3</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Both rows are the same grid-free Radau solve with one constant changed, so the
difference is a PARAMETER-SET difference and carries no discretisation at all.
The +0.028 % reproduction of section 11.5.2's sensitivity sentence is an agreement with
Van Welsenaere &amp; Froment's 0.018 ATM, obtained with THEIR atm parameter set. Read
in the bar that section 11.5.2 itself prints, the same sentence is out by -1.105 %
and its own design point sits at 627 C - 212 K ABOVE the ceiling the facing page
states, which no reading of the chapter can be right about. That is why the atm
reading is the one used, and it is stated rather than assumed: Fig. 11.5.2-1's own
ordinate label reads 'p0, atm'.

At R_t = 0.0127 m - the radius the printed 2.54 cm diameter implies - the same
inlet pressure gives a hot spot of 662 C, outside the operating range the same page
states, and p0* falls to 0.017779 atm. The figures of section 11.5.2
cannot have been computed at that radius; R_t = 0.0125 m is what reproduces them, and
it is also what eq. (11.7.4-1) needs to return the printed U. Two independent
constraints, same answer.


CONTROL: p0_critical bisects and treats a non-converged solve as supercritical, so
the number it returns COULD be a Newton-convergence boundary rather than a crossing
of the 415 C ceiling. It is checked, on EVERY call this page makes - not
only on these five rungs: `p0_critical` runs `crossing_control` itself and RAISES if it fails, so a
threshold that is not a ceiling crossing cannot reach a table, a sweep or a
bisection. What follows is that same check, displayed for the five reported rungs.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11ctl" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11ctl_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">rung</th>
<th id="T_d11ctl_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">p0_star</th>
<th id="T_d11ctl_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">T_just_below_C</th>
<th id="T_d11ctl_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">T_just_above_C</th>
<th id="T_d11ctl_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">jump_K</th>
<th id="T_d11ctl_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">crossing</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11ctl_row0_col0" class="data row0 col0">1</td>
<td id="T_d11ctl_row0_col1" class="data row0 col1">0.0180238</td>
<td id="T_d11ctl_row0_col2" class="data row0 col2">414.98</td>
<td id="T_d11ctl_row0_col3" class="data row0 col3">415.02</td>
<td id="T_d11ctl_row0_col4" class="data row0 col4">0.034</td>
<td id="T_d11ctl_row0_col5" class="data row0 col5">True</td>
</tr>
<tr class="even">
<td id="T_d11ctl_row1_col0" class="data row1 col0">2</td>
<td id="T_d11ctl_row1_col1" class="data row1 col1">0.0180537</td>
<td id="T_d11ctl_row1_col2" class="data row1 col2">414.98</td>
<td id="T_d11ctl_row1_col3" class="data row1 col3">415.02</td>
<td id="T_d11ctl_row1_col4" class="data row1 col4">0.035</td>
<td id="T_d11ctl_row1_col5" class="data row1 col5">True</td>
</tr>
<tr class="odd">
<td id="T_d11ctl_row2_col0" class="data row2 col0">3</td>
<td id="T_d11ctl_row2_col1" class="data row2 col1">0.0171693</td>
<td id="T_d11ctl_row2_col2" class="data row2 col2">414.98</td>
<td id="T_d11ctl_row2_col3" class="data row2 col3">415.02</td>
<td id="T_d11ctl_row2_col4" class="data row2 col4">0.046</td>
<td id="T_d11ctl_row2_col5" class="data row2 col5">True</td>
</tr>
<tr class="even">
<td id="T_d11ctl_row3_col0" class="data row3 col0">4</td>
<td id="T_d11ctl_row3_col1" class="data row3 col1">0.0208483</td>
<td id="T_d11ctl_row3_col2" class="data row3 col2">414.99</td>
<td id="T_d11ctl_row3_col3" class="data row3 col3">415.01</td>
<td id="T_d11ctl_row3_col4" class="data row3 col4">0.012</td>
<td id="T_d11ctl_row3_col5" class="data row3 col5">True</td>
</tr>
<tr class="odd">
<td id="T_d11ctl_row4_col0" class="data row4 col0">5</td>
<td id="T_d11ctl_row4_col1" class="data row4 col1">0.0164314</td>
<td id="T_d11ctl_row4_col2" class="data row4 col2">414.95</td>
<td id="T_d11ctl_row4_col3" class="data row4 col3">415.05</td>
<td id="T_d11ctl_row4_col4" class="data row4 col4">0.095</td>
<td id="T_d11ctl_row4_col5" class="data row4 col5">True</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>All five cross the ceiling, and cross it CONTINUOUSLY: the widest jump between the
two solves is 0.095 K, against the 1 K the control allows and the hundreds of
kelvin an ignition discontinuity gives. So no rung's p0* is set by a convergence
failure. Above the threshold the Newton may give up - the situation bisection exists to
survive - and that is NOT an absence of a steady state: the grid-free Radau route
returns a bounded one at the top of the bracket, 1000 C at p_A0 = 0.02.

Brentq on the identical bracket, on ALL FIVE rungs at the n_z = 600 the break rows
use - this is what licenses bisection, so it is measured on every rung rather than
on the two it is cheapest to show:
   rung 1: bisection 0.01804248
   rung 2: bisection 0.01807238
   rung 3: bisection 0.01718650
   rung 4: bisection 0.02087305
   rung 5: bisection 0.01642914
Brentq raises on a NaN on at least one rung, and on every rung where it survives it
returns the bisection root to better than 1e-10 (asserted). WHICH rungs it survives
is decided by round-off, not by the rung: its points above the threshold are
cold-started fixed-inlet solves, whose convergence is the round-off-decided event the
note on locating thresholds describes (here it fails on rungs 2, 4). So brentq is not wrong
where it survives; it simply cannot be relied on.

And rung 5 at p_A0 = 0.018 atm, past its own threshold: on the coarser (600, 10)
grid the cold-started solve reaches a bounded runaway state above 900 C (asserted),
more than 480 K past the ceiling (here 963 C), so the reactor HAS a steady
state there. Its exact temperature, and whether the (1200, 20) grid converges at all,
is decided by round-off: this is a fixed-inlet solve above a threshold, started
cold, which branch following does not cover.</code></pre>
</div>
</div>
<div id="5edae047" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:43:24.704756Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:43:24.704556Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:43:46.688137Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:43:46.687274Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- rung 5 carries error on TWO axes: refine both, separately ---------------</span></span>
<span id="cb25-2">r5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb25-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n_z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>):</span>
<span id="cb25-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n_r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>):</span>
<span id="cb25-5">        lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r)</span>
<span id="cb25-6">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_robust(lad, P0_REF)</span>
<span id="cb25-7">        Tb, zb, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hotspot(lad.z_c, lad.bulk_T(c))</span>
<span id="cb25-8">        Ta, za, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hotspot(lad.z_c, lad.axis_T(c))</span>
<span id="cb25-9">        i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(lad.axis_T(c)))</span>
<span id="cb25-10">        r5.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r, T_bulk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Tb, T_axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ta,</span>
<span id="cb25-11">                       dT_radial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[i, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c[i, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb25-12">R5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(r5)</span>
<span id="cb25-13">show(R5.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11conv5"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb25-14">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_bulk"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_axis"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT_radial"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb25-15">_z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R5[R5.n_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>]</span>
<span id="cb25-16">_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R5[R5.n_z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>]</span>
<span id="cb25-17">ORD_Z5, LIM_Z5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(_z.T_axis, _z.n_z)</span>
<span id="cb25-18">ORD_R5, LIM_R5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(_r.T_axis, _r.n_r)</span>
<span id="cb25-19">T_AXIS_REPORTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R5[(R5.n_z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_Z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (R5.n_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_R)].T_axis.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb25-20">ERR_RADIAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_AXIS_REPORTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> LIM_R5</span>
<span id="cb25-21">ERR_AXIAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_z.T_axis.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> LIM_Z5</span>
<span id="cb25-22">AXIS_MINUS_BULK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_AXIS_REPORTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (LADDER.loc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_hot"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>)</span>
<span id="cb25-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"axial axis (n_r = 40): observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_Z5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, limit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_Z5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span></span>
<span id="cb25-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">radial axis (n_z = 1200): observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_R5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, limit"</span></span>
<span id="cb25-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_R5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span></span>
<span id="cb25-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The radial axis converges at second order and the axial at first, so the"</span></span>
<span id="cb25-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">two-dimensional rung's error is set by the axis the model is NOT named after."</span></span>
<span id="cb25-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">BOTH ARE TINY. Comparing LIKE WITH LIKE - the AXIS temperature against an AXIS"</span></span>
<span id="cb25-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">limit, on the same axis that was refined:"</span></span>
<span id="cb25-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   radial discretisation error at (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_R<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ERR_RADIAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span></span>
<span id="cb25-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   axial  discretisation error at (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 40) : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ERR_AXIAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span></span>
<span id="cb25-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">i.e. both below 0.03 K on a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_R5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C hot spot (asserted), and the"</span></span>
<span id="cb25-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" axial one is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ERR_AXIAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ERR_RADIAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the radial one."</span>)</span>
<span id="cb25-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ERR_RADIAL), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ERR_AXIAL)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a rung-5 axis error is not below 0.03 K"</span></span>
<span id="cb25-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT IS *NOT* A GRID ERROR:"</span></span>
<span id="cb25-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the axis-minus-bulk difference at the reported grid,"</span></span>
<span id="cb25-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AXIS_MINUS_BULK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span></span>
<span id="cb25-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_AXIS_REPORTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C on the axis against"</span></span>
<span id="cb25-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LADDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_hot'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C for the radial mean). That is the radial"</span></span>
<span id="cb25-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">temperature difference the two-dimensional model exists to resolve - the physics,"</span></span>
<span id="cb25-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">not the discretisation - and it is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(AXIS_MINUS_BULK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ERR_RADIAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the"</span></span>
<span id="cb25-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" radial grid error beside it. The</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">same quantity measured wall-to-axis is the"</span></span>
<span id="cb25-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" dT_radial column above,"</span></span>
<span id="cb25-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R5[(R5.n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span>N_Z)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>(R5.n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span>N_R)].dT_radial.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K."</span>)</span>
<span id="cb25-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">NOT REFINED ANYWHERE, and said so: rung 5's THRESHOLD, which is the quantity the"</span></span>
<span id="cb25-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ladder table reports. Its (600, 10) and (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_R<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) values differ by about a"</span></span>
<span id="cb25-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tenth of a percentage point - printed in the break-table cell below - and no"</span></span>
<span id="cb25-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">observed order or Richardson limit is offered for it. The two refinements above"</span></span>
<span id="cb25-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">are of the hot spot at a fixed inlet, not of the threshold."</span>)</span>
<span id="cb25-50"></span>
<span id="cb25-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- rung 2: the difference it makes against the numerical diffusion of upwind</span></span>
<span id="cb25-52">DISP_LEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb25-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">RUNG 2 NEEDS THIS SAID OUT LOUD. First-order upwind adds a numerical"</span></span>
<span id="cb25-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">diffusivity u dz/2, i.e. a dispersion LENGTH dz/2 - A2.1's finding, applied"</span></span>
<span id="cb25-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">here. The physical dispersion length of (11.6-1) divided by u_s is"</span></span>
<span id="cb25-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d_p/Pe_ma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_LEN<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm. At n_z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the numerical one is"</span></span>
<span id="cb25-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>L_BED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>N_Z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm, i.e."</span></span>
<span id="cb25-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>L_BED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>N_Z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>DISP_LEN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of it, so a rung-1-versus-rung-2 comparison on a"</span></span>
<span id="cb25-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" single grid is mostly scheme."</span>)</span>
<span id="cb25-60">d2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb25-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4800</span>):</span>
<span id="cb25-62">    l1, l2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n), Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n)</span>
<span id="cb25-63">    p1, p2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(l1), p0_critical(l2)</span>
<span id="cb25-64">    d2.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, numerical_mm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L_BED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, p0_rung1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p1,</span>
<span id="cb25-65">                   p0_rung2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p2, shift_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb25-66">D2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(d2)</span>
<span id="cb25-67">show(D2.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11r2conv"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb25-68">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numerical_mm"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_rung1"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.8f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_rung2"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.8f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb25-69">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_pct"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb25-70">ORD_S2, LIM_S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(D2.shift_pct, D2.n_z)</span>
<span id="cb25-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The shift itself converges (observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_S2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_S2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % as"</span></span>
<span id="cb25-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" h -&gt; 0.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">It is smaller than the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>LIM_P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % discretisation"</span></span>
<span id="cb25-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" error of the rung-1 baseline at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">n_z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so this rung is only resolvable if both"</span></span>
<span id="cb25-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" models are extrapolated -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which is exactly why the ladder table above reports"</span></span>
<span id="cb25-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" root-found thresholds and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this cell reports their limit."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11conv5" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11conv5_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">n_z</th>
<th id="T_d11conv5_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">n_r</th>
<th id="T_d11conv5_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">T_bulk</th>
<th id="T_d11conv5_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">T_axis</th>
<th id="T_d11conv5_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">dT_radial</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11conv5_row0_col0" class="data row0 col0">300</td>
<td id="T_d11conv5_row0_col1" class="data row0 col1">5</td>
<td id="T_d11conv5_row0_col2" class="data row0 col2">635.5893</td>
<td id="T_d11conv5_row0_col3" class="data row0 col3">639.7119</td>
<td id="T_d11conv5_row0_col4" class="data row0 col4">6.7948</td>
</tr>
<tr class="even">
<td id="T_d11conv5_row1_col0" class="data row1 col0">300</td>
<td id="T_d11conv5_row1_col1" class="data row1 col1">10</td>
<td id="T_d11conv5_row1_col2" class="data row1 col2">635.5129</td>
<td id="T_d11conv5_row1_col3" class="data row1 col3">639.7506</td>
<td id="T_d11conv5_row1_col4" class="data row1 col4">7.5801</td>
</tr>
<tr class="odd">
<td id="T_d11conv5_row2_col0" class="data row2 col0">300</td>
<td id="T_d11conv5_row2_col1" class="data row2 col1">20</td>
<td id="T_d11conv5_row2_col2" class="data row2 col2">635.4933</td>
<td id="T_d11conv5_row2_col3" class="data row2 col3">639.7597</td>
<td id="T_d11conv5_row2_col4" class="data row2 col4">7.9714</td>
</tr>
<tr class="even">
<td id="T_d11conv5_row3_col0" class="data row3 col0">300</td>
<td id="T_d11conv5_row3_col1" class="data row3 col1">40</td>
<td id="T_d11conv5_row3_col2" class="data row3 col2">635.4883</td>
<td id="T_d11conv5_row3_col3" class="data row3 col3">639.7619</td>
<td id="T_d11conv5_row3_col4" class="data row3 col4">8.1668</td>
</tr>
<tr class="odd">
<td id="T_d11conv5_row4_col0" class="data row4 col0">600</td>
<td id="T_d11conv5_row4_col1" class="data row4 col1">5</td>
<td id="T_d11conv5_row4_col2" class="data row4 col2">635.6274</td>
<td id="T_d11conv5_row4_col3" class="data row4 col3">639.7667</td>
<td id="T_d11conv5_row4_col4" class="data row4 col4">6.8232</td>
</tr>
<tr class="even">
<td id="T_d11conv5_row5_col0" class="data row5 col0">600</td>
<td id="T_d11conv5_row5_col1" class="data row5 col1">10</td>
<td id="T_d11conv5_row5_col2" class="data row5 col2">635.5506</td>
<td id="T_d11conv5_row5_col3" class="data row5 col3">639.8055</td>
<td id="T_d11conv5_row5_col4" class="data row5 col4">7.6100</td>
</tr>
<tr class="odd">
<td id="T_d11conv5_row6_col0" class="data row6 col0">600</td>
<td id="T_d11conv5_row6_col1" class="data row6 col1">20</td>
<td id="T_d11conv5_row6_col2" class="data row6 col2">635.5309</td>
<td id="T_d11conv5_row6_col3" class="data row6 col3">639.8146</td>
<td id="T_d11conv5_row6_col4" class="data row6 col4">8.0027</td>
</tr>
<tr class="even">
<td id="T_d11conv5_row7_col0" class="data row7 col0">600</td>
<td id="T_d11conv5_row7_col1" class="data row7 col1">40</td>
<td id="T_d11conv5_row7_col2" class="data row7 col2">635.5260</td>
<td id="T_d11conv5_row7_col3" class="data row7 col3">639.8168</td>
<td id="T_d11conv5_row7_col4" class="data row7 col4">8.1989</td>
</tr>
<tr class="odd">
<td id="T_d11conv5_row8_col0" class="data row8 col0">1200</td>
<td id="T_d11conv5_row8_col1" class="data row8 col1">5</td>
<td id="T_d11conv5_row8_col2" class="data row8 col2">635.6468</td>
<td id="T_d11conv5_row8_col3" class="data row8 col3">639.7946</td>
<td id="T_d11conv5_row8_col4" class="data row8 col4">6.8370</td>
</tr>
<tr class="even">
<td id="T_d11conv5_row9_col0" class="data row9 col0">1200</td>
<td id="T_d11conv5_row9_col1" class="data row9 col1">10</td>
<td id="T_d11conv5_row9_col2" class="data row9 col2">635.5698</td>
<td id="T_d11conv5_row9_col3" class="data row9 col3">639.8334</td>
<td id="T_d11conv5_row9_col4" class="data row9 col4">7.6258</td>
</tr>
<tr class="odd">
<td id="T_d11conv5_row10_col0" class="data row10 col0">1200</td>
<td id="T_d11conv5_row10_col1" class="data row10 col1">20</td>
<td id="T_d11conv5_row10_col2" class="data row10 col2">635.5501</td>
<td id="T_d11conv5_row10_col3" class="data row10 col3">639.8425</td>
<td id="T_d11conv5_row10_col4" class="data row10 col4">8.0192</td>
</tr>
<tr class="even">
<td id="T_d11conv5_row11_col0" class="data row11 col0">1200</td>
<td id="T_d11conv5_row11_col1" class="data row11 col1">40</td>
<td id="T_d11conv5_row11_col2" class="data row11 col2">635.5451</td>
<td id="T_d11conv5_row11_col3" class="data row11 col3">639.8447</td>
<td id="T_d11conv5_row11_col4" class="data row11 col4">8.2156</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>axial axis (n_r = 40): observed order 0.975, limit 366.7236 C
radial axis (n_z = 1200): observed order 2.044, limit 366.6954 C
The radial axis converges at second order and the axial at first, so the
two-dimensional rung's error is set by the axis the model is NOT named after.
BOTH ARE TINY. Comparing LIKE WITH LIKE - the AXIS temperature against an AXIS
limit, on the same axis that was refined:
   radial discretisation error at (1200, 20) : -0.0029 K
   axial  discretisation error at (1200, 40) : -0.0289 K
i.e. both below 0.03 K on a 367 C hot spot (asserted), and the axial one is
10 times the radial one.

WHAT IS *NOT* A GRID ERROR:
the axis-minus-bulk difference at the reported grid, +4.292 K
(366.69 C on the axis against 362.40 C for the radial mean). That is the radial
temperature difference the two-dimensional model exists to resolve - the physics,
not the discretisation - and it is 1467 times the radial grid error beside it. The
same quantity measured wall-to-axis is the dT_radial column above, 8.02 K.

NOT REFINED ANYWHERE, and said so: rung 5's THRESHOLD, which is the quantity the
ladder table reports. Its (600, 10) and (1200, 20) values differ by about a
tenth of a percentage point - printed in the break-table cell below - and no
observed order or Richardson limit is offered for it. The two refinements above
are of the hot spot at a fixed inlet, not of the threshold.

RUNG 2 NEEDS THIS SAID OUT LOUD. First-order upwind adds a numerical
diffusivity u dz/2, i.e. a dispersion LENGTH dz/2 - A2.1's finding, applied
here. The physical dispersion length of (11.6-1) divided by u_s is
d_p/Pe_ma = 2.000 mm. At n_z = 1200 the numerical one is 1.250 mm, i.e. 62 %
of it, so a rung-1-versus-rung-2 comparison on a single grid is mostly scheme.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11r2conv" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11r2conv_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">n_z</th>
<th id="T_d11r2conv_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">numerical_mm</th>
<th id="T_d11r2conv_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">p0_rung1</th>
<th id="T_d11r2conv_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">p0_rung2</th>
<th id="T_d11r2conv_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">shift_pct</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11r2conv_row0_col0" class="data row0 col0">300</td>
<td id="T_d11r2conv_row0_col1" class="data row0 col1">5.0000</td>
<td id="T_d11r2conv_row0_col2" class="data row0 col2">0.01807966</td>
<td id="T_d11r2conv_row0_col3" class="data row0 col3">0.01810952</td>
<td id="T_d11r2conv_row0_col4" class="data row0 col4">+0.1651</td>
</tr>
<tr class="even">
<td id="T_d11r2conv_row1_col0" class="data row1 col0">600</td>
<td id="T_d11r2conv_row1_col1" class="data row1 col1">2.5000</td>
<td id="T_d11r2conv_row1_col2" class="data row1 col2">0.01804248</td>
<td id="T_d11r2conv_row1_col3" class="data row1 col3">0.01807238</td>
<td id="T_d11r2conv_row1_col4" class="data row1 col4">+0.1657</td>
</tr>
<tr class="odd">
<td id="T_d11r2conv_row2_col0" class="data row2 col0">1200</td>
<td id="T_d11r2conv_row2_col1" class="data row2 col1">1.2500</td>
<td id="T_d11r2conv_row2_col2" class="data row2 col2">0.01802381</td>
<td id="T_d11r2conv_row2_col3" class="data row2 col3">0.01805374</td>
<td id="T_d11r2conv_row2_col4" class="data row2 col4">+0.1660</td>
</tr>
<tr class="even">
<td id="T_d11r2conv_row3_col0" class="data row3 col0">2400</td>
<td id="T_d11r2conv_row3_col1" class="data row3 col1">0.6250</td>
<td id="T_d11r2conv_row3_col2" class="data row3 col2">0.01801446</td>
<td id="T_d11r2conv_row3_col3" class="data row3 col3">0.01804441</td>
<td id="T_d11r2conv_row3_col4" class="data row3 col4">+0.1662</td>
</tr>
<tr class="odd">
<td id="T_d11r2conv_row4_col0" class="data row4 col0">4800</td>
<td id="T_d11r2conv_row4_col1" class="data row4 col1">0.3125</td>
<td id="T_d11r2conv_row4_col2" class="data row4 col2">0.01800977</td>
<td id="T_d11r2conv_row4_col3" class="data row4 col3">0.01803973</td>
<td id="T_d11r2conv_row4_col4" class="data row4 col4">+0.1663</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The shift itself converges (observed order 0.93) to +0.1665 % as h -&gt; 0.
It is smaller than the 0.104 % discretisation error of the rung-1 baseline at
n_z = 1200, so this rung is only resolvable if both models are extrapolated -
which is exactly why the ladder table above reports root-found thresholds and
this cell reports their limit.</code></pre>
</div>
</div>
<div id="29a86aec" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:43:46.690093Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:43:46.689965Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:43:46.726946Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:43:46.726189Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ===== 3. Example 11.5.3.A against Van Welsenaere &amp; Froment's own numbers =====</span></span>
<span id="cb28-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># D2.2 owns the criteria; this checks the BOOK'S TRANSCRIPTION of their example.</span></span>
<span id="cb28-3">tr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb28-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> bkey, ex_q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_cr"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dT_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT_eff"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Q"</span>),</span>
<span id="cb28-5">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_lower_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_lower"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_upper_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_upper"</span>),</span>
<span id="cb28-6">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_mean_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_mean"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_backint_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_critical"</span>)):</span>
<span id="cb28-7">    src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> VWF_EX[(VWF_EX.example.isin([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> ex_q)]</span>
<span id="cb28-8">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(src.value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHICH of Van Welsenaere &amp; Froment's examples the row was found in, and at what</span></span>
<span id="cb28-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># radius, is printed - because a row-by-row ratio of 1.000000 says nothing about</span></span>
<span id="cb28-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># whether the two rows belong to the SAME case, and here two of them do not.</span></span>
<span id="cb28-12">    tr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(quantity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ex_q, VWF_example<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(src.example.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb28-13">                   VWF_conditions<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(src.conditions.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>],</span>
<span id="cb28-14">                   VWF_1970<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>o, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(src.unit.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb28-15">                   book<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(bkey), ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(bkey) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> o))</span>
<span id="cb28-16">TRANS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(tr)</span>
<span id="cb28-17">show(TRANS.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11trans"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb28-18">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VWF_1970"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb28-19">N_EXAMPLES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRANS.VWF_example.nunique()</span>
<span id="cb28-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Every dimensionless and kelvin row transcribes unchanged and every ATM row is"</span></span>
<span id="cb28-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">multiplied by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ATM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - except the last, which is not: the atm/bar audit again,"</span></span>
<span id="cb28-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">from the other side."</span></span>
<span id="cb28-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">BUT LOOK AT THE `VWF_example` COLUMN. These seven rows are looked up in"</span></span>
<span id="cb28-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" whichever of the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">1970 paper's worked examples happens to carry each quantity, and"</span></span>
<span id="cb28-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" they come from</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_EXAMPLES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them, at two different tube radii. A ratio of"</span></span>
<span id="cb28-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1.000000 says the number was</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">copied correctly; it says nothing about whether the"</span></span>
<span id="cb28-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rows belong to the SAME case.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Q is the one where they do not, and the next block is"</span></span>
<span id="cb28-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" what this check misses."</span>)</span>
<span id="cb28-29"></span>
<span id="cb28-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Table 11.5.3.A-2's own arithmetic, on its own printed Q and dT</span></span>
<span id="cb28-31">Q, DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_625"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dT_625"</span>)</span>
<span id="cb28-32">t2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb28-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower limit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT (1 + Q^2)"</span>, DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_625"</span>)),</span>
<span id="cb28-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Upper limit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT (1 + Q)^2"</span>, DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_625"</span>)),</span>
<span id="cb28-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT (1 + Q + Q^2)"</span>, DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_mean_625"</span>)),</span>
<span id="cb28-36">], columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"formula printed on that row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the formula gives"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table prints"</span>])</span>
<span id="cb28-37">t2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table prints"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the formula gives"</span>]</span>
<span id="cb28-38">show(t2.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11t2"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb28-39">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the formula gives"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table prints"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb28-40">T2_UPPER_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t2.ratio.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-41">_mean_of_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_625"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_625"</span>))</span>
<span id="cb28-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Row 1 checks. Row 2 does not: dT(1+Q)^2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>Q)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, and the"</span></span>
<span id="cb28-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_dTad_upper_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed beside it is what row 3's formula gives"</span></span>
<span id="cb28-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>Q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>Q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C). Row 3 then prints</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_dTad_mean_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, which is the arithmetic mean of the two printed"</span></span>
<span id="cb28-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" numbers (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_mean_of_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C) and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which no formula in the table produces."</span></span>
<span id="cb28-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" One slip, propagating once.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Note that dT(1+Q+Q^2) IS identically the mean of"</span></span>
<span id="cb28-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" dT(1+Q^2) and dT(1+Q)^2 - the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">identity holds for every Q - so the 'Mean' row's"</span></span>
<span id="cb28-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" formula is right and only its</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">number is wrong. Table 11.5.3.A-1, at 635 K, is"</span></span>
<span id="cb28-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" internally consistent throughout:"</span>)</span>
<span id="cb28-51">Q1, DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_635"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_635"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">635.0</span></span>
<span id="cb28-52">t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb28-53">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower limit"</span>, DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_635"</span>)),</span>
<span id="cb28-54">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Upper limit"</span>, DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_635"</span>)),</span>
<span id="cb28-55">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean"</span>, DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_mean_635"</span>)),</span>
<span id="cb28-56">], columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the formula gives"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table prints"</span>])</span>
<span id="cb28-57">t1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the formula gives"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table prints"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb28-58">show(t1.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11t1"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb28-59">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the formula gives"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table prints"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb28-60">T1_WORST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T1_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on a table whose entries are printed to 3 figures."</span>)</span>
<span id="cb28-62"></span>
<span id="cb28-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ===== the LARGER defect in the same table, which no row-by-row check can see =====</span></span>
<span id="cb28-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Table 11.5.3.A-2 has TWO columns, and the example prints the constant that ties</span></span>
<span id="cb28-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># them together: dT_ad = (B/A) p0.  ONE DIVISION on the example's own printed A and B.</span></span>
<span id="cb28-66">BOA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_A"</span>)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># per ATM, the units A and B are in</span></span>
<span id="cb28-67">xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb28-68"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, pkey, dkey, form <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (</span>
<span id="cb28-69">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower limit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_lower_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_625"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb28-70">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Upper limit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_upper_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_625"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb28-71">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_mean_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_mean_625"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))):</span>
<span id="cb28-72">    p0_atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(pkey) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ATM                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the column is printed in bar</span></span>
<span id="cb28-73">    needed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BOA</span>
<span id="cb28-74">    qi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: form(q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> needed, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb28-75">    xc.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab, p0_printed_bar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(pkey), dTad_needed_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>needed,</span>
<span id="cb28-76">                   dTad_printed_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(dkey), dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(dkey) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> needed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, Q_implied<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>qi))</span>
<span id="cb28-77">XC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(xc)</span>
<span id="cb28-78">show(XC.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11t2cross"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb28-79">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_printed_bar"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dTad_needed_K"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.1f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dTad_printed_K"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.1f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb28-80">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dev"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.3f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Q_implied"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb28-81">T2_DTAD_WORST_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(XC.dev).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-82">T2_Q_IMPLIED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(XC.Q_implied.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-83">T1_CROSS_WORST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bk(dk) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (bk(pk) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ATM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BOA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pk, dk <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span></span>
<span id="cb28-84">                     ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_lower_635"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_635"</span>),</span>
<span id="cb28-85">                      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_upper_635"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_635"</span>),</span>
<span id="cb28-86">                      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_mean_635"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_mean_635"</span>)))</span>
<span id="cb28-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"THE TWO COLUMNS OF TABLE 11.5.3.A-2 DISAGREE. dT_ad = (B/A) p0 with the example's"</span></span>
<span id="cb28-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">own printed A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_A'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and B = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_B'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e. B/A ="</span></span>
<span id="cb28-89">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BOA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> per atm, and the printed"</span></span>
<span id="cb28-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">dT_ad column is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T2_DTAD_WORST_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % low at worst. Invert each row for the Q"</span></span>
<span id="cb28-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" it needs and all</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">three agree: Q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Q_implied<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to"</span></span>
<span id="cb28-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Q_implied<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, against the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb28-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">TABLE 11.5.3.A-1 PASSES THE SAME TEST - worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T1_CROSS_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on the same"</span></span>
<span id="cb28-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" three rows,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T2_DTAD_WORST_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % - which rules out a wrong B/A, a"</span></span>
<span id="cb28-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" wrong conversion and a wrong</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reading of the formulae, since every one of those"</span></span>
<span id="cb28-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" would move BOTH tables.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">It does NOT confine the defect to A-2:"</span></span>
<span id="cb28-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the block below inverts each table's own printed Q"</span></span>
<span id="cb28-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" for the radius it</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">implies, and both of them point at the same 0.0175 m."</span>)</span>
<span id="cb28-99"></span>
<span id="cb28-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHERE the printed Q comes from - the example's own second half, two paragraphs on</span></span>
<span id="cb28-101">Q_SCALED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_R_critical_625"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R_T)</span>
<span id="cb28-102">C_AT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_vol"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R)</span>
<span id="cb28-103">Q_FROM_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R, A, TM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>: np.sqrt(</span>
<span id="cb28-104">    C_AT(R) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_625"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> TM <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> TM))))</span>
<span id="cb28-105">_r4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>)]</span>
<span id="cb28-106"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHY. The same Example 11.5.3.A asks, two paragraphs later, what radius would be"</span></span>
<span id="cb28-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">critical, and answers - book page"</span></span>
<span id="cb28-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BK.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -"</span></span>
<span id="cb28-109">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_C_formula_claim'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'"</span></span>
<span id="cb28-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D2.2's CSV of the 1970 original carries the same answer as its Example 4:"</span></span>
<span id="cb28-111">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" R = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_r4.value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_r4.conditions.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb28-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" So Q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> IS a printed value of this example - it is the Q of the"</span></span>
<span id="cb28-113">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">CRITICAL radius </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, transplanted onto the"</span></span>
<span id="cb28-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m case that Table 11.5.3.A-2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tabulates."</span></span>
<span id="cb28-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">That printed C formula is itself the proof, because C = 2U/(c_p R_t) - with the"</span></span>
<span id="cb28-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">VOLUMETRIC c_p, D2.2's finding - is"</span></span>
<span id="cb28-117">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inversely proportional to R_t at a fixed T_M, so Q scales as R_t^(-1/2):"</span></span>
<span id="cb28-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Q at R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, from Q(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) x sqrt(R_crit/R_t)   :"</span></span>
<span id="cb28-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_SCALED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Q at R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, from C = Q^2 A exp(b - E/RT_M) directly : "</span></span>
<span id="cb28-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_FROM_C(R_T, A_G)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_G<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb28-122">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Q at R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m by the same formula, against the printed"</span></span>
<span id="cb28-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_FROM_C(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>), A_G)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Q the p0 column of Table 11.5.3.A-2 needs                 : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2_Q_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Four routes, one answer: the case tabulated needs Q ~ </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2_Q_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and the"</span></span>
<span id="cb28-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" table was computed</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">with </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The p0 column is Van Welsenaere &amp; Froment's own,"</span></span>
<span id="cb28-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" converted;"</span></span>
<span id="cb28-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the dT_ad column beside it was recomputed with a Q from a different radius."</span></span>
<span id="cb28-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">This is LARGER than the Upper/Mean slip above, and it is invisible to the"</span></span>
<span id="cb28-130">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">transcription table: every one of those rows transcribes at ratio 1.000000,"</span></span>
<span id="cb28-131">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">because the number was copied correctly - from the wrong case. Reported, not"</span></span>
<span id="cb28-132">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">repaired: nothing on this page uses Q."</span>)</span>
<span id="cb28-133"></span>
<span id="cb28-134"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- AND THE SAME </span><span class="al" style="color: #AD0000;
background-color: null;
font-style: inherit;">TEST</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"> ON TABLE A-1, WHICH THE CROSS-COLUMN CHECK CANNOT SEE ----</span></span>
<span id="cb28-135"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The C route is validated on Van Welsenaere &amp; Froment's own printed numbers first:</span></span>
<span id="cb28-136"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># their Q at the critical radius, and their printed C, which pins R by itself.</span></span>
<span id="cb28-137">_C4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)].value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-138">R_FROM_C_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_vol"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _C4)</span>
<span id="cb28-139">R_IMPLIED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Qp, TM: R_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Q_FROM_C(R_T, A_G, TM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Qp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb28-140">QINV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb28-141">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5.3.A-2"</span>, T_M_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_625"</span>), Q_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Q,</span>
<span id="cb28-142">         Q_at_0_0125<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Q_FROM_C(R_T, A_G, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_625"</span>)),</span>
<span id="cb28-143">         R_t_implied<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R_IMPLIED(Q, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_625"</span>))),</span>
<span id="cb28-144">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5.3.A-1"</span>, T_M_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_635"</span>), Q_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Q1,</span>
<span id="cb28-145">         Q_at_0_0125<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Q_FROM_C(R_T, A_G, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_635"</span>)),</span>
<span id="cb28-146">         R_t_implied<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R_IMPLIED(Q1, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_635"</span>))),</span>
<span id="cb28-147">])</span>
<span id="cb28-148">show(QINV.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11qinv"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb28-149">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_M_K"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Q_printed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Q_at_0_0125"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb28-150">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_t_implied"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb28-151">R_A1_IMPLIED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(QINV.R_t_implied.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-152"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The route is Van Welsenaere &amp; Froment's own, and it is checked against their own"</span></span>
<span id="cb28-153">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed numbers before it is inverted: their C = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_C4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h with"</span></span>
<span id="cb28-154">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" C = 2U/(c_p R_t) alone</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gives R ="</span></span>
<span id="cb28-155">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_FROM_C_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m against the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m the book prints"</span></span>
<span id="cb28-156">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" beside it, and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Q(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_FROM_C(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>), A_G)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-157">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" against their printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb28-158">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">BOTH TABLES' Q BELONG TO R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_R_critical_625'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m."</span></span>
<span id="cb28-159">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Table A-1's printed Q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> implies</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">R_t ="</span></span>
<span id="cb28-160">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_A1_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, the same radius as A-2's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and A-1 states the same"</span></span>
<span id="cb28-161">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">as A-2 does. So the transplant is in BOTH tables, and the reason only"</span></span>
<span id="cb28-162">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" A-2's columns</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">disagree is that A-1's two columns are not independent of each"</span></span>
<span id="cb28-163">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" other: they agree to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T1_CROSS_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, which is what a column"</span></span>
<span id="cb28-164">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" back-calculated from the other looks like, while</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A-2's p0 column is Van"</span></span>
<span id="cb28-165">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Welsenaere &amp; Froment's own - the transcription table above</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">shows those three"</span></span>
<span id="cb28-166">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" entries at ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ATM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exactly - and its dT_ad column is not."</span></span>
<span id="cb28-167">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A CROSS-COLUMN TEST CAN ONLY SEE A TRANSPLANT THAT MOVED ONE COLUMN. That is a"</span></span>
<span id="cb28-168">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">limit of the test: A-1's pass does not confine the defect to A-2."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11trans" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11trans_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">quantity</th>
<th id="T_d11trans_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">VWF_example</th>
<th id="T_d11trans_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">VWF_conditions</th>
<th id="T_d11trans_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">VWF_1970</th>
<th id="T_d11trans_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">unit</th>
<th id="T_d11trans_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">book</th>
<th id="T_d11trans_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">ratio</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11trans_row0_col0" class="data row0 col0">T_cr</td>
<td id="T_d11trans_row0_col1" class="data row0 col1">1a</td>
<td id="T_d11trans_row0_col2" class="data row0 col2">Tw=625 K, R=0.0125 m</td>
<td id="T_d11trans_row0_col3" class="data row0 col3">656.6</td>
<td id="T_d11trans_row0_col4" class="data row0 col4">K</td>
<td id="T_d11trans_row0_col5" class="data row0 col5">656.6</td>
<td id="T_d11trans_row0_col6" class="data row0 col6">1.000000</td>
</tr>
<tr class="even">
<td id="T_d11trans_row1_col0" class="data row1 col0">dT_eff</td>
<td id="T_d11trans_row1_col1" class="data row1 col1">4</td>
<td id="T_d11trans_row1_col2" class="data row1 col2">Tw=625 K, p0=0.0125 atm</td>
<td id="T_d11trans_row1_col3" class="data row1 col3">31.6</td>
<td id="T_d11trans_row1_col4" class="data row1 col4">K</td>
<td id="T_d11trans_row1_col5" class="data row1 col5">31.6</td>
<td id="T_d11trans_row1_col6" class="data row1 col6">1.000000</td>
</tr>
<tr class="odd">
<td id="T_d11trans_row2_col0" class="data row2 col0">Q</td>
<td id="T_d11trans_row2_col1" class="data row2 col1">4</td>
<td id="T_d11trans_row2_col2" class="data row2 col2">Tw=625 K, p0=0.0125 atm</td>
<td id="T_d11trans_row2_col3" class="data row2 col3">3.4675</td>
<td id="T_d11trans_row2_col4" class="data row2 col4">-</td>
<td id="T_d11trans_row2_col5" class="data row2 col5">3.4675</td>
<td id="T_d11trans_row2_col6" class="data row2 col6">1.000000</td>
</tr>
<tr class="even">
<td id="T_d11trans_row3_col0" class="data row3 col0">p0_lower</td>
<td id="T_d11trans_row3_col1" class="data row3 col1">1a</td>
<td id="T_d11trans_row3_col2" class="data row3 col2">Tw=625 K, R=0.0125 m</td>
<td id="T_d11trans_row3_col3" class="data row3 col3">0.01353</td>
<td id="T_d11trans_row3_col4" class="data row3 col4">atm</td>
<td id="T_d11trans_row3_col5" class="data row3 col5">0.01371</td>
<td id="T_d11trans_row3_col6" class="data row3 col6">1.013304</td>
</tr>
<tr class="odd">
<td id="T_d11trans_row4_col0" class="data row4 col0">p0_upper</td>
<td id="T_d11trans_row4_col1" class="data row4 col1">1a</td>
<td id="T_d11trans_row4_col2" class="data row4 col2">Tw=625 K, R=0.0125 m</td>
<td id="T_d11trans_row4_col3" class="data row4 col3">0.01976</td>
<td id="T_d11trans_row4_col4" class="data row4 col4">atm</td>
<td id="T_d11trans_row4_col5" class="data row4 col5">0.02002</td>
<td id="T_d11trans_row4_col6" class="data row4 col6">1.013158</td>
</tr>
<tr class="even">
<td id="T_d11trans_row5_col0" class="data row5 col0">p0_mean</td>
<td id="T_d11trans_row5_col1" class="data row5 col1">1a</td>
<td id="T_d11trans_row5_col2" class="data row5 col2">Tw=625 K, R=0.0125 m</td>
<td id="T_d11trans_row5_col3" class="data row5 col3">0.01665</td>
<td id="T_d11trans_row5_col4" class="data row5 col4">atm</td>
<td id="T_d11trans_row5_col5" class="data row5 col5">0.01687</td>
<td id="T_d11trans_row5_col6" class="data row5 col6">1.013213</td>
</tr>
<tr class="odd">
<td id="T_d11trans_row6_col0" class="data row6 col0">p0_critical</td>
<td id="T_d11trans_row6_col1" class="data row6 col1">1a</td>
<td id="T_d11trans_row6_col2" class="data row6 col2">Tw=625 K, R=0.0125 m; back-integra</td>
<td id="T_d11trans_row6_col3" class="data row6 col3">0.01651</td>
<td id="T_d11trans_row6_col4" class="data row6 col4">atm</td>
<td id="T_d11trans_row6_col5" class="data row6 col5">0.01651</td>
<td id="T_d11trans_row6_col6" class="data row6 col6">1.000000</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Every dimensionless and kelvin row transcribes unchanged and every ATM row is
multiplied by 1.01325 - except the last, which is not: the atm/bar audit again,
from the other side.

BUT LOOK AT THE `VWF_example` COLUMN. These seven rows are looked up in whichever of the
1970 paper's worked examples happens to carry each quantity, and they come from
2 of them, at two different tube radii. A ratio of 1.000000 says the number was
copied correctly; it says nothing about whether the rows belong to the SAME case.
Q is the one where they do not, and the next block is what this check misses.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11t2" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11t2_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">row</th>
<th id="T_d11t2_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">formula printed on that row</th>
<th id="T_d11t2_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">the formula gives</th>
<th id="T_d11t2_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">the table prints</th>
<th id="T_d11t2_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">ratio</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11t2_row0_col0" class="data row0 col0">Lower limit</td>
<td id="T_d11t2_row0_col1" class="data row0 col1">dT (1 + Q^2)</td>
<td id="T_d11t2_row0_col2" class="data row0 col2">411.54</td>
<td id="T_d11t2_row0_col3" class="data row0 col3">411.50</td>
<td id="T_d11t2_row0_col4" class="data row0 col4">0.9999</td>
</tr>
<tr class="even">
<td id="T_d11t2_row1_col0" class="data row1 col0">Upper limit</td>
<td id="T_d11t2_row1_col1" class="data row1 col1">dT (1 + Q)^2</td>
<td id="T_d11t2_row1_col2" class="data row1 col2">630.69</td>
<td id="T_d11t2_row1_col3" class="data row1 col3">521.10</td>
<td id="T_d11t2_row1_col4" class="data row1 col4">0.8262</td>
</tr>
<tr class="odd">
<td id="T_d11t2_row2_col0" class="data row2 col0">Mean</td>
<td id="T_d11t2_row2_col1" class="data row2 col1">dT (1 + Q + Q^2)</td>
<td id="T_d11t2_row2_col2" class="data row2 col2">521.12</td>
<td id="T_d11t2_row2_col3" class="data row2 col3">466.30</td>
<td id="T_d11t2_row2_col4" class="data row2 col4">0.8948</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Row 1 checks. Row 2 does not: dT(1+Q)^2 = 630.7 C, and the 521.1 C
printed beside it is what row 3's formula gives (521.1 C). Row 3 then prints
466.3 C, which is the arithmetic mean of the two printed numbers (466.3 C) and
which no formula in the table produces. One slip, propagating once.
Note that dT(1+Q+Q^2) IS identically the mean of dT(1+Q^2) and dT(1+Q)^2 - the
identity holds for every Q - so the 'Mean' row's formula is right and only its
number is wrong. Table 11.5.3.A-1, at 635 K, is internally consistent throughout:</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11t1" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11t1_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">row</th>
<th id="T_d11t1_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">the formula gives</th>
<th id="T_d11t1_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">the table prints</th>
<th id="T_d11t1_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">rel. dev.</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11t1_row0_col0" class="data row0 col0">Lower limit</td>
<td id="T_d11t1_row0_col1" class="data row0 col1">311.48</td>
<td id="T_d11t1_row0_col2" class="data row0 col2">310.00</td>
<td id="T_d11t1_row0_col3" class="data row0 col3">+0.0048</td>
</tr>
<tr class="even">
<td id="T_d11t1_row1_col0" class="data row1 col0">Upper limit</td>
<td id="T_d11t1_row1_col1" class="data row1 col1">502.40</td>
<td id="T_d11t1_row1_col2" class="data row1 col2">504.00</td>
<td id="T_d11t1_row1_col3" class="data row1 col3">-0.0032</td>
</tr>
<tr class="odd">
<td id="T_d11t1_row2_col0" class="data row2 col0">Mean</td>
<td id="T_d11t1_row2_col1" class="data row2 col1">406.94</td>
<td id="T_d11t1_row2_col2" class="data row2 col2">407.00</td>
<td id="T_d11t1_row2_col3" class="data row2 col3">-0.0001</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>worst 0.005 on a table whose entries are printed to 3 figures.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11t2cross" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11t2cross_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">row</th>
<th id="T_d11t2cross_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">p0_printed_bar</th>
<th id="T_d11t2cross_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">dTad_needed_K</th>
<th id="T_d11t2cross_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">dTad_printed_K</th>
<th id="T_d11t2cross_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">dev</th>
<th id="T_d11t2cross_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">Q_implied</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11t2cross_row0_col0" class="data row0 col0">Lower limit</td>
<td id="T_d11t2cross_row0_col1" class="data row0 col1">0.01371</td>
<td id="T_d11t2cross_row0_col2" class="data row0 col2">565.4</td>
<td id="T_d11t2cross_row0_col3" class="data row0 col3">411.5</td>
<td id="T_d11t2cross_row0_col4" class="data row0 col4">-0.272</td>
<td id="T_d11t2cross_row0_col5" class="data row0 col5">4.1102</td>
</tr>
<tr class="even">
<td id="T_d11t2cross_row1_col0" class="data row1 col0">Upper limit</td>
<td id="T_d11t2cross_row1_col1" class="data row1 col1">0.02002</td>
<td id="T_d11t2cross_row1_col2" class="data row1 col2">825.7</td>
<td id="T_d11t2cross_row1_col3" class="data row1 col3">521.1</td>
<td id="T_d11t2cross_row1_col4" class="data row1 col4">-0.369</td>
<td id="T_d11t2cross_row1_col5" class="data row1 col5">4.1116</td>
</tr>
<tr class="odd">
<td id="T_d11t2cross_row2_col0" class="data row2 col0">Mean</td>
<td id="T_d11t2cross_row2_col1" class="data row2 col1">0.01687</td>
<td id="T_d11t2cross_row2_col2" class="data row2 col2">695.8</td>
<td id="T_d11t2cross_row2_col3" class="data row2 col3">466.3</td>
<td id="T_d11t2cross_row2_col4" class="data row2 col4">-0.330</td>
<td id="T_d11t2cross_row2_col5" class="data row2 col5">4.1117</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>THE TWO COLUMNS OF TABLE 11.5.3.A-2 DISAGREE. dT_ad = (B/A) p0 with the example's
own printed A = 6150 and B = 2.57e+08, i.e. B/A = 41789 per atm, and the printed
dT_ad column is 37 % low at worst. Invert each row for the Q it needs and all
three agree: Q = 4.1102 to 4.1117, against the printed 3.4675.
TABLE 11.5.3.A-1 PASSES THE SAME TEST - worst 1.8 % on the same three rows,
against 37 % - which rules out a wrong B/A, a wrong conversion and a wrong
reading of the formulae, since every one of those would move BOTH tables.
It does NOT confine the defect to A-2: the block below inverts each table's own printed Q for the radius it
implies, and both of them point at the same 0.0175 m.

WHY. The same Example 11.5.3.A asks, two paragraphs later, what radius would be
critical, and answers - book page 520 - 'From [displayed] C = Q2 A exp(-E/RT + b) [/displayed] the radius Rt is found to be 0.0175 m.'
D2.2's CSV of the 1970 original carries the same answer as its Example 4: R = 0.0175 m,
"Tw=625 K, p0=0.0125 atm; the radius that is critical". So Q = 3.4675 IS a printed value of this example - it is the Q of the
CRITICAL radius 0.0175 m, transplanted onto the 0.0125 m case that Table 11.5.3.A-2
tabulates.
That printed C formula is itself the proof, because C = 2U/(c_p R_t) - with the
VOLUMETRIC c_p, D2.2's finding - is
inversely proportional to R_t at a fixed T_M, so Q scales as R_t^(-1/2):
   Q at R_t = 0.0125 m, from Q(0.0175) x sqrt(R_crit/R_t)   : 4.1028
   Q at R_t = 0.0125 m, from C = Q^2 A exp(b - E/RT_M) directly : 4.1051   (A = 6165)
   Q at R_t = 0.0175 m by the same formula, against the printed 3.4675: 3.4694
   Q the p0 column of Table 11.5.3.A-2 needs                 : 4.1102
Four routes, one answer: the case tabulated needs Q ~ 4.11 and the table was computed
with 3.4675. The p0 column is Van Welsenaere &amp; Froment's own, converted;
the dT_ad column beside it was recomputed with a Q from a different radius.
This is LARGER than the Upper/Mean slip above, and it is invisible to the
transcription table: every one of those rows transcribes at ratio 1.000000,
because the number was copied correctly - from the wrong case. Reported, not
repaired: nothing on this page uses Q.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11qinv" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11qinv_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">table</th>
<th id="T_d11qinv_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">T_M_K</th>
<th id="T_d11qinv_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">Q_printed</th>
<th id="T_d11qinv_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">Q_at_0_0125</th>
<th id="T_d11qinv_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">R_t_implied</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11qinv_row0_col0" class="data row0 col0">11.5.3.A-2</td>
<td id="T_d11qinv_row0_col1" class="data row0 col1">656.60</td>
<td id="T_d11qinv_row0_col2" class="data row0 col2">3.4675</td>
<td id="T_d11qinv_row0_col3" class="data row0 col3">4.1051</td>
<td id="T_d11qinv_row0_col4" class="data row0 col4">0.017519</td>
</tr>
<tr class="even">
<td id="T_d11qinv_row1_col0" class="data row1 col0">11.5.3.A-1</td>
<td id="T_d11qinv_row1_col1" class="data row1 col1">667.69</td>
<td id="T_d11qinv_row1_col2" class="data row1 col2">2.9203</td>
<td id="T_d11qinv_row1_col3" class="data row1 col3">3.4547</td>
<td id="T_d11qinv_row1_col4" class="data row1 col4">0.017494</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The route is Van Welsenaere &amp; Froment's own, and it is checked against their own
printed numbers before it is inverted: their C = 29206.4 1/h with C = 2U/(c_p R_t) alone
gives R = 0.017533 m against the 0.0175 m the book prints beside it, and
Q(0.0175) = 3.4694 against their printed 3.4675.

BOTH TABLES' Q BELONG TO R_t = 0.0175 m. Table A-1's printed Q = 2.9203 implies
R_t = 0.017494 m, the same radius as A-2's 3.4675, and A-1 states the same 0.0125 m
as A-2 does. So the transplant is in BOTH tables, and the reason only A-2's columns
disagree is that A-1's two columns are not independent of each other: they agree to
1.8 %, which is what a column back-calculated from the other looks like, while
A-2's p0 column is Van Welsenaere &amp; Froment's own - the transcription table above
shows those three entries at ratio 1.01325 exactly - and its dT_ad column is not.
A CROSS-COLUMN TEST CAN ONLY SEE A TRANSPLANT THAT MOVED ONE COLUMN. That is a
limit of the test: A-1's pass does not confine the defect to A-2.</code></pre>
</div>
</div>
<div id="4fadf987" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:43:46.729306Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:43:46.729133Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:43:46.822202Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:43:46.821503Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ======== 4. eq. (11.9.1-11) against a pellet grid solve and B1.1's table =====</span></span>
<span id="cb34-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the pellet is model.py's `Pellet`: a spherical grid (`nu = 2`), surface values</span></span>
<span id="cb34-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># imposed, eta from the surface-flux row of the gradient operator.</span></span>
<span id="cb34-4"></span>
<span id="cb34-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) the pellet grid solve against eq. (11.9.1-11), refined</span></span>
<span id="cb34-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the pellet is examined at the rung-1 hot spot of section 11.5.2's OWN design point,</span></span>
<span id="cb34-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which is the hottest state any rung reaches while still having a solution</span></span>
<span id="cb34-8">_c1hs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_Z).solve(P0_BOOK)</span>
<span id="cb34-9">_ihs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(_c1hs[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb34-10">T_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_c1hs[_ihs, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb34-11">P_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_c1hs[_ihs, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb34-12">PHI_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi_prime(RX, T_HS, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-6</span>)</span>
<span id="cb34-13">pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb34-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">256</span>):</span>
<span id="cb34-15">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pellet(RX, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n).solve(THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P_HS, T_HS)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta"</span>]</span>
<span id="cb34-16">    pv.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, eta_numeric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>e, eta_11_9_1_11<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>eta_sphere(PHI_HS),</span>
<span id="cb34-17">                   rel_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eta_sphere(PHI_HS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb34-18">PV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(pv)</span>
<span id="cb34-19">show(PV.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11pellet"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb34-20">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_numeric"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_11_9_1_11"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel_dev"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb34-21">ORD_ETA, LIM_ETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(PV.eta_numeric, PV.n_r)</span>
<span id="cb34-22">ETA_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(PV.rel_dev.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb34-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"phi'' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the rung-1 hot spot (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C,"</span></span>
<span id="cb34-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" p_A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm)."</span></span>
<span id="cb34-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_ETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, limit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_ETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, against eq. (11.9.1-11)'s"</span></span>
<span id="cb34-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eta_sphere(PHI_HS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(LIM_ETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eta_sphere(PHI_HS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The analytical"</span></span>
<span id="cb34-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" solution and the grid solve agree."</span>)</span>
<span id="cb34-28"></span>
<span id="cb34-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) the same closed form against B1.1's exact table, which is an INDEPENDENT</span></span>
<span id="cb34-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     transcription of it from Thiele (1939) rather than from Froment eq. (11.9.1-11)</span></span>
<span id="cb34-31">SPH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ETA_REF[ETA_REF.geometry <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sphere"</span>]</span>
<span id="cb34-32">B11_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_sphere(SPH.phi.values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SPH.eta.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb34-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Eq. (11.9.1-11) against B1.1's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SPH)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact sphere rows, phi ="</span></span>
<span id="cb34-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>phi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>phi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span></span>
<span id="cb34-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   worst relative deviation </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Same closed form, two independent"</span></span>
<span id="cb34-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   transcriptions from two documents. B1.1's own pymrm pellet matches its table"</span></span>
<span id="cb34-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'isothermal_max_rel_error_phi_le_30'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for phi &lt;= 30 and"</span></span>
<span id="cb34-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'isothermal_max_rel_error_all_phi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over all phi - B1.1's claims, and"</span></span>
<span id="cb34-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   this page's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ETA_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is consistent with it."</span>)</span>
<span id="cb34-40"></span>
<span id="cb34-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (c) the book's claim that the particle is practically isothermal</span></span>
<span id="cb34-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">section 11.9.1, book page 598, verbatim:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb34-43">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"isothermal_pellet_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>))</span>
<span id="cb34-44">niso <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pellet(RX, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>, isothermal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).solve(THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P_HS, T_HS)</span>
<span id="cb34-45">PELLET_DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> niso[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_centre"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_HS</span>
<span id="cb34-46">BETA_PRATER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P_HS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T_HS)</span>
<span id="cb34-47">GAMMA_ARRH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T_HS</span>
<span id="cb34-48">_c3hs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_robust(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_Z), P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb34-49">FILM_DT_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_c3hs[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _c3hs[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb34-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   intraparticle rise, centre minus surface : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PELLET_DT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span></span>
<span id="cb34-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   interfacial rise across the film, at rung 3's own threshold: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_DT_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span></span>
<span id="cb34-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   ratio                                    : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_DT_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PELLET_DT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb34-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Prater number beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRATER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, Arrhenius gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAMMA_ARRH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb34-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" gamma*beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAMMA_ARRH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>BETA_PRATER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb34-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   eta with the pellet energy balance on: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>niso[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eta'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, against"</span></span>
<span id="cb34-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eta_sphere(PHI_HS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> isothermal"</span></span>
<span id="cb34-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Both halves of the claim hold on this reactor, and the second half is the"</span></span>
<span id="cb34-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">stronger: the film carries </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_DT_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PELLET_DT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the temperature difference the"</span></span>
<span id="cb34-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" particle does. This</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sits far below B1.1's fold (beta = 0.6, gamma = 20), so none of"</span></span>
<span id="cb34-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" its multiplicity</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is in play here and none of it is borrowed."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11pellet" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11pellet_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">n_r</th>
<th id="T_d11pellet_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">eta_numeric</th>
<th id="T_d11pellet_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">eta_11_9_1_11</th>
<th id="T_d11pellet_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">rel_dev</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11pellet_row0_col0" class="data row0 col0">16</td>
<td id="T_d11pellet_row0_col1" class="data row0 col1">0.707281897</td>
<td id="T_d11pellet_row0_col2" class="data row0 col2">0.708189707</td>
<td id="T_d11pellet_row0_col3" class="data row0 col3">-1.28e-03</td>
</tr>
<tr class="even">
<td id="T_d11pellet_row1_col0" class="data row1 col0">32</td>
<td id="T_d11pellet_row1_col1" class="data row1 col1">0.707972671</td>
<td id="T_d11pellet_row1_col2" class="data row1 col2">0.708189707</td>
<td id="T_d11pellet_row1_col3" class="data row1 col3">-3.06e-04</td>
</tr>
<tr class="odd">
<td id="T_d11pellet_row2_col0" class="data row2 col0">64</td>
<td id="T_d11pellet_row2_col1" class="data row2 col1">0.708136784</td>
<td id="T_d11pellet_row2_col2" class="data row2 col2">0.708189707</td>
<td id="T_d11pellet_row2_col3" class="data row2 col3">-7.47e-05</td>
</tr>
<tr class="even">
<td id="T_d11pellet_row3_col0" class="data row3 col0">128</td>
<td id="T_d11pellet_row3_col1" class="data row3 col1">0.708176649</td>
<td id="T_d11pellet_row3_col2" class="data row3 col2">0.708189707</td>
<td id="T_d11pellet_row3_col3" class="data row3 col3">-1.84e-05</td>
</tr>
<tr class="odd">
<td id="T_d11pellet_row4_col0" class="data row4 col0">256</td>
<td id="T_d11pellet_row4_col1" class="data row4 col1">0.708186464</td>
<td id="T_d11pellet_row4_col2" class="data row4 col2">0.708189707</td>
<td id="T_d11pellet_row4_col3" class="data row4 col3">-4.58e-06</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>phi'' = 2.711346 at the rung-1 hot spot (412.93 C, p_A = 0.010108 atm).
observed order 2.022, limit 0.708189671, against eq. (11.9.1-11)'s 0.708189707
  -&gt; 5.1e-08. The analytical solution and the grid solve agree.

Eq. (11.9.1-11) against B1.1's 60 exact sphere rows, phi = 0.05 to 100:
   worst relative deviation 3.15e-06. Same closed form, two independent
   transcriptions from two documents. B1.1's own pymrm pellet matches its table
   to 2.2e-04 for phi &lt;= 30 and 6.5e-03 over all phi - B1.1's claims, and
   this page's 4.6e-06 at phi = 2.71 is consistent with it.

section 11.9.1, book page 598, verbatim:
   Fortunately, even with strongly exothermic reactions the particle is practically isothermal: the main resistance inside the pellet is to mass transfer, and the main resistance in the film surrounding the particle is to heat transfer.
   intraparticle rise, centre minus surface : +0.3650 K
   interfacial rise across the film, at rung 3's own threshold: +3.3083 K
   ratio                                    : 9.06
   Prater number beta = 8.306e-04, Arrhenius gamma = 19.88, gamma*beta = 0.0165
   eta with the pellet energy balance on: 0.71005415, against 0.70818971 isothermal
Both halves of the claim hold on this reactor, and the second half is the
stronger: the film carries 9x the temperature difference the particle does. This
sits far below B1.1's fold (beta = 0.6, gamma = 20), so none of its multiplicity
is in play here and none of it is borrowed.</code></pre>
</div>
</div>
<div id="9d75e337" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:43:46.824611Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:43:46.824419Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:43:46.884757Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:43:46.884347Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ===== 5. the chapter's own criteria for deciding whether to climb a rung =====</span></span>
<span id="cb36-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Section 11.6 offers three yardsticks for whether rung 2 is needed. Two of them"</span></span>
<span id="cb36-3">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">cannot be evaluated on the reactor section 11.5.2 designs.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(i) the rule of thumb, book page 560:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axial_50dp_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>))</span>
<span id="cb36-5">L_OVER_DP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L_BED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_P</span>
<span id="cb36-6">PE_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L_OVER_DP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_axial_low"</span>), L_OVER_DP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_axial_high"</span>)</span>
<span id="cb36-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   L/d_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_OVER_DP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_OVER_DP<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'axial_50dp_claim'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the"</span></span>
<span id="cb36-8">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rule's 50, and the length Peclet number</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Pe_a' = Pe_a L/d_p ="</span></span>
<span id="cb36-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_L[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_L[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Page 563 says axial mixing would matter in"</span></span>
<span id="cb36-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   methanol synthesis below Pe_a' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_ma_methanol'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and in ethylene"</span></span>
<span id="cb36-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" oxidation below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_ma_ethylene'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb36-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   MEASURED SHIFT, extrapolated: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_S2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % in p0*. The rule of thumb is"</span></span>
<span id="cb36-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" right.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-14"></span>
<span id="cb36-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(ii) criterion (11.6-3), for a rate that decreases monotonically:"</span>)</span>
<span id="cb36-16">r_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kexp(T_R0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P0_BOOK                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kmol/(kg cat h)</span></span>
<span id="cb36-17">C0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P0_BOOK</span>
<span id="cb36-18">CRIT_MASS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> C0)</span>
<span id="cb36-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      r_A0 rho_B d_p / (u_s C_0)  =  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CRIT_MASS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;  Pe_ma ="</span></span>
<span id="cb36-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_high'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   satisfied by"</span></span>
<span id="cb36-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CRIT_MASS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      (-dH) r_A0 rho_B d_p / [(T_0 - T_w) u_s rho_g c_p]  &lt;&lt;  Pe_ha"</span>)</span>
<span id="cb36-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      T_0 - T_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_R0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_R0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K on this reactor, BY CONSTRUCTION: section"</span></span>
<span id="cb36-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 11.5.2 sets</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      T = T_0 = T_r at z = 0, and section 11.5.3 builds its whole"</span></span>
<span id="cb36-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" runaway diagram</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      for 'the common situation where T_r = T_0'. The heat"</span></span>
<span id="cb36-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" criterion divides by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      zero and cannot be evaluated for the chapter's own"</span></span>
<span id="cb36-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" design case.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-28"></span>
<span id="cb36-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(iii) criterion (11.6-4), for a rate with an interior maximum, book page 561:"</span>)</span>
<span id="cb36-30">lad1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4800</span>)</span>
<span id="cb36-31">c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lad1.solve(P0_BOOK)</span>
<span id="cb36-32">dx_dzdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.gradient(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c1[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0_BOOK, lad1.z_c))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P)</span>
<span id="cb36-33">dT_dzdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.gradient(c1[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], lad1.z_c))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P)</span>
<span id="cb36-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      max |dx / d(z/d_p)|  =  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dx_dzdp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;  Pe_ma   satisfied by"</span></span>
<span id="cb36-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dx_dzdp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb36-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      max |dT / d(z/d_p)|  =  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dT_dzdp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K   &lt;&lt;  Pe_ha"</span>)</span>
<span id="cb36-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      AS PRINTED THIS IS DIMENSIONALLY INHOMOGENEOUS: the left side is a"</span></span>
<span id="cb36-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" temperature</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      per particle diameter and the right side is a dimensionless"</span></span>
<span id="cb36-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" group. Its own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      companion in (11.6-3) is normalised by (T_0 - T_w) and is"</span></span>
<span id="cb36-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" dimensionless;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      (11.6-4)'s mass criterion is dimensionless too, because x"</span></span>
<span id="cb36-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is. The heat one</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      is missing a temperature scale, and there is no candidate"</span></span>
<span id="cb36-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" in the chapter:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      (T_0 - T_w) is zero here."</span>)</span>
<span id="cb36-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      the book asserts, on the same page:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb36-44">      bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axial_steep_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      Taking the natural repair - dividing by the adiabatic temperature rise,"</span></span>
<span id="cb36-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      LABELLED AS AN INFERENCE and not as the book's - gives"</span></span>
<span id="cb36-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dT_dzdp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(B_G<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A_G<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P0_BOOK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, satisfied</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      by"</span></span>
<span id="cb36-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(dT_dzdp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(B_G<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A_G<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P0_BOOK))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x. So the assertion is"</span></span>
<span id="cb36-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" correct on any reading; it is the criterion,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      not the conclusion, that cannot"</span></span>
<span id="cb36-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" be used."</span>)</span>
<span id="cb36-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(iv) THE CHAPTER IS NOT THE ONLY PLACE THE BOOK DISCUSSES THESE. Section 12.7.2,"</span></span>
<span id="cb36-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     book page </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BK.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ch12_yf_claim'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb36-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BK.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ch12_yf_claim'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">561</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pages later, says of the very same"</span></span>
<span id="cb36-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" criteria:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ch12_yf_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"     Read that carefully, because the page's gloss on it is an INFERENCE and is"</span></span>
<span id="cb36-56">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     labelled as one. What 12.7.2 STATES is that Mears found the criteria not"</span></span>
<span id="cb36-57">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     general and supplied alternates for equal feed and wall temperatures. That"</span></span>
<span id="cb36-58">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     those alternates exist BECAUSE of the two problems found above - a division"</span></span>
<span id="cb36-59">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     by (T_0 - T_w) that is zero when the feed and wall temperatures are equal,"</span></span>
<span id="cb36-60">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     and a dimensionally inhomogeneous heat criterion - is this page's reading of"</span></span>
<span id="cb36-61">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     the sentence, not something the sentence says. The one thing that is not an"</span></span>
<span id="cb36-62">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     inference is that the situation it singles out, equal feed and wall"</span></span>
<span id="cb36-63">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     temperatures, is exactly the situation section 11.5.2 builds. Section 11.6"</span></span>
<span id="cb36-64">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     carries no cross-reference to 12.7.2 and 12.7.2 none to 11.6; the nearest"</span></span>
<span id="cb36-65">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     thing is 12.7.2's own next paragraph, 'the latter has been thoroughly covered"</span></span>
<span id="cb36-66">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     in Chapter 11', which is about RADIAL dispersion, not about the criteria."</span></span>
<span id="cb36-67">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     (Searched: all 13 occurrences of 'Peclet number' in the 902-page text layer,"</span></span>
<span id="cb36-68">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     both 'Finlayson' hits in Ch. 11 and both in Ch. 12, and the notation list"</span></span>
<span id="cb36-69">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     entries between Pr and PN, which define only Pe_a = u_i d_p / D_ea and"</span></span>
<span id="cb36-70">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     Pe_a' = u_i L / D_ea - never Pe_ha or Pe_ma.)"</span>)</span>
<span id="cb36-71"></span>
<span id="cb36-72">CRIT_HEAT_DENOM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_R0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_R0</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Section 11.6 offers three yardsticks for whether rung 2 is needed. Two of them
cannot be evaluated on the reactor section 11.5.2 designs.

(i) the rule of thumb, book page 560:
   It has been shown several times that for the flow velocities used in industrial practice, the effect of axial dispersion of heat and mass on conversion is negligible when the bed depth exceeds about 50 particle diameters.
   L/d_p = 1000, which is 20x the rule's 50, and the length Peclet number
   Pe_a' = Pe_a L/d_p = 1000 to 2000. Page 563 says axial mixing would matter in
   methanol synthesis below Pe_a' = 30 and in ethylene oxidation below 200.
   MEASURED SHIFT, extrapolated: +0.1665 % in p0*. The rule of thumb is right.

(ii) criterion (11.6-3), for a rate that decreases monotonically:
      r_A0 rho_B d_p / (u_s C_0)  =  7.126e-04   &lt;&lt;  Pe_ma = 1 to 2   satisfied by 1.4e+03
      (-dH) r_A0 rho_B d_p / [(T_0 - T_w) u_s rho_g c_p]  &lt;&lt;  Pe_ha
      T_0 - T_w = 0.0 K on this reactor, BY CONSTRUCTION: section 11.5.2 sets
      T = T_0 = T_r at z = 0, and section 11.5.3 builds its whole runaway diagram
      for 'the common situation where T_r = T_0'. The heat criterion divides by
      zero and cannot be evaluated for the chapter's own design case.

(iii) criterion (11.6-4), for a rate with an interior maximum, book page 561:
      max |dx / d(z/d_p)|  =  2.9646e-03   &lt;&lt;  Pe_ma   satisfied by 337x
      max |dT / d(z/d_p)|  =  0.5312 K   &lt;&lt;  Pe_ha
      AS PRINTED THIS IS DIMENSIONALLY INHOMOGENEOUS: the left side is a temperature
      per particle diameter and the right side is a dimensionless group. Its own
      companion in (11.6-3) is normalised by (T_0 - T_w) and is dimensionless;
      (11.6-4)'s mass criterion is dimensionless too, because x is. The heat one
      is missing a temperature scale, and there is no candidate in the chapter:
      (T_0 - T_w) is zero here.

      the book asserts, on the same page:
      "It takes very steep gradients not to satisfy (11.6-4)."
      Taking the natural repair - dividing by the adiabatic temperature rise,
      LABELLED AS AN INFERENCE and not as the book's - gives 7.079e-04, satisfied
      by 1413x. So the assertion is correct on any reading; it is the criterion,
      not the conclusion, that cannot be used.

(iv) THE CHAPTER IS NOT THE ONLY PLACE THE BOOK DISCUSSES THESE. Section 12.7.2,
     book page 709, 148 pages later, says of the very same criteria:
     "Mears [1976] pointed out that these criteria were not general, and he provided alternate ones for equal feed and wall temperatures."
     Read that carefully, because the page's gloss on it is an INFERENCE and is
     labelled as one. What 12.7.2 STATES is that Mears found the criteria not
     general and supplied alternates for equal feed and wall temperatures. That
     those alternates exist BECAUSE of the two problems found above - a division
     by (T_0 - T_w) that is zero when the feed and wall temperatures are equal,
     and a dimensionally inhomogeneous heat criterion - is this page's reading of
     the sentence, not something the sentence says. The one thing that is not an
     inference is that the situation it singles out, equal feed and wall
     temperatures, is exactly the situation section 11.5.2 builds. Section 11.6
     carries no cross-reference to 12.7.2 and 12.7.2 none to 11.6; the nearest
     thing is 12.7.2's own next paragraph, 'the latter has been thoroughly covered
     in Chapter 11', which is about RADIAL dispersion, not about the criteria.
     (Searched: all 13 occurrences of 'Peclet number' in the 902-page text layer,
     both 'Finlayson' hits in Ch. 11 and both in Ch. 12, and the notation list
     entries between Pr and PN, which define only Pe_a = u_i d_p / D_ea and
     Pe_a' = u_i L / D_ea - never Pe_ha or Pe_ma.)</code></pre>
</div>
</div>
<div id="0d66c270" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:43:46.887072Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:43:46.886895Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:43:46.937090Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:43:46.936457Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ======== 6. rung 3's interfacial difference against the book's own claim =====</span></span>
<span id="cb38-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"section 11.8.2, book page 590, on this same reactor and kinetic scheme:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb38-3">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_dT_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-4">lad3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_Z, T_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"startup_T0_1182"</span>))</span>
<span id="cb38-5">c3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_robust(lad3, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y_A0_1173"</span>))</span>
<span id="cb38-6">DT_FILM_1182 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(c3[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c3[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb38-7">DP_FILM_1182 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(c3[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c3[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb38-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">At the book's own startup conditions - T_0 = T_r ="</span></span>
<span id="cb38-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'startup_T0_1182'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, and the 11.7.3</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inlet mole fraction"</span></span>
<span id="cb38-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" y_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'y_A0_1173'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the same reactor:"</span></span>
<span id="cb38-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   max gas-to-solid temperature difference : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT_FILM_1182<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K   against the"</span></span>
<span id="cb38-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed 'of the order of 1 C'"</span></span>
<span id="cb38-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   max partial-pressure drop across the film: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DP_FILM_1182<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm,"</span></span>
<span id="cb38-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>DP_FILM_1182<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'y_A0_1173'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the inlet"</span></span>
<span id="cb38-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The temperature claim holds; the chapter's other statement that 'the most likely"</span></span>
<span id="cb38-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">interfacial gradient to occur is the temperature gradient' (page 585) is"</span></span>
<span id="cb38-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" confirmed</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by the same pair of numbers."</span></span>
<span id="cb38-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">TWO OF THE THREE INPUTS ARE NOT SECTION 11.8.2'S. It prints"</span></span>
<span id="cb38-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" T_0 = T_r = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'startup_T0_1182'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">nothing else quantitative for"</span></span>
<span id="cb38-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" this case: the inlet composition is borrowed from</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">section 11.7.3 and k_g, h_f come"</span></span>
<span id="cb38-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" from A3.4's correlation, which the chapter does not</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">print either. So this"</span></span>
<span id="cb38-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reproduces 'of the order of 1 C' at the book's own startup</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">TEMPERATURE with two"</span></span>
<span id="cb38-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" imported inputs, and it is worth exactly what an order-of-</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">magnitude claim with two"</span></span>
<span id="cb38-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" free inputs is worth. The crossover row below is what</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bounds the film's importance"</span></span>
<span id="cb38-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" without them."</span>)</span>
<span id="cb38-26"></span>
<span id="cb38-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mears' criterion for the onset of interphase temperature gradients, page 588.</span></span>
<span id="cb38-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The criterion family belongs to published B1.7; this is it evaluated here.</span></span>
<span id="cb38-29">i_hs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(c3[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb38-30">r_obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kexp(c3[i_hs, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c3[i_hs, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kmol/(kg s)</span></span>
<span id="cb38-31">CHI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P</span>
<span id="cb38-32">       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FILM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h_f"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c3[i_hs, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb38-33">MEARS_RHS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mears_constant"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c3[i_hs, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb38-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Mears' interphase criterion, book page 588 (the criterion family is B1.7's;"</span></span>
<span id="cb38-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this is B1.7's eq. 14 evaluated on this reactor):"</span></span>
<span id="cb38-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |chi| = (-dH) r_A rho_B d_p / (2 h_f T) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CHI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb38-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   0.15 R T / E                            = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEARS_RHS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb38-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'SATISFIED'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> CHI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> MEARS_RHS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'VIOLATED'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, by a factor"</span></span>
<span id="cb38-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEARS_RHS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CHI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND YET. At section 11.5.2's own design point the same </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_DT_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K film"</span></span>
<span id="cb38-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" difference moves</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the safe inlet partial pressure by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb38-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_p0_increment'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_p0_safe'</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times"</span></span>
<span id="cb38-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_p0_increment'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_p0_safe'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % margin</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">that section"</span></span>
<span id="cb38-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 11.5.2's own sensitivity sentence hangs on. Mears' criterion asks whether</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the"</span></span>
<span id="cb38-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" OBSERVED RATE deviates by 5 % from the intrinsic one, and it correctly says no."</span></span>
<span id="cb38-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">It is not a statement about the runaway boundary, and near a runaway boundary a"</span></span>
<span id="cb38-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rate that is right to 5 % is not enough. That is the ladder's lesson in one"</span></span>
<span id="cb38-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" line:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the criteria in the chapter test the RATE, and what a designer of this"</span></span>
<span id="cb38-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reactor</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">needs tested is the THRESHOLD."</span>)</span>
<span id="cb38-50"></span>
<span id="cb38-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND THE CHAPTER SAYS SO ITSELF, in the sentence immediately after the one this"</span></span>
<span id="cb38-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">page uses as its anchor. Book page"</span></span>
<span id="cb38-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BK.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'heat_mass_transfer_claim'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, verbatim:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb38-54">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_mass_transfer_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"That is section 11.5.2 stating, at exactly the operating points this page works"</span></span>
<span id="cb38-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_BOOK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the curves just above it - that the pseudohomogeneous model is"</span></span>
<span id="cb38-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">no longer adequate there and that interfacial transport has to be added. Which is"</span></span>
<span id="cb38-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rung 3, qualitatively, PRINTED IN THE CHAPTER. So the contribution here is not"</span></span>
<span id="cb38-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the observation; it is the size and the sign - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % in the threshold,"</span></span>
<span id="cb38-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" against a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Mears criterion that passes by a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEARS_RHS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CHI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - and the"</span></span>
<span id="cb38-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" point that the chapter's own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">yardsticks are rate criteria while its own warning is"</span></span>
<span id="cb38-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" about the threshold. The</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">chapter noticed; it did not quantify, and it did not"</span></span>
<span id="cb38-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reconcile the warning with</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the criteria it prints three pages later."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>section 11.8.2, book page 590, on this same reactor and kinetic scheme:
   "The difference in temperature between the gas and solid is really very small and of the order of 1 C. Yet, this is a very exothermic reaction, and the operating conditions used in these calculations are realistic."

At the book's own startup conditions - T_0 = T_r = 362 C, and the 11.7.3
inlet mole fraction y_A0 = 0.00924 for the same reactor:
   max gas-to-solid temperature difference : 0.8452 K   against the printed 'of the order of 1 C'
   max partial-pressure drop across the film: 4.856e-05 atm, 0.526 % of the inlet
The temperature claim holds; the chapter's other statement that 'the most likely
interfacial gradient to occur is the temperature gradient' (page 585) is confirmed
by the same pair of numbers.

TWO OF THE THREE INPUTS ARE NOT SECTION 11.8.2'S. It prints T_0 = T_r = 362 C and
nothing else quantitative for this case: the inlet composition is borrowed from
section 11.7.3 and k_g, h_f come from A3.4's correlation, which the chapter does not
print either. So this reproduces 'of the order of 1 C' at the book's own startup
TEMPERATURE with two imported inputs, and it is worth exactly what an order-of-
magnitude claim with two free inputs is worth. The crossover row below is what
bounds the film's importance without them.

Mears' interphase criterion, book page 588 (the criterion family is B1.7's;
this is B1.7's eq. 14 evaluated on this reactor):
   |chi| = (-dH) r_A rho_B d_p / (2 h_f T) = 0.00189
   0.15 R T / E                            = 0.00717
   -&gt; SATISFIED, by a factor 3.79

AND YET. At section 11.5.2's own design point the same 3.31 K film difference moves
the safe inlet partial pressure by -4.74 % - 4.3 times the 1.11 % margin
that section 11.5.2's own sensitivity sentence hangs on. Mears' criterion asks whether
the OBSERVED RATE deviates by 5 % from the intrinsic one, and it correctly says no.
It is not a statement about the runaway boundary, and near a runaway boundary a
rate that is right to 5 % is not enough. That is the ladder's lesson in one line:
the criteria in the chapter test the RATE, and what a designer of this reactor
needs tested is the THRESHOLD.

AND THE CHAPTER SAYS SO ITSELF, in the sentence immediately after the one this
page uses as its anchor. Book page 513, verbatim:
   "Note that for the upper part of the curves with pA0 = 0.0181, 0.0182, and 0.019 (Figs. 11.5.2-1 and 11.5.2-2), the model used here is no longer entirely adequate: heat and mass transfer effects would have to be taken into account."
That is section 11.5.2 stating, at exactly the operating points this page works
at - 0.018, and the curves just above it - that the pseudohomogeneous model is
no longer adequate there and that interfacial transport has to be added. Which is
rung 3, qualitatively, PRINTED IN THE CHAPTER. So the contribution here is not
the observation; it is the size and the sign - -4.74 % in the threshold, against a
Mears criterion that passes by a factor 3.79 - and the point that the chapter's own
yardsticks are rate criteria while its own warning is about the threshold. The
chapter noticed; it did not quantify, and it did not reconcile the warning with
the criteria it prints three pages later.</code></pre>
</div>
</div>
<div id="6d5307dc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:43:46.939694Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:43:46.939516Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:49:01.711295Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:49:01.710411Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ======== 7. the crossovers, root-found rather than sampled ==================</span></span>
<span id="cb40-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Where does each rung stop mattering? Every row of the table below is a CONTROLLED"</span></span>
<span id="cb40-3">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">SCAN: a sweep outward from the chapter's own value in which each threshold must"</span></span>
<span id="cb40-4">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pass the crossing control before its shift is used for anything, run until two"</span></span>
<span id="cb40-5">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">VALIDATED points straddle the target, then refined between them with every"</span></span>
<span id="cb40-6">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">iterate controlled too. All four rows are ROOTS.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb40-7">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The thresholds follow the start-up branch (see the note on locating thresholds"</span></span>
<span id="cb40-8">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">at the top of Validation), and the scan meets no rejected point at all.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-9">BASE600 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>))</span>
<span id="cb40-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ONE definition of "shift" in this table, and it is the same-grid one: rung 1 at the</span></span>
<span id="cb40-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SAME n_z as the rung being moved.  Mixing two - some rows against the</span></span>
<span id="cb40-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Richardson-extrapolated rung-1 threshold and others against a same-grid one -</span></span>
<span id="cb40-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># costs a large fraction of the target, because rung 1's own</span></span>
<span id="cb40-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 600-cell discretisation error is a fifth of it.  Both readings of the film row are</span></span>
<span id="cb40-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># measured and printed at the end of this cell.  Same-grid is the right one: it is</span></span>
<span id="cb40-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what cancels the discretisation between the two models being compared.</span></span>
<span id="cb40-17"></span>
<span id="cb40-18"></span>
<span id="cb40-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> shift_pct(lad, base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb40-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(lad, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (BASE600 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> base <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> base)</span>
<span id="cb40-21">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb40-22"></span>
<span id="cb40-23"></span>
<span id="cb40-24">TARGET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># per cent shift in p0*, the crossover definition</span></span>
<span id="cb40-25">cross, SCANS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}</span>
<span id="cb40-26"></span>
<span id="cb40-27"></span>
<span id="cb40-28"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _row(key, lbl, quantity, chapter, factor, res):</span>
<span id="cb40-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""factor = how many times the chapter's own value the located one is."""</span></span>
<span id="cb40-30">    SCANS[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> res</span>
<span id="cb40-31">    cross.append((lbl, quantity, res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>], res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>], chapter, factor,</span>
<span id="cb40-32">                  res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_pct"</span>]))</span>
<span id="cb40-33"></span>
<span id="cb40-34"></span>
<span id="cb40-35">_MARGIN_BEFORE_SCANS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_K"</span>]     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the four scans' own margin, below</span></span>
<span id="cb40-36">CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_K"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.inf</span>
<span id="cb40-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) rung 2: how small must Pe_ma = Pe_ha be before axial dispersion moves p0* 1 %?</span></span>
<span id="cb40-38">PE_SWEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.32</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.24</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.23</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.21</span>,</span>
<span id="cb40-39">            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>)</span>
<span id="cb40-40">S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pe: shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pe, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pe)),</span>
<span id="cb40-41">                PE_SWEEP, TARGET)</span>
<span id="cb40-42">_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 2, sec. 11.6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axial Peclet number Pe_a"</span>,</span>
<span id="cb40-43">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_high'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (page 560)"</span>,</span>
<span id="cb40-44">     bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_axial_low"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>], S2)</span>
<span id="cb40-45"></span>
<span id="cb40-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) rung 3: how large must the film coefficients be before the film moves p0* 1 %?</span></span>
<span id="cb40-47">FILM_SWEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)</span>
<span id="cb40-48">S3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> fs: shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fs)),</span>
<span id="cb40-49">                FILM_SWEEP, TARGET)</span>
<span id="cb40-50">_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 3, sec. 11.8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Wakao-Funazkri k_g and h_f, x"</span>,</span>
<span id="cb40-51">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.0 (as correlated)"</span>, S3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, S3)</span>
<span id="cb40-52"></span>
<span id="cb40-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (c) rung 4: how large must D_e be before intraparticle diffusion moves p0* 1 %?</span></span>
<span id="cb40-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     measured against RUNG 3, not rung 1: as D_e -&gt; infinity rung 4 collapses onto</span></span>
<span id="cb40-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     rung 3 (eta -&gt; 1), not onto rung 1, so rung 1 is the wrong baseline for THIS</span></span>
<span id="cb40-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     rung's own contribution.  The other three rows each sit one rung above their</span></span>
<span id="cb40-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     own baseline already.</span></span>
<span id="cb40-58">BASE3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>))</span>
<span id="cb40-59">DE_SWEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0e-5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-2</span>)</span>
<span id="cb40-60">S4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> de: shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, D_e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>de), base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE3),</span>
<span id="cb40-61">                DE_SWEEP, TARGET)</span>
<span id="cb40-62">_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"De"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 4, sec. 11.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"effective diffusivity D_e [m2/s], vs rung 3"</span>,</span>
<span id="cb40-63">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NOT PRINTED for this catalyst"</span>, S4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-6</span>, S4)</span>
<span id="cb40-64"></span>
<span id="cb40-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (d) rung 5: how small must the tube radius be before 2-D moves p0* 1 %?</span></span>
<span id="cb40-66">S5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_R(TARGET)</span>
<span id="cb40-67">SCAN_MARGIN_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_K"</span>]</span>
<span id="cb40-68">CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_K"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_MARGIN_BEFORE_SCANS, SCAN_MARGIN_K)</span>
<span id="cb40-69">_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 5, sec. 11.7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tube radius R_t [m]"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (this reactor)"</span>,</span>
<span id="cb40-70">     R_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>], S5)</span>
<span id="cb40-71"></span>
<span id="cb40-72">SWEEP_LABEL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pe_ma = Pe_ha"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film coefficients, x"</span>,</span>
<span id="cb40-73">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"De"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_e [m2/s]"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_t [m]"</span>}</span>
<span id="cb40-74"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _res <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SCANS.items():</span>
<span id="cb40-75">    _t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep"</span>].rename(columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>: SWEEP_LABEL[_k]})</span>
<span id="cb40-76">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_LABEL[_k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sweep: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_evaluated'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points evaluated,"</span></span>
<span id="cb40-77">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_controlled'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> validated, the search uses only those,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the sweep"</span></span>
<span id="cb40-78">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" stops once two VALIDATED points straddle the target. Refinement:"</span></span>
<span id="cb40-79">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'levels'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> levels took the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-wide straddling pair"</span></span>
<span id="cb40-80">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_res[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb40-81">    show(_t.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11sweep"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _k).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb40-82">        {SWEEP_LABEL[_k]: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_pct"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>},</span>
<span id="cb40-83">        na_rep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the control REJECTS this point"</span>))</span>
<span id="cb40-84">PE_STAR, FILM_STAR, DE_STAR, R_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>], S3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>], S4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>],</span>
<span id="cb40-85">                                       S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb40-86">CROSS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(cross, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover"</span>,</span>
<span id="cb40-87">                                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the chapter's value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor away"</span>,</span>
<span id="cb40-88">                                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift there, %"</span>])</span>
<span id="cb40-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NOT asserted that list(CROSS.kind) == ["root"] * 4: cross_scan has a single</span></span>
<span id="cb40-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `return`, always kind="root", so that assert could never fail - a toothless</span></span>
<span id="cb40-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># check on the one page that audits toothless checks.  The "kind" column stays,</span></span>
<span id="cb40-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed rather than guarded.</span></span>
<span id="cb40-93">show(CROSS.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11cross"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb40-94">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor away"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift there, %"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb40-95"></span>
<span id="cb40-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the certificate the located rung-2 crossover itself carries, printed rather than</span></span>
<span id="cb40-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># asserted - it is the whole of the case that this row is a root and not an artefact</span></span>
<span id="cb40-98">_L2S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_STAR, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_STAR)</span>
<span id="cb40-99">_P2S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(_L2S, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>)</span>
<span id="cb40-100">_LO2, _HI2, _OK2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> crossing_control(_L2S, _P2S)</span>
<span id="cb40-101"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _OK2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the located rung-2 crossover does not pass the crossing control"</span></span>
<span id="cb40-102">SCAN_PROBED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"probed"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SCANS.values())</span>
<span id="cb40-103">SCAN_REFUSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refused"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SCANS.values())</span>
<span id="cb40-104">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_evaluated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_controlled"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SCANS.values()))</span>
<span id="cb40-105"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ALL FOUR ROWS ARE ROOTS. At Pe_a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the rung-2 shift is"</span></span>
<span id="cb40-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, and that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold carries the same certificate as the"</span></span>
<span id="cb40-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" five rungs of the ladder table -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">p0* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_P2S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm with </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_LO2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C just"</span></span>
<span id="cb40-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below it and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_HI2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C just above, a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_HI2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_LO2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K jump against the"</span></span>
<span id="cb40-109">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL_JUMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K the control allows. So axial dispersion has to be"</span></span>
<span id="cb40-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times stronger than the chapter's own lower limit"</span></span>
<span id="cb40-111">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" before it moves the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. The four refinements probed"</span></span>
<span id="cb40-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SCAN_PROBED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> interior points between them and,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">with the sweep points, the control"</span></span>
<span id="cb40-113">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rejected </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SCAN_REFUSED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of all the thresholds the four scans used."</span>)</span>
<span id="cb40-114"></span>
<span id="cb40-115">RANK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CROSS.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor away"</span>)</span>
<span id="cb40-116"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Read the 'factor away' column as a RANKING: it is how far each coefficient would"</span></span>
<span id="cb40-117">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">have to move from the chapter's own value before its rung shifted the threshold"</span></span>
<span id="cb40-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, so SMALL means the rung is close to not mattering."</span>)</span>
<span id="cb40-119"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, _row_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RANK.iterrows():</span>
<span id="cb40-120">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_row_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rung'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;20s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_row_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'factor away'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb40-121">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_row_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'quantity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-122"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The ordering is DECIDABLE, all four of it: rung 5 is closest to irrelevance by a"</span></span>
<span id="cb40-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">wide margin, then rung 2 at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, then rung 3 at"</span></span>
<span id="cb40-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and rung 4 is furthest at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DE_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-6</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Rungs 2 and 3 are"</span></span>
<span id="cb40-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FILM_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PE_STAR)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % apart, which is the"</span></span>
<span id="cb40-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" honest caveat on THAT pair."</span>)</span>
<span id="cb40-127"></span>
<span id="cb40-128"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE CONTROL'S VERDICT ALONG Pe_a, on a regular 0.001 grid from 0.316 to 0.308.</span></span>
<span id="cb40-129">_UNIFORM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb40-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.arange(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.316</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3075</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>):</span>
<span id="cb40-131">    _UNIFORM.append((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_p), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_shift_or_none(</span>
<span id="cb40-132">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_p))))</span>
<span id="cb40-133">UNIFORM_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, _, o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _UNIFORM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> o)</span>
<span id="cb40-134"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> UNIFORM_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_UNIFORM), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the control rejects a point of the fine Pe_a grid"</span></span>
<span id="cb40-135"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff([v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, v, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _UNIFORM]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), (</span>
<span id="cb40-136">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the rung-2 shift is not monotone on the fine Pe_a grid"</span>)</span>
<span id="cb40-137"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE CONTROL'S VERDICT ALONG Pe_a, on a regular 0.001 grid:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb40-138">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, v, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _UNIFORM)</span>
<span id="cb40-139">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UNIFORM_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_UNIFORM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> validate, and the shift rises monotonically as"</span></span>
<span id="cb40-140">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Pe_a falls."</span>)</span>
<span id="cb40-141"></span>
<span id="cb40-142"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE REST OF THE Pe_a SWEEP, evaluated although the crossover did not need it. The</span></span>
<span id="cb40-143"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># scan above stops as soon as the target is bracketed, so "the largest shift the sweep</span></span>
<span id="cb40-144"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># shows" would otherwise be an artefact of where it stopped.  The tail is measured.</span></span>
<span id="cb40-145">PE_TAIL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_p), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_shift_or_none(</span>
<span id="cb40-146">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_p)))</span>
<span id="cb40-147">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PE_SWEEP[S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_evaluated"</span>]:]]</span>
<span id="cb40-148">_ALL2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ([(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.x), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.shift_pct)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep"</span>].itertuples() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r.controlled]</span>
<span id="cb40-149">         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(p, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, v, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PE_TAIL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ok])</span>
<span id="cb40-150">_MAX2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_ALL2, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb40-151">PE_TAIL_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, _, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PE_TAIL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ok)</span>
<span id="cb40-152"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THE WHOLE SWEEP REACHES, tail included:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb40-153">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ok <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"REFUSED"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, v, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PE_TAIL)</span>
<span id="cb40-154">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Across all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PE_SWEEP)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> swept points the control validates </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_ALL2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the"</span></span>
<span id="cb40-155">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" largest |shift| any</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of them carries is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_MAX2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at"</span></span>
<span id="cb40-156">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Pe_a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_MAX2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. So a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % crossover for rung 2 is bracketable on"</span></span>
<span id="cb40-157">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this sweep, and the break row that moves the crossover target moves it to"</span></span>
<span id="cb40-158">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">What lies below Pe_a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(p <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ALL2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is not"</span></span>
<span id="cb40-159">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reported here."</span>)</span>
<span id="cb40-160"></span>
<span id="cb40-161"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE ACCURACY OF THE RUNG-2 ROOT, the same way rung 5's is done below: the same-grid</span></span>
<span id="cb40-162"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># shift at a validated sweep point on three grids, divided by the local slope.</span></span>
<span id="cb40-163">PE_ANCHOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb40-164">PE_GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb40-165"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span>, N_Z):</span>
<span id="cb40-166">    _b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE600 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_n))</span>
<span id="cb40-167">    PE_GRID[_n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_n, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_ANCHOR,</span>
<span id="cb40-168">                                              pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_ANCHOR), hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb40-169">PE_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(PE_GRID.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(PE_GRID.values())</span>
<span id="cb40-170">PE_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair_shift"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair_shift"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb40-171">                                                                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb40-172">PE_STAR_UNC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PE_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PE_SLOPE</span>
<span id="cb40-173"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND THE DIGITS OF Pe_a* THAT MEAN ANYTHING. The refinement resolves the"</span></span>
<span id="cb40-174">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" straddling</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pair to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, but that is a TOLERANCE. The accuracy is"</span></span>
<span id="cb40-175">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" set by the grid, and it is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">measured under the SAME-GRID definition this table uses"</span></span>
<span id="cb40-176">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - which is the point, because</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">against a fixed extrapolated baseline the same"</span></span>
<span id="cb40-177">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" comparison would carry rung 1's own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">600-to-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> movement instead of cancelling it."</span></span>
<span id="cb40-178">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" At Pe_a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_ANCHOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, a validated sweep point:"</span></span>
<span id="cb40-179">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   n_z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   shift = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PE_GRID.items())</span>
<span id="cb40-180">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">a spread of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_GAP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pp across a doubling of the grid. On the local slope of"</span></span>
<span id="cb40-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sweep, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_SLOPE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pp per 0.001 in Pe_a, that is"</span></span>
<span id="cb40-182">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Pe_a* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_STAR_UNC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">factor"</span></span>
<span id="cb40-183">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/-"</span></span>
<span id="cb40-184">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PE_STAR_UNC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PE_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Three figures on Pe_a*, not the"</span></span>
<span id="cb40-185">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" six its refinement</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tolerance would suggest - the same reading the tube radius gets"</span></span>
<span id="cb40-186">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below."</span>)</span>
<span id="cb40-187">_sw5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep"</span>]</span>
<span id="cb40-188">_brk5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the straddling pair the root sits in</span></span>
<span id="cb40-189">_slope5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair_shift"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair_shift"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _brk5</span>
<span id="cb40-190">_gap5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_sw5.shift_pct[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (600, 10) against (1200, 20), R_t as built</span></span>
<span id="cb40-191">R_STAR_UNC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _gap5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _slope5</span>
<span id="cb40-192"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(_sw5.shift_pct[_sw5.controlled].values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), (</span>
<span id="cb40-193">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the rung-5 shift is not monotone over the validated sweep"</span>)</span>
<span id="cb40-194"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">RUNG 5, THE ONE ROW WHOSE CROSSOVER IS INSIDE THIS REACTOR'S OWN RANGE."</span></span>
<span id="cb40-195">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" R_t* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d_t/d_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>R_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, where |shift| ="</span></span>
<span id="cb40-196">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift_pct'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %: a tube only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>R_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x narrower than this"</span></span>
<span id="cb40-197">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">one - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm rather than </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm - already brings the"</span></span>
<span id="cb40-198">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" two-dimensional rung</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inside </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. THE DIGITS THAT MEAN ANYTHING:"</span></span>
<span id="cb40-199">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the refinement resolves the bracket to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb40-200">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" micrometres, but that is a TOLERANCE and not an accuracy. The accuracy is set"</span></span>
<span id="cb40-201">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by the grid: this page's own (600, 10) and (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_R<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) values of the rung-5"</span></span>
<span id="cb40-202">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" shift differ by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_gap5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pp, and the local slope of the sweep is"</span></span>
<span id="cb40-203">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_slope5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pp/mm, so R_t* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_STAR_UNC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm,"</span></span>
<span id="cb40-204">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d_t/d_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>R_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>R_STAR_UNC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, factor"</span></span>
<span id="cb40-205">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>R_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>R_STAR_UNC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>R_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Three figures on R_t*, not six."</span>)</span>
<span id="cb40-206"></span>
<span id="cb40-207"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NARROWER TUBES THAN THE CROSSOVER, measured HERE and not inside the crossover scan:</span></span>
<span id="cb40-208"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the scan stops as soon as the target is bracketed, and this is a different question.</span></span>
<span id="cb40-209">R_NARROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0098</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.00975</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0097</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0096</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0094</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0090</span>)</span>
<span id="cb40-210">_NARROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(R, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_shift_or_none(shift_rung5, R)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> R_NARROW]</span>
<span id="cb40-211"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(ok <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, _, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _NARROW), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the control rejects a radius below the crossover"</span></span>
<span id="cb40-212">_N_OK5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(R, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _NARROW]</span>
<span id="cb40-213"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff([v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _N_OK5]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), (</span>
<span id="cb40-214">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the rung-5 shift is not monotone over the radii below the crossover"</span>)</span>
<span id="cb40-215">_SIGN5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(R, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _N_OK5 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb40-216">_NEG5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(R, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _N_OK5 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb40-217"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _SIGN5[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _NEG5[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the rung-5 sign change is not where this text says"</span></span>
<span id="cb40-218">_UNDER5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(R, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _N_OK5 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> TARGET]</span>
<span id="cb40-219">_OVER5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(R, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _N_OK5 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> TARGET]</span>
<span id="cb40-220"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _OVER5 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(R <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _UNDER5) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(R <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _OVER5), (</span>
<span id="cb40-221">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the second 1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% c</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">rossing on narrow tubes is not where this text says"</span>)</span>
<span id="cb40-222"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND ON TUBES NARROWER THAN THE CROSSOVER. On </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R_NARROW)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> radii below it the"</span></span>
<span id="cb40-223">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" control validates</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">every threshold:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb40-224">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _N_OK5)</span>
<span id="cb40-225">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The signed shift rises monotonically as the tube narrows (checked, not assumed)"</span></span>
<span id="cb40-226">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">CHANGES SIGN between </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_NEG5[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_NEG5[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %) and"</span></span>
<span id="cb40-227">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_SIGN5[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_SIGN5[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %): the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">two-dimensional correction is"</span></span>
<span id="cb40-228">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" NEGATIVE on this tube and POSITIVE on a narrower one.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">|shift| stays under"</span></span>
<span id="cb40-229">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from R_t* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm down to"</span></span>
<span id="cb40-230">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(R <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _UNDER5)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm, and is past </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % again,"</span></span>
<span id="cb40-231">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">on the positive side, by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(R <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _OVER5)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span></span>
<span id="cb40-232">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> R, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _OVER5][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)."</span>)</span>
<span id="cb40-233"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">None of that contradicts section 11.7.3's own sentence, which reads, verbatim:"</span></span>
<span id="cb40-234">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial_gradient_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">That sentence is"</span></span>
<span id="cb40-235">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" about the radial temperature GRADIENT and this measure is about the"</span></span>
<span id="cb40-236">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">runaway THRESHOLD: the gradient here is"</span></span>
<span id="cb40-237">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R5[(R5.n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span>N_Z)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>(R5.n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span>N_R)].dT_radial.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K wall-to-axis while"</span></span>
<span id="cb40-238">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the threshold moves </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. Severe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gradients and a modest threshold"</span></span>
<span id="cb40-239">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" shift are the same reactor."</span></span>
<span id="cb40-240">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The film sits a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> away, which is why that rung's size depends"</span></span>
<span id="cb40-241">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">on which correlation you pick. The intraparticle rung is the one that is not"</span></span>
<span id="cb40-242">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">decidable from the chapter at all: the crossover D_e is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s,"</span></span>
<span id="cb40-243">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the chapter prints no D_e for this catalyst - it sends the reader to two"</span></span>
<span id="cb40-244">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">documents (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'De_source_claim'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">52</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">...)."</span>)</span>
<span id="cb40-245"></span>
<span id="cb40-246"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE CONTROL ON A COARSE GRID: rung 4's anchor at n_z = 300, the grid of the</span></span>
<span id="cb40-247"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># coarse-grid break row.</span></span>
<span id="cb40-248">_L300 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb40-249">_P300 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(_L300, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>)</span>
<span id="cb40-250">_LO3, _HI3, _OK3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> crossing_control(_L300, _P300)</span>
<span id="cb40-251"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND ON A COARSE GRID. At n_z = 300, rung 4's own anchor point - its default"</span></span>
<span id="cb40-252">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D_e = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-6</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s, the first point of that sweep - returns p0* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_P300<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb40-253">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" with</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_LO3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C just below it and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_HI3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C just above: a clean"</span></span>
<span id="cb40-254">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" crossing (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_OK3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), so the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">coarse-grid break row runs at 300 cells."</span>)</span>
<span id="cb40-255"></span>
<span id="cb40-256"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT THE OTHER SHIFT DEFINITION WOULD COST, measured on the row where it is largest</span></span>
<span id="cb40-257">S3_EXTRAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> fs: shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fs),</span>
<span id="cb40-258">                                            base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LIM_P), FILM_SWEEP, TARGET)</span>
<span id="cb40-259"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE COST OF THE SHIFT DEFINITION, on the row where it is largest. Rung 1's"</span></span>
<span id="cb40-260">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 600-cell</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE600<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm and its Richardson limit is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LIM_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb40-261">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" a gap of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(BASE600<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>LIM_P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> percentage points - a fifth of the"</span></span>
<span id="cb40-262">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TARGET<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % target. The film row against the"</span></span>
<span id="cb40-263">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">same-grid baseline used above: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Against the extrapolated"</span></span>
<span id="cb40-264">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" baseline: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S3_EXTRAP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">One definition, said once, in every row: the"</span></span>
<span id="cb40-265">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" same-grid one, because it is what</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cancels the discretisation between the two models"</span></span>
<span id="cb40-266">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" being compared."</span>)</span>
<span id="cb40-267"></span>
<span id="cb40-268"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what the printed a_1 group of page 574 would cost, given the chapter's own</span></span>
<span id="cb40-269"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># insensitivity claim for Pe_mr</span></span>
<span id="cb40-270"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And the printed a_1 = (D_er)_s/(u_i d_p) inconsistency of page 574, measured."</span></span>
<span id="cb40-271">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The chapter says: </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_mr_insensitive_claim'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-272">S_PEMR_AS_IS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span>
<span id="cb40-273">S_PEMR_LITERAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, pe_mr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_MR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> EPS))</span>
<span id="cb40-274">S_LAMER_5PCT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shift_pct(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, lam_er<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAM_ER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>,</span>
<span id="cb40-275">                                pe_hr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_HR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>))</span>
<span id="cb40-276"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Pe_mr = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_MR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as this page reads the group : p0* shift"</span></span>
<span id="cb40-277">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_PEMR_AS_IS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb40-278">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Pe_mr = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_MR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>EPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the printed group read literally: p0* shift"</span></span>
<span id="cb40-279">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_PEMR_LITERAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %  (delta"</span></span>
<span id="cb40-280">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_PEMR_LITERAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>S_PEMR_AS_IS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)"</span></span>
<span id="cb40-281">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   lambda_er raised 5 %                          : p0* shift"</span></span>
<span id="cb40-282">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_LAMER_5PCT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %  (delta </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_LAMER_5PCT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>S_PEMR_AS_IS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)"</span></span>
<span id="cb40-283">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The chapter's sensitivity claim is confirmed on the threshold as well as on the"</span></span>
<span id="cb40-284">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">profiles, and it is WHY the epsilon in a_1 is invisible: a factor 1/eps ="</span></span>
<span id="cb40-285">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>EPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">radial mass dispersion costs"</span></span>
<span id="cb40-286">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S_PEMR_LITERAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>S_PEMR_AS_IS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % where 5 % on lambda_er costs"</span></span>
<span id="cb40-287">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S_LAMER_5PCT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>S_PEMR_AS_IS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A printed group can be wrong by a void"</span></span>
<span id="cb40-288">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" fraction and never be found, if the quantity</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">it multiplies is the one the model is"</span></span>
<span id="cb40-289">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" insensitive to."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Where does each rung stop mattering? Every row of the table below is a CONTROLLED
SCAN: a sweep outward from the chapter's own value in which each threshold must
pass the crossing control before its shift is used for anything, run until two
VALIDATED points straddle the target, then refined between them with every
iterate controlled too. All four rows are ROOTS.

The thresholds follow the start-up branch (see the note on locating thresholds
at the top of Validation), and the scan meets no rejected point at all.


the Pe_ma = Pe_ha sweep: 9 points evaluated, 9 validated, the search uses only those,
and the sweep stops once two VALIDATED points straddle the target. Refinement:
8 levels took the 0.01-wide straddling pair to 1.53e-07.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11sweeppe" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11sweeppe_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">Pe_ma = Pe_ha</th>
<th id="T_d11sweeppe_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">shift_pct</th>
<th id="T_d11sweeppe_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">controlled</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11sweeppe_row0_col0" class="data row0 col0">2</td>
<td id="T_d11sweeppe_row0_col1" class="data row0 col1">+0.1243</td>
<td id="T_d11sweeppe_row0_col2" class="data row0 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweeppe_row1_col0" class="data row1 col0">1.5</td>
<td id="T_d11sweeppe_row1_col1" class="data row1 col1">+0.1657</td>
<td id="T_d11sweeppe_row1_col2" class="data row1 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweeppe_row2_col0" class="data row2 col0">1</td>
<td id="T_d11sweeppe_row2_col1" class="data row2 col1">+0.2485</td>
<td id="T_d11sweeppe_row2_col2" class="data row2 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweeppe_row3_col0" class="data row3 col0">0.6</td>
<td id="T_d11sweeppe_row3_col1" class="data row3 col1">+0.4141</td>
<td id="T_d11sweeppe_row3_col2" class="data row3 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweeppe_row4_col0" class="data row4 col0">0.4</td>
<td id="T_d11sweeppe_row4_col1" class="data row4 col1">+0.6213</td>
<td id="T_d11sweeppe_row4_col2" class="data row4 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweeppe_row5_col0" class="data row5 col0">0.32</td>
<td id="T_d11sweeppe_row5_col1" class="data row5 col1">+0.7769</td>
<td id="T_d11sweeppe_row5_col2" class="data row5 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweeppe_row6_col0" class="data row6 col0">0.3</td>
<td id="T_d11sweeppe_row6_col1" class="data row6 col1">+0.8288</td>
<td id="T_d11sweeppe_row6_col2" class="data row6 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweeppe_row7_col0" class="data row7 col0">0.25</td>
<td id="T_d11sweeppe_row7_col1" class="data row7 col1">+0.9953</td>
<td id="T_d11sweeppe_row7_col2" class="data row7 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweeppe_row8_col0" class="data row8 col0">0.24</td>
<td id="T_d11sweeppe_row8_col1" class="data row8 col1">+1.0370</td>
<td id="T_d11sweeppe_row8_col2" class="data row8 col2">True</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
the film coefficients, x sweep: 5 points evaluated, 5 validated, the search uses only those,
and the sweep stops once two VALIDATED points straddle the target. Refinement:
8 levels took the 2-wide straddling pair to 3.05e-05.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11sweepfilm" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11sweepfilm_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">film coefficients, x</th>
<th id="T_d11sweepfilm_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">shift_pct</th>
<th id="T_d11sweepfilm_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">controlled</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11sweepfilm_row0_col0" class="data row0 col0">1</td>
<td id="T_d11sweepfilm_row0_col1" class="data row0 col1">-4.7443</td>
<td id="T_d11sweepfilm_row0_col2" class="data row0 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepfilm_row1_col0" class="data row1 col0">2</td>
<td id="T_d11sweepfilm_row1_col1" class="data row1 col1">-2.4298</td>
<td id="T_d11sweepfilm_row1_col2" class="data row1 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweepfilm_row2_col0" class="data row2 col0">3</td>
<td id="T_d11sweepfilm_row2_col1" class="data row2 col1">-1.6330</td>
<td id="T_d11sweepfilm_row2_col2" class="data row2 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepfilm_row3_col0" class="data row3 col0">4</td>
<td id="T_d11sweepfilm_row3_col1" class="data row3 col1">-1.2298</td>
<td id="T_d11sweepfilm_row3_col2" class="data row3 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweepfilm_row4_col0" class="data row4 col0">6</td>
<td id="T_d11sweepfilm_row4_col1" class="data row4 col1">-0.8232</td>
<td id="T_d11sweepfilm_row4_col2" class="data row4 col2">True</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
the D_e [m2/s] sweep: 4 points evaluated, 4 validated, the search uses only those,
and the sweep stops once two VALIDATED points straddle the target. Refinement:
8 levels took the 2e-05-wide straddling pair to 3.05e-10.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11sweepDe" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11sweepDe_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">D_e [m2/s]</th>
<th id="T_d11sweepDe_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">shift_pct</th>
<th id="T_d11sweepDe_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">controlled</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11sweepDe_row0_col0" class="data row0 col0">1e-06</td>
<td id="T_d11sweepDe_row0_col1" class="data row0 col1">+21.4503</td>
<td id="T_d11sweepDe_row0_col2" class="data row0 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepDe_row1_col0" class="data row1 col0">3e-06</td>
<td id="T_d11sweepDe_row1_col1" class="data row1 col1">+7.4752</td>
<td id="T_d11sweepDe_row1_col2" class="data row1 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweepDe_row2_col0" class="data row2 col0">1e-05</td>
<td id="T_d11sweepDe_row2_col1" class="data row2 col1">+2.2634</td>
<td id="T_d11sweepDe_row2_col2" class="data row2 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepDe_row3_col0" class="data row3 col0">3e-05</td>
<td id="T_d11sweepDe_row3_col1" class="data row3 col1">+0.7556</td>
<td id="T_d11sweepDe_row3_col2" class="data row3 col2">True</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
the R_t [m] sweep: 6 points evaluated, 6 validated, the search uses only those,
and the sweep stops once two VALIDATED points straddle the target. Refinement:
4 levels took the 0.0005-wide straddling pair to 1.95e-06.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11sweepR" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11sweepR_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">R_t [m]</th>
<th id="T_d11sweepR_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">shift_pct</th>
<th id="T_d11sweepR_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">controlled</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11sweepR_row0_col0" class="data row0 col0">0.0125</td>
<td id="T_d11sweepR_row0_col1" class="data row0 col1">-8.9419</td>
<td id="T_d11sweepR_row0_col2" class="data row0 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepR_row1_col0" class="data row1 col0">0.012</td>
<td id="T_d11sweepR_row1_col1" class="data row1 col1">-7.4775</td>
<td id="T_d11sweepR_row1_col2" class="data row1 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweepR_row2_col0" class="data row2 col0">0.0115</td>
<td id="T_d11sweepR_row2_col1" class="data row2 col1">-5.9441</td>
<td id="T_d11sweepR_row2_col2" class="data row2 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepR_row3_col0" class="data row3 col0">0.011</td>
<td id="T_d11sweepR_row3_col1" class="data row3 col1">-4.3384</td>
<td id="T_d11sweepR_row3_col2" class="data row3 col2">True</td>
</tr>
<tr class="odd">
<td id="T_d11sweepR_row4_col0" class="data row4 col0">0.0105</td>
<td id="T_d11sweepR_row4_col1" class="data row4 col1">-2.6569</td>
<td id="T_d11sweepR_row4_col2" class="data row4 col2">True</td>
</tr>
<tr class="even">
<td id="T_d11sweepR_row5_col0" class="data row5 col0">0.01</td>
<td id="T_d11sweepR_row5_col1" class="data row5 col1">-0.8962</td>
<td id="T_d11sweepR_row5_col2" class="data row5 col2">True</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11cross" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11cross_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">rung</th>
<th id="T_d11cross_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">quantity</th>
<th id="T_d11cross_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">kind</th>
<th id="T_d11cross_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">crossover</th>
<th id="T_d11cross_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">the chapter's value</th>
<th id="T_d11cross_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">factor away</th>
<th id="T_d11cross_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">shift there, %</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11cross_row0_col0" class="data row0 col0">rung 2, sec. 11.6</td>
<td id="T_d11cross_row0_col1" class="data row0 col1">axial Peclet number Pe_a</td>
<td id="T_d11cross_row0_col2" class="data row0 col2">root</td>
<td id="T_d11cross_row0_col3" class="data row0 col3">0.2488</td>
<td id="T_d11cross_row0_col4" class="data row0 col4">1 to 2 (page 560)</td>
<td id="T_d11cross_row0_col5" class="data row0 col5">4.02</td>
<td id="T_d11cross_row0_col6" class="data row0 col6">+1.0000</td>
</tr>
<tr class="even">
<td id="T_d11cross_row1_col0" class="data row1 col0">rung 3, sec. 11.8</td>
<td id="T_d11cross_row1_col1" class="data row1 col1">Wakao-Funazkri k_g and h_f, x</td>
<td id="T_d11cross_row1_col2" class="data row1 col2">root</td>
<td id="T_d11cross_row1_col3" class="data row1 col3">4.93</td>
<td id="T_d11cross_row1_col4" class="data row1 col4">1.0 (as correlated)</td>
<td id="T_d11cross_row1_col5" class="data row1 col5">4.93</td>
<td id="T_d11cross_row1_col6" class="data row1 col6">-1.0000</td>
</tr>
<tr class="odd">
<td id="T_d11cross_row2_col0" class="data row2 col0">rung 4, sec. 11.9</td>
<td id="T_d11cross_row2_col1" class="data row2 col1">effective diffusivity D_e [m2/s], vs rung 3</td>
<td id="T_d11cross_row2_col2" class="data row2 col2">root</td>
<td id="T_d11cross_row2_col3" class="data row2 col3">2.266e-05</td>
<td id="T_d11cross_row2_col4" class="data row2 col4">NOT PRINTED for this catalyst</td>
<td id="T_d11cross_row2_col5" class="data row2 col5">22.7</td>
<td id="T_d11cross_row2_col6" class="data row2 col6">+1.0000</td>
</tr>
<tr class="even">
<td id="T_d11cross_row3_col0" class="data row3 col0">rung 5, sec. 11.7</td>
<td id="T_d11cross_row3_col1" class="data row3 col1">tube radius R_t [m]</td>
<td id="T_d11cross_row3_col2" class="data row3 col2">root</td>
<td id="T_d11cross_row3_col3" class="data row3 col3">0.01003</td>
<td id="T_d11cross_row3_col4" class="data row3 col4">0.0125 (this reactor)</td>
<td id="T_d11cross_row3_col5" class="data row3 col5">1.25</td>
<td id="T_d11cross_row3_col6" class="data row3 col6">-1.0016</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
ALL FOUR ROWS ARE ROOTS. At Pe_a = 0.2488 the rung-2 shift is +1.00000 %, and that
threshold carries the same certificate as the five rungs of the ladder table -
p0* = 0.01822291 atm with 414.98 C just below it and 415.02 C just above, a
0.041 K jump against the 1 K the control allows. So axial dispersion has to be
4.02 times stronger than the chapter's own lower limit before it moves the
threshold 1 %. The four refinements probed 84 interior points between them and,
with the sweep points, the control rejected 0 of all the thresholds the four scans used.

Read the 'factor away' column as a RANKING: it is how far each coefficient would
have to move from the chapter's own value before its rung shifted the threshold
1 %, so SMALL means the rung is close to not mattering.
   rung 5, sec. 11.7    factor    1.25   tube radius R_t [m]
   rung 2, sec. 11.6    factor    4.02   axial Peclet number Pe_a
   rung 3, sec. 11.8    factor    4.93   Wakao-Funazkri k_g and h_f, x
   rung 4, sec. 11.9    factor   22.66   effective diffusivity D_e [m2/s], vs rung 3

The ordering is DECIDABLE, all four of it: rung 5 is closest to irrelevance by a
wide margin, then rung 2 at 4.02, then rung 3 at 4.93, and rung 4 is furthest at
22.66. Rungs 2 and 3 are only 23 % apart, which is the honest caveat on THAT pair.

THE CONTROL'S VERDICT ALONG Pe_a, on a regular 0.001 grid:
   0.316 +0.7867 %  0.315 +0.7893 %  0.314 +0.7918 %  0.313 +0.7943 %  0.312 +0.7969 %  0.311 +0.7994 %  0.310 +0.8020 %  0.309 +0.8046 %  0.308 +0.8072 %
9 of 9 validate, and the shift rises monotonically as Pe_a falls.

WHAT THE WHOLE SWEEP REACHES, tail included:
   0.23 +1.0823 %  0.22 +1.1319 %  0.21 +1.1861 %  0.20 +1.2459 %  0.15 +1.6665 %  0.10 +2.5219 %
Across all 15 swept points the control validates 15, and the largest |shift| any
of them carries is 2.5219 % at Pe_a = 0.10. So a 2 % crossover for rung 2 is bracketable on
this sweep, and the break row that moves the crossover target moves it to 2 %.
What lies below Pe_a = 0.10 is not reported here.

AND THE DIGITS OF Pe_a* THAT MEAN ANYTHING. The refinement resolves the straddling
pair to 1.5e-07, but that is a TOLERANCE. The accuracy is set by the grid, and it is
measured under the SAME-GRID definition this table uses - which is the point, because
against a fixed extrapolated baseline the same comparison would carry rung 1's own
600-to-1200 movement instead of cancelling it. At Pe_a = 0.2400, a validated sweep point:
   n_z =   600   shift = +1.03699 %
   n_z =   900   shift = +1.03748 %
   n_z =  1200   shift = +1.03776 %
a spread of 0.0008 pp across a doubling of the grid. On the local slope of the
sweep, 0.0042 pp per 0.001 in Pe_a, that is Pe_a* = 0.2488 +/- 0.0002,
factor 4.019 +/- 0.003. Three figures on Pe_a*, not the six its refinement
tolerance would suggest - the same reading the tube radius gets below.

RUNG 5, THE ONE ROW WHOSE CROSSOVER IS INSIDE THIS REACTOR'S OWN RANGE. R_t* = 0.010029 m,
d_t/d_p = 6.686, where |shift| = 1.0016 %: a tube only 1.25x narrower than this
one - 10.03 mm rather than 12.5 mm - already brings the two-dimensional rung
inside 1 %. THE DIGITS THAT MEAN ANYTHING: the refinement resolves the bracket to
2.0 micrometres, but that is a TOLERANCE and not an accuracy. The accuracy is set
by the grid: this page's own (600, 10) and (1200, 20) values of the rung-5 shift differ by
0.107 pp, and the local slope of the sweep is 3.5 pp/mm, so R_t* = 10.029 +/- 0.030 mm,
d_t/d_p = 6.69 +/- 0.02, factor 1.246 +/- 0.004. Three figures on R_t*, not six.

AND ON TUBES NARROWER THAN THE CROSSOVER. On 6 radii below it the control validates
every threshold:
   9.80 mm -0.1688 %  9.75 mm +0.0151 %  9.70 mm +0.1999 %  9.60 mm +0.5721 %  9.40 mm +1.3268 %  9.00 mm +2.8786 %
The signed shift rises monotonically as the tube narrows (checked, not assumed) and
CHANGES SIGN between 9.80 mm (-0.1688 %) and 9.75 mm (+0.0151 %): the
two-dimensional correction is NEGATIVE on this tube and POSITIVE on a narrower one.
|shift| stays under 1 % from R_t* = 10.03 mm down to 9.60 mm, and is past 1 % again,
on the positive side, by 9.40 mm (+1.3268 %).

None of that contradicts section 11.7.3's own sentence, which reads, verbatim:
   "Even for this case, which is not particularly drastic, and with a small tube diameter of only 2.54 cm, the radial temperature gradients are severe, as seen from Fig. 11.7.3-2. The temperature in the axis is well above the mean."
That sentence is about the radial temperature GRADIENT and this measure is about the
runaway THRESHOLD: the gradient here is 8.0 K wall-to-axis while the threshold moves 8.8 %. Severe
gradients and a modest threshold shift are the same reactor.
The film sits a factor 4.9 away, which is why that rung's size depends
on which correlation you pick. The intraparticle rung is the one that is not
decidable from the chapter at all: the crossover D_e is 2.27e-05 m2/s,
and the chapter prints no D_e for this catalyst - it sends the reader to two
documents (Numerical values for De and lambda_e are given in Sa...).

AND ON A COARSE GRID. At n_z = 300, rung 4's own anchor point - its default
D_e = 1e-06 m2/s, the first point of that sweep - returns p0* = 0.0209224155 with
414.994 C just below it and 415.006 C just above: a clean crossing (True), so the
coarse-grid break row runs at 300 cells.

THE COST OF THE SHIFT DEFINITION, on the row where it is largest. Rung 1's 600-cell
threshold is 0.01804248 atm and its Richardson limit is 0.01800508, a gap of
+0.208 percentage points - a fifth of the 1 % target. The film row against the
same-grid baseline used above: 4.9304. Against the extrapolated baseline: 4.0824.
One definition, said once, in every row: the same-grid one, because it is what
cancels the discretisation between the two models being compared.

And the printed a_1 = (D_er)_s/(u_i d_p) inconsistency of page 574, measured.
The chapter says: "the computed results are not very sensitive with respect to Pemr, but very sensitive with respect to lambda_er and alpha_w"
   Pe_mr = 10 as this page reads the group : p0* shift -8.942 %
   Pe_mr = 20.2, the printed group read literally: p0* shift -8.581 %  (delta +0.361 %)
   lambda_er raised 5 %                          : p0* shift -7.152 %  (delta +1.790 %)
The chapter's sensitivity claim is confirmed on the threshold as well as on the
profiles, and it is WHY the epsilon in a_1 is invisible: a factor 1/eps = 2.02 in
radial mass dispersion costs 0.361 % where 5 % on lambda_er costs 1.790 %.
A printed group can be wrong by a void fraction and never be found, if the quantity
it multiplies is the one the model is insensitive to.</code></pre>
</div>
</div>
<div id="6056f8fb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:49:01.713685Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:49:01.713492Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:49:01.727603Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:49:01.726857Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ===== 8. the book's restatement of Froment (1967), against C2.10's reading ====</span></span>
<span id="cb46-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># C2.10 owns the 1967 case. Nothing of it is re-run here; its numbers are printed</span></span>
<span id="cb46-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># beside the book's restatement of them, and the two are reconciled.</span></span>
<span id="cb46-4">F67 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(F67_PAR.index, F67_PAR.value))</span>
<span id="cb46-5">rec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb46-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, bkey, f67key, factor <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (</span>
<span id="cb46-7">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_1/R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1_over_R_1173"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>),</span>
<span id="cb46-8">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_2/R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E2_over_R_1173"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>),</span>
<span id="cb46-9">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_3/R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E3_over_R_1173"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)):</span>
<span id="cb46-10">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_1/R"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_2/R"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_3/R"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E3"</span>}[lab]</span>
<span id="cb46-11">    rec.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(quantity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab, book_11_7_3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(bkey),</span>
<span id="cb46-12">                    from_C2_10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>F67[e] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_gas"</span>],</span>
<span id="cb46-13">                    ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(bkey) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (F67[e] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_gas"</span>])))</span>
<span id="cb46-14">rec.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(quantity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_1/R used in sec. 11.5.2"</span>, book_11_7_3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_E_over_R"</span>),</span>
<span id="cb46-15">                from_C2_10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_gas"</span>],</span>
<span id="cb46-16">                ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_E_over_R"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_gas"</span>])))</span>
<span id="cb46-17">REC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rec)</span>
<span id="cb46-18">show(REC.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11rec"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb46-19">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_11_7_3"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.1f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"from_C2_10"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb46-20">ER_INTERNAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_E_over_R"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1_over_R_1173"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb46-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"C2.10 establishes that the 1967 paper's own gas constant is"</span></span>
<span id="cb46-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'R_gas'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cal/(mol K), and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'E1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'R_gas'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ="</span></span>
<span id="cb46-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'E1'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'R_gas'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is what section 11.5.2 prints. Section 11.7.3, fourteen"</span></span>
<span id="cb46-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pages earlier in the same chapter and for the same reaction on the same catalyst,"</span></span>
<span id="cb46-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'E1_over_R_1173'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'E1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/1.987."</span></span>
<span id="cb46-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" THE CHAPTER PRINTS THE SAME ACTIVATION</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ENERGY TWO WAYS, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ER_INTERNAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb46-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" apart, and neither section mentions the other's value."</span>)</span>
<span id="cb46-28"></span>
<span id="cb46-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what section 11.5.2's "first approximation" actually is</span></span>
<span id="cb46-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> k_1967(T, i):</span>
<span id="cb46-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(F67[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"lnA</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F67[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"E</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_gas"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T))</span>
<span id="cb46-32"></span>
<span id="cb46-33"></span>
<span id="cb46-34">K1_HS, K3_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k_1967(T_HS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), k_1967(T_HS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb46-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH1"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5.2's heat of reaction is not C2.10's minus_dH1"</span></span>
<span id="cb46-36">K_1152_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kexp(T_HS)</span>
<span id="cb46-37">LUMP_DEFICIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_1152_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (K1_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K3_HS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb46-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And what the 'first approximation ... pseudo-first order' rate of section 11.5.2"</span></span>
<span id="cb46-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">IS, which the section does not say. At the rung-1 hot spot,"</span></span>
<span id="cb46-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" T = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C:"</span></span>
<span id="cb46-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   k of section 11.5.2      = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_1152_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb46-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   k_1 of section 11.7.3    = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K1_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     (o-xylene -&gt; phthalic anhydride)"</span></span>
<span id="cb46-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   k_3 of section 11.7.3    = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K3_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     (o-xylene -&gt; CO, CO2)"</span></span>
<span id="cb46-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   k_1 + k_3                = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K1_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>K3_HS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     (total o-xylene consumption)"</span></span>
<span id="cb46-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Section 11.5.2's single rate is k_1 alone to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(K_1152_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K1_HS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, not the"</span></span>
<span id="cb46-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" sum: it is the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rate of the WANTED reaction used as the rate of total consumption,"</span></span>
<span id="cb46-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>LUMP_DEFICIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % low.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Its heat of reaction, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'minus_dH'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/kmol, is"</span></span>
<span id="cb46-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" C2.10's minus_dH1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'minus_dH1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exactly, so the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">heat release is"</span></span>
<span id="cb46-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" understated by the same factor and the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F67[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'minus_dH3'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/kmol of the"</span></span>
<span id="cb46-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">combustion route is absent. The ladder's base case is therefore a consistent"</span></span>
<span id="cb46-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">single-reaction reactor, and NOT a conservative approximation to the three-"</span></span>
<span id="cb46-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reaction one - a point that matters for reading any of the shifts above as"</span></span>
<span id="cb46-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">advice about a real o-xylene reactor."</span>)</span>
<span id="cb46-54"></span>
<span id="cb46-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Finally, section 11.7.4's own one- versus two-dimensional comparison, book page"</span></span>
<span id="cb46-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 579:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv1d_claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb46-57">c210_2d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> F67_RES[F67_RES.quantity.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.contains(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"runaway"</span>, case<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, na<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)]</span>
<span id="cb46-58">show(c210_2d.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11c210"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>))</span>
<span id="cb46-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The book states </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_1d_1174'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C for the equivalent"</span></span>
<span id="cb46-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" one-dimensional model and"</span></span>
<span id="cb46-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'runaway_2d_1174'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' C for the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">two-dimensional one - a sharpened"</span></span>
<span id="cb46-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pair. C2.10 located both</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by bisection on the 1967"</span></span>
<span id="cb46-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" paper's own kinetics and reports them above. Read the two</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">together: the book turns a"</span></span>
<span id="cb46-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" range into a number. This page does not re-run that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">case, and its own rung-1/rung-5"</span></span>
<span id="cb46-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pair - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % in p0* on the pseudo-first-order</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">chemistry - is a different"</span></span>
<span id="cb46-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" measurement of the same effect, in the same direction."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11rec" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11rec_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">quantity</th>
<th id="T_d11rec_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">book_11_7_3</th>
<th id="T_d11rec_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">from_C2_10</th>
<th id="T_d11rec_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">ratio</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11rec_row0_col0" class="data row0 col0">E_1/R</td>
<td id="T_d11rec_row0_col1" class="data row0 col1">13588.0</td>
<td id="T_d11rec_row0_col2" class="data row0 col2">13636.36</td>
<td id="T_d11rec_row0_col3" class="data row0 col3">0.996453</td>
</tr>
<tr class="even">
<td id="T_d11rec_row1_col0" class="data row1 col0">E_2/R</td>
<td id="T_d11rec_row1_col1" class="data row1 col1">15803.0</td>
<td id="T_d11rec_row1_col2" class="data row1 col2">15858.59</td>
<td id="T_d11rec_row1_col3" class="data row1 col3">0.996495</td>
</tr>
<tr class="odd">
<td id="T_d11rec_row2_col0" class="data row2 col0">E_3/R</td>
<td id="T_d11rec_row2_col1" class="data row2 col1">14394.0</td>
<td id="T_d11rec_row2_col2" class="data row2 col2">14444.44</td>
<td id="T_d11rec_row2_col3" class="data row2 col3">0.996508</td>
</tr>
<tr class="even">
<td id="T_d11rec_row3_col0" class="data row3 col0">E_1/R used in sec. 11.5.2</td>
<td id="T_d11rec_row3_col1" class="data row3 col1">13636.0</td>
<td id="T_d11rec_row3_col2" class="data row3 col2">13636.36</td>
<td id="T_d11rec_row3_col3" class="data row3 col3">0.999973</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>C2.10 establishes that the 1967 paper's own gas constant is 1.98 cal/(mol K), and
27000/1.98 = 13636.4 is what section 11.5.2 prints. Section 11.7.3, fourteen
pages earlier in the same chapter and for the same reaction on the same catalyst,
prints 13,588, which is 27000/1.987. THE CHAPTER PRINTS THE SAME ACTIVATION
ENERGY TWO WAYS, +0.353 % apart, and neither section mentions the other's value.

And what the 'first approximation ... pseudo-first order' rate of section 11.5.2
IS, which the section does not say. At the rung-1 hot spot, T = 412.9 C:
   k of section 11.5.2      = 0.962370
   k_1 of section 11.7.3    = 0.961860     (o-xylene -&gt; phthalic anhydride)
   k_3 of section 11.7.3    = 0.124467     (o-xylene -&gt; CO, CO2)
   k_1 + k_3                = 1.086327     (total o-xylene consumption)
Section 11.5.2's single rate is k_1 alone to 5.3e-04, not the sum: it is the
rate of the WANTED reaction used as the rate of total consumption, -11.4 % low.
Its heat of reaction, 307,000 kcal/kmol, is C2.10's minus_dH1 = 307000 exactly, so the
heat release is understated by the same factor and the 1090000 kcal/kmol of the
combustion route is absent. The ladder's base case is therefore a consistent
single-reaction reactor, and NOT a conservative approximation to the three-
reaction one - a point that matters for reading any of the shifts above as
advice about a real o-xylene reactor.

Finally, section 11.7.4's own one- versus two-dimensional comparison, book page 579:
   "The two-dimensional model predicts runaway at an inlet temperature of less than 360 C, the equivalent one-dimensional model at 365 C. The discrepancy between the predictions of both models grows as the conditions become more severe."</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11c210" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11c210_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">quantity</th>
<th id="T_d11c210_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">value</th>
<th id="T_d11c210_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">unit</th>
<th id="T_d11c210_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">model</th>
<th id="T_d11c210_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">qualifier</th>
<th id="T_d11c210_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">printed_where</th>
<th id="T_d11c210_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">statement</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11c210_row0_col0" class="data row0 col0">runaway_limit_2d</td>
<td id="T_d11c210_row0_col1" class="data row0 col1">360.000000</td>
<td id="T_d11c210_row0_col2" class="data row0 col2">degC</td>
<td id="T_d11c210_row0_col3" class="data row0 col3">2D</td>
<td id="T_d11c210_row0_col4" class="data row0 col4">runs away at</td>
<td id="T_d11c210_row0_col5" class="data row0 col5">p. 25</td>
<td id="T_d11c210_row0_col6" class="data row0 col6">'The temperature rise goes out of control' (p. 25) when the inlet is raised from 357 by 3 degC; p. 26 (col 2): 'The two-dimensional model predicts a runaway of the reactor for an inlet temperature of 360 degC'</td>
</tr>
<tr class="even">
<td id="T_d11c210_row1_col0" class="data row1 col0">runaway_limit_1d</td>
<td id="T_d11c210_row1_col1" class="data row1 col1">365.000000</td>
<td id="T_d11c210_row1_col2" class="data row1 col2">degC</td>
<td id="T_d11c210_row1_col3" class="data row1 col3">1D</td>
<td id="T_d11c210_row1_col4" class="data row1 col4">now found to be</td>
<td id="T_d11c210_row1_col5" class="data row1 col5">p. 26</td>
<td id="T_d11c210_row1_col6" class="data row1 col6">'The runaway temperature is now found to be 365 degC' (U = 82.7)</td>
</tr>
<tr class="odd">
<td id="T_d11c210_row2_col0" class="data row2 col0">runaway_gap</td>
<td id="T_d11c210_row2_col1" class="data row2 col1">5.000000</td>
<td id="T_d11c210_row2_col2" class="data row2 col2">degC</td>
<td id="T_d11c210_row2_col3" class="data row2 col3">1D vs 2D</td>
<td id="T_d11c210_row2_col4" class="data row2 col4">within</td>
<td id="T_d11c210_row2_col5" class="data row2 col5">p. 26</td>
<td id="T_d11c210_row2_col6" class="data row2 col6">'the prediction of the runaway limit within five degrees of the two-dimensional model has to be considered excellent'</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The book states 365 C for the equivalent one-dimensional model and 'less than 360' C for the
two-dimensional one - a sharpened pair. C2.10 located both
by bisection on the 1967 paper's own kinetics and reports them above. Read the two
together: the book turns a range into a number. This page does not re-run that
case, and its own rung-1/rung-5 pair - -8.84 % in p0* on the pseudo-first-order
chemistry - is a different measurement of the same effect, in the same direction.</code></pre>
</div>
</div>
<div id="59342ad5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:49:01.730034Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:49:01.729908Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:50:42.805154Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:50:42.804175Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb49-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ============== defect injection: every metric needs a row that moves it ======</span></span>
<span id="cb49-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The helpers below are the ONLY route to each baseline metric, so a row that</span></span>
<span id="cb49-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># perturbs a helper's argument provably reaches the code that produced the number.</span></span>
<span id="cb49-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Each helper's default call is asserted against the baseline computed above.</span></span>
<span id="cb49-5"></span>
<span id="cb49-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_ex1151a(dp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Calls the SAME f_ergun / f_hicks / dP the table above was built from, so a</span></span>
<span id="cb49-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    row that perturbs dp, a or b provably reaches the reported numbers."""</span></span>
<span id="cb49-9">    dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dp <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> dp</span>
<span id="cb49-10">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_a"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> a</span>
<span id="cb49-11">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ergun_b"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> b</span>
<span id="cb49-12">    fe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_ergun(dp, a, b)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb49-13">    fm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_ergun(dp, bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_a"</span>), bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_b"</span>))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb49-14">    fh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_hicks(dp)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb49-15">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(Ergun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dP(fe, dp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_ergun"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-16">             McD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dP(fm, dp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_mcdonald"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-17">             Hicks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dP(fh, dp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_dp_hicks"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-18">    ridx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb49-19">        Ergun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb49-20">            a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_ergun"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span>),</span>
<span id="cb49-21">        McD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb49-22">            bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mcdonald_b"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R)</span>
<span id="cb49-23">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_mcdonald"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span>),</span>
<span id="cb49-24">        Hicks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R: bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_coefficient"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> bk(</span>
<span id="cb49-25">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_exponent_eps"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hicks_exponent_Re"</span>)</span>
<span id="cb49-26">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_f_hicks"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span>))</span>
<span id="cb49-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ex1151a_worst_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d.values()),</span>
<span id="cb49-28">                dp_definition_cost<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(dP(f_ergun(DP_SV, a, b)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], DP_SV)</span>
<span id="cb49-29">                                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dP(f_ergun(DP_ROUNDED, a, b)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], DP_ROUNDED)</span>
<span id="cb49-30">                                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb49-31">                re_implied_spread<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ridx.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(ridx.values()))</span>
<span id="cb49-32"></span>
<span id="cb49-33"></span>
<span id="cb49-34"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_units(p_B0_book<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, atm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-35">    p_B0_book <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen_pressure"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p_B0_book <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p_B0_book</span>
<span id="cb49-36">    atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ATM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> atm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> atm</span>
<span id="cb49-37">    worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p_B0_book <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> atm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb49-38">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_of_reaction"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-39">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_lower"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_upper"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_mean"</span>):</span>
<span id="cb49-40">        o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> q)].value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-41">        worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_625"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> atm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-42">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(VWF_EX[(VWF_EX.example <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (VWF_EX.quantity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_critical"</span>)].value.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(conversion_worst_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>worst,</span>
<span id="cb49-44">                backint_residual<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_backint_625"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> atm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-45"></span>
<span id="cb49-46"></span>
<span id="cb49-47"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_groups(cp_vol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, minus_dH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, p_B0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-48">    cp_vol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_vol"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cp_vol <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> cp_vol</span>
<span id="cb49-49">    minus_dH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> minus_dH <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> minus_dH</span>
<span id="cb49-50">    p_B0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p_B0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p_B0</span>
<span id="cb49-51">    Bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minus_dH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p_B0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cp_vol</span>
<span id="cb49-52">    Ac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_t"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p_B0</span>
<span id="cb49-53">    cps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [cp_vol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>],</span>
<span id="cb49-54">           minus_dH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p_B0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>],</span>
<span id="cb49-55">           PE_HR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_ER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (G_FLUX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P),</span>
<span id="cb49-56">           F67_PAR.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL]</span>
<span id="cb49-57">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(group_B_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-58">                group_A_printed_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_A"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-59">                cp_printed_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(cps)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"specific_heat"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-60">                cp_route_spread<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(cps) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(cps) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-61"></span>
<span id="cb49-62"></span>
<span id="cb49-63"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_equiv1d(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, alpha_w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, lam_er<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-64">    R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R_T <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> R <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> R</span>
<span id="cb49-65">    alpha_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ALPHA_W <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> alpha_w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> alpha_w</span>
<span id="cb49-66">    lam_er <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> LAM_ER <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lam_er <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> lam_er</span>
<span id="cb49-67">    ai <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> alpha_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_er))</span>
<span id="cb49-68">    ai_printed_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> alpha_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_er))</span>
<span id="cb49-69">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># U_from_2d_dev lands at machine zero - the book's 0.096 IS eq. (11.7.4-1) at</span></span>
<span id="cb49-70">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R_t = 0.0125 m to every digit it prints - so it is registered as a bound.  The</span></span>
<span id="cb49-71">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># companion is the same identity evaluated at the radius the printed tube</span></span>
<span id="cb49-72">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># diameter implies, a value well away from zero.</span></span>
<span id="cb49-73">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(U_from_2d_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ai <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overall_U"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-74">                U_from_2d_dev_at_printed_radius<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ai_printed_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overall_U"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-75"></span>
<span id="cb49-76"></span>
<span id="cb49-77"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_tables(Q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, dT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, Q1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, TM1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, atm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-78">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 11.5.3.A-1 and A-2, INCLUDING the cross-column test that a row-by-row</span></span>
<span id="cb49-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    transcription check cannot do: dT_ad = (B/A) p0 ties the two columns of A-2</span></span>
<span id="cb49-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    together, so A, B and the atm factor are arguments a break row can move."""</span></span>
<span id="cb49-81">    Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_625"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> Q</span>
<span id="cb49-82">    dT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dT_625"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dT <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> dT</span>
<span id="cb49-83">    Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_635"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Q1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> Q1</span>
<span id="cb49-84">    DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_TM_635"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> TM1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> TM1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">635.0</span></span>
<span id="cb49-85">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_A"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> A <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> A</span>
<span id="cb49-86">    B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_B"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> B <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> B</span>
<span id="cb49-87">    atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ATM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> atm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> atm</span>
<span id="cb49-88">    w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_635"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb49-89">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_635"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb49-90">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_mean_635"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-91">    boa, devs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A, []</span>
<span id="cb49-92">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pk, dk, form <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_lower_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_lower_625"</span>,</span>
<span id="cb49-93">                          <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: dT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb49-94">                         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_upper_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_625"</span>,</span>
<span id="cb49-95">                          <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: dT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb49-96">                         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_p0_mean_625"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_mean_625"</span>,</span>
<span id="cb49-97">                          <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: dT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))):</span>
<span id="cb49-98">        needed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(pk) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> atm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> boa</span>
<span id="cb49-99">        devs.append((bk(dk) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> needed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, needed, form))</span>
<span id="cb49-100">    q_imp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: devs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>](q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> devs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb49-101">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table2_upper_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dTad_upper_625"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (dT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb49-102">                table1_worst_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>w,</span>
<span id="cb49-103">                table2_dTad_worst_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> devs),</span>
<span id="cb49-104">                table2_Q_implied_by_p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>q_imp)</span>
<span id="cb49-105"></span>
<span id="cb49-106"></span>
<span id="cb49-107"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_eta(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, eta_col<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-108">    n_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">256</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n_r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> n_r</span>
<span id="cb49-109">    phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PHI_HS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> phi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> phi</span>
<span id="cb49-110">    nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> nu                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># another nu injects a wrong geometry</span></span>
<span id="cb49-111">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pellet(RX, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu).solve(THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P_HS, T_HS)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta"</span>]</span>
<span id="cb49-112">    ana <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eta_sphere(phi)</span>
<span id="cb49-113">    col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SPH.eta.values <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> eta_col <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> eta_col</span>
<span id="cb49-114">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eta_grid_vs_11_9_1_11<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ana <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb49-115">                eta_vs_B11_worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_sphere(SPH.phi.values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()))</span>
<span id="cb49-116"></span>
<span id="cb49-117"></span>
<span id="cb49-118"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_shifts(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb49-119">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the four rung-to-rung shifts, on the coarse grid the break table uses"""</span></span>
<span id="cb49-120">    ceiling <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_PERM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ceiling <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ceiling</span>
<span id="cb49-121">    base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kw.items()</span>
<span id="cb49-122">                                                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_r"</span>)}),</span>
<span id="cb49-123">                       ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling)</span>
<span id="cb49-124">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-125">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, key, hi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung3_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>),</span>
<span id="cb49-126">                       (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung4_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung5_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>)):</span>
<span id="cb49-127">        allowed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kw.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> Ladder.<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>.__code__.co_varnames}</span>
<span id="cb49-128">        lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>allowed)</span>
<span id="cb49-129">        out[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(lad, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-130">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-131"></span>
<span id="cb49-132"></span>
<span id="cb49-133"></span>
<span id="cb49-134"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_rung1(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NS_RUNG1, extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, ratio_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-135">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""rung 1's seven metrics, from THE SAME `rung1_chain` call the Validation cell</span></span>
<span id="cb49-136"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    displayed - the default call is memoised, so these are the displayed numbers</span></span>
<span id="cb49-137"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    themselves rather than a second, coarser computation of them.  A row that</span></span>
<span id="cb49-138"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    perturbs R or the ceiling re-runs the full chain.  `extrapolate=False` compares</span></span>
<span id="cb49-139"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the finest grid with the ODE route instead of the Richardson limit (so the</span></span>
<span id="cb49-140"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    finest grid is also the limit the order-fit guard measures against), and</span></span>
<span id="cb49-141"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `ratio_read` fits the orders with the grid ratio misread; both reuse the chain."""</span></span>
<span id="cb49-142">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rung1_chain(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling, ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ns)</span>
<span id="cb49-143">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>])</span>
<span id="cb49-144">    tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table"</span>]</span>
<span id="cb49-145">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> extrapolate:</span>
<span id="cb49-146">        m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_p0_star_extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab.p0_star.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb49-147">        m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_p0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab.p0_star.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_ode"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-148">        m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_T"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab.T_hot.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_ode"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-149">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the guard measured against the limit in use, which is now the finest grid</span></span>
<span id="cb49-150">        m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_finest_err_over_start_floor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb49-151">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab.p0_star.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_p0_star_extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> START_FLOOR</span>
<span id="cb49-152">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ratio_read <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb49-153">        ns_read <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [ns[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ratio_read <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ns))]</span>
<span id="cb49-154">        m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_p0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(tab.p0_star, ns_read)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb49-155">        m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_T"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(tab.T_hot, ns_read)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb49-156">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m</span>
<span id="cb49-157"></span>
<span id="cb49-158"></span>
<span id="cb49-159"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_units_model(p_B0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, p_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-160">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""What section 11.5.2's sensitivity sentence gives on a stated reading of its</span></span>
<span id="cb49-161"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    own pressure unit.  Grid-free (Radau) on both readings, so a break row that</span></span>
<span id="cb49-162"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    flips the reading moves ONLY the parameter set."""</span></span>
<span id="cb49-163">    p_B0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen_pressure"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p_B0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p_B0</span>
<span id="cb49-164">    p_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"total_pressure"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p_t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p_t</span>
<span id="cb49-165">    ceiling <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_PERM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ceiling <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ceiling</span>
<span id="cb49-166">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unit_reading(p_B0, p_t, ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ceiling)</span>
<span id="cb49-167">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(p0_star_bar_reading_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>u[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0_BOOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-168">                T_hot_0018_bar_reading_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>u[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_at_book_p0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>)</span>
<span id="cb49-169"></span>
<span id="cb49-170"></span>
<span id="cb49-171">_H_CROSS_DIAG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (target, n_z) -&gt; the three cross_scan() dicts, kept rather</span></span>
<span id="cb49-172">                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># than discarded, so a break-row scan's own refinement can be</span></span>
<span id="cb49-173">                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># inspected the same way the reported rows' is - see the</span></span>
<span id="cb49-174">                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break-row-scan diagnostics printed after BREAKS below.</span></span>
<span id="cb49-175"></span>
<span id="cb49-176"></span>
<span id="cb49-177"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_cross(target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>):</span>
<span id="cb49-178">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The three one-dimensional crossover rows, from the same CONTROLLED SCAN as</span></span>
<span id="cb49-179"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the display cell: same sweeps, same same-grid baseline, same bisection, so the</span></span>
<span id="cb49-180"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    two are identical by construction at the default arguments and are asserted so.</span></span>
<span id="cb49-181"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    A row that moves the target or the grid re-runs the whole scan, control and all;</span></span>
<span id="cb49-182"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    a scan that cannot straddle its target between two validated points RAISES</span></span>
<span id="cb49-183"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    rather than falling back on a bound, so no row can report an edge as an answer."""</span></span>
<span id="cb49-184">    target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TARGET <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> target <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> target</span>
<span id="cb49-185">    base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z))</span>
<span id="cb49-186">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sh(lad, b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-187">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(lad, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (base <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-188">    pe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: sh(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p)),</span>
<span id="cb49-189">                    PE_SWEEP, target)</span>
<span id="cb49-190">    fs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> f: sh(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f)),</span>
<span id="cb49-191">                    FILM_SWEEP, target)</span>
<span id="cb49-192">    b3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z))       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rung 4's own baseline</span></span>
<span id="cb49-193">    de <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: sh(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, D_e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d), b3), DE_SWEEP, target)</span>
<span id="cb49-194">    _H_CROSS_DIAG[(target, n_z)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pe<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pe, fs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fs, de<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>de)</span>
<span id="cb49-195">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(crossover_pe_axial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pe[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>], crossover_film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fs[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>],</span>
<span id="cb49-196">                crossover_D_e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>de[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb49-197"></span>
<span id="cb49-198"></span>
<span id="cb49-199"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_cross_R(target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>):</span>
<span id="cb49-200">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The tube-radius crossover, on the same sweep and the same grids as the</span></span>
<span id="cb49-201"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    display cell.  Memoised there, so a default call costs nothing twice; each</span></span>
<span id="cb49-202"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    evaluation is two full threshold bisections, one of them two-dimensional, which</span></span>
<span id="cb49-203"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    is what limits the refinement to four levels of the straddling pair - a</span></span>
<span id="cb49-204"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    TOLERANCE of a couple of micrometres against a grid-set ACCURACY of some</span></span>
<span id="cb49-205"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    3e-5 m, both printed above."""</span></span>
<span id="cb49-206">    target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TARGET <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> target <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> target</span>
<span id="cb49-207">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(crossover_R_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cross_R(target, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb49-208"></span>
<span id="cb49-209"></span>
<span id="cb49-210"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_film_dt(film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, n_r_pellet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-211">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The three film/pellet temperature differences and Mears' margin, recomputed</span></span>
<span id="cb49-212"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    from the same solves the Validation cells displayed.</span></span>
<span id="cb49-213"></span>
<span id="cb49-214"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    They are covered by the film-scale and coarse-pellet rows."""</span></span>
<span id="cb49-215">    fs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> film_scale <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> film_scale</span>
<span id="cb49-216">    n_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n_r_pellet <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> n_r_pellet</span>
<span id="cb49-217">    lad3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_Z, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_R, film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fs)</span>
<span id="cb49-218">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># AT RUNG 3'S OWN THRESHOLD, recomputed for the film coefficients in force -</span></span>
<span id="cb49-219">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which is what the displayed number means, and what makes the helper safe to</span></span>
<span id="cb49-220">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># perturb: at HALVED film coefficients the unperturbed threshold is past this</span></span>
<span id="cb49-221">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># model's own, and the Newton diverges there rather than returning a number.</span></span>
<span id="cb49-222">    hot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_robust(lad3, p0_critical(lad3, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HI[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]))</span>
<span id="cb49-223">    dt_hot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(hot[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hot[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb49-224">    start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_robust(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_Z, T_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"startup_T0_1182"</span>),</span>
<span id="cb49-225">                                film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fs), P0_REF)</span>
<span id="cb49-226">    dt_start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(start[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> start[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb49-227">    pdt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pellet(RX, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_p, isothermal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).solve(THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P_HS, T_HS)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_centre"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_HS</span>
<span id="cb49-228">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(start[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb49-229">    r_obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kexp(start[i, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> start[i, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span></span>
<span id="cb49-230">    chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus_dH"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KCAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_P</span>
<span id="cb49-231">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> film(RX, fs)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h_f"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> start[i, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb49-232">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(film_dT_at_hotspot_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dt_hot, film_dT_at_startup_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dt_start,</span>
<span id="cb49-233">                film_dT_over_pellet_dT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dt_hot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pdt,</span>
<span id="cb49-234">                mears_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mears_constant"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> start[i, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> chi)</span>
<span id="cb49-235"></span>
<span id="cb49-236"></span>
<span id="cb49-237"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_control(p0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-238">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The crossing control on the five ladder rungs, as the Validation cell ran it:</span></span>
<span id="cb49-239"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    each rung's own threshold, solved either side from the branch state its own</span></span>
<span id="cb49-240"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    bisection stored.  `p0s` hands each rung a different threshold, which is how a</span></span>
<span id="cb49-241"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    break row tests that the control rejects one that is not the rung's own."""</span></span>
<span id="cb49-242">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p0s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb49-243">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS:</span>
<span id="cb49-244">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(LAD[r].branch[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P0S[r] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, (</span>
<span id="cb49-245">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rung </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: the stored branch state is not at this rung's threshold"</span>)</span>
<span id="cb49-246">    p0s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P0S <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p0s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p0s</span>
<span id="cb49-247">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [crossing_control(LAD[r], p0s[r], guess<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAD[r].branch[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS]</span>
<span id="cb49-248">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ladder_controls_rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> out <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ok))</span>
<span id="cb49-249"></span>
<span id="cb49-250"></span>
<span id="cb49-251">PE_FINE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.arange(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.316</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3075</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb49-252"></span>
<span id="cb49-253"></span>
<span id="cb49-254"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_rejections(jump<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-255">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The two rejection counts, recomputed over the ladder's five controls and the</span></span>
<span id="cb49-256"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    9-point fine Pe_a grid of the crossover cell, with the control's jump allowance</span></span>
<span id="cb49-257"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    as an argument.  The page-wide counts cover more thresholds than this; a row</span></span>
<span id="cb49-258"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    that injects a defect here recomputes what it can afford, and the counts it</span></span>
<span id="cb49-259"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    returns are rejections that defect produces.  CTL_STATS is restored, so a break</span></span>
<span id="cb49-260"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    row does not leak into the page-wide count."""</span></span>
<span id="cb49-261">    saved <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(CTL_STATS)</span>
<span id="cb49-262">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb49-263">        lad_rej <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS</span>
<span id="cb49-264">                      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> crossing_control(LAD[r], P0S[r], guess<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAD[r].branch[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb49-265">                                              jump<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>jump)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb49-266">        grid_rej <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PE_FINE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _shift_or_none(</span>
<span id="cb49-267">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x),</span>
<span id="cb49-268">                                           hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>, jump<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>jump) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BASE600 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), p)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb49-269">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">finally</span>:</span>
<span id="cb49-270">        CTL_STATS.clear()</span>
<span id="cb49-271">        CTL_STATS.update(saved)</span>
<span id="cb49-272">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(scan_points_rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>grid_rej, thresholds_rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lad_rej <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> grid_rej)</span>
<span id="cb49-273"></span>
<span id="cb49-274"></span>
<span id="cb49-275"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h_chapter_internal(E_over_R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, E1_1173<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb49-276">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The two chapter-against-itself numbers.  Both hang on the same printed</span></span>
<span id="cb49-277"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    constant - section 11.5.2's own E/R - which is why one row moves both, and</span></span>
<span id="cb49-278"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    they were the other two agreement.json entries with no helper at all."""</span></span>
<span id="cb49-279">    a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> E_over_R <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> E_over_R</span>
<span id="cb49-280">    e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1_over_R_1173"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> E1_1173 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> E1_1173</span>
<span id="cb49-281">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.clip(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T_HS, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)))</span>
<span id="cb49-282">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(E_over_R_internal_dev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-283">                lump_deficit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (K1_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K3_HS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-284"></span>
<span id="cb49-285"></span>
<span id="cb49-286">BASE_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-287">BASE_M.update(h_ex1151a())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_units())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_groups())</span>
<span id="cb49-288">BASE_M.update(h_equiv1d())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_tables())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_eta())</span>
<span id="cb49-289">BASE_M.update(h_rung1())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_cross())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_cross_R())</span>
<span id="cb49-290">BASE_M.update(h_units_model())</span>
<span id="cb49-291">BASE_M.update(h_film_dt())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_chapter_internal())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BASE_M.update(h_control())</span>
<span id="cb49-292">BASE_M.update(h_rejections())</span>
<span id="cb49-293">BASE_SHIFTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> h_shifts()</span>
<span id="cb49-294">BASE_M.update(BASE_SHIFTS)</span>
<span id="cb49-295"></span>
<span id="cb49-296"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the four shifts at BOTH resolutions, so the coarse ones are reported too ----</span></span>
<span id="cb49-297">SH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r,</span>
<span id="cb49-298">                        displayed_n_z_1200_n_r_20<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SHIFT[r],</span>
<span id="cb49-299">                        break_rows_n_z_600_n_r_10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE_SHIFTS[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"shift_rung</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_pct"</span>],</span>
<span id="cb49-300">                        gap_pp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE_SHIFTS[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"shift_rung</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SHIFT[r])</span>
<span id="cb49-301">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)])</span>
<span id="cb49-302">show(SH.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11shiftgrid"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb49-303">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"displayed_n_z_1200_n_r_20"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break_rows_n_z_600_n_r_10"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb49-304">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap_pp"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb49-305">SHIFT_GRID_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.gap_pp.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb49-306"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"agreement.json carries the RIGHT-HAND column, because every break row that"</span></span>
<span id="cb49-307">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" touches a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">shift has to re-run it. The gap to the displayed values is at most"</span></span>
<span id="cb49-308">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHIFT_GRID_GAP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> percentage</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">points, and it is printed here rather than left to"</span></span>
<span id="cb49-309">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" be discovered. Rung 5's row is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the reason rung 5's threshold is called unrefined"</span></span>
<span id="cb49-310">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" above.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb49-311"></span>
<span id="cb49-312"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the helpers ARE the route to the reported numbers, asserted rather than asserted-to</span></span>
<span id="cb49-313">_R1M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>]</span>
<span id="cb49-314"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ONE list, used BOTH to check each helper against its printed number and to check</span></span>
<span id="cb49-315"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># that no metric escapes the check.  Written once, so "checked as a set" cannot</span></span>
<span id="cb49-316"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># drift between two copies.</span></span>
<span id="cb49-317">_ASSERTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ex1151a_worst_dev"</span>, EX1151A_WORST),</span>
<span id="cb49-318">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dp_definition_cost"</span>, DP_DEFINITION_COST),</span>
<span id="cb49-319">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_implied_spread"</span>, RE_IMPLIED_SPREAD),</span>
<span id="cb49-320">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion_worst_dev"</span>, CONV_WORST),</span>
<span id="cb49-321">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backint_residual"</span>, BACKINT_RESIDUAL),</span>
<span id="cb49-322">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"group_B_dev"</span>, B_PRINTED_DEV),</span>
<span id="cb49-323">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"group_A_printed_dev"</span>, A_PRINTED_DEV),</span>
<span id="cb49-324">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_printed_dev"</span>, CP_PRINTED_DEV),</span>
<span id="cb49-325">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_route_spread"</span>, CP_SPREAD),</span>
<span id="cb49-326">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U_from_2d_dev"</span>, U_FROM_2D_DEV),</span>
<span id="cb49-327">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U_from_2d_dev_at_printed_radius"</span>, U_PRINTED_R_DEV),</span>
<span id="cb49-328">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2_upper_ratio"</span>, T2_UPPER_RATIO),</span>
<span id="cb49-329">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_worst_dev"</span>, T1_WORST),</span>
<span id="cb49-330">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2_dTad_worst_dev"</span>, T2_DTAD_WORST_DEV),</span>
<span id="cb49-331">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2_Q_implied_by_p0"</span>, T2_Q_IMPLIED),</span>
<span id="cb49-332">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_grid_vs_11_9_1_11"</span>, ETA_DEV),</span>
<span id="cb49-333">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_vs_B11_worst"</span>, B11_DEV),</span>
<span id="cb49-334">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_pe_axial"</span>, PE_STAR),</span>
<span id="cb49-335">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_film_scale"</span>, FILM_STAR),</span>
<span id="cb49-336">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_D_e"</span>, DE_STAR),</span>
<span id="cb49-337">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_R_t"</span>, R_STAR),</span>
<span id="cb49-338">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star_bar_reading_dev"</span>, P0_STAR_BAR_DEV),</span>
<span id="cb49-339">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_hot_0018_bar_reading_C"</span>, T_0018_BAR_C),</span>
<span id="cb49-340">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_p0_star_extrapolated"</span>, _R1M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_p0_star_extrapolated"</span>]),</span>
<span id="cb49-341">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_p0"</span>, _R1M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_p0"</span>]),</span>
<span id="cb49-342">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_T"</span>, _R1M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_T"</span>]),</span>
<span id="cb49-343">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_p0"</span>, _R1M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_p0"</span>]),</span>
<span id="cb49-344">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_T"</span>, _R1M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_T"</span>]),</span>
<span id="cb49-345">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star_vs_printed_0018"</span>, _R1M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p0_star_vs_printed_0018"</span>]),</span>
<span id="cb49-346">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_finest_err_over_start_floor"</span>, R1_FINEST_OVER_FLOOR),</span>
<span id="cb49-347">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>, SH.break_rows_n_z_600_n_r_10.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb49-348">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung3_pct"</span>, SH.break_rows_n_z_600_n_r_10.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb49-349">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung4_pct"</span>, SH.break_rows_n_z_600_n_r_10.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb49-350">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung5_pct"</span>, SH.break_rows_n_z_600_n_r_10.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]),</span>
<span id="cb49-351">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_dT_at_hotspot_K"</span>, FILM_DT_HS),</span>
<span id="cb49-352">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_dT_at_startup_K"</span>, DT_FILM_1182),</span>
<span id="cb49-353">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_dT_over_pellet_dT"</span>, FILM_DT_HS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PELLET_DT),</span>
<span id="cb49-354">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mears_margin"</span>, MEARS_RHS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CHI),</span>
<span id="cb49-355">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_over_R_internal_dev"</span>, ER_INTERNAL),</span>
<span id="cb49-356">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lump_deficit"</span>, LUMP_DEFICIT),</span>
<span id="cb49-357">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder_controls_rejected"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>CTL.crossing).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())),</span>
<span id="cb49-358">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scan_points_rejected"</span>, SCAN_REFUSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_UNIFORM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> UNIFORM_OK)),</span>
<span id="cb49-359">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thresholds_rejected"</span>, CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rejected"</span>]))</span>
<span id="cb49-360">_MISMATCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(k, BASE_M[k], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(live)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, live <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ASSERTED</span>
<span id="cb49-361">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BASE_M[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> live) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(live))]</span>
<span id="cb49-362"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _MISMATCH, (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a helper does not reproduce the number reported above, so a "</span></span>
<span id="cb49-363">                       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break row perturbing it would not reach that number: "</span></span>
<span id="cb49-364">                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(_MISMATCH))</span>
<span id="cb49-365">_UNASSERTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(BASE_M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> {k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ASSERTED})</span>
<span id="cb49-366"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _UNASSERTED, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"helper metrics not asserted against a printed number: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_UNASSERTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-367"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ALL </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BASE_M)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> helper metrics are asserted equal, to 1e-12, to a number"</span></span>
<span id="cb49-368">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed earlier in</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this notebook - none excepted. For the seven rung-1 metrics the"</span></span>
<span id="cb49-369">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" assertion is an</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">identity: the Validation cell displayed this helper's own return"</span></span>
<span id="cb49-370">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" value."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11shiftgrid" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11shiftgrid_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">rung</th>
<th id="T_d11shiftgrid_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">displayed_n_z_1200_n_r_20</th>
<th id="T_d11shiftgrid_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">break_rows_n_z_600_n_r_10</th>
<th id="T_d11shiftgrid_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">gap_pp</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11shiftgrid_row0_col0" class="data row0 col0">2</td>
<td id="T_d11shiftgrid_row0_col1" class="data row0 col1">+0.1660</td>
<td id="T_d11shiftgrid_row0_col2" class="data row0 col2">+0.1657</td>
<td id="T_d11shiftgrid_row0_col3" class="data row0 col3">-0.0004</td>
</tr>
<tr class="even">
<td id="T_d11shiftgrid_row1_col0" class="data row1 col0">3</td>
<td id="T_d11shiftgrid_row1_col1" class="data row1 col1">-4.7408</td>
<td id="T_d11shiftgrid_row1_col2" class="data row1 col2">-4.7443</td>
<td id="T_d11shiftgrid_row1_col3" class="data row1 col3">-0.0034</td>
</tr>
<tr class="odd">
<td id="T_d11shiftgrid_row2_col0" class="data row2 col0">4</td>
<td id="T_d11shiftgrid_row2_col1" class="data row2 col1">+15.6711</td>
<td id="T_d11shiftgrid_row2_col2" class="data row2 col2">+15.6884</td>
<td id="T_d11shiftgrid_row2_col3" class="data row2 col3">+0.0173</td>
</tr>
<tr class="even">
<td id="T_d11shiftgrid_row3_col0" class="data row3 col0">5</td>
<td id="T_d11shiftgrid_row3_col1" class="data row3 col1">-8.8352</td>
<td id="T_d11shiftgrid_row3_col2" class="data row3 col2">-8.9419</td>
<td id="T_d11shiftgrid_row3_col3" class="data row3 col3">-0.1067</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>agreement.json carries the RIGHT-HAND column, because every break row that touches a
shift has to re-run it. The gap to the displayed values is at most 0.107 percentage
points, and it is printed here rather than left to be discovered. Rung 5's row is
the reason rung 5's threshold is called unrefined above.

ALL 43 helper metrics are asserted equal, to 1e-12, to a number printed earlier in
this notebook - none excepted. For the seven rung-1 metrics the assertion is an
identity: the Validation cell displayed this helper's own return value.</code></pre>
</div>
</div>
<div id="fc5faf74" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:50:42.807759Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:50:42.807617Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:59:20.982531Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:59:20.981659Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb51-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------- the break rows ---------------------------------</span></span>
<span id="cb51-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> misread(key, swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, digit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb51-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A printed number misread: the characters at `swap` and `swap + 1` of its</span></span>
<span id="cb51-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    printed string transposed, or one digit read as another."""</span></span>
<span id="cb51-5">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bk(key, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>)</span>
<span id="cb51-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> swap <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb51-7">        t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[:swap] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t[swap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t[swap] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t[swap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:]</span>
<span id="cb51-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb51-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> t.count(digit[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, t</span>
<span id="cb51-10">        t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t.replace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>digit)</span>
<span id="cb51-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> bk(key), (key, t)</span>
<span id="cb51-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t)</span>
<span id="cb51-13"></span>
<span id="cb51-14"></span>
<span id="cb51-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_dp_definition():</span>
<span id="cb51-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Example 11.5.1.A's d_p read as eq. (11.5.1-9) defines it, 6 V/S = d."""</span></span>
<span id="cb51-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_ex1151a(dp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>DP_SV)</span>
<span id="cb51-18"></span>
<span id="cb51-19"></span>
<span id="cb51-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_ergun_refit():</span>
<span id="cb51-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A1.1's refit of Ergun's own 244 markers, k1 = 151.9, k2 = 1.697."""</span></span>
<span id="cb51-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_ex1151a(a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k2_refit_all_points"</span>], b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k1_refit_all_points"</span>])</span>
<span id="cb51-23"></span>
<span id="cb51-24"></span>
<span id="cb51-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_atm_factor():</span>
<span id="cb51-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the atm-to-bar factor set to 1, i.e. 11.5.2 read as a straight copy."""</span></span>
<span id="cb51-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_units(atm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_tables(atm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb51-28"></span>
<span id="cb51-29"></span>
<span id="cb51-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_table_A():</span>
<span id="cb51-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 11.5.3.A-2's cross-column test on the A its own formula gives, 6165,</span></span>
<span id="cb51-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    instead of the printed 6150."""</span></span>
<span id="cb51-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_tables(A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A_G)</span>
<span id="cb51-34"></span>
<span id="cb51-35"></span>
<span id="cb51-36"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_unit_reading():</span>
<span id="cb51-37">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""section 11.5.2's pressures read in VWF's atm rather than the printed bar."""</span></span>
<span id="cb51-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_units_model(p_B0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>], p_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_t"</span>])</span>
<span id="cb51-39"></span>
<span id="cb51-40"></span>
<span id="cb51-41"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_target_R_2pct():</span>
<span id="cb51-42">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the tube-radius crossover defined as a 2 % shift instead of 1 %."""</span></span>
<span id="cb51-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_cross_R(target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb51-44"></span>
<span id="cb51-45"></span>
<span id="cb51-46"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pB0_bar():</span>
<span id="cb51-47">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""p_B0 read as the 0.211 bar of 11.5.2 rather than the 0.208 atm of 11.5.3.A."""</span></span>
<span id="cb51-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_units(p_B0_book<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_B0"</span>])</span>
<span id="cb51-49"></span>
<span id="cb51-50"></span>
<span id="cb51-51"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_cp_printed():</span>
<span id="cb51-52">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the volumetric c_p replaced by the printed 0.992 kJ/(kg K) x rho_g."""</span></span>
<span id="cb51-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(h_groups(cp_vol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"specific_heat"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_g"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> KCAL),</span>
<span id="cb51-54">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{})</span>
<span id="cb51-55"></span>
<span id="cb51-56"></span>
<span id="cb51-57"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_dH_kcal_kJ():</span>
<span id="cb51-58">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(-dH) taken as the kJ/kmol of 11.5.2 without converting back to kcal."""</span></span>
<span id="cb51-59">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_groups(minus_dH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_of_reaction"</span>))</span>
<span id="cb51-60"></span>
<span id="cb51-61"></span>
<span id="cb51-62"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_radius_printed():</span>
<span id="cb51-63">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""R_t = 0.0127 m, the radius the printed 2.54 cm diameter implies."""</span></span>
<span id="cb51-64">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_equiv1d(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_shifts(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>),</span>
<span id="cb51-65">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_rung1(R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb51-66"></span>
<span id="cb51-67"></span>
<span id="cb51-68"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_lam_er_5pct():</span>
<span id="cb51-69">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""lambda_er raised 5 %, the parameter 11.7.3 calls the sensitive one."""</span></span>
<span id="cb51-70">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_equiv1d(lam_er<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAM_ER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>),</span>
<span id="cb51-71">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_shifts(lam_er<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAM_ER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, pe_hr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_HR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>))</span>
<span id="cb51-72"></span>
<span id="cb51-73"></span>
<span id="cb51-74"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_alpha_w_5pct():</span>
<span id="cb51-75">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""alpha_w raised 5 %, the other sensitive one."""</span></span>
<span id="cb51-76">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_equiv1d(alpha_w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ALPHA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>)</span>
<span id="cb51-77"></span>
<span id="cb51-78"></span>
<span id="cb51-79"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_table_Q():</span>
<span id="cb51-80">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 11.5.3.A-2's Q read as 3.4657 - two digits transposed."""</span></span>
<span id="cb51-81">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_tables(Q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_625"</span>, swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb51-82"></span>
<span id="cb51-83"></span>
<span id="cb51-84"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_table_dT():</span>
<span id="cb51-85">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the permissible rise read as 31.9 K instead of 31.6 K."""</span></span>
<span id="cb51-86">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_tables(dT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_dT_625"</span>, digit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9"</span>)))</span>
<span id="cb51-87"></span>
<span id="cb51-88"></span>
<span id="cb51-89"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pellet_nu():</span>
<span id="cb51-90">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""construct_div nu = 1 (cylindrical) in the pellet, which is a sphere."""</span></span>
<span id="cb51-91">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_eta(nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb51-92"></span>
<span id="cb51-93"></span>
<span id="cb51-94"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_E_over_R_swap():</span>
<span id="cb51-95">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The chapter's two printed activation energies swapped: section 11.7.3's</span></span>
<span id="cb51-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    E_1/R = 13,588 K used where section 11.5.2's 13,636 K is, and the other way</span></span>
<span id="cb51-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    round.  Both chapter-against-itself metrics hang on that one constant."""</span></span>
<span id="cb51-98">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_chapter_internal(E_over_R<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E1_over_R_1173"</span>), E1_1173<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>])</span>
<span id="cb51-99"></span>
<span id="cb51-100"></span>
<span id="cb51-101"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pellet_coarse():</span>
<span id="cb51-102">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the pellet on 16 radial cells instead of 256 (and 16 instead of 128 for the</span></span>
<span id="cb51-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    non-isothermal solve the film/pellet ratio uses)."""</span></span>
<span id="cb51-104">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_eta(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_film_dt(n_r_pellet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>))</span>
<span id="cb51-105"></span>
<span id="cb51-106"></span>
<span id="cb51-107"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_eta_csv():</span>
<span id="cb51-108">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""B1.1's exact eta column perturbed in its last digit."""</span></span>
<span id="cb51-109">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_eta(eta_col<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SPH.eta.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>))</span>
<span id="cb51-110"></span>
<span id="cb51-111"></span>
<span id="cb51-112"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pe_axial():</span>
<span id="cb51-113">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Pe_ma = Pe_ha at half the chapter's own lower limit, i.e. axial dispersion</span></span>
<span id="cb51-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    twice as strong; inside the validated region of the sweep the crossover row</span></span>
<span id="cb51-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    scans."""</span></span>
<span id="cb51-116">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_shifts(pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_axial_low"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pe_axial_low"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb51-117"></span>
<span id="cb51-118"></span>
<span id="cb51-119"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_film_scale():</span>
<span id="cb51-120">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the Wakao-Funazkri coefficients halved."""</span></span>
<span id="cb51-121">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_shifts(film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_film_dt(film_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>))</span>
<span id="cb51-122"></span>
<span id="cb51-123"></span>
<span id="cb51-124"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_De():</span>
<span id="cb51-125">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""D_e raised a decade from the value rung 4 is evaluated at."""</span></span>
<span id="cb51-126">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_shifts(D_e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DE_SWEEP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb51-127"></span>
<span id="cb51-128"></span>
<span id="cb51-129"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pe_mr_literal():</span>
<span id="cb51-130">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""page 574's a_1 group read literally, i.e. Pe_mr divided by eps."""</span></span>
<span id="cb51-131">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_shifts(pe_mr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PE_MR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> EPS)</span>
<span id="cb51-132"></span>
<span id="cb51-133"></span>
<span id="cb51-134"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_ceiling():</span>
<span id="cb51-135">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the permissible ceiling read as 410 C instead of the printed 415 C."""</span></span>
<span id="cb51-136">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_shifts(ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>h_rung1(ceiling<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>))</span>
<span id="cb51-137"></span>
<span id="cb51-138"></span>
<span id="cb51-139"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pB0_group():</span>
<span id="cb51-140">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""p_B0 read as the 0.211 bar section 11.5.2 prints, in the kcal groups."""</span></span>
<span id="cb51-141">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_groups(p_B0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen_pressure"</span>))</span>
<span id="cb51-142"></span>
<span id="cb51-143"></span>
<span id="cb51-144"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_table1_Q():</span>
<span id="cb51-145">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 11.5.3.A-1's Q read as 2.9023 - two digits transposed."""</span></span>
<span id="cb51-146">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_tables(Q1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vwf_Q_635"</span>, swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb51-147"></span>
<span id="cb51-148"></span>
<span id="cb51-149"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_eta_off():</span>
<span id="cb51-150">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""rung 4 with eq. (11.9.1-11) switched off, i.e. eta forced to 1."""</span></span>
<span id="cb51-151">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_shifts(eta_on<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb51-152"></span>
<span id="cb51-153"></span>
<span id="cb51-154"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_target_up():</span>
<span id="cb51-155">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The crossover definition read as a 2 % shift instead of 1 %.  (The Pe_a</span></span>
<span id="cb51-156"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    sweep validates every point and reaches 2.5 %, printed in the crossover cell.)"""</span></span>
<span id="cb51-157">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_cross(target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb51-158"></span>
<span id="cb51-159"></span>
<span id="cb51-160"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_target_half():</span>
<span id="cb51-161">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the crossover definition read as a 0.5 % shift instead of 1 %."""</span></span>
<span id="cb51-162">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_cross(target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb51-163"></span>
<span id="cb51-164"></span>
<span id="cb51-165"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_pe_extrap_baseline():</span>
<span id="cb51-166">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The rung-2 shift measured against rung 1's Richardson-extrapolated</span></span>
<span id="cb51-167"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    threshold instead of the same-grid one: the mixed-baseline defect the</span></span>
<span id="cb51-168"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    crossover cell measures.  Rung 1's own 600-cell discretisation error is a</span></span>
<span id="cb51-169"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    fifth of the target, so the crossover moves."""</span></span>
<span id="cb51-170">    sc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_scan(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p0_critical(Ladder(RX, rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, pe_ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p,</span>
<span id="cb51-171">                                                          pe_ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p), hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.09</span>)</span>
<span id="cb51-172">                                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> LIM_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), PE_SWEEP, TARGET)</span>
<span id="cb51-173">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(crossover_pe_axial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb51-174"></span>
<span id="cb51-175"></span>
<span id="cb51-176"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_richardson_skipped():</span>
<span id="cb51-177">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""rung 1's finest grid compared with the ODE route, no Richardson limit."""</span></span>
<span id="cb51-178">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_rung1(extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb51-179"></span>
<span id="cb51-180"></span>
<span id="cb51-181"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_richardson_ratio():</span>
<span id="cb51-182">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the rung-1 orders fitted with the grid ratio read as 3 instead of 2."""</span></span>
<span id="cb51-183">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_rung1(ratio_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb51-184"></span>
<span id="cb51-185"></span>
<span id="cb51-186"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_wrong_rung_threshold():</span>
<span id="cb51-187">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""each rung's crossing control run at the NEIGHBOURING rung's threshold (rung 1</span></span>
<span id="cb51-188"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    at rung 2's, every other rung at rung 1's): a threshold that is not the rung's</span></span>
<span id="cb51-189"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    own, which the control must reject."""</span></span>
<span id="cb51-190">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_control(p0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{r: P0S[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RUNGS})</span>
<span id="cb51-191"></span>
<span id="cb51-192"></span>
<span id="cb51-193"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_jump_allowance():</span>
<span id="cb51-194">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the crossing control's jump allowance read as 0.005 K instead of 1 K - below</span></span>
<span id="cb51-195"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    every jump the five rungs measure (the control table above), so a correct</span></span>
<span id="cb51-196"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    threshold is rejected and the rejection counts must leave zero."""</span></span>
<span id="cb51-197">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_rejections(jump<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>)</span>
<span id="cb51-198"></span>
<span id="cb51-199"></span>
<span id="cb51-200"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk_cross_coarse():</span>
<span id="cb51-201">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The crossovers located on a coarser grid, 300 cells instead of 600.  (The</span></span>
<span id="cb51-202"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    crossover cell prints rung 4's anchor point at 300 cells as a clean crossing.)"""</span></span>
<span id="cb51-203">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h_cross(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb51-204"></span>
<span id="cb51-205"></span>
<span id="cb51-206">BREAK_FNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb51-207">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover definition read as 2 %, not 1 %"</span>, brk_target_up),</span>
<span id="cb51-208">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover definition read as 0.5 %, not 1 %"</span>, brk_target_half),</span>
<span id="cb51-209">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossovers located on a 300-cell grid"</span>, brk_cross_coarse),</span>
<span id="cb51-210">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung-2 shift against rung 1's extrapolated threshold"</span>, brk_pe_extrap_baseline),</span>
<span id="cb51-211">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 1: finest grid against the ODE, no Richardson limit"</span>, brk_richardson_skipped),</span>
<span id="cb51-212">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 1: orders fitted with the grid ratio read as 3"</span>, brk_richardson_ratio),</span>
<span id="cb51-213">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder controls run at the neighbouring rung's threshold"</span>, brk_wrong_rung_threshold),</span>
<span id="cb51-214">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossing control's jump allowance read as 0.005 K"</span>, brk_jump_allowance),</span>
<span id="cb51-215">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tube-radius crossover read as 2 %, not 1 %"</span>, brk_target_R_2pct),</span>
<span id="cb51-216">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 11.5.3.A-2 cross-checked against A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_G<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, brk_table_A),</span>
<span id="cb51-217">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5.2's pressures read in atm, not the printed bar"</span>, brk_unit_reading),</span>
<span id="cb51-218">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ex 11.5.1.A: d_p from eq. (11.5.1-9), 6V/S = d"</span>, brk_dp_definition),</span>
<span id="cb51-219">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Ergun constants: A1.1's refit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k1_refit_all_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> /"</span></span>
<span id="cb51-220">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A11_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k2_refit_all_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, brk_ergun_refit),</span>
<span id="cb51-221">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"units: atm-to-bar factor set to 1"</span>, brk_atm_factor),</span>
<span id="cb51-222">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"units: p_B0 read as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_B0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar, not </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p_B0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm converted"</span>, brk_pB0_bar),</span>
<span id="cb51-223">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"c_p: the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'specific_heat'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kJ/(kg K) used instead"</span>, brk_cp_printed),</span>
<span id="cb51-224">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(-dH): the kJ/kmol value used in the kcal groups"</span>, brk_dH_kcal_kJ),</span>
<span id="cb51-225">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"R_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, from the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tube_id'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> diameter"</span>,</span>
<span id="cb51-226">     brk_radius_printed),</span>
<span id="cb51-227">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_er raised 5 %"</span>, brk_lam_er_5pct),</span>
<span id="cb51-228">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_w raised 5 %"</span>, brk_alpha_w_5pct),</span>
<span id="cb51-229">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 11.5.3.A-2: Q read </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_Q_625'</span>, swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, brk_table_Q),</span>
<span id="cb51-230">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 11.5.3.A-2: dT read </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_dT_625'</span>, digit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'6'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'9'</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span>, brk_table_dT),</span>
<span id="cb51-231">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pellet: construct_div nu = 1, not 2"</span>, brk_pellet_nu),</span>
<span id="cb51-232">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pellet: 16 radial cells, not 256"</span>, brk_pellet_coarse),</span>
<span id="cb51-233">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B1.1's exact eta column shifted 1e-4"</span>, brk_eta_csv),</span>
<span id="cb51-234">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Pe_ma = Pe_ha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pe_axial_low'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (2x the chapter's lower limit)"</span>, brk_pe_axial),</span>
<span id="cb51-235">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film coefficients halved"</span>, brk_film_scale),</span>
<span id="cb51-236">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_e raised to 1e-5 m2/s"</span>, brk_De),</span>
<span id="cb51-237">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pe_mr from page 574's a_1 read literally"</span>, brk_pe_mr_literal),</span>
<span id="cb51-238">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"permissible ceiling read as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span>, brk_ceiling),</span>
<span id="cb51-239">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"p_B0 read as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'oxygen_pressure'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bar in the kcal groups"</span>, brk_pB0_group),</span>
<span id="cb51-240">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 11.5.3.A-1: Q read </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vwf_Q_635'</span>, swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, brk_table1_Q),</span>
<span id="cb51-241">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5.2's E/R and 11.7.3's E_1/R swapped"</span>, brk_E_over_R_swap),</span>
<span id="cb51-242">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung 4 with eq. (11.9.1-11) switched off"</span>, brk_eta_off),</span>
<span id="cb51-243">]</span>
<span id="cb51-244"></span>
<span id="cb51-245">METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(BASE_M)</span>
<span id="cb51-246">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb51-247">rows, COVERAGE, BREAK_GOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}, {}</span>
<span id="cb51-248"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS:</span>
<span id="cb51-249">    got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn()</span>
<span id="cb51-250">    BREAK_GOT[lbl] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> got</span>
<span id="cb51-251">    unknown <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(got) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS))</span>
<span id="cb51-252">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> unknown, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break row '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lbl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' recomputes names that are not metrics: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>unknown<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb51-253">    moved <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb51-254">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items():</span>
<span id="cb51-255">        base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE_M[k]</span>
<span id="cb51-256">        rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb51-257">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL:</span>
<span id="cb51-258">            moved.append(k)</span>
<span id="cb51-259">            COVERAGE.setdefault(k, []).append((lbl, rel))</span>
<span id="cb51-260">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(injected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lbl, metrics_touched<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(got), metrics_moved<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(moved),</span>
<span id="cb51-261">                     worst_rel_move<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(got[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BASE_M[k]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BASE_M[k]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb51-262">                                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got), default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)))</span>
<span id="cb51-263">BREAKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb51-264">show(BREAKS.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11breaks"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb51-265">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"worst_rel_move"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb51-266"></span>
<span id="cb51-267"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- a break row's OWN cross_scan refinement is not announced above, unlike the ----</span></span>
<span id="cb51-268"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- four reported rows' (printed earlier, in the crossover cell) - so print it ----</span></span>
<span id="cb51-269">_DIAG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(t, n, k, d) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (t, n), dd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(_H_CROSS_DIAG.items()) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> dd.items()]</span>
<span id="cb51-270"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">THE BREAK-ROW SCANS' OWN REFINEMENT, which the table above does not show:"</span>)</span>
<span id="cb51-271"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _t, _n, _k, _d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _DIAG:</span>
<span id="cb51-272">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   target </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %  n_z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;3s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'levels'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> levels,"</span></span>
<span id="cb51-273">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'probed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> probed, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'refused'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_evaluated'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_controlled'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb51-274">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rejected, bracket </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb51-275">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bracket'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the value)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11breaks" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11breaks_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">injected</th>
<th id="T_d11breaks_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">metrics_touched</th>
<th id="T_d11breaks_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">metrics_moved</th>
<th id="T_d11breaks_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">worst_rel_move</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11breaks_row0_col0" class="data row0 col0">crossover definition read as 2 %, not 1 %</td>
<td id="T_d11breaks_row0_col1" class="data row0 col1">3</td>
<td id="T_d11breaks_row0_col2" class="data row0 col2">3</td>
<td id="T_d11breaks_row0_col3" class="data row0 col3">5.050e-01</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row1_col0" class="data row1 col0">crossover definition read as 0.5 %, not 1 %</td>
<td id="T_d11breaks_row1_col1" class="data row1 col1">3</td>
<td id="T_d11breaks_row1_col2" class="data row1 col2">3</td>
<td id="T_d11breaks_row1_col3" class="data row1 col3">1.010e+00</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row2_col0" class="data row2 col0">crossovers located on a 300-cell grid</td>
<td id="T_d11breaks_row2_col1" class="data row2 col1">3</td>
<td id="T_d11breaks_row2_col2" class="data row2 col2">3</td>
<td id="T_d11breaks_row2_col3" class="data row2 col3">2.060e-03</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row3_col0" class="data row3 col0">rung-2 shift against rung 1's extrapolated threshold</td>
<td id="T_d11breaks_row3_col1" class="data row3 col1">1</td>
<td id="T_d11breaks_row3_col2" class="data row3 col2">1</td>
<td id="T_d11breaks_row3_col3" class="data row3 col3">2.637e-01</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row4_col0" class="data row4 col0">rung 1: finest grid against the ODE, no Richardson limit</td>
<td id="T_d11breaks_row4_col1" class="data row4 col1">7</td>
<td id="T_d11breaks_row4_col2" class="data row4 col2">4</td>
<td id="T_d11breaks_row4_col3" class="data row4 col3">6.557e+02</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row5_col0" class="data row5 col0">rung 1: orders fitted with the grid ratio read as 3</td>
<td id="T_d11breaks_row5_col1" class="data row5 col1">7</td>
<td id="T_d11breaks_row5_col2" class="data row5 col2">2</td>
<td id="T_d11breaks_row5_col3" class="data row5 col3">3.691e-01</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row6_col0" class="data row6 col0">ladder controls run at the neighbouring rung's threshold</td>
<td id="T_d11breaks_row6_col1" class="data row6 col1">1</td>
<td id="T_d11breaks_row6_col2" class="data row6 col2">1</td>
<td id="T_d11breaks_row6_col3" class="data row6 col3">5.000e+12</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row7_col0" class="data row7 col0">crossing control's jump allowance read as 0.005 K</td>
<td id="T_d11breaks_row7_col1" class="data row7 col1">2</td>
<td id="T_d11breaks_row7_col2" class="data row7 col2">2</td>
<td id="T_d11breaks_row7_col3" class="data row7 col3">1.400e+13</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row8_col0" class="data row8 col0">tube-radius crossover read as 2 %, not 1 %</td>
<td id="T_d11breaks_row8_col1" class="data row8 col1">1</td>
<td id="T_d11breaks_row8_col2" class="data row8 col2">1</td>
<td id="T_d11breaks_row8_col3" class="data row8 col3">2.804e-02</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row9_col0" class="data row9 col0">Table 11.5.3.A-2 cross-checked against A = 6165</td>
<td id="T_d11breaks_row9_col1" class="data row9 col1">4</td>
<td id="T_d11breaks_row9_col2" class="data row9 col2">2</td>
<td id="T_d11breaks_row9_col3" class="data row9 col3">4.183e-03</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row10_col0" class="data row10 col0">11.5.2's pressures read in atm, not the printed bar</td>
<td id="T_d11breaks_row10_col1" class="data row10 col1">2</td>
<td id="T_d11breaks_row10_col2" class="data row10 col2">2</td>
<td id="T_d11breaks_row10_col3" class="data row10 col3">1.026e+00</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row11_col0" class="data row11 col0">Ex 11.5.1.A: d_p from eq. (11.5.1-9), 6V/S = d</td>
<td id="T_d11breaks_row11_col1" class="data row11 col1">3</td>
<td id="T_d11breaks_row11_col2" class="data row11 col2">1</td>
<td id="T_d11breaks_row11_col3" class="data row11 col3">2.111e+02</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row12_col0" class="data row12 col0">Ergun constants: A1.1's refit 151.9 / 1.697</td>
<td id="T_d11breaks_row12_col1" class="data row12 col1">3</td>
<td id="T_d11breaks_row12_col2" class="data row12 col2">3</td>
<td id="T_d11breaks_row12_col3" class="data row12 col3">2.293e+01</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row13_col0" class="data row13 col0">units: atm-to-bar factor set to 1</td>
<td id="T_d11breaks_row13_col1" class="data row13 col1">6</td>
<td id="T_d11breaks_row13_col2" class="data row13 col2">4</td>
<td id="T_d11breaks_row13_col3" class="data row13 col3">1.146e+01</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row14_col0" class="data row14 col0">units: p_B0 read as 0.208 bar, not 0.208 atm converted</td>
<td id="T_d11breaks_row14_col1" class="data row14 col1">2</td>
<td id="T_d11breaks_row14_col2" class="data row14 col2">1</td>
<td id="T_d11breaks_row14_col3" class="data row14 col3">1.030e+01</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row15_col0" class="data row15 col0">c_p: the printed 0.992 kJ/(kg K) used instead</td>
<td id="T_d11breaks_row15_col1" class="data row15 col1">4</td>
<td id="T_d11breaks_row15_col2" class="data row15 col2">3</td>
<td id="T_d11breaks_row15_col3" class="data row15 col3">2.505e+03</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row16_col0" class="data row16 col0">(-dH): the kJ/kmol value used in the kcal groups</td>
<td id="T_d11breaks_row16_col1" class="data row16 col1">4</td>
<td id="T_d11breaks_row16_col2" class="data row16 col2">3</td>
<td id="T_d11breaks_row16_col3" class="data row16 col3">1.470e+05</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row17_col0" class="data row17 col0">R_t = 0.0127 m, from the printed 2.54 cm diameter</td>
<td id="T_d11breaks_row17_col1" class="data row17 col1">13</td>
<td id="T_d11breaks_row17_col2" class="data row17 col2">12</td>
<td id="T_d11breaks_row17_col3" class="data row17 col3">6.116e+09</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row18_col0" class="data row18 col0">lambda_er raised 5 %</td>
<td id="T_d11breaks_row18_col1" class="data row18 col1">6</td>
<td id="T_d11breaks_row18_col2" class="data row18 col2">3</td>
<td id="T_d11breaks_row18_col3" class="data row18 col3">1.866e+10</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row19_col0" class="data row19 col0">alpha_w raised 5 %</td>
<td id="T_d11breaks_row19_col1" class="data row19 col1">2</td>
<td id="T_d11breaks_row19_col2" class="data row19 col2">2</td>
<td id="T_d11breaks_row19_col3" class="data row19 col3">3.019e+10</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row20_col0" class="data row20 col0">Table 11.5.3.A-2: Q read 3.4657</td>
<td id="T_d11breaks_row20_col1" class="data row20 col1">4</td>
<td id="T_d11breaks_row20_col2" class="data row20 col2">1</td>
<td id="T_d11breaks_row20_col3" class="data row20 col3">8.063e-04</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row21_col0" class="data row21 col0">Table 11.5.3.A-2: dT read 31.9 K</td>
<td id="T_d11breaks_row21_col1" class="data row21 col1">4</td>
<td id="T_d11breaks_row21_col2" class="data row21 col2">2</td>
<td id="T_d11breaks_row21_col3" class="data row21 col3">9.404e-03</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row22_col0" class="data row22 col0">pellet: construct_div nu = 1, not 2</td>
<td id="T_d11breaks_row22_col1" class="data row22 col1">2</td>
<td id="T_d11breaks_row22_col2" class="data row22 col2">1</td>
<td id="T_d11breaks_row22_col3" class="data row22 col3">4.986e+04</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row23_col0" class="data row23 col0">pellet: 16 radial cells, not 256</td>
<td id="T_d11breaks_row23_col1" class="data row23 col1">6</td>
<td id="T_d11breaks_row23_col2" class="data row23 col2">2</td>
<td id="T_d11breaks_row23_col3" class="data row23 col3">2.790e+02</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row24_col0" class="data row24 col0">B1.1's exact eta column shifted 1e-4</td>
<td id="T_d11breaks_row24_col1" class="data row24 col1">2</td>
<td id="T_d11breaks_row24_col2" class="data row24 col2">1</td>
<td id="T_d11breaks_row24_col3" class="data row24 col3">3.172e+01</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row25_col0" class="data row25 col0">Pe_ma = Pe_ha = 0.5 (2x the chapter's lower limit)</td>
<td id="T_d11breaks_row25_col1" class="data row25 col1">4</td>
<td id="T_d11breaks_row25_col2" class="data row25 col2">1</td>
<td id="T_d11breaks_row25_col3" class="data row25 col3">1.999e+00</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row26_col0" class="data row26 col0">film coefficients halved</td>
<td id="T_d11breaks_row26_col1" class="data row26 col1">8</td>
<td id="T_d11breaks_row26_col2" class="data row26 col2">6</td>
<td id="T_d11breaks_row26_col3" class="data row26 col3">1.071e+00</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row27_col0" class="data row27 col0">D_e raised to 1e-5 m2/s</td>
<td id="T_d11breaks_row27_col1" class="data row27 col1">4</td>
<td id="T_d11breaks_row27_col2" class="data row27 col2">1</td>
<td id="T_d11breaks_row27_col3" class="data row27 col3">1.165e+00</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row28_col0" class="data row28 col0">Pe_mr from page 574's a_1 read literally</td>
<td id="T_d11breaks_row28_col1" class="data row28 col1">4</td>
<td id="T_d11breaks_row28_col2" class="data row28 col2">1</td>
<td id="T_d11breaks_row28_col3" class="data row28 col3">4.039e-02</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row29_col0" class="data row29 col0">permissible ceiling read as 410 C</td>
<td id="T_d11breaks_row29_col1" class="data row29 col1">11</td>
<td id="T_d11breaks_row29_col2" class="data row29 col2">9</td>
<td id="T_d11breaks_row29_col3" class="data row29 col3">1.294e+01</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row30_col0" class="data row30 col0">p_B0 read as 0.211 bar in the kcal groups</td>
<td id="T_d11breaks_row30_col1" class="data row30 col1">4</td>
<td id="T_d11breaks_row30_col2" class="data row30 col2">4</td>
<td id="T_d11breaks_row30_col3" class="data row30 col3">6.652e+02</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row31_col0" class="data row31 col0">Table 11.5.3.A-1: Q read 2.9023</td>
<td id="T_d11breaks_row31_col1" class="data row31 col1">4</td>
<td id="T_d11breaks_row31_col2" class="data row31 col2">1</td>
<td id="T_d11breaks_row31_col3" class="data row31 col3">1.584e+00</td>
</tr>
<tr class="odd">
<td id="T_d11breaks_row32_col0" class="data row32 col0">11.5.2's E/R and 11.7.3's E_1/R swapped</td>
<td id="T_d11breaks_row32_col1" class="data row32 col1">2</td>
<td id="T_d11breaks_row32_col2" class="data row32 col2">2</td>
<td id="T_d11breaks_row32_col3" class="data row32 col3">1.996e+00</td>
</tr>
<tr class="even">
<td id="T_d11breaks_row33_col0" class="data row33 col0">rung 4 with eq. (11.9.1-11) switched off</td>
<td id="T_d11breaks_row33_col1" class="data row33 col1">4</td>
<td id="T_d11breaks_row33_col2" class="data row33 col2">1</td>
<td id="T_d11breaks_row33_col3" class="data row33 col3">1.302e+00</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
THE BREAK-ROW SCANS' OWN REFINEMENT, which the table above does not show:
   target  0.5 %  n_z =  600  pe : 8 levels,  24 probed, 0 rejected, bracket 3.05e-06 (0.00061 % of the value)
   target  0.5 %  n_z =  600  fs : 8 levels,  24 probed, 0 rejected, bracket 6.1e-05 (0.00062 % of the value)
   target  0.5 %  n_z =  600  de : 8 levels,  24 probed, 0 rejected, bracket 1.07e-09 (0.0024 % of the value)
   target  1.0 %  n_z =  300  pe : 8 levels,  24 probed, 0 rejected, bracket 1.53e-07 (6.1e-05 % of the value)
   target  1.0 %  n_z =  300  fs : 8 levels,  24 probed, 0 rejected, bracket 3.05e-05 (0.00062 % of the value)
   target  1.0 %  n_z =  300  de : 8 levels,  24 probed, 0 rejected, bracket 3.05e-10 (0.0013 % of the value)
   target  1.0 %  n_z =  600  pe : 8 levels,  24 probed, 0 rejected, bracket 1.53e-07 (6.1e-05 % of the value)
   target  1.0 %  n_z =  600  fs : 8 levels,  24 probed, 0 rejected, bracket 3.05e-05 (0.00062 % of the value)
   target  1.0 %  n_z =  600  de : 8 levels,  24 probed, 0 rejected, bracket 3.05e-10 (0.0013 % of the value)
   target  2.0 %  n_z =  600  pe : 8 levels,  24 probed, 0 rejected, bracket 7.63e-07 (0.00061 % of the value)
   target  2.0 %  n_z =  600  fs : 8 levels,  24 probed, 0 rejected, bracket 1.53e-05 (0.00063 % of the value)
   target  2.0 %  n_z =  600  de : 8 levels,  24 probed, 0 rejected, bracket 3.05e-10 (0.0027 % of the value)</code></pre>
</div>
</div>
<div id="d2ab1dcb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:59:20.985119Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:59:20.984912Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:59:21.063876Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:59:21.063132Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb53-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- and the rows must COMPUTE what they return, parsed rather than trusted ----</span></span>
<span id="cb53-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A row that returns a TYPED CONSTANT for a metric records a move of exactly 1</span></span>
<span id="cb53-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># whatever the reported value is: a hand-written coverage claim wearing the</span></span>
<span id="cb53-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># generator's clothes.  This guard is copied from published J4.2.  It parses each row's own source plus one level of the</span></span>
<span id="cb53-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># helpers that row names, and rejects any metric key bound to a numeric literal or</span></span>
<span id="cb53-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to a local that is only ever assigned one.  What it cannot say is whether the</span></span>
<span id="cb53-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># expression is the RIGHT one; that is what the measured moves are for.</span></span>
<span id="cb53-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> ast, inspect, textwrap</span>
<span id="cb53-9"></span>
<span id="cb53-10">_NUM_CTORS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"float"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"int"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"complex"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"float64"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"float32"</span>}</span>
<span id="cb53-11"></span>
<span id="cb53-12"></span>
<span id="cb53-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _const(node, env, depth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>):</span>
<span id="cb53-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""True if `node` is PROVABLY a numeric constant.  Constant-folds, so it also</span></span>
<span id="cb53-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    catches the laundering forms `0.1656 + 0.0001`, `float("15.688")`, `_T[0]` off</span></span>
<span id="cb53-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    a frozen tuple, and a helper whose every `return` is a literal; the negative</span></span>
<span id="cb53-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    controls below are exactly those four plus the bare literal."""</span></span>
<span id="cb53-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>:</span>
<span id="cb53-19">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb53-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.Constant):</span>
<span id="cb53-21">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.value, (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>)</span>
<span id="cb53-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.UnaryOp) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.op, (ast.UAdd, ast.USub)):</span>
<span id="cb53-23">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _const(node.operand, env, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb53-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.BinOp):</span>
<span id="cb53-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _const(node.left, env, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _const(node.right, env, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb53-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.Name):</span>
<span id="cb53-27">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> node.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> env <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _const(env[node.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>], env, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb53-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.Subscript):</span>
<span id="cb53-29">        base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> node.value</span>
<span id="cb53-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(base, ast.Name) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> base.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> env:</span>
<span id="cb53-31">            base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> env[base.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>]</span>
<span id="cb53-32">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(base, (ast.Tuple, ast.List))</span>
<span id="cb53-33">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(_const(e, env, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> base.elts))</span>
<span id="cb53-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.Call):</span>
<span id="cb53-35">        fname <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(node.func, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(node.func, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"attr"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb53-36">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> fname <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _NUM_CTORS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(node.args) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb53-37">            a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> node.args[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb53-38">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(a, ast.Constant) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(a.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>):</span>
<span id="cb53-39">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb53-40">                    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(a.value)</span>
<span id="cb53-41">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb53-42">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb53-43">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb53-44">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _const(a, env, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb53-45">        obj <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">globals</span>().get(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(node.func, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb53-46">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (inspect.isfunction(obj) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(obj, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__module__"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__main__"</span>):</span>
<span id="cb53-47">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb53-48">                sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ast.parse(textwrap.dedent(inspect.getsource(obj)))</span>
<span id="cb53-49">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> (<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">OSError</span>, <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">TypeError</span>):</span>
<span id="cb53-50">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb53-51">            senv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _frozen(sub)</span>
<span id="cb53-52">            rets <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [n.value <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(sub)</span>
<span id="cb53-53">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Return) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> n.value <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb53-54">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(rets) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(_const(r, senv, depth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rets)</span>
<span id="cb53-55">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb53-56"></span>
<span id="cb53-57"></span>
<span id="cb53-58"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _frozen(tree):</span>
<span id="cb53-59">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""names assigned once, to something constant-foldable or to a frozen tuple.</span></span>
<span id="cb53-60"></span>
<span id="cb53-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    TUPLE UNPACKING IS INCLUDED: `a, b = 0.1657, 2.0` binds a local that only ever</span></span>
<span id="cb53-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    carries a literal, which is a form the guard's own positive claim names."""</span></span>
<span id="cb53-63">    env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb53-64">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(tree):</span>
<span id="cb53-65">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Assign):</span>
<span id="cb53-66">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.targets:</span>
<span id="cb53-67">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Name):</span>
<span id="cb53-68">                    env[t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n.value</span>
<span id="cb53-69">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Tuple) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n.value, ast.Tuple)</span>
<span id="cb53-70">                        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t.elts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(n.value.elts)):</span>
<span id="cb53-71">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tt, vv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(t.elts, n.value.elts):</span>
<span id="cb53-72">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(tt, ast.Name):</span>
<span id="cb53-73">                            env[tt.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vv</span>
<span id="cb53-74">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> env</span>
<span id="cb53-75"></span>
<span id="cb53-76"></span>
<span id="cb53-77"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _key_bindings(src):</span>
<span id="cb53-78">    tree, out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ast.parse(textwrap.dedent(src)), []</span>
<span id="cb53-79">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(tree):</span>
<span id="cb53-80">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Dict):</span>
<span id="cb53-81">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(k.value, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(n.keys, n.values)</span>
<span id="cb53-82">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(k, ast.Constant) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(k.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)]</span>
<span id="cb53-83">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Call) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(n.func, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dict"</span>:</span>
<span id="cb53-84">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(kw.arg, kw.value) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.keywords <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kw.arg]</span>
<span id="cb53-85">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Assign):</span>
<span id="cb53-86">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.targets:</span>
<span id="cb53-87">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Subscript) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>, ast.Constant)</span>
<span id="cb53-88">                        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)):</span>
<span id="cb53-89">                    out.append((t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>.value, n.value))</span>
<span id="cb53-90">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb53-91"></span>
<span id="cb53-92"></span>
<span id="cb53-93"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sources(fn):</span>
<span id="cb53-94">    src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> textwrap.dedent(inspect.getsource(fn))</span>
<span id="cb53-95">    seen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [src]</span>
<span id="cb53-96">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(ast.parse(src)):</span>
<span id="cb53-97">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Name):</span>
<span id="cb53-98">            obj <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">globals</span>().get(n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>)</span>
<span id="cb53-99">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (inspect.isfunction(obj) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(obj, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__module__"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__main__"</span></span>
<span id="cb53-100">                    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> obj <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> fn):</span>
<span id="cb53-101">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb53-102">                    seen.append(textwrap.dedent(inspect.getsource(obj)))</span>
<span id="cb53-103">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> (<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">OSError</span>, <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">TypeError</span>):</span>
<span id="cb53-104">                    seen.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"# UNREADABLE SOURCE: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb53-105">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> seen</span>
<span id="cb53-106"></span>
<span id="cb53-107"></span>
<span id="cb53-108"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> literal_metrics(fn):</span>
<span id="cb53-109">    bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb53-110">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> src <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _sources(fn):</span>
<span id="cb53-111">        tree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ast.parse(textwrap.dedent(src))</span>
<span id="cb53-112">        env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _frozen(tree)</span>
<span id="cb53-113">        bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _key_bindings(src) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _const(v, env)]</span>
<span id="cb53-114">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(bad))</span>
<span id="cb53-115"></span>
<span id="cb53-116"></span>
<span id="cb53-117"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_bare():</span>
<span id="cb53-118">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""1. the bare literal."""</span></span>
<span id="cb53-119">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung3_pct"</span>: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.7</span>,</span>
<span id="cb53-120">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung4_pct"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15.7</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_grid_vs_11_9_1_11"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>,</span>
<span id="cb53-121">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_diagnostic"</span>: np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)}</span>
<span id="cb53-122"></span>
<span id="cb53-123"></span>
<span id="cb53-124"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_arith():</span>
<span id="cb53-125">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""2. two literals added, and one multiplied by 1."""</span></span>
<span id="cb53-126">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1656</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0001</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung3_pct"</span>: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.744</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>}</span>
<span id="cb53-127"></span>
<span id="cb53-128"></span>
<span id="cb53-129"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_cast():</span>
<span id="cb53-130">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""3. a literal laundered through float()."""</span></span>
<span id="cb53-131">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung4_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15.688"</span>)}</span>
<span id="cb53-132"></span>
<span id="cb53-133"></span>
<span id="cb53-134"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_tuple():</span>
<span id="cb53-135">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""4. a frozen tuple, subscripted."""</span></span>
<span id="cb53-136">    _T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2488</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2665e-05</span>)</span>
<span id="cb53-137">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_pe_axial"</span>: _T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_D_e"</span>: _T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]}</span>
<span id="cb53-138"></span>
<span id="cb53-139"></span>
<span id="cb53-140"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_helper_value():</span>
<span id="cb53-141">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the one-line laundering helper of control 5 - all returns are literals."""</span></span>
<span id="cb53-142">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span></span>
<span id="cb53-143"></span>
<span id="cb53-144"></span>
<span id="cb53-145"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_helper():</span>
<span id="cb53-146">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""5. laundered through a __main__ helper - the case the guard ADVERTISES."""</span></span>
<span id="cb53-147">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: _nc_helper_value()}</span>
<span id="cb53-148"></span>
<span id="cb53-149"></span>
<span id="cb53-150"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_unpack():</span>
<span id="cb53-151">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""6. a local bound by TUPLE UNPACKING, which the guard's own positive claim -</span></span>
<span id="cb53-152"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    "a local that only ever carries one" - covers exactly.  `_frozen` reads tuple</span></span>
<span id="cb53-153"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    targets, so it is a negative control rather than an escape."""</span></span>
<span id="cb53-154">    _u, _v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2488</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb53-155">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_pe_axial"</span>: _u}</span>
<span id="cb53-156"></span>
<span id="cb53-157"></span>
<span id="cb53-158">_NC_GLOBAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a module-level constant, for the escape list below</span></span>
<span id="cb53-159"></span>
<span id="cb53-160"></span>
<span id="cb53-161"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_global():</span>
<span id="cb53-162">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""a metric bound to a name assigned OUTSIDE the row's own source"""</span></span>
<span id="cb53-163">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: _NC_GLOBAL}</span>
<span id="cb53-164"></span>
<span id="cb53-165"></span>
<span id="cb53-166"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_cond():</span>
<span id="cb53-167">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>}</span>
<span id="cb53-168"></span>
<span id="cb53-169"></span>
<span id="cb53-170"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_round():</span>
<span id="cb53-171">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)}</span>
<span id="cb53-172"></span>
<span id="cb53-173"></span>
<span id="cb53-174"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_array():</span>
<span id="cb53-175">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]}</span>
<span id="cb53-176"></span>
<span id="cb53-177"></span>
<span id="cb53-178"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_fstring():</span>
<span id="cb53-179">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)}</span>
<span id="cb53-180"></span>
<span id="cb53-181"></span>
<span id="cb53-182"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_sum():</span>
<span id="cb53-183">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>])}</span>
<span id="cb53-184"></span>
<span id="cb53-185"></span>
<span id="cb53-186"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_comprehension():</span>
<span id="cb53-187">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {k: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>,)}</span>
<span id="cb53-188"></span>
<span id="cb53-189"></span>
<span id="cb53-190"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_lambda():</span>
<span id="cb53-191">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>)()}</span>
<span id="cb53-192"></span>
<span id="cb53-193"></span>
<span id="cb53-194"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_update():</span>
<span id="cb53-195">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb53-196">    d.update(shift_rung2_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>)</span>
<span id="cb53-197">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> d</span>
<span id="cb53-198"></span>
<span id="cb53-199"></span>
<span id="cb53-200"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_zip():</span>
<span id="cb53-201">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>]))</span>
<span id="cb53-202"></span>
<span id="cb53-203"></span>
<span id="cb53-204"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_setdefault():</span>
<span id="cb53-205">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb53-206">    d.setdefault(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>)</span>
<span id="cb53-207">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> d</span>
<span id="cb53-208"></span>
<span id="cb53-209"></span>
<span id="cb53-210"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_abs():</span>
<span id="cb53-211">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""abs() of a literal: constant-FOLDABLE, but a call and not arithmetic, and</span></span>
<span id="cb53-212"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `abs` is not one of the numeric constructors `_const` unwraps.  It is an</span></span>
<span id="cb53-213"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    escape, which is why the positive claim below does not say</span></span>
<span id="cb53-214"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    'constant-foldable'."""</span></span>
<span id="cb53-215">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>)}</span>
<span id="cb53-216"></span>
<span id="cb53-217"></span>
<span id="cb53-218"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_annassign():</span>
<span id="cb53-219">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""13. an ANNOTATED assignment: `_a: float = 0.1657` is an ast.AnnAssign, which</span></span>
<span id="cb53-220"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `_frozen` never reads at all (it only walks ast.Assign).  The guard's own</span></span>
<span id="cb53-221"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    positive claim about "a local name ... that only ever carries one" is a</span></span>
<span id="cb53-222"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    category, and this is one more form inside it that escapes."""</span></span>
<span id="cb53-223">    _a: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span></span>
<span id="cb53-224">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: _a}</span>
<span id="cb53-225"></span>
<span id="cb53-226"></span>
<span id="cb53-227"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_list_target():</span>
<span id="cb53-228">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""14. a LIST-target assignment: `[_a, _b] = 0.1657, 2.0` binds `_a` to a</span></span>
<span id="cb53-229"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    literal exactly the way tuple unpacking does, but `_frozen` only matches an</span></span>
<span id="cb53-230"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ast.Tuple target, never an ast.List one, so it is missed."""</span></span>
<span id="cb53-231">    [_a, _b] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb53-232">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: _a}</span>
<span id="cb53-233"></span>
<span id="cb53-234"></span>
<span id="cb53-235"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_nested_unpack():</span>
<span id="cb53-236">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""15. NESTED tuple unpacking: `(_a, _b), _c = (0.1657, 2.0), 3.0` puts a</span></span>
<span id="cb53-237"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Tuple where `_frozen` expects a bare Name inside the outer target's elements,</span></span>
<span id="cb53-238"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    so the recursion into the inner tuple never happens and `_a` is missed."""</span></span>
<span id="cb53-239">    (_a, _b), _c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span></span>
<span id="cb53-240">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: _a}</span>
<span id="cb53-241"></span>
<span id="cb53-242"></span>
<span id="cb53-243"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nc_walrus():</span>
<span id="cb53-244">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""16. a WALRUS binding: `(_a := 0.1657)` is an ast.NamedExpr, a third kind of</span></span>
<span id="cb53-245"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    name-binding node `_frozen` never reads at all (it only walks ast.Assign)."""</span></span>
<span id="cb53-246">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: (_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1657</span>)}</span>
<span id="cb53-247"></span>
<span id="cb53-248"></span>
<span id="cb53-249"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _fp_computed():</span>
<span id="cb53-250">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""FALSE-POSITIVE control, and this one is not vacuous. It binds a METRIC key</span></span>
<span id="cb53-251"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    to a computed value; the guard must not flag it.  A NON-metric key would not</span></span>
<span id="cb53-252"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    do: `literal_metrics` filters it out before it looks at anything."""</span></span>
<span id="cb53-253">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))}</span>
<span id="cb53-254"></span>
<span id="cb53-255"></span>
<span id="cb53-256">ESCAPES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a module-level constant"</span>, _nc_global),</span>
<span id="cb53-257">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.1657 if True else ..."</span>, _nc_cond),</span>
<span id="cb53-258">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"round(0.1657, 4)"</span>, _nc_round),</span>
<span id="cb53-259">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"np.array([0.1657])[0]"</span>, _nc_array),</span>
<span id="cb53-260">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'float(f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{0.1657}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")'</span>, _nc_fstring),</span>
<span id="cb53-261">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sum([0.1657])"</span>, _nc_sum),</span>
<span id="cb53-262">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a dict comprehension"</span>, _nc_comprehension),</span>
<span id="cb53-263">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a lambda"</span>, _nc_lambda),</span>
<span id="cb53-264">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d.update(key=0.1657)"</span>, _nc_update),</span>
<span id="cb53-265">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dict(zip([key], [0.1657]))"</span>, _nc_zip),</span>
<span id="cb53-266">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d.setdefault(key, 0.1657)"</span>, _nc_setdefault),</span>
<span id="cb53-267">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs(0.1657)"</span>, _nc_abs),</span>
<span id="cb53-268">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an annotated assignment, `_a: float = 0.1657`"</span>, _nc_annassign),</span>
<span id="cb53-269">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a list-target assignment, `[_a, _b] = 0.1657, 2.0`"</span>, _nc_list_target),</span>
<span id="cb53-270">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nested tuple unpacking, `(_a, _b), _c = (0.1657, 2.0), 3.0`"</span>,</span>
<span id="cb53-271">            _nc_nested_unpack),</span>
<span id="cb53-272">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a walrus binding, `(_a := 0.1657)`"</span>, _nc_walrus)]</span>
<span id="cb53-273"></span>
<span id="cb53-274">NEG_CONTROLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bare literal"</span>, _nc_bare,</span>
<span id="cb53-275">                 {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung3_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung4_pct"</span>,</span>
<span id="cb53-276">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_grid_vs_11_9_1_11"</span>}),</span>
<span id="cb53-277">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"literal arithmetic"</span>, _nc_arith,</span>
<span id="cb53-278">                 {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung3_pct"</span>}),</span>
<span id="cb53-279">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"float(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">...</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">) cast"</span>, _nc_cast, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung4_pct"</span>}),</span>
<span id="cb53-280">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"frozen tuple, subscripted"</span>, _nc_tuple,</span>
<span id="cb53-281">                 {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_pe_axial"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_D_e"</span>}),</span>
<span id="cb53-282">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"laundered through a helper"</span>, _nc_helper, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_rung2_pct"</span>}),</span>
<span id="cb53-283">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tuple unpacking"</span>, _nc_unpack, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_pe_axial"</span>})]</span>
<span id="cb53-284">LITERAL_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl: bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> bad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [literal_metrics(fn)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bad}</span>
<span id="cb53-285"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows parsed; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(LITERAL_ROWS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> return a metric as a typed"</span></span>
<span id="cb53-286">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" constant.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE GUARD'S TEETH, MEASURED on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(NEG_CONTROLS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> laundering forms:"</span>)</span>
<span id="cb53-287">_TEETH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb53-288"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn, want <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NEG_CONTROLS:</span>
<span id="cb53-289">    got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(literal_metrics(fn))</span>
<span id="cb53-290">    _TEETH.append(got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> want)</span>
<span id="cb53-291">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lbl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;28s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> caught </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(got)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'PASS'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> want <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'FAIL'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb53-292"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(_TEETH), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the literal guard does not catch every negative control"</span></span>
<span id="cb53-293"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> literal_metrics(_fp_computed), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the guard flagged a COMPUTED metric value"</span></span>
<span id="cb53-294"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> LITERAL_ROWS, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break rows returning typed constants: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LITERAL_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb53-295"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   false positives: a metric key bound to float(np.log(2.0)) is NOT flagged"</span></span>
<span id="cb53-296">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>literal_metrics(_fp_computed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> []<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb53-297"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND WHAT IT DOES NOT CATCH: AT LEAST </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ESCAPES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> more forms, measured rather"</span></span>
<span id="cb53-298">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" than left to be</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">discovered - each of these binds a metric key to 0.1657 and walks"</span></span>
<span id="cb53-299">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" through. AT LEAST is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the honest quantifier: an independent sabotage set can"</span></span>
<span id="cb53-300">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" find a form this list</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">does not name. The list:"</span>)</span>
<span id="cb53-301">_ESCAPED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(lbl, literal_metrics(fn)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ESCAPES]</span>
<span id="cb53-302"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ESCAPED <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> got))</span>
<span id="cb53-303"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> got <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ESCAPED), (</span>
<span id="cb53-304">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an escape form is now caught - update the printed list: "</span></span>
<span id="cb53-305">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>([lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ESCAPED <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> got]))</span>
<span id="cb53-306"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"So the accurate claim is a LIST OF FORMS and not a category: a metric key bound to"</span></span>
<span id="cb53-307">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">a numeric literal, to +-*/** arithmetic or unary minus on literals, to a"</span></span>
<span id="cb53-308">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" float/int/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">np.float64 cast of one, to a subscript of a frozen literal tuple, or to"</span></span>
<span id="cb53-309">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" a local name -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">in the row's own body or a one-level __main__ helper - bound by a"</span></span>
<span id="cb53-310">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" plain Name or</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">flat-tuple-unpacking assignment (annotated, list-target, nested-tuple"</span></span>
<span id="cb53-311">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and walrus</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bindings escape). NOT 'constant-foldable': abs(0.1657) is foldable,"</span></span>
<span id="cb53-312">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" but a call to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">something that is not a numeric constructor, and it escapes. And NOT 'any row"</span></span>
<span id="cb53-313">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" returning a metric as</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">a typed constant'. The realistic accidental case, a"</span></span>
<span id="cb53-314">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" module-level constant, is in</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the escape list. What the guard still cannot say is"</span></span>
<span id="cb53-315">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" whether the expression is the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">RIGHT one; that is what the measured moves in the"</span></span>
<span id="cb53-316">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" table above are for."</span>)</span>
<span id="cb53-317"></span>
<span id="cb53-318"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------- coverage map, GENERATED from the measured moves --------------</span></span>
<span id="cb53-319">CAVEATS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb53-320">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cp_route_spread"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A SPREAD among four routes to c_p, not an agreement among "</span></span>
<span id="cb53-321">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"four witnesses - the Parameters cell shows route 2 reproduces "</span></span>
<span id="cb53-322">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route 1 by construction and route 4 is route 1 rounded, so "</span></span>
<span id="cb53-323">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the four trace to one printed determination plus route 3. "</span></span>
<span id="cb53-324">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Perturbing any one of them moves this number, and "</span></span>
<span id="cb53-325">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brk_cp_printed and brk_dH_kcal_kJ both do; the caveat is "</span></span>
<span id="cb53-326">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"that it cannot detect a c_p that is wrong in the same "</span></span>
<span id="cb53-327">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"way in all four places, which is precisely what a shared "</span></span>
<span id="cb53-328">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"source looks like. C2.10 warns that U = 82.7 is such a "</span></span>
<span id="cb53-329">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared source between it and D2.2. The CONCLUSION it "</span></span>
<span id="cb53-330">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supports - that the printed 0.992 is inconsistent with the "</span></span>
<span id="cb53-331">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chapter's own groups - rests on cp_printed_dev, not on this."</span>),</span>
<span id="cb53-332">}</span>
<span id="cb53-333">cov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb53-334"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb53-335">    movers <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> COVERAGE.get(k, [])</span>
<span id="cb53-336">    cov.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(metric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k, value<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE_M[k], n_movers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(movers),</span>
<span id="cb53-337">                    best_mover<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(movers, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> movers <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>),</span>
<span id="cb53-338">                    best_rel_move<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> movers) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> movers <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)))</span>
<span id="cb53-339">COV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(cov)</span>
<span id="cb53-340">show(COV.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d11cov"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb53-341">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best_rel_move"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb53-342">uncovered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE))</span>
<span id="cb53-343"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> uncovered, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics no row moves: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>uncovered<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb53-344"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(COVERAGE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> moved by at least one row; none is"</span></span>
<span id="cb53-345">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" structural."</span>)</span>
<span id="cb53-346"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, why <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CAVEATS.items():</span>
<span id="cb53-347">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">CAVEAT - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>why<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb53-348"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE CROSSING CONTROL, COUNTED OVER THE WHOLE PAGE. Every threshold this"</span></span>
<span id="cb53-349">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" notebook</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">has computed up to this point - the ladder table, the six-grid rung-1"</span></span>
<span id="cb53-350">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" chain, the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rung-2 grid chain, the four crossover scans and all"</span></span>
<span id="cb53-351">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> break rows -"</span></span>
<span id="cb53-352">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" has been</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">checked: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'checked'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bisected thresholds, of which"</span></span>
<span id="cb53-353">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rejected'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> were REJECTED as not being ceiling</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">crossings. The"</span></span>
<span id="cb53-354">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" smallest distance of any control solve from the ceiling, or of any</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">jump from"</span></span>
<span id="cb53-355">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL_JUMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K allowance, is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'margin_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K, so no verdict"</span></span>
<span id="cb53-356">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" sits near round-off."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>34 rows parsed; 0 return a metric as a typed constant.
THE GUARD'S TEETH, MEASURED on 6 laundering forms:
   bare literal                 caught ['eta_grid_vs_11_9_1_11', 'shift_rung2_pct', 'shift_rung3_pct', 'shift_rung4_pct']   -&gt; PASS
   literal arithmetic           caught ['shift_rung2_pct', 'shift_rung3_pct']   -&gt; PASS
   float("...") cast            caught ['shift_rung4_pct']   -&gt; PASS
   frozen tuple, subscripted    caught ['crossover_D_e', 'crossover_pe_axial']   -&gt; PASS
   laundered through a helper   caught ['shift_rung2_pct']   -&gt; PASS
   tuple unpacking              caught ['crossover_pe_axial']   -&gt; PASS
   false positives: a metric key bound to float(np.log(2.0)) is NOT flagged (True).

AND WHAT IT DOES NOT CATCH: AT LEAST 16 more forms, measured rather than left to be
discovered - each of these binds a metric key to 0.1657 and walks through. AT LEAST is
the honest quantifier: an independent sabotage set can find a form this list
does not name. The list:
   a module-level constant; 0.1657 if True else ...; round(0.1657, 4); np.array([0.1657])[0]; float(f"{0.1657}"); sum([0.1657]); a dict comprehension; a lambda; d.update(key=0.1657); dict(zip([key], [0.1657])); d.setdefault(key, 0.1657); abs(0.1657); an annotated assignment, `_a: float = 0.1657`; a list-target assignment, `[_a, _b] = 0.1657, 2.0`; nested tuple unpacking, `(_a, _b), _c = (0.1657, 2.0), 3.0`; a walrus binding, `(_a := 0.1657)`
So the accurate claim is a LIST OF FORMS and not a category: a metric key bound to
a numeric literal, to +-*/** arithmetic or unary minus on literals, to a float/int/
np.float64 cast of one, to a subscript of a frozen literal tuple, or to a local name -
in the row's own body or a one-level __main__ helper - bound by a plain Name or
flat-tuple-unpacking assignment (annotated, list-target, nested-tuple and walrus
bindings escape). NOT 'constant-foldable': abs(0.1657) is foldable, but a call to
something that is not a numeric constructor, and it escapes. And NOT 'any row returning a metric as
a typed constant'. The realistic accidental case, a module-level constant, is in
the escape list. What the guard still cannot say is whether the expression is the
RIGHT one; that is what the measured moves in the table above are for.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_d11cov" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_d11cov_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">metric</th>
<th id="T_d11cov_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">value</th>
<th id="T_d11cov_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">n_movers</th>
<th id="T_d11cov_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">best_mover</th>
<th id="T_d11cov_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">best_rel_move</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_d11cov_row0_col0" class="data row0 col0">E_over_R_internal_dev</td>
<td id="T_d11cov_row0_col1" class="data row0 col1">0.00353253</td>
<td id="T_d11cov_row0_col2" class="data row0 col2">1</td>
<td id="T_d11cov_row0_col3" class="data row0 col3">11.5.2's E/R and 11.7.3's E_1/R swapped</td>
<td id="T_d11cov_row0_col4" class="data row0 col4">2.00e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row1_col0" class="data row1 col0">T_hot_0018_bar_reading_C</td>
<td id="T_d11cov_row1_col1" class="data row1 col1">627.261</td>
<td id="T_d11cov_row1_col2" class="data row1 col2">1</td>
<td id="T_d11cov_row1_col3" class="data row1 col3">11.5.2's pressures read in atm, not the printed bar</td>
<td id="T_d11cov_row1_col4" class="data row1 col4">3.39e-01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row2_col0" class="data row2 col0">U_from_2d_dev</td>
<td id="T_d11cov_row2_col1" class="data row2 col1">-1.11022e-16</td>
<td id="T_d11cov_row2_col2" class="data row2 col2">3</td>
<td id="T_d11cov_row2_col3" class="data row2 col3">alpha_w raised 5 %</td>
<td id="T_d11cov_row2_col4" class="data row2 col4">3.02e+10</td>
</tr>
<tr class="even">
<td id="T_d11cov_row3_col0" class="data row3 col0">U_from_2d_dev_at_printed_radius</td>
<td id="T_d11cov_row3_col1" class="data row3 col1">-0.00611621</td>
<td id="T_d11cov_row3_col2" class="data row3 col2">2</td>
<td id="T_d11cov_row3_col3" class="data row3 col3">alpha_w raised 5 %</td>
<td id="T_d11cov_row3_col4" class="data row3 col4">4.87e+00</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row4_col0" class="data row4 col0">backint_residual</td>
<td id="T_d11cov_row4_col1" class="data row4 col1">-0.0130767</td>
<td id="T_d11cov_row4_col2" class="data row4 col2">1</td>
<td id="T_d11cov_row4_col3" class="data row4 col3">units: atm-to-bar factor set to 1</td>
<td id="T_d11cov_row4_col4" class="data row4 col4">1.00e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row5_col0" class="data row5 col0">conversion_worst_dev</td>
<td id="T_d11cov_row5_col1" class="data row5 col1">0.00115774</td>
<td id="T_d11cov_row5_col2" class="data row5 col2">2</td>
<td id="T_d11cov_row5_col3" class="data row5 col3">units: atm-to-bar factor set to 1</td>
<td id="T_d11cov_row5_col4" class="data row5 col4">1.15e+01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row6_col0" class="data row6 col0">cp_printed_dev</td>
<td id="T_d11cov_row6_col1" class="data row6 col1">0.0570031</td>
<td id="T_d11cov_row6_col2" class="data row6 col2">3</td>
<td id="T_d11cov_row6_col3" class="data row6 col3">(-dH): the kJ/kmol value used in the kcal groups</td>
<td id="T_d11cov_row6_col4" class="data row6 col4">1.47e+01</td>
</tr>
<tr class="even">
<td id="T_d11cov_row7_col0" class="data row7 col0">cp_route_spread</td>
<td id="T_d11cov_row7_col1" class="data row7 col1">0.00936424</td>
<td id="T_d11cov_row7_col2" class="data row7 col2">3</td>
<td id="T_d11cov_row7_col3" class="data row7 col3">(-dH): the kJ/kmol value used in the kcal groups</td>
<td id="T_d11cov_row7_col4" class="data row7 col4">3.39e+02</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row8_col0" class="data row8 col0">crossover_D_e</td>
<td id="T_d11cov_row8_col1" class="data row8 col1">2.26645e-05</td>
<td id="T_d11cov_row8_col2" class="data row8 col2">3</td>
<td id="T_d11cov_row8_col3" class="data row8 col3">crossover definition read as 0.5 %, not 1 %</td>
<td id="T_d11cov_row8_col4" class="data row8 col4">1.00e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row9_col0" class="data row9 col0">crossover_R_t</td>
<td id="T_d11cov_row9_col1" class="data row9 col1">0.0100293</td>
<td id="T_d11cov_row9_col2" class="data row9 col2">1</td>
<td id="T_d11cov_row9_col3" class="data row9 col3">tube-radius crossover read as 2 %, not 1 %</td>
<td id="T_d11cov_row9_col4" class="data row9 col4">2.80e-02</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row10_col0" class="data row10 col0">crossover_film_scale</td>
<td id="T_d11cov_row10_col1" class="data row10 col1">4.93036</td>
<td id="T_d11cov_row10_col2" class="data row10 col2">3</td>
<td id="T_d11cov_row10_col3" class="data row10 col3">crossover definition read as 0.5 %, not 1 %</td>
<td id="T_d11cov_row10_col4" class="data row10 col4">1.01e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row11_col0" class="data row11 col0">crossover_pe_axial</td>
<td id="T_d11cov_row11_col1" class="data row11 col1">0.248832</td>
<td id="T_d11cov_row11_col2" class="data row11 col2">4</td>
<td id="T_d11cov_row11_col3" class="data row11 col3">crossover definition read as 0.5 %, not 1 %</td>
<td id="T_d11cov_row11_col4" class="data row11 col4">9.97e-01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row12_col0" class="data row12 col0">dp_definition_cost</td>
<td id="T_d11cov_row12_col1" class="data row12 col1">0.306752</td>
<td id="T_d11cov_row12_col2" class="data row12 col2">1</td>
<td id="T_d11cov_row12_col3" class="data row12 col3">Ergun constants: A1.1's refit 151.9 / 1.697</td>
<td id="T_d11cov_row12_col4" class="data row12 col4">7.88e-03</td>
</tr>
<tr class="even">
<td id="T_d11cov_row13_col0" class="data row13 col0">eta_grid_vs_11_9_1_11</td>
<td id="T_d11cov_row13_col1" class="data row13 col1">4.57853e-06</td>
<td id="T_d11cov_row13_col2" class="data row13 col2">2</td>
<td id="T_d11cov_row13_col3" class="data row13 col3">pellet: construct_div nu = 1, not 2</td>
<td id="T_d11cov_row13_col4" class="data row13 col4">4.99e+04</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row14_col0" class="data row14 col0">eta_vs_B11_worst</td>
<td id="T_d11cov_row14_col1" class="data row14 col1">3.15208e-06</td>
<td id="T_d11cov_row14_col2" class="data row14 col2">1</td>
<td id="T_d11cov_row14_col3" class="data row14 col3">B1.1's exact eta column shifted 1e-4</td>
<td id="T_d11cov_row14_col4" class="data row14 col4">3.17e+01</td>
</tr>
<tr class="even">
<td id="T_d11cov_row15_col0" class="data row15 col0">ex1151a_worst_dev</td>
<td id="T_d11cov_row15_col1" class="data row15 col1">0.00148889</td>
<td id="T_d11cov_row15_col2" class="data row15 col2">2</td>
<td id="T_d11cov_row15_col3" class="data row15 col3">Ex 11.5.1.A: d_p from eq. (11.5.1-9), 6V/S = d</td>
<td id="T_d11cov_row15_col4" class="data row15 col4">2.11e+02</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row16_col0" class="data row16 col0">film_dT_at_hotspot_K</td>
<td id="T_d11cov_row16_col1" class="data row16 col1">3.30833</td>
<td id="T_d11cov_row16_col2" class="data row16 col2">1</td>
<td id="T_d11cov_row16_col3" class="data row16 col3">film coefficients halved</td>
<td id="T_d11cov_row16_col4" class="data row16 col4">1.01e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row17_col0" class="data row17 col0">film_dT_at_startup_K</td>
<td id="T_d11cov_row17_col1" class="data row17 col1">0.845152</td>
<td id="T_d11cov_row17_col2" class="data row17 col2">1</td>
<td id="T_d11cov_row17_col3" class="data row17 col3">film coefficients halved</td>
<td id="T_d11cov_row17_col4" class="data row17 col4">1.07e+00</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row18_col0" class="data row18 col0">film_dT_over_pellet_dT</td>
<td id="T_d11cov_row18_col1" class="data row18 col1">9.06384</td>
<td id="T_d11cov_row18_col2" class="data row18 col2">2</td>
<td id="T_d11cov_row18_col3" class="data row18 col3">film coefficients halved</td>
<td id="T_d11cov_row18_col4" class="data row18 col4">1.01e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row19_col0" class="data row19 col0">group_A_printed_dev</td>
<td id="T_d11cov_row19_col1" class="data row19 col1">0.00244493</td>
<td id="T_d11cov_row19_col2" class="data row19 col2">1</td>
<td id="T_d11cov_row19_col3" class="data row19 col3">p_B0 read as 0.211 bar in the kcal groups</td>
<td id="T_d11cov_row19_col4" class="data row19 col4">5.91e+00</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row20_col0" class="data row20 col0">group_B_dev</td>
<td id="T_d11cov_row20_col1" class="data row20 col1">2.16839e-05</td>
<td id="T_d11cov_row20_col2" class="data row20 col2">3</td>
<td id="T_d11cov_row20_col3" class="data row20 col3">(-dH): the kJ/kmol value used in the kcal groups</td>
<td id="T_d11cov_row20_col4" class="data row20 col4">1.47e+05</td>
</tr>
<tr class="even">
<td id="T_d11cov_row21_col0" class="data row21 col0">ladder_controls_rejected</td>
<td id="T_d11cov_row21_col1" class="data row21 col1">0</td>
<td id="T_d11cov_row21_col2" class="data row21 col2">1</td>
<td id="T_d11cov_row21_col3" class="data row21 col3">ladder controls run at the neighbouring rung's threshold</td>
<td id="T_d11cov_row21_col4" class="data row21 col4">5.00e+12</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row22_col0" class="data row22 col0">lump_deficit</td>
<td id="T_d11cov_row22_col1" class="data row22 col1">-0.114106</td>
<td id="T_d11cov_row22_col2" class="data row22 col2">1</td>
<td id="T_d11cov_row22_col3" class="data row22 col3">11.5.2's E/R and 11.7.3's E_1/R swapped</td>
<td id="T_d11cov_row22_col4" class="data row22 col4">5.63e-01</td>
</tr>
<tr class="even">
<td id="T_d11cov_row23_col0" class="data row23 col0">mears_margin</td>
<td id="T_d11cov_row23_col1" class="data row23 col1">3.79251</td>
<td id="T_d11cov_row23_col2" class="data row23 col2">1</td>
<td id="T_d11cov_row23_col3" class="data row23 col3">film coefficients halved</td>
<td id="T_d11cov_row23_col4" class="data row23 col4">5.15e-01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row24_col0" class="data row24 col0">ode_vs_pymrm_T</td>
<td id="T_d11cov_row24_col1" class="data row24 col1">3.33676e-05</td>
<td id="T_d11cov_row24_col2" class="data row24 col2">2</td>
<td id="T_d11cov_row24_col3" class="data row24 col3">rung 1: finest grid against the ODE, no Richardson limit</td>
<td id="T_d11cov_row24_col4" class="data row24 col4">1.72e+01</td>
</tr>
<tr class="even">
<td id="T_d11cov_row25_col0" class="data row25 col0">ode_vs_pymrm_p0</td>
<td id="T_d11cov_row25_col1" class="data row25 col1">3.96411e-07</td>
<td id="T_d11cov_row25_col2" class="data row25 col2">3</td>
<td id="T_d11cov_row25_col3" class="data row25 col3">rung 1: finest grid against the ODE, no Richardson limit</td>
<td id="T_d11cov_row25_col4" class="data row25 col4">6.56e+02</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row26_col0" class="data row26 col0">p0_star_bar_reading_dev</td>
<td id="T_d11cov_row26_col1" class="data row26 col1">-0.0110537</td>
<td id="T_d11cov_row26_col2" class="data row26 col2">1</td>
<td id="T_d11cov_row26_col3" class="data row26 col3">11.5.2's pressures read in atm, not the printed bar</td>
<td id="T_d11cov_row26_col4" class="data row26 col4">1.03e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row27_col0" class="data row27 col0">p0_star_vs_printed_0018</td>
<td id="T_d11cov_row27_col1" class="data row27 col1">0.00028258</td>
<td id="T_d11cov_row27_col2" class="data row27 col2">2</td>
<td id="T_d11cov_row27_col3" class="data row27 col3">R_t = 0.0127 m, from the printed 2.54 cm diameter</td>
<td id="T_d11cov_row27_col4" class="data row27 col4">4.44e+01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row28_col0" class="data row28 col0">re_implied_spread</td>
<td id="T_d11cov_row28_col1" class="data row28 col1">0.453398</td>
<td id="T_d11cov_row28_col2" class="data row28 col2">1</td>
<td id="T_d11cov_row28_col3" class="data row28 col3">Ergun constants: A1.1's refit 151.9 / 1.697</td>
<td id="T_d11cov_row28_col4" class="data row28 col4">2.29e+01</td>
</tr>
<tr class="even">
<td id="T_d11cov_row29_col0" class="data row29 col0">rung1_finest_err_over_start_floor</td>
<td id="T_d11cov_row29_col1" class="data row29 col1">26072.4</td>
<td id="T_d11cov_row29_col2" class="data row29 col2">3</td>
<td id="T_d11cov_row29_col3" class="data row29 col3">rung 1: finest grid against the ODE, no Richardson limit</td>
<td id="T_d11cov_row29_col4" class="data row29 col4">1.00e+00</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row30_col0" class="data row30 col0">rung1_order_T</td>
<td id="T_d11cov_row30_col1" class="data row30 col1">0.943023</td>
<td id="T_d11cov_row30_col2" class="data row30 col2">2</td>
<td id="T_d11cov_row30_col3" class="data row30 col3">rung 1: orders fitted with the grid ratio read as 3</td>
<td id="T_d11cov_row30_col4" class="data row30 col4">3.69e-01</td>
</tr>
<tr class="even">
<td id="T_d11cov_row31_col0" class="data row31 col0">rung1_order_p0</td>
<td id="T_d11cov_row31_col1" class="data row31 col1">0.998351</td>
<td id="T_d11cov_row31_col2" class="data row31 col2">3</td>
<td id="T_d11cov_row31_col3" class="data row31 col3">rung 1: orders fitted with the grid ratio read as 3</td>
<td id="T_d11cov_row31_col4" class="data row31 col4">3.69e-01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row32_col0" class="data row32 col0">rung1_p0_star_extrapolated</td>
<td id="T_d11cov_row32_col1" class="data row32 col1">0.0180051</td>
<td id="T_d11cov_row32_col2" class="data row32 col2">3</td>
<td id="T_d11cov_row32_col3" class="data row32 col3">R_t = 0.0127 m, from the printed 2.54 cm diameter</td>
<td id="T_d11cov_row32_col4" class="data row32 col4">1.26e-02</td>
</tr>
<tr class="even">
<td id="T_d11cov_row33_col0" class="data row33 col0">scan_points_rejected</td>
<td id="T_d11cov_row33_col1" class="data row33 col1">0</td>
<td id="T_d11cov_row33_col2" class="data row33 col2">1</td>
<td id="T_d11cov_row33_col3" class="data row33 col3">crossing control's jump allowance read as 0.005 K</td>
<td id="T_d11cov_row33_col4" class="data row33 col4">9.00e+12</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row34_col0" class="data row34 col0">shift_rung2_pct</td>
<td id="T_d11cov_row34_col1" class="data row34 col1">0.165697</td>
<td id="T_d11cov_row34_col2" class="data row34 col2">3</td>
<td id="T_d11cov_row34_col3" class="data row34 col3">Pe_ma = Pe_ha = 0.5 (2x the chapter's lower limit)</td>
<td id="T_d11cov_row34_col4" class="data row34 col4">2.00e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row35_col0" class="data row35 col0">shift_rung3_pct</td>
<td id="T_d11cov_row35_col1" class="data row35 col1">-4.74425</td>
<td id="T_d11cov_row35_col2" class="data row35 col2">3</td>
<td id="T_d11cov_row35_col3" class="data row35 col3">film coefficients halved</td>
<td id="T_d11cov_row35_col4" class="data row35 col4">9.08e-01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row36_col0" class="data row36 col0">shift_rung4_pct</td>
<td id="T_d11cov_row36_col1" class="data row36 col1">15.6884</td>
<td id="T_d11cov_row36_col2" class="data row36 col2">5</td>
<td id="T_d11cov_row36_col3" class="data row36 col3">rung 4 with eq. (11.9.1-11) switched off</td>
<td id="T_d11cov_row36_col4" class="data row36 col4">1.30e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row37_col0" class="data row37 col0">shift_rung5_pct</td>
<td id="T_d11cov_row37_col1" class="data row37 col1">-8.94192</td>
<td id="T_d11cov_row37_col2" class="data row37 col2">4</td>
<td id="T_d11cov_row37_col3" class="data row37 col3">lambda_er raised 5 %</td>
<td id="T_d11cov_row37_col4" class="data row37 col4">2.00e-01</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row38_col0" class="data row38 col0">table1_worst_dev</td>
<td id="T_d11cov_row38_col1" class="data row38 col1">0.00475901</td>
<td id="T_d11cov_row38_col2" class="data row38 col2">1</td>
<td id="T_d11cov_row38_col3" class="data row38 col3">Table 11.5.3.A-1: Q read 2.9023</td>
<td id="T_d11cov_row38_col4" class="data row38 col4">1.58e+00</td>
</tr>
<tr class="even">
<td id="T_d11cov_row39_col0" class="data row39 col0">table2_Q_implied_by_p0</td>
<td id="T_d11cov_row39_col1" class="data row39 col1">4.11015</td>
<td id="T_d11cov_row39_col2" class="data row39 col2">3</td>
<td id="T_d11cov_row39_col3" class="data row39 col3">units: atm-to-bar factor set to 1</td>
<td id="T_d11cov_row39_col4" class="data row39 col4">6.99e-03</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row40_col0" class="data row40 col0">table2_dTad_worst_dev</td>
<td id="T_d11cov_row40_col1" class="data row40 col1">0.368875</td>
<td id="T_d11cov_row40_col2" class="data row40 col2">2</td>
<td id="T_d11cov_row40_col3" class="data row40 col3">units: atm-to-bar factor set to 1</td>
<td id="T_d11cov_row40_col4" class="data row40 col4">2.24e-02</td>
</tr>
<tr class="even">
<td id="T_d11cov_row41_col0" class="data row41 col0">table2_upper_ratio</td>
<td id="T_d11cov_row41_col1" class="data row41 col1">0.826237</td>
<td id="T_d11cov_row41_col2" class="data row41 col2">2</td>
<td id="T_d11cov_row41_col3" class="data row41 col3">Table 11.5.3.A-2: dT read 31.9 K</td>
<td id="T_d11cov_row41_col4" class="data row41 col4">9.40e-03</td>
</tr>
<tr class="odd">
<td id="T_d11cov_row42_col0" class="data row42 col0">thresholds_rejected</td>
<td id="T_d11cov_row42_col1" class="data row42 col1">0</td>
<td id="T_d11cov_row42_col2" class="data row42 col2">1</td>
<td id="T_d11cov_row42_col3" class="data row42 col3">crossing control's jump allowance read as 0.005 K</td>
<td id="T_d11cov_row42_col4" class="data row42 col4">1.40e+13</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>43 metrics, 43 moved by at least one row; none is structural.

CAVEAT - cp_route_spread:
   A SPREAD among four routes to c_p, not an agreement among four witnesses - the Parameters cell shows route 2 reproduces route 1 by construction and route 4 is route 1 rounded, so the four trace to one printed determination plus route 3. Perturbing any one of them moves this number, and brk_cp_printed and brk_dH_kcal_kJ both do; the caveat is that it cannot detect a c_p that is wrong in the same way in all four places, which is precisely what a shared source looks like. C2.10 warns that U = 82.7 is such a shared source between it and D2.2. The CONCLUSION it supports - that the printed 0.992 is inconsistent with the chapter's own groups - rests on cp_printed_dev, not on this.

THE CROSSING CONTROL, COUNTED OVER THE WHOLE PAGE. Every threshold this notebook
has computed up to this point - the ladder table, the six-grid rung-1 chain, the
rung-2 grid chain, the four crossover scans and all 34 break rows - has been
checked: 717 bisected thresholds, of which 0 were REJECTED as not being ceiling
crossings. The smallest distance of any control solve from the ceiling, or of any
jump from the 1 K allowance, is 4.79e-03 K, so no verdict sits near round-off.</code></pre>
</div>
</div>
<div id="905654c2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:59:21.065762Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:59:21.065638Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:59:21.075326Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:59:21.074612Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb56" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb56-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ============ claims: every published number says what it is ===================</span></span>
<span id="cb56-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># docs/claims-design.md.  One registration per metric.</span></span>
<span id="cb56-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># VALUES are physical, data and discretisation results; CI holds them to rtol of the</span></span>
<span id="cb56-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># committed baseline.  The default rtol is 0.05; it is tightened ONLY where a break</span></span>
<span id="cb56-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># row needs it, and only for numbers that are exact arithmetic on printed constants</span></span>
<span id="cb56-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># or bisected to 1e-12, so the tighter band is still far above any machine spread.</span></span>
<span id="cb56-7">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D1.1"</span>)</span>
<span id="cb56-8">RTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb56-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dp_definition_cost"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed-constant arithmetic; Ergun refit moves 0.8 %</span></span>
<span id="cb56-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2_upper_ratio"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed-constant arithmetic; dT row moves 0.9 %</span></span>
<span id="cb56-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2_dTad_worst_dev"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed-constant arithmetic; atm row moves 2.2 %</span></span>
<span id="cb56-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2_Q_implied_by_p0"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed-constant arithmetic; atm row moves 0.7 %</span></span>
<span id="cb56-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_p0_star_extrapolated"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># thresholds start-dependent at ~1e-8; R_t row moves 1.3 %</span></span>
<span id="cb56-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_R_t"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># refinement bracket 2e-4 relative; 2 % row moves 2.8 %</span></span>
<span id="cb56-15">}</span>
<span id="cb56-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOUNDS: identities, two-route gaps and convergence orders.  Each states its basis.</span></span>
<span id="cb56-17">BOUNDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb56-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U_from_2d_dev"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-19">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb56-20">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (11.7.4-1) at R_t = 0.0125 m returns the printed U = 0.096 to "</span></span>
<span id="cb56-21">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"round-off, so only a bound is stated"</span>),</span>
<span id="cb56-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_p0"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-23">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb56-24">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two routes to rung 1's threshold: Richardson limit of the 150-4800 chain "</span></span>
<span id="cb56-25">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"against grid-free Radau (rtol 1e-12); the limit's own error, measured "</span></span>
<span id="cb56-26">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.0e-7; the bound is 25x that, and the finest grid alone is off by 2.6e-4"</span>),</span>
<span id="cb56-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ode_vs_pymrm_T"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-28">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb56-29">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two routes to rung 1's hot spot at 0.018 atm, as for ode_vs_pymrm_p0; "</span></span>
<span id="cb56-30">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measured 3.3e-5, the bound 3x that; the 4800-cell value alone is off by "</span></span>
<span id="cb56-31">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"about 17x the measured gap"</span>),</span>
<span id="cb56-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_p0"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-33">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb56-34">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind on the 150-4800 chain"</span>),</span>
<span id="cb56-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_order_T"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-36">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb56-37">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind; the hot spot is a root-found maximum, measured 0.94"</span>),</span>
<span id="cb56-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_grid_vs_11_9_1_11"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-39">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb56-40">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"256-cell second-order pellet grid against the closed form; measured 4.6e-6"</span>),</span>
<span id="cb56-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rung1_finest_err_over_start_floor"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-42">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb56-43">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|p0*(4800)/limit - 1| over the 1e-8 start-dependence floor of a "</span></span>
<span id="cb56-44">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"threshold: the order fit is not fitted to that noise"</span>),</span>
<span id="cb56-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_vs_B11_worst"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb56-46">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb56-47">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same closed form against B1.1's tabulated exact eta, whose phi column "</span></span>
<span id="cb56-48">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is printed to 6 significant figures; measured 3.2e-6"</span>),</span>
<span id="cb56-49">}</span>
<span id="cb56-50">EXACT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder_controls_rejected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scan_points_rejected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thresholds_rejected"</span>)</span>
<span id="cb56-51"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb56-52">    v_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE_M[k_]</span>
<span id="cb56-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS:</span>
<span id="cb56-54">        claims.bound(k_, v_, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>BOUNDS[k_])</span>
<span id="cb56-55">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXACT:</span>
<span id="cb56-56">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb56-57">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb56-58">        claims.value(k_, v_, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RTOL.get(k_, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>))</span>
<span id="cb56-59"></span>
<span id="cb56-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THRESHOLDED RESULTS carry their margin.  The crossing control decides a verdict by</span></span>
<span id="cb56-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># comparing two temperatures with the ceiling and their difference with CTL_JUMP; the</span></span>
<span id="cb56-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># margin is the smallest of those distances, in K.  Round-off in T is about 1e-10 K.</span></span>
<span id="cb56-63">_CTL_MARGIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(T_PERM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>), (hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_PERM,</span>
<span id="cb56-64">                            CTL_JUMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(j))</span>
<span id="cb56-65">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lo, hi, j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(CTL.T_just_below_C, CTL.T_just_above_C,</span>
<span id="cb56-66">                                             CTL.jump_K)))</span>
<span id="cb56-67">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder_controls_rejected"</span>, BASE_M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder_controls_rejected"</span>],</span>
<span id="cb56-68">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_CTL_MARGIN, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb56-69">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin in K: closest control solve to the 415 C ceiling, or jump to "</span></span>
<span id="cb56-70">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 1 K allowance, over the five ladder rungs"</span>)</span>
<span id="cb56-71">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thresholds_rejected"</span>, CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rejected"</span>],</span>
<span id="cb56-72">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CTL_STATS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin_K"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb56-73">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over every bisected threshold on the page, break rows included; "</span></span>
<span id="cb56-74">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin in K as for ladder_controls_rejected"</span>)</span>
<span id="cb56-75">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scan_points_rejected"</span>, SCAN_REFUSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_UNIFORM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> UNIFORM_OK),</span>
<span id="cb56-76">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SCAN_MARGIN_K, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb56-77">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thresholds rejected in the four crossover scans (sweep points and "</span></span>
<span id="cb56-78">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refinement probes) and the 9-point fine Pe_a grid; margin in K over "</span></span>
<span id="cb56-79">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the four scans"</span>)</span>
<span id="cb56-80"></span>
<span id="cb56-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every break row, measured above, is fed to the claims it touches</span></span>
<span id="cb56-82"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS:</span>
<span id="cb56-83">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_GOT[lbl].items():</span>
<span id="cb56-84">        claims.breaks(lbl, k_, v_)</span>
<span id="cb56-85"></span>
<span id="cb56-86">missing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(claims.metrics))</span>
<span id="cb56-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> missing, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics with a break row but no claim: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>missing<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb56-88">_kinds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {kd: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kd)</span>
<span id="cb56-89">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)}</span>
<span id="cb56-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values,"</span></span>
<span id="cb56-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bound'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exact'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact."</span>)</span>
<span id="cb56-92"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>):</span>
<span id="cb56-93">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _kinds[kd]:</span>
<span id="cb56-94">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[k_]</span>
<span id="cb56-95">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;5s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'note'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span>)[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb56-96"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Values tightened below rtol 0.05, each because a break row needs it: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb56-97"></span>
<span id="cb56-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PROSE: the numbers the Markdown cells quote, checked against their claims (one unit</span></span>
<span id="cb56-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># in the last written place).  Everything else this notebook prints is an f-string of</span></span>
<span id="cb56-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the registered number itself.</span></span>
<span id="cb56-101">SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb56-102">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_pe_axial"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.24883"</span>],          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the note on locating thresholds</span></span>
<span id="cb56-103">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scan_points_rejected"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>],              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "every point of every scan passes"</span></span>
<span id="cb56-104">}</span>
<span id="cb56-105"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.items():</span>
<span id="cb56-106">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lits:</span>
<span id="cb56-107">        claims.says(lit, k_)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>43 claims: 32 values, 8 bounds, 3 exact.
   bound U_from_2d_dev                      (here -1.1e-16)  eq. (11.7.4-1) at R_t = 0.0125 m returns the printed U = 0.0
   bound eta_grid_vs_11_9_1_11              (here 4.6e-06)  256-cell second-order pellet grid against the closed form; m
   bound eta_vs_B11_worst                   (here 3.2e-06)  the same closed form against B1.1's tabulated exact eta, who
   bound ode_vs_pymrm_T                     (here 3.3e-05)  two routes to rung 1's hot spot at 0.018 atm, as for ode_vs_
   bound ode_vs_pymrm_p0                    (here 4e-07)  two routes to rung 1's threshold: Richardson limit of the 15
   bound rung1_finest_err_over_start_floor  (here 2.6e+04)  |p0*(4800)/limit - 1| over the 1e-8 start-dependence floor o
   bound rung1_order_T                      (here 0.94)  first-order upwind; the hot spot is a root-found maximum, me
   bound rung1_order_p0                     (here 1)  first-order upwind on the 150-4800 chain
   exact ladder_controls_rejected           (here 0)  margin in K: closest control solve to the 415 C ceiling, or 
   exact scan_points_rejected               (here 0)  thresholds rejected in the four crossover scans (sweep point
   exact thresholds_rejected                (here 0)  over every bisected threshold on the page, break rows includ
Values tightened below rtol 0.05, each because a break row needs it: {'dp_definition_cost': 0.001, 'table2_upper_ratio': 0.001, 'table2_dTad_worst_dev': 0.001, 'table2_Q_implied_by_p0': 0.001, 'rung1_p0_star_extrapolated': 0.001, 'crossover_R_t': 0.01}</code></pre>
</div>
</div>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Honestly: not accuracy.</strong> Every rung of this ladder is a system Froment, De Wilde &amp; Bischoff solved in 1961-1967 with a Crank-Nicolson code, and section 11.7.4 says in as many words that “the possibilities of present-day computers are such that there is no longer any reason for not using the two-dimensional model”. Nothing here is a numerical advance over the book.</p>
<p>What pymrm adds is that <strong>the five models become five arguments to one assembly rather than five programs</strong>, and that is what makes the comparison possible at all. Concretely:</p>
<ul>
<li>the ladder’s five configurations differ by <em>which operators are built</em>, not by which file is run: rung 2 adds a <code>construct_grad</code>/<code>construct_div</code> pair to the same convection matrix, rung 5 adds a second <code>construct_grad</code>/<code>construct_div</code> pair on a second axis with <code>nu=1</code>, and rungs 3 and 4 add two algebraic fields masked out of the divergence by a <code>construct_coefficient_matrix</code>. Because the five share the residual, the source term and the kinetics, a difference between two rungs is a difference between two <em>models</em>, not between two codebases;</li>
<li>the effectiveness factor is read off <strong>the surface-flux row of the gradient operator</strong>, which is the same quantity the film balance uses, so eq. (11.9.1-11) can be checked against the equation it is a solution of rather than against a volume-averaged reaction rate that would hide a boundary-condition error;</li>
<li>the geometry of a divergence is a parameter (<code>nu = 0, 1, 2</code>), so the pellet sphere and the tube annulus are the same code, and the break table can inject a wrong geometry into either;</li>
<li><code>NumJac</code> makes the four-field algebraic-plus-differential system of rung 3 a Newton solve of the same shape as rung 1’s, and the film balances are two extra rows rather than an inner iteration.</li>
</ul>
<p>Two things this page adds that the chapter does not have, both consequences of the above rather than of pymrm:</p>
<ul>
<li><strong>the comparison is a threshold, not a profile.</strong> The chapter compares its models by plotting them; every figure in sections 11.5.2, 11.7.3 and 11.7.4 is a profile or a sensitivity curve, and the one quantitative comparison it prints - “less than 360” against “365” - is read off two such plots. Root-finding the inlet partial pressure at which the hot spot reaches the chapter’s own stated ceiling turns each rung into a single number with a sign, which is what “what does this rung buy” actually means to someone sizing a tube;</li>
<li><strong>the crossovers are located rather than asserted, and the solver’s own limits are located with them.</strong> The chapter’s yardsticks for climbing a rung are a rule of thumb (50 particle diameters), two criteria that cannot be evaluated on its own design case, and a sentence about sensitivity. Four root-found crossovers say how far each coefficient would have to move before its rung mattered, which is the same question with an answer - and they <strong>rank</strong> all four rungs, which is the part a rule of thumb cannot do. Each root is located between two points the crossing control validates, and each carries a grid-set error bar rather than its refinement tolerance.</li>
</ul>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>What to lift.</strong></p>
<ul>
<li><code>Ladder</code> is the whole ladder. Substituting a different reaction means replacing <code>source</code>; the five configurations, the boundary conditions and the diagnostics carry over unchanged. <code>p0_critical</code> is the reusable part of the comparison.</li>
<li><strong>Locate a threshold by following the branch, not by cold starts.</strong> Near a runaway threshold there are several steady states, and Newton’s damping does not choose between them: which one a cold start reaches is decided by the guess, and when the guess is itself a runaway profile, by round-off. The remedy is one cold solve at a safe parameter value, then every scan point and every bisection midpoint started from the converged state at the current lower end of the bracket. No state is carried from one search to the next, so the result still cannot depend on the direction a sweep was run in - the defect <code>B1.1</code> records for continuation chains.</li>
<li><strong>Put the control inside the root-find, not beside it.</strong> A bisection that treats a non-converged solve as “past the threshold” returns a <em>solver</em> boundary wherever the solver gives out, and it does it silently. Run the <img src="https://latex.codecogs.com/png.latex?%5Cpm%2010%5E%7B-5%7D"> control on <strong>every</strong> call and <em>raise</em> when it fails, so a bad threshold cannot become a number anywhere, and write the searches so that a rejected point is recorded and used for nothing and a scan that cannot straddle its target raises. On this page, with the branch followed, the control rejects nothing; it is there for the case where it would.</li>
<li>The <strong>Danckwerts inlet as a length</strong>: because <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20D_%7Bea%7D/u_s"> and <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bea%7D/(%5Crho_g%20c_p%20u_s)"> are both lengths, the inlet condition of rung 2 is <code>{"a": d_p/Pe, "b": 1.0, "d": c_in}</code> with no unit bookkeeping at all, and the two fields differ only in their Péclet number. That is <code>A2.1</code>’s dict with the scaling done once.</li>
<li><strong>Scale an algebraic residual to the units of its own unknown.</strong> Written in the units the book writes them in, (11.8.1-3) is in atm/h and (11.8.1-4) in kcal/(m<img src="https://latex.codecogs.com/png.latex?%5E3"> h), so a residual test with one absolute threshold, like the one in <code>Ladder.solve</code>, is strict for one row and loose for the other. Dividing each balance by its own transfer coefficient puts both rows in the units of the surface unknown they determine.</li>
<li>The <strong>helper-plus-injection pattern</strong> in the break table: each metric has exactly one function that computes it, <em>every</em> metric’s helper default is asserted equal to a number printed earlier in the notebook to 1e-12, and every break row perturbs one of its arguments. That is what makes “the row reaches the code it perturbs” checkable rather than a claim: a row that reads a module constant instead of the configuration does not reach the code it names. Two further rules:
<ul>
<li><strong>an unasserted helper drifts.</strong> A helper that runs its own coarser refinement while the notebook displays a finer one carries a different number into <code>agreement.json</code>, and nothing compares them. The remedy is structural rather than a tighter tolerance - the display and the metric are the <em>same call</em>, memoised - and the assertion list is checked against the metric set, so a metric cannot be added without one.</li>
<li><strong>the four shifts are the exception, and exceptions get printed.</strong> The break rows cannot afford the displayed grid once per row, so those four metrics are computed on a coarser one. Both values and their gap are printed in a table; an exception you can see is a caveat, an exception you cannot is a discrepancy.</li>
</ul></li>
<li><strong>The AST guard, but only if you measure its teeth on the forms you care about AND publish the ones it misses.</strong> This one parses each row plus one level of the helpers it names and rejects a metric key bound to a numeric literal - and it constant-folds, so <code>0.1656 + 0.0001</code>, <code>float("15.688")</code>, a subscript off a frozen tuple, a one-line laundering helper and tuple unpacking are all caught. A negative control that tests only the bare literal measures the guard’s easiest case rather than its coverage, so there is one control per laundering form, each asserted to catch exactly its own keys - and a list of ESCAPE forms, printed and asserted to escape (the guard cell prints both counts), so the notebook states the guard’s blind spots rather than implying it has none. A module-level constant is one of them, and it is the realistic accidental case. The false-positive control binds a <em>metric</em> key to a computed value; a non-metric key is filtered out before the guard looks at anything, and would measure nothing.</li>
</ul>
<p><strong>What not to lift.</strong></p>
<ul>
<li><strong>The constants, without the audit.</strong> Section 11.5.2’s printed specific heat is several per cent from what its own downstream groups require, its printed mean density is out by <img src="https://latex.codecogs.com/png.latex?10%5E3">, group <img src="https://latex.codecogs.com/png.latex?A"> of Example 11.5.3.A misses its own printed formula, its tube radius is not the one its own figures were computed at, and its pressures are in a different unit from the one it prints. Every one of those was found by <em>loading <code>D2.2</code>’s and <code>C2.10</code>’s CSVs and printing them beside the book’s</em>, which took an afternoon and is the single highest-yield thing on this page. If you retype a constant from a textbook restatement of a paper, check the restatement. (All the percentages are computed in <em>Parameters</em> and <em>Validation</em>; none is typed here.)</li>
<li><strong>A row-by-row transcription check, on its own.</strong> Every row of Table 11.5.3.A-2 transcribes from the 1970 paper at a ratio of exactly 1.000000, and the table is still internally inconsistent by about a third, because one of those rows was copied correctly <em>from a different worked example at a different tube radius</em>. What caught it was a CROSS-COLUMN test the table imposes on itself - <img src="https://latex.codecogs.com/png.latex?%5CDelta%20T_%7Bad%7D%20=%20(B/A)p_0"> with the example’s own printed <img src="https://latex.codecogs.com/png.latex?A"> and <img src="https://latex.codecogs.com/png.latex?B">. If a table has two columns computed from one quantity, check them against each other, not only against the source. <strong>And then check what the cross-column test cannot see</strong>: Table 11.5.3.A-1 <em>passes</em> it while carrying the same transplanted <img src="https://latex.codecogs.com/png.latex?Q">, because both of its columns descend from that <img src="https://latex.codecogs.com/png.latex?Q">. A consistency test between two numbers can only catch a defect that moved one of them.</li>
<li><strong>The shifts, as advice about a real o-xylene reactor.</strong> The base case is section 11.5.2’s deliberate simplification, and the notebook shows it is <img src="https://latex.codecogs.com/png.latex?k_1"> alone used as the total consumption rate, with the combustion route’s heat of reaction (printed in the reconciliation cell) absent. The rung-to-rung <em>ordering</em> is what transfers; the magnitudes are for this pseudo-first-order reactor.</li>
<li><strong>Any of it as validation.</strong> Chapter 11 reports no experiment. Everything here is a reproduction of the book’s own arithmetic, of its transcription of a 1970 paper, and of five claims it makes about its own models.</li>
</ul>
<p><strong>What the page cannot conclude.</strong></p>
<ul>
<li>Whether rung 4 is needed on the real catalyst. The crossover <img src="https://latex.codecogs.com/png.latex?D_e"> is computed, but the chapter prints no <img src="https://latex.codecogs.com/png.latex?D_e"> for V<img src="https://latex.codecogs.com/png.latex?_2">O<img src="https://latex.codecogs.com/png.latex?_5"> on silica and sends the reader to two documents that are not on disk, so the sign of the rung-4 correction is established and its size is not.</li>
<li>Whether <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bea%7D"> makes rung 2 matter. The chapter says “little information is available” and never defines <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D_%7Bha%7D">; the page sweeps the two Péclet numbers together, so the crossover it root-finds is a crossover in <em>both</em> at once and not in <img src="https://latex.codecogs.com/png.latex?%5Clambda_%7Bea%7D"> alone. Nor is the shift below the swept range reported: the crossover cell prints the largest <img src="https://latex.codecogs.com/png.latex?%7C">shift<img src="https://latex.codecogs.com/png.latex?%7C"> on that sweep, and nothing is claimed about smaller Péclet numbers.</li>
<li>Anything about section 11.10, the sixth cell of Table 11.4-1 - the two-dimensional heterogeneous model. It is out of scope, and the Papageorgiou &amp; Froment [1995] kinetics it uses are a different reaction model.</li>
<li>Anything read off a figure. Figures 11.5.2-1/2, 11.6-1/2, 11.7.1-1/2/3, all six 11.7.3 figures, 11.7.4-1, 11.8.1-1..4, 11.8.2-1, 11.9.1.A-1..8 and the runaway band of Fig. 11.5.3-1 are not digitised, not traced and not read. The <strong>one</strong> thing taken from a figure anywhere on this page is the <em>unit word</em> on Fig. 11.5.2-1’s ordinate label, “<img src="https://latex.codecogs.com/png.latex?p_0">, atm”, read on a 300 ppi crop; no curve, tick or point is read from it or from any other.</li>
<li><strong>How rung 5’s threshold converges.</strong> Its hot spot is refined on both axes, but the threshold - the quantity the ladder table actually reports for that rung - is refined on neither. The (600, 10)-versus-(1200, 20) gap is printed; no observed order and no Richardson limit is claimed for it, and the tube-radius crossover is located at (600, 10) with that gap, divided by the local slope of the sweep, as its error bar - three figures on <img src="https://latex.codecogs.com/png.latex?R_t%5E*">, not the six its bisection tolerance would suggest.</li>
<li><strong>Whether a state exists that the Newton cannot reach.</strong> <code>p0_critical</code> counts a non-converged solve as supercritical. A control shows that every threshold this page reports - not only the five default rungs - is a genuine 415 <img src="https://latex.codecogs.com/png.latex?%5E%5Ccirc">C crossing rather than a convergence boundary, and thresholds that fail it are raised on rather than returned. What the control cannot do is find a bounded state the Newton never reaches: section 11.6’s own three-steady-state discussion is a warning that a computation can miss a state that exists. Each threshold here is, by construction, the one on the branch followed up from a safe feed; other branches are not searched for.</li>
</ul>
<div id="a8a7e6c4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T08:59:21.077234Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T08:59:21.077060Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T08:59:21.084372Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T08:59:21.083648Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb58-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb58-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb58-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for D1.1:
  E_over_R_internal_dev             = 0.0035325        value  rtol 0.05
  T_hot_0018_bar_reading_C          = 627.26           value  rtol 0.05
  U_from_2d_dev                     = (here -1.1e-16)  bound  bound [-1e-12, 1e-12] [chosen]
  U_from_2d_dev_at_printed_radius   = -0.0061162       value  rtol 0.05
  backint_residual                  = -0.013077        value  rtol 0.05
  conversion_worst_dev              = 0.0011577        value  rtol 0.05
  cp_printed_dev                    = 0.057003         value  rtol 0.05
  cp_route_spread                   = 0.0093642        value  rtol 0.05
  crossover_D_e                     = 2.2664e-05       value  rtol 0.05
  crossover_R_t                     = 0.010029         value  rtol 0.01
  crossover_film_scale              = 4.9304           value  rtol 0.05
  crossover_pe_axial                = 0.24883          value  rtol 0.05
  dp_definition_cost                = 0.30675          value  rtol 0.001
  eta_grid_vs_11_9_1_11             = (here 4.6e-06)   bound  bound &lt;= 0.0001 [theory]
  eta_vs_B11_worst                  = (here 3.2e-06)   bound  bound &lt;= 1e-05 [chosen]
  ex1151a_worst_dev                 = 0.0014889        value  rtol 0.05
  film_dT_at_hotspot_K              = 3.3083           value  rtol 0.05
  film_dT_at_startup_K              = 0.84515          value  rtol 0.05
  film_dT_over_pellet_dT            = 9.0638           value  rtol 0.05
  group_A_printed_dev               = 0.0024449        value  rtol 0.05
  group_B_dev                       = 2.1684e-05       value  rtol 0.05
  lump_deficit                      = -0.11411         value  rtol 0.05
  mears_margin                      = 3.7925           value  rtol 0.05
  ode_vs_pymrm_T                    = (here 3.3e-05)   bound  bound &lt;= 0.0001 [chosen]
  ode_vs_pymrm_p0                   = (here 4.0e-07)   bound  bound &lt;= 1e-05 [chosen]
  p0_star_bar_reading_dev           = -0.011054        value  rtol 0.05
  p0_star_vs_printed_0018           = 0.00028258       value  rtol 0.05
  re_implied_spread                 = 0.4534           value  rtol 0.05
  rung1_finest_err_over_start_floor = (here 2.6e+04)   bound  bound &gt;= 1000 [theory]
  rung1_order_T                     = (here 9.4e-01)   bound  bound [0.85, 1.15] [theory]
  rung1_order_p0                    = (here 1.0e+00)   bound  bound [0.9, 1.1] [theory]
  rung1_p0_star_extrapolated        = 0.018005         value  rtol 0.001
  shift_rung2_pct                   = 0.1657           value  rtol 0.05
  shift_rung3_pct                   = -4.7443          value  rtol 0.05
  shift_rung4_pct                   = 15.688           value  rtol 0.05
  shift_rung5_pct                   = -8.9419          value  rtol 0.05
  table1_worst_dev                  = 0.004759         value  rtol 0.05
  table2_Q_implied_by_p0            = 4.1102           value  rtol 0.001
  table2_dTad_worst_dev             = 0.36887          value  rtol 0.001
  table2_upper_ratio                = 0.82624          value  rtol 0.001
  ladder_controls_rejected          = 0                exact  exact, margin 0.00598
  thresholds_rejected               = 0                exact  exact, margin 0.00479
  scan_points_rejected              = 0                exact  exact, margin 0.006</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:D</category>
  <category>struct:S2</category>
  <category>struct:S4</category>
  <category>struct:S6</category>
  <category>struct:S7</category>
  <category>struct:S8</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/D1.1-froment-fixed-bed-ladder/</guid>
  <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Heck, Wei &amp; Katzer 1976: what the one-dimensional monolith model is adequate for</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/I1.3-heck-wei-katzer-monolith/</link>
  <description><![CDATA[ 




<section id="heck-wei-katzer-1976-what-the-one-dimensional-monolith-model-is-adequate-for" class="level1">
<h1>Heck, Wei &amp; Katzer 1976: what the one-dimensional monolith model is adequate for</h1>
<p><strong>Catalog ID:</strong> <code>I1.3</code> · <strong>Structure:</strong> <code>S6</code> (2-D PDE) · <strong>Tier:</strong> T0</p>
<p>The abstract makes two claims and the page tests both:</p>
<blockquote class="blockquote">
<p>“A two-dimensional model is shown to predict unusual behavior of the Nusselt number in the presence of rapid reaction. However, a simpler one-dimensional model is adequate for predicting monolith behavior.”</p>
</blockquote>
<p><em>Unusual</em> compared with what: that is Table 1, the paper’s only printed table, and this page derives five of its eight cells (two of them in closed form) instead of quoting them. <em>Adequate</em> for what, and where it stops: that is a 1-D versus 2-D comparison the page runs itself, and the paper’s own numbers for it are <strong>sampled inlet temperatures, not root-found thresholds</strong>.</p>
<div id="0cf95cb2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:06.005440Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:06.005214Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:06.020850Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:06.020032Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I1.3-heck-wei-katzer-monolith"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="ca436641" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:06.023060Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:06.022792Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:06.595095Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:06.594278Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> warnings</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> dataclasses <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> replace</span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> display_html</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq, minimize_scalar</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, load_claims, load_data</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (Channel, Graetz, Radial, Voltz, closed_form_nusselt, correlation,</span>
<span id="cb2-11">                   cross, duct, fitted_order, local_nusselt, observed_order, parse_flux,</span>
<span id="cb2-12">                   reconstruct_groups, richardson, square_spectral, wall_flux)</span>
<span id="cb2-13"></span>
<span id="cb2-14">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb2-15"></span>
<span id="cb2-16"></span>
<span id="cb2-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> show(styler):</span>
<span id="cb2-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Display a styled table as HTML only, with a pinned uuid, so reruns are identical."""</span></span>
<span id="cb2-19">    display_html(styler.to_html(), raw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>A monolith converter is a bundle of parallel ceramic channels with platinum on the walls. CO oxidation over Pt is strongly exothermic <em>and</em> inhibited by CO, so the rate is <strong>negative order</strong> in CO at high CO: the rate curve rises, peaks and falls as the wall concentration increases. Put that curve against a straight mass-transfer line and you get one or three intersections, and the jump from the outer to the inner one is <strong>light-off</strong>.</p>
<p>The question the paper asks is a modelling question, not a chemistry one. A 1-D model lumps the cross-section and closes the wall fluxes with a Nusselt and a Sherwood number. A 2-D model resolves the radial profiles and <em>computes</em> the Nusselt number from them. Young and Finlayson (1974) had reported that the Nusselt number behaves strangely when the reaction is fast, and concluded the expensive 2-D model was necessary. Heck, Wei and Katzer confirm the strange behaviour and then argue the 1-D model is good enough anyway.</p>
<p>Both halves are checkable <strong>without touching a figure</strong>, because the paper states the numbers that matter in running text.</p>
<p><code>I1.2</code> (Oh &amp; Cavendish 1982) is the neighbouring page: the same reactor, the same Voltz kinetics family, transient rather than steady, and reproduced against a printed table. This page shares no data with it and loads none of its files.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Read off the 300 ppi page bitmaps (<code>pdfimages -list</code> reports 300 ppi CCITT-G4 bilevel on all eight pages, so 300 is native). Nothing below came from the PDF text layer. The printed constants are listed from the data file in <em>The data</em>.</p>
<section id="the-kinetics-p.-478-from-voltz-et-al.-1973" class="level3">
<h3 class="anchored" data-anchor-id="the-kinetics-p.-478-from-voltz-et-al.-1973">The kinetics (p.&nbsp;478), from Voltz et al.&nbsp;(1973)</h3>
<p><img src="https://latex.codecogs.com/png.latex?r=%5Cfrac%7Bk_r%5C,C%5C,C_%7B%5Cmathrm%7BO_2%7D%7D%7D%7B%5B1+k_a%20C%5D%5E%7B2%7D%7D,%5Cqquad%0Ak_r=k_r%5E%7Bo%7D%5Cexp%5C!%5Cleft%5B-%5Cfrac%7BE_r%7D%7BR%5C,(T_w+273)%7D%5Cright%5D,%5Cqquad%0Ak_a=k_a%5E%7Bo%7D%5Cexp%5C!%5Cleft%5B-%5Cfrac%7BE_a%7D%7BR%5C,(T_w+273)%7D%5Cright%5D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?C"> a <strong>mole fraction</strong> (Notation, p.&nbsp;483) and <img src="https://latex.codecogs.com/png.latex?E_a%20%3C%200"> (adsorption). The paper writes no oxygen balance, so <img src="https://latex.codecogs.com/png.latex?C_%7B%5Cmathrm%7BO_2%7D%7D"> is held at its inlet value here and stoichiometric depletion is a break-table row.</p>
</section>
<section id="the-one-dimensional-model-eqs.-8-to-14" class="level3">
<h3 class="anchored" data-anchor-id="the-one-dimensional-model-eqs.-8-to-14">The one-dimensional model (eqs. 8 to 14)</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdC_G%7D%7BdX%5E%7B%5Cast%7D%7D=%5Cfrac%7BSh%7D%7BLe%7D(C_w-C_G),%5Cqquad%0A%5Cfrac%7BdT_G%7D%7BdX%5E%7B%5Cast%7D%7D=Nu%5C,(T_w-T_G),"></p>
<p>closed by <img src="https://latex.codecogs.com/png.latex?-r%5CDelta%20H%20=%20h(T_w-T_G)"> and <img src="https://latex.codecogs.com/png.latex?r=%5Cfrac%7B%5Crho_G%20k_m%7D%7BM_G%7D(C_G-C_w)">, and reduced with the adiabatic relation to a single algebraic wall condition. With <img src="https://latex.codecogs.com/png.latex?Le%5Ccong1"> and <img src="https://latex.codecogs.com/png.latex?Sh%5Ccong%20Nu"> the paper’s eq. (14) is</p>
<p><img src="https://latex.codecogs.com/png.latex?T_w%20%5Ccong%20T_G%5E%7Bo%7D%20+%20%5CDelta%20T_%7B%5Cmathrm%7BAD%7D%7D%5Cleft(1-%5Cfrac%7BC_w%7D%7BC_G%5E%7Bo%7D%7D%5Cright),%0A%5Cqquad%20%5CDelta%20T_%7B%5Cmathrm%7BAD%7D%7D=%5Cfrac%7B%5CDelta%20H%5C,C_G%5E%7Bo%7D%7D%7BM_G%20C_%7BPG%7D%7D%20."></p>
<p><strong>Equation (14) is not printed that way.</strong> Verbatim, it reads</p>
<blockquote class="blockquote">
<p><img src="https://latex.codecogs.com/png.latex?T_w%20%5Ccong%20T_G%7B%7D%5E%7Bo%7D%20+%20%5CDelta%20T_%7BAD%7D%20=%20%5Cleft(1%20-%20%5Cdfrac%7BC_w%7D%7BC_G%7B%7D%5E%7Bo%7D%7D%5Cright)"> (14)</p>
</blockquote>
<p>with an “=” where a multiplication is required. As printed it sets a temperature equal to a dimensionless number, so it cannot be right; the form above is what eq. (13) gives when <img src="https://latex.codecogs.com/png.latex?Le%5Ccong1"> and <img src="https://latex.codecogs.com/png.latex?Sh%5Ccong%20Nu"> are imposed as the text instructs. That is a derivation, labelled an inference. Reported, not repaired.</p>
</section>
<section id="the-two-dimensional-model-eqs.-15-to-19" class="level3">
<h3 class="anchored" data-anchor-id="the-two-dimensional-model-eqs.-15-to-19">The two-dimensional model (eqs. 15 to 19)</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B(1-R%5E%7B2%7D)%7D%7B2%7D%5Cfrac%7B%5Cpartial%20T_G%7D%7B%5Cpartial%20X%5E%7B%5Cast%7D%7D%0A=%5Cfrac%7B1%7D%7BR%7D%5Cfrac%7B%5Cpartial%7D%7B%5Cpartial%20R%7D%5Cleft(R%5Cfrac%7B%5Cpartial%20T_G%7D%7B%5Cpartial%20R%7D%5Cright),%0A%5Cqquad%0A%5Cfrac%7B(1-R%5E%7B2%7D)%7D%7B2%7D%5Cfrac%7B%5Cpartial%20C_G%7D%7B%5Cpartial%20X%5E%7B%5Cast%7D%7D%0A=%5Cfrac%7B1%7D%7BLe%5C,R%7D%5Cfrac%7B%5Cpartial%7D%7B%5Cpartial%20R%7D%5Cleft(R%5Cfrac%7B%5Cpartial%20C_G%7D%7B%5Cpartial%20R%7D%5Cright),"></p>
<p><img src="https://latex.codecogs.com/png.latex?r%5CDelta%20H=%5Cfrac%7B2k_G%7D%7BD%7D%5Cleft.%5Cfrac%7B%5Cpartial%20T_G%7D%7B%5Cpartial%20R%7D%5Cright%7C_w,%0A%5Cqquad%20r=%5Cfrac%7B2%5Crho_G%5Cmathcal%7BD%7D%7D%7BM_G%20D%7D%5Cleft.%5Cfrac%7B%5Cpartial%20C_G%7D%7B%5Cpartial%20R%7D%5Cright%7C_w,%0A%5Cqquad%0ANu=%5Cfrac%7B2%5C,%5Cpartial%20T/%5Cpartial%20R%7C_w%7D%7BT_w-%5Cbar%20T_G%7D.%20"></p>
<p>Two things about this block carry everything below.</p>
<p><strong>First, <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D"> does not mean the same thing in eq. (9) and eq. (15).</strong> The Notation defines <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D=4x/(D%5C,Re%5C,Pr)">. Equation (9) requires exactly that (it is the 1-D energy balance with <img src="https://latex.codecogs.com/png.latex?Nu=hD/k_G">). Equation (15) requires <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D=x/(D%5C,Re%5C,Pr)">, a factor of four smaller, and the figure abscissae are labelled <code>X/(D RE PR)</code> without the four. The paper’s own printed check value settles which the 2-D results use (Validation, first section). A <strong>third</strong> scaling, <img src="https://latex.codecogs.com/png.latex?1000%5C,x/(D%5C,Re%5C,Pr)">, is required by the Grigull-Tratz correlations the paper reprints on p.&nbsp;482, shown against a solve further down.</p>
<p><strong>Second, eqs. (17) and (18) cannot both have the sign they are printed with.</strong> The wall is a <em>sink</em> for CO and a <em>source</em> of heat, so <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20C_G/%5Cpartial%20R%7C_w"> and <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20T_G/%5Cpartial%20R%7C_w"> must have opposite signs; as printed both equations set a positive <img src="https://latex.codecogs.com/png.latex?r"> proportional to a positive gradient. The same applies to eq. (10) against eq. (12): <img src="https://latex.codecogs.com/png.latex?%5CDelta%20H"> cannot be positive in one and negative in the other. These are sign-convention slips with an obvious intent, reported, not repaired: the physically consistent signs are used.</p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p>Everything the paper prints is in <code>data/heck-1976-printed-values.csv</code>, with the journal page and the location for each row: running text, a displayed equation, a figure caption, or a character printed <strong>inside</strong> a figure’s frame (an annotation box, an abscissa tick label, a curve label or a case label). <strong>No curve was digitised anywhere on this page.</strong></p>
<section id="what-the-paper-does-not-print" class="level3">
<h3 class="anchored" data-anchor-id="what-the-paper-does-not-print">What the paper does not print</h3>
<p>The reacting model needs two dimensional groups the paper never states:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5CDelta%20T_%7B%5Cmathrm%7BAD%7D%7D%20=%20%5CDelta%20H%5C,C_G%5E%7Bo%7D/(M_G%20C_%7BPG%7D)">: <img src="https://latex.codecogs.com/png.latex?%5CDelta%20H"> and <img src="https://latex.codecogs.com/png.latex?C_G%5E%7Bo%7D"> are printed, <img src="https://latex.codecogs.com/png.latex?M_G%20C_%7BPG%7D"> is not;</li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cbeta%20%5Cequiv%20%5Crho_G%20k_m/M_G%20=%20(P/R_g%20T)%5C,Sh%5C,%5Cmathcal%7BD%7D/D">: <img src="https://latex.codecogs.com/png.latex?Sh"> and <img src="https://latex.codecogs.com/png.latex?D"> are printed, the molar density and the diffusivity are not.</li>
</ul>
<p>Neither can be recovered from the paper without circularity, so both are <strong>reconstructed from ordinary gas properties</strong> (an exhaust gas taken as air, the CO-air diffusivity scaled with temperature, atmospheric pressure, properties at the inlet temperature of Fig. 1; the values are printed below). The 1-D and the 2-D model use <em>the same two numbers</em>, so the comparison between them, which is what the page is about, is far less sensitive to the reconstruction than either model alone; the Validation section measures how much less.</p>
</section>
<section id="scope-figures-are-out" class="level3">
<h3 class="anchored" data-anchor-id="scope-figures-are-out">Scope: figures are out</h3>
<p>Figures 1 to 13 carry the paper’s profiles. Comparing against them would need digitisation, which needs a maintainer review that is not available, so <strong>it is scoped out</strong>: nothing is taken from a figure except characters <em>printed</em> in it, and every such row is listed and counted below. The page cannot check any profile shape, any light-off <em>position</em> against the paper’s own, or the conversion curves of Figs. 4 to 6 and 12. What it can do instead is check every number the paper states in words.</p>
<div id="80f6efe7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:06.597730Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:06.597552Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:06.608167Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:06.607442Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">T1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heck-1976-table1-nusselt.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-2">PV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heck-1976-printed-values.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-3">P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {r.quantity: r.value <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PV.itertuples()}         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed values, by name</span></span>
<span id="cb3-4"></span>
<span id="cb3-5"></span>
<span id="cb3-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pf(name):</span>
<span id="cb3-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A printed value as a float."""</span></span>
<span id="cb3-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P[name])</span>
<span id="cb3-9"></span>
<span id="cb3-10"></span>
<span id="cb3-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> t1(geom, col):</span>
<span id="cb3-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A Table 1 cell as printed."""</span></span>
<span id="cb3-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T1.loc[T1.geometry <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> geom, col].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb3-14"></span>
<span id="cb3-15"></span>
<span id="cb3-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every numeric printed value is registered as read: the page quotes them</span></span>
<span id="cb3-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PV.itertuples():</span>
<span id="cb3-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb3-19">        claims.exact(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"paper_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>quantity<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.value), structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb3-20">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read from heck-1976-printed-values.csv"</span>)</span>
<span id="cb3-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb3-22">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span>                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the four printed expressions</span></span>
<span id="cb3-23"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T1.itertuples():</span>
<span id="cb3-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>):</span>
<span id="cb3-25">        claims.exact(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"paper_table1_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>geometry<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' '</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb3-26">                     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(r, col)), structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb3-27">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read from heck-1976-table1-nusselt.csv"</span>)</span>
<span id="cb3-28"></span>
<span id="cb3-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the reconstruction (model.reconstruct_groups holds the gas properties)</span></span>
<span id="cb3-30">CG0, NU_SQ, T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CG_CO_inlet"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_used_1D"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TG_inlet_fig1"</span>)</span>
<span id="cb3-31">NU_CI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>)                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># round-tube value for the shape split</span></span>
<span id="cb3-32">DTAD, BETA, B0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reconstruct_groups(pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_H"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>, CG0, pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"channel_diameter"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb3-33">                                    NU_SQ, T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.0</span>)</span>
<span id="cb3-34">KIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Voltz(pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_r0"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_a0"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Er_over_R"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ea_over_R"</span>), CG0,</span>
<span id="cb3-35">            pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CG_O2_inlet"</span>))</span>
<span id="cb3-36">CH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Channel(KIN, DTAD, B0)</span>
<span id="cb3-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reconstructed: dT_AD = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DTAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K from the printed dH = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_H'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> MJ/kmol "</span></span>
<span id="cb3-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and C_G0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CG0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"               beta  = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kmol/m2 s per unit mole fraction, "</span></span>
<span id="cb3-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(P/RgT) Sh D_AB / D with Sh = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-41"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> inspect</span>
<span id="cb3-42">GAS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v.default <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> inspect.signature(reconstruct_groups).parameters.items()</span>
<span id="cb3-43">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M_G"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_PG"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_g"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_AB300"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_T"</span>)}</span>
<span id="cb3-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas properties: "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GAS.items())</span>
<span id="cb3-45">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (kg/kmol, J/kg K, Pa, J/kmol K, m2/s at 300 K, exponent of T)"</span>)</span>
<span id="cb3-46"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GAS.items():</span>
<span id="cb3-47">    claims.exact(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"input_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v), structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"model.reconstruct_groups default"</span>)</span>
<span id="cb3-48">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred_omega"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Graetz.solve default relaxation"</span>)</span>
<span id="cb3-49">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep_L_margin"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen sweep end past the paper's lengths"</span>)</span>
<span id="cb3-50">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dTad_reconstructed"</span>, DTAD, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb3-51">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_reconstructed"</span>, BETA, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>reconstructed: dT_AD = 425.15 K from the printed dH = 336.9 MJ/kmol and C_G0 = 0.04
               beta  = 3.3267e-03 kmol/m2 s per unit mole fraction, (P/RgT) Sh D_AB / D with Sh = 3.608
gas properties: M_G = 29, C_PG = 1093, P = 101325, R_g = 8314, D_AB300 = 2.08e-05, n_T = 1.75  (kg/kmol, J/kg K, Pa, J/kmol K, m2/s at 300 K, exponent of T)</code></pre>
</div>
</div>
</section>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Two files, both tier 6 (the paper’s own printed values, no measurement).</p>
<ul>
<li><code>heck-1976-table1-nusselt.csv</code>: Table 1, all eight cells, the paper’s <strong>only</strong> printed table.</li>
<li><code>heck-1976-printed-values.csv</code>: every constant and every stated numerical result, with its journal page.</li>
</ul>
<p>Table 1 is not the authors’ computation: its footnote attributes it to Shah and London (1971), which was <strong>not consulted</strong>. Two of its cells have exact closed forms, derived here. The sinusoidal row cannot be checked from this paper at all: the geometry column prints only a glyph, and the paper states no aspect ratio or wall profile.</p>
<p>The cell below lists every row that names a figure and <strong>counts them from the CSV itself</strong>, so the scope statement above can be audited without diffing the file.</p>
<div id="0407618a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:06.609944Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:06.609771Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:06.658875Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:06.658140Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1">show(T1.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_t1"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>))</span>
<span id="cb5-2">IN_FRAME <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"annotation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"annotation box"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tick label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abscissa tick labels"</span>),</span>
<span id="cb5-3">            (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curve label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curve label"</span>), (<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"case </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"case label"</span>))</span>
<span id="cb5-4">OUTSIDE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"caption"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure caption"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"running text"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"running text"</span>),</span>
<span id="cb5-5">           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"displayed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"displayed equation"</span>))</span>
<span id="cb5-6"></span>
<span id="cb5-7"></span>
<span id="cb5-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _kinds(w, pats):</span>
<span id="cb5-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(lab <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pat, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pats <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> re.search(pat, w)) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span></span>
<span id="cb5-10"></span>
<span id="cb5-11"></span>
<span id="cb5-12">prov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([(r.quantity, r.where, _kinds(r.where, IN_FRAME), _kinds(r.where, OUTSIDE))</span>
<span id="cb5-13">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PV.itertuples() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> re.search(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"Fig"</span>, r.where)],</span>
<span id="cb5-14">                    columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"where (as recorded in the CSV)"</span>,</span>
<span id="cb5-15">                             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read INSIDE the figure frame"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"also printed outside it"</span>])</span>
<span id="cb5-16">show(prov.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_prov"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>))</span>
<span id="cb5-17">inside <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prov[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read INSIDE the figure frame"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span></span>
<span id="cb5-18">n_in <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(inside.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb5-19">n_only <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((inside <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (prov[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"also printed outside it"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb5-20">by_kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lab: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(prov[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read INSIDE the figure frame"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.contains(lab, regex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb5-21">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> IN_FRAME}</span>
<span id="cb5-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PV)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed constants and stated results; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows in Table 1."</span>)</span>
<span id="cb5-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(prov)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows name a figure; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_in<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> were read inside a figure's frame, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_only<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of "</span></span>
<span id="cb5-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"them</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed nowhere else in the paper; the other </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(prov) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n_in<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are in running "</span></span>
<span id="cb5-25">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text or a caption."</span>)</span>
<span id="cb5-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"By kind: "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> by_kind.items()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)</span>
<span id="cb5-27">show(PV[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unit"</span>]].style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_pv"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>))</span>
<span id="cb5-28"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data_rows"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PV)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_rows"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows_naming_a_figure"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(prov)),</span>
<span id="cb5-29">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows_inside_a_frame"</span>, n_in), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows_only_in_a_frame"</span>, n_only)):</span>
<span id="cb5-30">    claims.exact(name, n, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"counted from the CSV"</span>)</span>
<span id="cb5-31"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> by_kind.items():</span>
<span id="cb5-32">    claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows_"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> lab.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>), n, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"counted from the CSV"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_t1" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_t1_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">geometry</th>
<th id="T_i13_t1_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">glyph</th>
<th id="T_i13_t1_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">Nu_H</th>
<th id="T_i13_t1_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">Nu_T</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_t1_row0_col0" class="data row0 col0">circular</td>
<td id="T_i13_t1_row0_col1" class="data row0 col1">O</td>
<td id="T_i13_t1_row0_col2" class="data row0 col2">4.364000</td>
<td id="T_i13_t1_row0_col3" class="data row0 col3">3.657000</td>
</tr>
<tr class="even">
<td id="T_i13_t1_row1_col0" class="data row1 col0">square</td>
<td id="T_i13_t1_row1_col1" class="data row1 col1">square</td>
<td id="T_i13_t1_row1_col2" class="data row1 col2">3.608000</td>
<td id="T_i13_t1_row1_col3" class="data row1 col3">2.976000</td>
</tr>
<tr class="odd">
<td id="T_i13_t1_row2_col0" class="data row2 col0">equilateral triangle</td>
<td id="T_i13_t1_row2_col1" class="data row2 col1">triangle</td>
<td id="T_i13_t1_row2_col2" class="data row2 col2">3.111000</td>
<td id="T_i13_t1_row2_col3" class="data row2 col3">2.470000</td>
</tr>
<tr class="even">
<td id="T_i13_t1_row3_col0" class="data row3 col0">sinusoidal</td>
<td id="T_i13_t1_row3_col1" class="data row3 col1">approx-equal</td>
<td id="T_i13_t1_row3_col2" class="data row3 col2">2.617000</td>
<td id="T_i13_t1_row3_col3" class="data row3 col3">2.120000</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_prov" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_prov_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">row</th>
<th id="T_i13_prov_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">where (as recorded in the CSV)</th>
<th id="T_i13_prov_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">read INSIDE the figure frame</th>
<th id="T_i13_prov_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">also printed outside it</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_prov_row0_col0" class="data row0 col0">CG_CO_inlet</td>
<td id="T_i13_prov_row0_col1" class="data row0 col1">Figs. 1-5 annotation boxes; p. 478 col. 2 running text</td>
<td id="T_i13_prov_row0_col2" class="data row0 col2">annotation box</td>
<td id="T_i13_prov_row0_col3" class="data row0 col3">running text</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row1_col0" class="data row1 col0">CG_O2_inlet</td>
<td id="T_i13_prov_row1_col1" class="data row1 col1">Figs. 1-5 annotation boxes</td>
<td id="T_i13_prov_row1_col2" class="data row1 col2">annotation box</td>
<td id="T_i13_prov_row1_col3" class="data row1 col3">-</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row2_col0" class="data row2 col0">TG_inlet_fig1</td>
<td id="T_i13_prov_row2_col1" class="data row2 col1">p. 478 col. 2 running text and Fig. 1 annotation</td>
<td id="T_i13_prov_row2_col2" class="data row2 col2">annotation box</td>
<td id="T_i13_prov_row2_col3" class="data row2 col3">running text</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row3_col0" class="data row3 col0">delta_H</td>
<td id="T_i13_prov_row3_col1" class="data row3 col1">Fig. 13 annotation box, p. 482</td>
<td id="T_i13_prov_row3_col2" class="data row3 col2">annotation box</td>
<td id="T_i13_prov_row3_col3" class="data row3 col3">-</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row4_col0" class="data row4 col0">channel_diameter</td>
<td id="T_i13_prov_row4_col1" class="data row4 col1">Fig. 3 annotation box, p. 479</td>
<td id="T_i13_prov_row4_col2" class="data row4 col2">annotation box</td>
<td id="T_i13_prov_row4_col3" class="data row4 col3">-</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row5_col0" class="data row5 col0">Nu_used_1D</td>
<td id="T_i13_prov_row5_col1" class="data row5 col1">Figs. 2 and 7 annotation boxes</td>
<td id="T_i13_prov_row5_col2" class="data row5 col2">annotation box</td>
<td id="T_i13_prov_row5_col3" class="data row5 col3">-</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row6_col0" class="data row6 col0">lightoff_window_2D_low</td>
<td id="T_i13_prov_row6_col1" class="data row6 col1">p. 481 col. 2 running text (Fig. 11 case 1)</td>
<td id="T_i13_prov_row6_col2" class="data row6 col2">-</td>
<td id="T_i13_prov_row6_col3" class="data row6 col3">running text</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row7_col0" class="data row7 col0">lightoff_window_2D_high</td>
<td id="T_i13_prov_row7_col1" class="data row7 col1">p. 481 col. 2 running text (Fig. 11 case 3)</td>
<td id="T_i13_prov_row7_col2" class="data row7 col2">-</td>
<td id="T_i13_prov_row7_col3" class="data row7 col3">running text</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row8_col0" class="data row8 col0">lightoff_window_2D_inlet_case</td>
<td id="T_i13_prov_row8_col1" class="data row8 col1">Fig. 11 case 4 label, p. 482</td>
<td id="T_i13_prov_row8_col2" class="data row8 col2">case label</td>
<td id="T_i13_prov_row8_col3" class="data row8 col3">-</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row9_col0" class="data row9 col0">fig2_abscissa_end</td>
<td id="T_i13_prov_row9_col1" class="data row9 col1">Fig. 2 abscissa tick labels, p. 479</td>
<td id="T_i13_prov_row9_col2" class="data row9 col2">abscissa tick labels</td>
<td id="T_i13_prov_row9_col3" class="data row9 col3">-</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row10_col0" class="data row10 col0">fig3_abscissa_end</td>
<td id="T_i13_prov_row10_col1" class="data row10 col1">Figs. 3-5 abscissa tick labels, p. 479</td>
<td id="T_i13_prov_row10_col2" class="data row10 col2">abscissa tick labels</td>
<td id="T_i13_prov_row10_col3" class="data row10 col3">-</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row11_col0" class="data row11 col0">fig11_abscissa_end</td>
<td id="T_i13_prov_row11_col1" class="data row11 col1">Fig. 11 abscissa tick labels, p. 482</td>
<td id="T_i13_prov_row11_col2" class="data row11 col2">abscissa tick labels</td>
<td id="T_i13_prov_row11_col3" class="data row11 col3">-</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row12_col0" class="data row12 col0">Qw_fig8</td>
<td id="T_i13_prov_row12_col1" class="data row12 col1">Fig. 8 curve labels, p. 481</td>
<td id="T_i13_prov_row12_col2" class="data row12 col2">curve label</td>
<td id="T_i13_prov_row12_col3" class="data row12 col3">-</td>
</tr>
<tr class="even">
<td id="T_i13_prov_row13_col0" class="data row13 col0">Qw_fig9</td>
<td id="T_i13_prov_row13_col1" class="data row13 col1">Fig. 9 caption, p. 481</td>
<td id="T_i13_prov_row13_col2" class="data row13 col2">-</td>
<td id="T_i13_prov_row13_col3" class="data row13 col3">figure caption</td>
</tr>
<tr class="odd">
<td id="T_i13_prov_row14_col0" class="data row14 col0">Tbar_at_X_0p25</td>
<td id="T_i13_prov_row14_col1" class="data row14 col1">p. 481 col. 1 running text (Fig. 10)</td>
<td id="T_i13_prov_row14_col2" class="data row14 col2">-</td>
<td id="T_i13_prov_row14_col3" class="data row14 col3">running text</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>33 printed constants and stated results; 4 rows in Table 1.
15 rows name a figure; 11 were read inside a figure's frame, 9 of them
printed nowhere else in the paper; the other 4 are in running text or a caption.
By kind: annotation box 6, abscissa tick labels 3, curve label 1, case label 1.</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_pv" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_pv_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">quantity</th>
<th id="T_i13_pv_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">value</th>
<th id="T_i13_pv_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">unit</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_pv_row0_col0" class="data row0 col0">k_r0</td>
<td id="T_i13_pv_row0_col1" class="data row0 col1">4.14e8</td>
<td id="T_i13_pv_row0_col2" class="data row0 col2">kg mole/m2 s</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row1_col0" class="data row1 col0">k_a0</td>
<td id="T_i13_pv_row1_col1" class="data row1 col1">65.5</td>
<td id="T_i13_pv_row1_col2" class="data row1 col2">dimensionless</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row2_col0" class="data row2 col0">Er_over_R</td>
<td id="T_i13_pv_row2_col1" class="data row2 col1">12600</td>
<td id="T_i13_pv_row2_col2" class="data row2 col2">K</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row3_col0" class="data row3 col0">Ea_over_R</td>
<td id="T_i13_pv_row3_col1" class="data row3 col1">-961</td>
<td id="T_i13_pv_row3_col2" class="data row3 col2">K</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row4_col0" class="data row4 col0">CG_CO_inlet</td>
<td id="T_i13_pv_row4_col1" class="data row4 col1">0.04</td>
<td id="T_i13_pv_row4_col2" class="data row4 col2">mole fraction</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row5_col0" class="data row5 col0">CG_O2_inlet</td>
<td id="T_i13_pv_row5_col1" class="data row5 col1">0.04</td>
<td id="T_i13_pv_row5_col2" class="data row5 col2">mole fraction</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row6_col0" class="data row6 col0">TG_inlet_fig1</td>
<td id="T_i13_pv_row6_col1" class="data row6 col1">316</td>
<td id="T_i13_pv_row6_col2" class="data row6 col2">degC</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row7_col0" class="data row7 col0">Cw_at_rate_maximum</td>
<td id="T_i13_pv_row7_col1" class="data row7 col1">0.003</td>
<td id="T_i13_pv_row7_col2" class="data row7 col2">mole fraction</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row8_col0" class="data row8 col0">delta_H</td>
<td id="T_i13_pv_row8_col1" class="data row8 col1">336.9</td>
<td id="T_i13_pv_row8_col2" class="data row8 col2">MJ/kg mole</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row9_col0" class="data row9 col0">channel_diameter</td>
<td id="T_i13_pv_row9_col1" class="data row9 col1">1.52</td>
<td id="T_i13_pv_row9_col2" class="data row9 col2">mm</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row10_col0" class="data row10 col0">Nu_used_1D</td>
<td id="T_i13_pv_row10_col1" class="data row10 col1">3.608</td>
<td id="T_i13_pv_row10_col2" class="data row10 col2">dimensionless</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row11_col0" class="data row11 col0">lightoff_window_1D_low</td>
<td id="T_i13_pv_row11_col1" class="data row11 col1">304</td>
<td id="T_i13_pv_row11_col2" class="data row11 col2">degC</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row12_col0" class="data row12 col0">lightoff_window_1D_high</td>
<td id="T_i13_pv_row12_col1" class="data row12 col1">343</td>
<td id="T_i13_pv_row12_col2" class="data row12 col2">degC</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row13_col0" class="data row13 col0">lightoff_window_2D_low</td>
<td id="T_i13_pv_row13_col1" class="data row13 col1">293</td>
<td id="T_i13_pv_row13_col2" class="data row13 col2">degC</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row14_col0" class="data row14 col0">lightoff_window_2D_high</td>
<td id="T_i13_pv_row14_col1" class="data row14 col1">343</td>
<td id="T_i13_pv_row14_col2" class="data row14 col2">degC</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row15_col0" class="data row15 col0">lightoff_window_2D_inlet_case</td>
<td id="T_i13_pv_row15_col1" class="data row15 col1">349</td>
<td id="T_i13_pv_row15_col2" class="data row15 col2">degC</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row16_col0" class="data row16 col0">fig2_abscissa_end</td>
<td id="T_i13_pv_row16_col1" class="data row16 col1">0.20</td>
<td id="T_i13_pv_row16_col2" class="data row16 col2">Graetz units</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row17_col0" class="data row17 col0">fig3_abscissa_end</td>
<td id="T_i13_pv_row17_col1" class="data row17 col1">0.25</td>
<td id="T_i13_pv_row17_col2" class="data row17 col2">Graetz units</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row18_col0" class="data row18 col0">fig11_abscissa_end</td>
<td id="T_i13_pv_row18_col1" class="data row18 col1">0.50</td>
<td id="T_i13_pv_row18_col2" class="data row18 col2">Graetz units</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row19_col0" class="data row19 col0">axial_step_1D</td>
<td id="T_i13_pv_row19_col1" class="data row19 col1">0.0005</td>
<td id="T_i13_pv_row19_col2" class="data row19 col2">Graetz units</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row20_col0" class="data row20 col0">axial_step_1D_metric</td>
<td id="T_i13_pv_row20_col1" class="data row20 col1">0.0076</td>
<td id="T_i13_pv_row20_col2" class="data row20 col2">cm</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row21_col0" class="data row21 col0">radial_points_2D</td>
<td id="T_i13_pv_row21_col1" class="data row21 col1">10</td>
<td id="T_i13_pv_row21_col2" class="data row21 col2">count</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row22_col0" class="data row22 col0">axial_step_2D</td>
<td id="T_i13_pv_row22_col1" class="data row22 col1">0.00025</td>
<td id="T_i13_pv_row22_col2" class="data row22 col2">Graetz units</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row23_col0" class="data row23 col0">Qw_fig8</td>
<td id="T_i13_pv_row23_col1" class="data row23 col1">-9.46+(46.0 X)**8</td>
<td id="T_i13_pv_row23_col2" class="data row23 col2">dimensionless</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row24_col0" class="data row24 col0">Qw_fig9</td>
<td id="T_i13_pv_row24_col1" class="data row24 col1">-3+(40 X)**8</td>
<td id="T_i13_pv_row24_col2" class="data row24 col2">dimensionless</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row25_col0" class="data row25 col0">Qw_zero_stated</td>
<td id="T_i13_pv_row25_col1" class="data row25 col1">0.029</td>
<td id="T_i13_pv_row25_col2" class="data row25 col2">Graetz units</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row26_col0" class="data row26 col0">X_sign_negative_Nu</td>
<td id="T_i13_pv_row26_col1" class="data row26 col1">0.032</td>
<td id="T_i13_pv_row26_col2" class="data row26 col2">Graetz units</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row27_col0" class="data row27 col0">X_sign_positive_Nu</td>
<td id="T_i13_pv_row27_col1" class="data row27 col1">0.033</td>
<td id="T_i13_pv_row27_col2" class="data row27 col2">Graetz units</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row28_col0" class="data row28 col0">Tbar_at_X_0p25</td>
<td id="T_i13_pv_row28_col1" class="data row28 col1">0.0224</td>
<td id="T_i13_pv_row28_col2" class="data row28 col2">dimensionless</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row29_col0" class="data row29 col0">Nu_GrigullTratz_Tw</td>
<td id="T_i13_pv_row29_col1" class="data row29 col1">3.655+6.874*X**-0.488*exp(-0.0572*X)</td>
<td id="T_i13_pv_row29_col2" class="data row29 col2">dimensionless</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row30_col0" class="data row30 col0">Nu_GrigullTratz_Qw</td>
<td id="T_i13_pv_row30_col1" class="data row30 col1">4.364+8.68*X**-0.506*exp(-0.041*X)</td>
<td id="T_i13_pv_row30_col2" class="data row30 col2">dimensionless</td>
</tr>
<tr class="even">
<td id="T_i13_pv_row31_col0" class="data row31 col0">adequacy_claim_degC</td>
<td id="T_i13_pv_row31_col1" class="data row31 col1">2</td>
<td id="T_i13_pv_row31_col2" class="data row31 col2">degC</td>
</tr>
<tr class="odd">
<td id="T_i13_pv_row32_col0" class="data row32 col0">compute_time_ratio</td>
<td id="T_i13_pv_row32_col1" class="data row32 col1">10</td>
<td id="T_i13_pv_row32_col2" class="data row32 col2">dimensionless</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Three solvers, in <code>model.py</code>, all built from <code>pymrm</code> operators that are assembled once per solve.</p>
<ol type="1">
<li><strong><code>duct(...)</code></strong>: fully developed flow and heat transfer in a duct cross-section, for Table 1. Cartesian 2-D for the square (quarter domain, symmetry planes as zero-gradient boundaries), cylindrical 1-D for the circle (<code>nu=1</code> in <code>construct_div</code>). The constant-wall-temperature case is the <img src="https://latex.codecogs.com/png.latex?u">-weighted eigenproblem, solved by shift-invert <code>eigsh</code>.</li>
<li><strong><code>Graetz</code></strong>: the developing problem in a round tube on the whole <img src="https://latex.codecogs.com/png.latex?(X,%20R)"> domain, shape <code>(n_x, n_r)</code>, with van Leer face values in <img src="https://latex.codecogs.com/png.latex?X">. The axial direction carries convection only, so the outlet takes no condition: <code>{"outflow": True}</code>. The radial wall takes an imposed flux that varies along <img src="https://latex.codecogs.com/png.latex?X"> (an array-valued <code>d</code>) or a fixed temperature, and wall values come from <code>compute_boundary_values</code>. The production route is deferred correction on one LU of the upwind operator, under-relaxed with <img src="https://latex.codecogs.com/png.latex?%5Comega%20=%200.6">. An independent route, <code>solve_newton</code>, solves the same discrete equations with the exact van Leer Jacobian of <code>ConvFluxTVD</code> and <code>newton(damping="monotone")</code>; the Validation section compares the two.</li>
<li><strong><code>Channel</code></strong>: the reacting monolith channel, 1-D and 2-D on a common axial coordinate <img src="https://latex.codecogs.com/png.latex?G%20=%20x/(D%5C,Re%5C,Pr)"> and on the same reconstructed groups. With <img src="https://latex.codecogs.com/png.latex?Le%20=%201"> the 2-D field is linear in the wall flux <img src="https://latex.codecogs.com/png.latex?q">, so the response to a unit flux is computed once per step length and each backward-Euler step is one linear solve (on a matrix from <code>construct_coefficient_matrix</code> and the radial operators) and then a <em>scalar</em> root for the wall value: the same algebra as the 1-D mass-transfer line, with an effective <img src="https://latex.codecogs.com/png.latex?%5Cbeta">. The cold branch exists while the bulk value lies above the fold, <img src="https://latex.codecogs.com/png.latex?r'(C_w)%20=%20-%5Cbeta">; light-off is root-found <strong>inside the crossing step</strong>, on the length of that step, not reported as the step itself.</li>
</ol>
<p>Every switch a break-table row needs is a <strong>function argument</strong>, so each row re-runs the computation with the defect in place.</p>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="table-1-derived-rather-than-quoted" class="level3">
<h3 class="anchored" data-anchor-id="table-1-derived-rather-than-quoted">1. Table 1, derived rather than quoted</h3>
<p>The paper’s only table is the “usual” behaviour against which the Nusselt number is called unusual. Two of its cells have exact closed forms; the square pair does not, and is computed twice on discretisations that share nothing.</p>
<div id="f1256bdd" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:06.660906Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:06.660658Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:07.258638Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:07.257639Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">nu_c_exact, nu_t_exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> closed_form_nusselt()</span>
<span id="cb7-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"circular duct,   constant wall flux: Nu_H1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nu_c_exact<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_c_exact)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-3">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (Table 1 prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'circular'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nu_H'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb7-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equilateral tri, constant wall flux: Nu_H1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nu_t_exact<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_t_exact)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-5">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (Table 1 prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equilateral triangle'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nu_H'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb7-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Both from exact polynomial solutions of the cross-section problem; nothing is quoted."</span>)</span>
<span id="cb7-7">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_circle_exact"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_c_exact), structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb7-8">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"48/11, a symbolic result; no solver argument produces it"</span>)</span>
<span id="cb7-9">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_triangle_exact"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_t_exact), structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb7-10">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"28/9, a symbolic result"</span>)</span>
<span id="cb7-11"></span>
<span id="cb7-12"></span>
<span id="cb7-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> printed_relerr(exact, printed):</span>
<span id="cb7-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> exact</span>
<span id="cb7-15"></span>
<span id="cb7-16"></span>
<span id="cb7-17">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_circle_printed_relerr"</span>,</span>
<span id="cb7-18">             printed_relerr(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_c_exact), t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>)), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb7-19">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_triangle_printed_relerr"</span>,</span>
<span id="cb7-20">             printed_relerr(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_t_exact), t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equilateral triangle"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>)), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>circular duct,   constant wall flux: Nu_H1 = 48/11 = 4.363636   (Table 1 prints 4.364)
equilateral tri, constant wall flux: Nu_H1 = 28/9 = 3.111111   (Table 1 prints 3.111)
Both from exact polynomial solutions of the cross-section problem; nothing is quoted.</code></pre>
</div>
</div>
<div id="8a1213fc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:07.260808Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:07.260617Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:08.353839Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:08.353126Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"></span>
<span id="cb9-2"></span>
<span id="cb9-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> duct_ladders(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb9-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Circle and square Nusselt numbers and fRe, Richardson-extrapolated over four rungs."""</span></span>
<span id="cb9-5">    lad_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [duct(n, geom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">256</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">512</span>)]</span>
<span id="cb9-6">    lad_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [duct(n, geom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kw.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_r"</span>})</span>
<span id="cb9-7">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">256</span>)]</span>
<span id="cb9-8">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb9-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, lad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle"</span>, lad_c), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, lad_s)):</span>
<span id="cb9-10">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fRe"</span>):</span>
<span id="cb9-11">            out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson([d[q] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lad])</span>
<span id="cb9-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb9-13"></span>
<span id="cb9-14"></span>
<span id="cb9-15">DU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duct_ladders()</span>
<span id="cb9-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"circle  fRe -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'circle_fRe'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (Poiseuille: 16)"</span>)</span>
<span id="cb9-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"square  fRe -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'square_fRe'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb9-18">A315 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A3.15-graetz-nusselt"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_infinity"</span>]</span>
<span id="cb9-19">tab1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb9-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>, t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>), DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_H1"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_c_exact)),</span>
<span id="cb9-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>, t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>), DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_T"</span>], np.nan),</span>
<span id="cb9-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>, t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>), DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>], np.nan),</span>
<span id="cb9-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>, t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>), DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_T"</span>], np.nan),</span>
<span id="cb9-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equilateral triangle"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>, t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equilateral triangle"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>), np.nan,</span>
<span id="cb9-25">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_t_exact))],</span>
<span id="cb9-26">    columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"geometry"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"column"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm (extrapolated)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form"</span>])</span>
<span id="cb9-27">ref_col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm (extrapolated)"</span>].fillna(tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form"</span>])</span>
<span id="cb9-28">tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_col) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ref_col</span>
<span id="cb9-29">tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half a printed unit, rel."</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ref_col</span>
<span id="cb9-30">show(tab1.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_table1"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb9-31">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm (extrapolated)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb9-32">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half a printed unit, rel."</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb9-33">n_agree <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half a printed unit, rel."</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb9-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_agree<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tab1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> reproduced cells agree with every printed digit."</span>)</span>
<span id="cb9-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"circular Nu_T against A3.15's committed Graetz limit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A315<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: relative gap "</span></span>
<span id="cb9-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'circle_Nu_T'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A315 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), held below 1e-6."</span>)</span>
<span id="cb9-37"></span>
<span id="cb9-38"></span>
<span id="cb9-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> table1_claims(du, nu_h_circle_exact<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_c_exact), col_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>, col_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>):</span>
<span id="cb9-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The Table 1 claims from a set of duct ladders (columns as read from the CSV)."""</span></span>
<span id="cb9-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb9-42">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_square_pymrm"</span>: du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_pymrm"</span>: du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_T"</span>],</span>
<span id="cb9-43">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_circle_pymrm"</span>: du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_T"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_circle_pymrm"</span>: du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_H1"</span>],</span>
<span id="cb9-44">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fre_square"</span>: du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_fRe"</span>],</span>
<span id="cb9-45">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fre_circle_vs_16"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_fRe"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb9-46">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_circle_solve_vs_exact"</span>: printed_relerr(nu_h_circle_exact, du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_H1"</span>]),</span>
<span id="cb9-47">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_square_printed_relerr"</span>: printed_relerr(du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>], t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, col_h)),</span>
<span id="cb9-48">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_printed_relerr"</span>: printed_relerr(du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_T"</span>], t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, col_t)),</span>
<span id="cb9-49">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_circle_printed_relerr"</span>: printed_relerr(du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_T"</span>], t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, col_t)),</span>
<span id="cb9-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_circle_vs_A315"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_T"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A315 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb9-51">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_cells_within_printed_digits"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(</span>
<span id="cb9-52">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t1(g, col) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, col, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (</span>
<span id="cb9-53">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, col_h, nu_h_circle_exact), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, col_t, du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle_Nu_T"</span>]),</span>
<span id="cb9-54">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, col_h, du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, col_t, du[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_T"</span>]),</span>
<span id="cb9-55">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equilateral triangle"</span>, col_h, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_t_exact))))),</span>
<span id="cb9-56">    }</span>
<span id="cb9-57"></span>
<span id="cb9-58"></span>
<span id="cb9-59">TC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table1_claims(DU)</span>
<span id="cb9-60"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TC.items():</span>
<span id="cb9-61">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fre_circle_vs_16"</span>:</span>
<span id="cb9-62">        claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Poiseuille fRe = 16, Richardson"</span>)</span>
<span id="cb9-63">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_circle_solve_vs_exact"</span>:</span>
<span id="cb9-64">        claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Richardson-extrapolated against 48/11"</span>)</span>
<span id="cb9-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_circle_vs_A315"</span>:</span>
<span id="cb9-66">        claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb9-67">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"another page's committed value, independent route"</span>)</span>
<span id="cb9-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_cells_within_printed_digits"</span>:</span>
<span id="cb9-69">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n_agree</span>
<span id="cb9-70">        claims.exact(k, v, margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. dev."</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half a printed unit, rel."</span>])</span>
<span id="cb9-71">                                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half a printed unit, rel."</span>])),</span>
<span id="cb9-72">                     min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin: smallest distance to the half-unit edge, relative"</span>)</span>
<span id="cb9-73">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_relerr"</span>):</span>
<span id="cb9-74">        claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb9-75">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb9-76">        claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>circle  fRe -&gt; 16.000000   (Poiseuille: 16)
square  fRe -&gt; 14.227078</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_table1" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_table1_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">geometry</th>
<th id="T_i13_table1_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">column</th>
<th id="T_i13_table1_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">printed</th>
<th id="T_i13_table1_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">pymrm (extrapolated)</th>
<th id="T_i13_table1_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">closed form</th>
<th id="T_i13_table1_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">rel. dev.</th>
<th id="T_i13_table1_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">half a printed unit, rel.</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_table1_row0_col0" class="data row0 col0">circular</td>
<td id="T_i13_table1_row0_col1" class="data row0 col1">Nu_H</td>
<td id="T_i13_table1_row0_col2" class="data row0 col2">4.364</td>
<td id="T_i13_table1_row0_col3" class="data row0 col3">4.363636</td>
<td id="T_i13_table1_row0_col4" class="data row0 col4">4.363636</td>
<td id="T_i13_table1_row0_col5" class="data row0 col5">8.33e-05</td>
<td id="T_i13_table1_row0_col6" class="data row0 col6">1.15e-04</td>
</tr>
<tr class="even">
<td id="T_i13_table1_row1_col0" class="data row1 col0">circular</td>
<td id="T_i13_table1_row1_col1" class="data row1 col1">Nu_T</td>
<td id="T_i13_table1_row1_col2" class="data row1 col2">3.657</td>
<td id="T_i13_table1_row1_col3" class="data row1 col3">3.656793</td>
<td id="T_i13_table1_row1_col4" class="data row1 col4">nan</td>
<td id="T_i13_table1_row1_col5" class="data row1 col5">5.65e-05</td>
<td id="T_i13_table1_row1_col6" class="data row1 col6">1.37e-04</td>
</tr>
<tr class="odd">
<td id="T_i13_table1_row2_col0" class="data row2 col0">square</td>
<td id="T_i13_table1_row2_col1" class="data row2 col1">Nu_H</td>
<td id="T_i13_table1_row2_col2" class="data row2 col2">3.608</td>
<td id="T_i13_table1_row2_col3" class="data row2 col3">3.607950</td>
<td id="T_i13_table1_row2_col4" class="data row2 col4">nan</td>
<td id="T_i13_table1_row2_col5" class="data row2 col5">1.37e-05</td>
<td id="T_i13_table1_row2_col6" class="data row2 col6">1.39e-04</td>
</tr>
<tr class="even">
<td id="T_i13_table1_row3_col0" class="data row3 col0">square</td>
<td id="T_i13_table1_row3_col1" class="data row3 col1">Nu_T</td>
<td id="T_i13_table1_row3_col2" class="data row3 col2">2.976</td>
<td id="T_i13_table1_row3_col3" class="data row3 col3">2.977523</td>
<td id="T_i13_table1_row3_col4" class="data row3 col4">nan</td>
<td id="T_i13_table1_row3_col5" class="data row3 col5">5.11e-04</td>
<td id="T_i13_table1_row3_col6" class="data row3 col6">1.68e-04</td>
</tr>
<tr class="odd">
<td id="T_i13_table1_row4_col0" class="data row4 col0">equilateral triangle</td>
<td id="T_i13_table1_row4_col1" class="data row4 col1">Nu_H</td>
<td id="T_i13_table1_row4_col2" class="data row4 col2">3.111</td>
<td id="T_i13_table1_row4_col3" class="data row4 col3">nan</td>
<td id="T_i13_table1_row4_col4" class="data row4 col4">3.111111</td>
<td id="T_i13_table1_row4_col5" class="data row4 col5">3.57e-05</td>
<td id="T_i13_table1_row4_col6" class="data row4 col6">1.61e-04</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>4 of 5 reproduced cells agree with every printed digit.
circular Nu_T against A3.15's committed Graetz limit 3.65679346: relative gap (here 1.8e-09), held below 1e-6.</code></pre>
</div>
</div>
<div id="27d8fac7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:08.355820Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:08.355690Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:08.431412Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:08.430530Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">SPEC_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>)</span>
<span id="cb12-2"></span>
<span id="cb12-3"></span>
<span id="cb12-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spectral_ladder(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb12-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [square_spectral(N, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SPEC_N]</span>
<span id="cb12-6"></span>
<span id="cb12-7"></span>
<span id="cb12-8">SPEC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spectral_ladder()</span>
<span id="cb12-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fourier-sine Galerkin, square duct, Nu_T (converges from below as observed here): "</span></span>
<span id="cb12-10">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"N=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N, (_, b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(SPEC_N, SPEC)))</span>
<span id="cb12-11">d_spec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.diff([b <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SPEC])</span>
<span id="cb12-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm finite volume, extrapolated: Nu_H1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'square_Nu_H1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb12-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Nu_T = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'square_Nu_T'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-14">two_routes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SPEC[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>]</span>
<span id="cb12-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb12-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The spectral sequence is not a bound: the sine-Galerkin eigenproblem is a</span></span>
<span id="cb12-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Rayleigh-Ritz restriction, so it bounds the eigenvalue from above, while the</span></span>
<span id="cb12-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">truncated integral of u converges from below, and their product has no one-sided</span></span>
<span id="cb12-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">guarantee. What the sequence shows is that it is still increasing at N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPEC_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (last step</span></span>
<span id="cb12-20"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d_spec[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb12-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">where it has already reached </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPEC[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, above the interval</span></span>
<span id="cb12-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'square'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nu_T'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'square'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nu_T'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'square'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nu_T'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> allows. The two routes</span></span>
<span id="cb12-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">agree to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>two_routes<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative on Nu_H1 at N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPEC_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."""</span>)</span>
<span id="cb12-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N, (_, b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(SPEC_N, SPEC):</span>
<span id="cb12-25">    claims.value(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nu_t_square_spectral_N</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, b, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb12-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(d_spec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb12-27">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_spectral_last_increment"</span>, d_spec[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,</span>
<span id="cb12-28">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N = 20 to 24; every increment of the ladder is positive"</span>)</span>
<span id="cb12-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_square_two_routes_reldiff"</span>, two_routes, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb12-30">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_spectral_above_interval"</span>, SPEC[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb12-31">             rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N = 24 value minus the upper edge of the printed interval"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Fourier-sine Galerkin, square duct, Nu_T (converges from below as observed here): N=12 2.976249, N=16 2.976978, N=20 2.977242, N=24 2.977359
pymrm finite volume, extrapolated: Nu_H1 = 3.607950, Nu_T = 2.977523

The spectral sequence is not a bound: the sine-Galerkin eigenproblem is a
Rayleigh-Ritz restriction, so it bounds the eigenvalue from above, while the
truncated integral of u converges from below, and their product has no one-sided
guarantee. What the sequence shows is that it is still increasing at N = 24 (last step
+1.2e-04),
where it has already reached 2.977359, above the interval
[2.9755, 2.9765] the printed 2.976 allows. The two routes
agree to 1.1e-04 relative on Nu_H1 at N = 24.</code></pre>
</div>
</div>
<p><strong>Five of the eight cells are reproduced</strong>, and the count of those that agree with every printed digit is printed above. The square duct at constant wall temperature does not: it is printed <strong>2.976</strong> where both routes give <strong>2.9775</strong>. <code>2.976</code> implies the interval [2.9755, 2.9765], which excludes 2.9775, so this is not a rounding difference. It is also not a defect this page can pin on Heck et al.: Table 1 is attributed to Shah and London (1971), which was <strong>not consulted</strong>, so the discrepancy could be in the 1971 tabulation or in the transcription of it, and the page does not choose. (The paper’s own reference list prints that source as “<strong>Shar</strong>, R. K., and A. L. London” where Table 1’s footnote says “Shah and London”: reported, not repaired.)</p>
<p><strong>Three cells are not reproduced.</strong> The equilateral triangle at constant wall temperature needs a <img src="https://latex.codecogs.com/png.latex?u">-weighted eigenproblem on a non-tensor domain, which this page does not build. Both sinusoidal cells are <strong>under-determined by the paper</strong>: the geometry column prints a glyph and no aspect ratio or wall profile anywhere, so there is no problem to solve.</p>
</section>
<section id="the-unusual-nusselt-number-and-what-actually-causes-it" class="level3">
<h3 class="anchored" data-anchor-id="the-unusual-nusselt-number-and-what-actually-causes-it">2. The unusual Nusselt number, and what actually causes it</h3>
<p>The paper demonstrates the anomaly on the <em>non-reacting</em> Graetz problem with an imposed wall flux that rises through zero, and it prints both the flux functions and the landmark positions, in running text, in Fig. 8’s curve labels and in Fig. 9’s caption (printed characters, no curve read; the two functions are read from the CSV below):</p>
<ul>
<li>“the wall flux rises rapidly from a negative value and passes through zero near <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D=0.029">. As the wall flux passes through zero, infinite negative and positive values for the Nusselt number occur.”</li>
<li>“When <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D=0.032"> … the average gas temperature <img src="https://latex.codecogs.com/png.latex?T_G%5E%7B%5Cast%7D"> is higher than <img src="https://latex.codecogs.com/png.latex?T_w%5E%7B%5Cast%7D">; thus a large negative value results … At <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D=0.033">, <img src="https://latex.codecogs.com/png.latex?(%5Cpartial%20T_G%5E%7B%5Cast%7D/%5Cpartial%20R)_w"> and <img src="https://latex.codecogs.com/png.latex?(T_w%5E%7B%5Cast%7D-%5Cbar%20T_G%5E%7B%5Cast%7D)"> are both positive.”</li>
</ul>
<p>So the paper states one location for the singularity in the first quotation and brackets a different one in the second. That is decidable by computation.</p>
<div id="c7234292" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:08.433446Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:08.433270Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:34.584237Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:34.583170Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">QW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 8"</span>: parse_flux(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Qw_fig8"</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>: parse_flux(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Qw_fig9"</span>])}</span>
<span id="cb14-2">X_SIGN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_sign_negative_Nu"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_sign_positive_Nu"</span>))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the p. 481 sign statements</span></span>
<span id="cb14-3">GZ_PROD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6000</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb14-4"></span>
<span id="cb14-5"></span>
<span id="cb14-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> anomaly(coef, grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>GZ_PROD, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>solve_kw):</span>
<span id="cb14-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Flux zero, Nusselt zero and pole of one printed wall flux, all root-found."""</span></span>
<span id="cb14-8">    Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> wall_flux(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>coef)</span>
<span id="cb14-9">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>grid).solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, Q), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>solve_kw)</span>
<span id="cb14-10">    zero_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(Q, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb14-11">    pole <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>])</span>
<span id="cb14-12">    nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> local_nusselt(s)</span>
<span id="cb14-13">    pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> pole                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># before the pole Nu is continuous</span></span>
<span id="cb14-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s, zero_q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zero_q, zero_nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cross(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>][pre], nu[pre]), pole<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pole,</span>
<span id="cb14-15">                pole_area<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cross(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>]),</span>
<span id="cb14-16">                nu_at_zero_q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.interp(zero_q, s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], nu)))</span>
<span id="cb14-17"></span>
<span id="cb14-18"></span>
<span id="cb14-19">AN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {nm: anomaly(coef) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, coef <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QW.items()}</span>
<span id="cb14-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> AN.items():</span>
<span id="cb14-21">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Qw = 0 at X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zero_q'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (text: 'near </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Qw_zero_stated'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">')"</span>)</span>
<span id="cb14-22">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        Nu there (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nu_at_zero_q'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), so it passes through zero, not "</span></span>
<span id="cb14-23">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"infinity"</span>)</span>
<span id="cb14-24">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        Nu = 0 at X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zero_nu'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the same point, root-found on Nu"</span>)</span>
<span id="cb14-25">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        Nu pole at X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (mixing-cup mean), "</span></span>
<span id="cb14-26">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_area'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (area mean)"</span>)</span>
<span id="cb14-27">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        the pole sits </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zero_q'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % downstream of the "</span></span>
<span id="cb14-28">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux zero</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-29">a9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> AN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>]</span>
<span id="cb14-30"></span>
<span id="cb14-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the paper's own ten radial points, reused below</span></span>
<span id="cb14-32">G10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial_points_2D"</span>)), r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb14-33">pole_10r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> anomaly(QW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>], G10)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>]</span>
<span id="cb14-34"></span>
<span id="cb14-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># normalisation: the problem is linear in T, so halving Q_w leaves the pole</span></span>
<span id="cb14-36">gh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb14-37">a, b, p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> QW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>]</span>
<span id="cb14-38">sh1, sh2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gh.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, wall_flux(a, b, p))), gh.solve(</span>
<span id="cb14-39">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> X: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> wall_flux(a, b, p)(X)))</span>
<span id="cb14-40">pole_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cross(sh1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], sh1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sh1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cross(sh2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], sh2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sh2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]))</span>
<span id="cb14-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Q_w and Q_w/2 on one grid: poles differ by (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pole_gap<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), below 1e-12."</span>)</span>
<span id="cb14-42"></span>
<span id="cb14-43"></span>
<span id="cb14-44"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> anomaly_claims(an, p10):</span>
<span id="cb14-45">    a8, a9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> an[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 8"</span>], an[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>]</span>
<span id="cb14-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fluxzero_X_fig8"</span>: a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fluxzero_X_fig9"</span>: a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>],</span>
<span id="cb14-47">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_zero_X_fig8"</span>: a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_nu"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_zero_X_fig9"</span>: a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_nu"</span>],</span>
<span id="cb14-48">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_X_fig8"</span>: a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_X_fig9"</span>: a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>],</span>
<span id="cb14-49">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_area_X_fig8"</span>: a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_area"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_area_X_fig9"</span>: a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_area"</span>],</span>
<span id="cb14-50">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_over_fluxzero_fig8"</span>: a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>],</span>
<span id="cb14-51">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_over_fluxzero_fig9"</span>: a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>],</span>
<span id="cb14-52">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_downstream_fig8"</span>: a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb14-53">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_downstream_fig9"</span>: a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb14-54">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_below_bracket_centre_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.mean(X_SIGN)),</span>
<span id="cb14-55">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_X_fig9_n_r10"</span>: p10,</span>
<span id="cb14-56">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_n_r10_dev_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb14-57">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_n_r10_short_of_0p032_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])}</span>
<span id="cb14-58"></span>
<span id="cb14-59"></span>
<span id="cb14-60">ANC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> anomaly_claims(AN, pole_10r)</span>
<span id="cb14-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ANC.items():</span>
<span id="cb14-62">    claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb14-63"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> AN:</span>
<span id="cb14-64">    tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nm.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig"</span>)</span>
<span id="cb14-65">    claims.bound(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nu_zero_minus_fluxzero_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(AN[nm][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_nu"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> AN[nm][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_q"</span>]),</span>
<span id="cb14-66">                 <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb14-67">                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu's numerator is the imposed flux; the gap is the interpolation of Nu"</span>)</span>
<span id="cb14-68">    claims.bound(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nu_at_fluxzero_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(AN[nm][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_at_zero_q"</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb14-69">                 basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"interpolated Nu at the flux zero"</span>)</span>
<span id="cb14-70">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_normalisation_gap"</span>, pole_gap, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb14-71">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the problem is linear in T"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Fig. 8  Qw = 0 at X* = 0.028789   (text: 'near 0.029')
        Nu there (here -1.2e-05), so it passes through zero, not infinity
        Nu = 0 at X* = 0.028789, the same point, root-found on Nu
        Nu pole at X* = 0.031300 (mixing-cup mean), 0.030916 (area mean)
        the pole sits 8.72 % downstream of the flux zero

Fig. 9  Qw = 0 at X* = 0.028680   (text: 'near 0.029')
        Nu there (here -7.5e-06), so it passes through zero, not infinity
        Nu = 0 at X* = 0.028680, the same point, root-found on Nu
        Nu pole at X* = 0.031183 (mixing-cup mean), 0.030800 (area mean)
        the pole sits 8.73 % downstream of the flux zero

Q_w and Q_w/2 on one grid: poles differ by (here 3.5e-18), below 1e-12.</code></pre>
</div>
</div>
<div id="8a035d00" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:34.586412Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:34.586265Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:34.595603Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:34.594798Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1">s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>]</span>
<span id="cb16-2"></span>
<span id="cb16-3"></span>
<span id="cb16-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sign_rows(s):</span>
<span id="cb16-5">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb16-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> xq <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.025</span>,) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X_SIGN:</span>
<span id="cb16-7">        i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xq)))</span>
<span id="cb16-8">        d, q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>][i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>][i], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"q"</span>][i]</span>
<span id="cb16-9">        rows.append((s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>][i], q, d, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d))</span>
<span id="cb16-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X*"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Qw = dT/dR|w"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw - Tbar"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu"</span>])</span>
<span id="cb16-11"></span>
<span id="cb16-12"></span>
<span id="cb16-13">SG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sign_rows(s)</span>
<span id="cb16-14">SG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper says"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cooling, Nu positive and ordinary"</span>,</span>
<span id="cb16-15">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT/dR|w &gt; 0 but Tbar &gt; Tw, so LARGE NEGATIVE Nu"</span>,</span>
<span id="cb16-16">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT/dR|w &gt; 0 and Tw &gt; Tbar, so large positive Nu"</span>]</span>
<span id="cb16-17">show(SG.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_signs"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb16-18">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X*"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Qw = dT/dR|w"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw - Tbar"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.3f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb16-19"></span>
<span id="cb16-20"></span>
<span id="cb16-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sign_claims(sg):</span>
<span id="cb16-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9_sign_0p032_matches_paper"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(sg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw - Tbar"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb16-23">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9_sign_0p033_matches_paper"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(sg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw - Tbar"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)}</span>
<span id="cb16-24"></span>
<span id="cb16-25"></span>
<span id="cb16-26">SC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sign_claims(SG)</span>
<span id="cb16-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SC.items():</span>
<span id="cb16-28">    claims.exact(k, v, margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw - Tbar"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"032"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])),</span>
<span id="cb16-29">                 min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin: |Tw - Tbar| at that cell"</span>)</span>
<span id="cb16-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""The X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> statement is reproduced; the X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> statement is not. The pole is</span></span>
<span id="cb16-31"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">root-found at X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a9[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so by X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the solve has already passed it and</span></span>
<span id="cb16-32"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(Tw - Tbar) is positive. The paper's two sentences bracket the pole in (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">);</span></span>
<span id="cb16-33"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this solve puts it </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ANC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nu_pole_below_bracket_centre_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % below the centre of that bracket. On the paper's own</span></span>
<span id="cb16-34"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G10[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_r'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> radial points the same solver gives X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pole_10r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ANC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_n_r10_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from the converged</span></span>
<span id="cb16-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">value and still </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ANC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_n_r10_short_of_0p032_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % short of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_signs" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_signs_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">X*</th>
<th id="T_i13_signs_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">Qw = dT/dR|w</th>
<th id="T_i13_signs_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">Tw - Tbar</th>
<th id="T_i13_signs_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">Nu</th>
<th id="T_i13_signs_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">paper says</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_signs_row0_col0" class="data row0 col0">0.0250</td>
<td id="T_i13_signs_row0_col1" class="data row0 col1">-2.0013</td>
<td id="T_i13_signs_row0_col2" class="data row0 col2">-1.00716</td>
<td id="T_i13_signs_row0_col3" class="data row0 col3">+3.974</td>
<td id="T_i13_signs_row0_col4" class="data row0 col4">cooling, Nu positive and ordinary</td>
</tr>
<tr class="even">
<td id="T_i13_signs_row1_col0" class="data row1 col0">0.0320</td>
<td id="T_i13_signs_row1_col1" class="data row1 col1">+4.1983</td>
<td id="T_i13_signs_row1_col2" class="data row1 col2">+0.29354</td>
<td id="T_i13_signs_row1_col3" class="data row1 col3">+28.604</td>
<td id="T_i13_signs_row1_col4" class="data row1 col4">dT/dR|w &gt; 0 but Tbar &gt; Tw, so LARGE NEGATIVE Nu</td>
</tr>
<tr class="odd">
<td id="T_i13_signs_row2_col0" class="data row2 col0">0.0330</td>
<td id="T_i13_signs_row2_col1" class="data row2 col1">+6.2077</td>
<td id="T_i13_signs_row2_col2" class="data row2 col2">+0.73971</td>
<td id="T_i13_signs_row2_col3" class="data row2 col3">+16.784</td>
<td id="T_i13_signs_row2_col4" class="data row2 col4">dT/dR|w &gt; 0 and Tw &gt; Tbar, so large positive Nu</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The X* = 0.033 statement is reproduced; the X* = 0.032 statement is not. The pole is
root-found at X* = 0.031183, so by X* = 0.032 the solve has already passed it and
(Tw - Tbar) is positive. The paper's two sentences bracket the pole in (0.032, 0.033);
this solve puts it 4.1 % below the centre of that bracket. On the paper's own
10 radial points the same solver gives X* = 0.031285, 0.33 % from the converged
value and still 2.2 % short of 0.032.</code></pre>
</div>
</div>
<p><strong>The cause the text gives is not the cause.</strong> At the zero of the wall flux the Nusselt number of eq. (19) has a vanishing <em>numerator</em>, so it passes through <strong>zero</strong>, not infinity, which is what the computation shows. The pole is the zero of the <em>denominator</em> <img src="https://latex.codecogs.com/png.latex?T_w-%5Cbar%20T_G">, and it lies <strong>8.7 %</strong> further downstream in both of the paper’s flux functions. The two are close but distinct, and they must be: the bulk temperature integrates the flux history, so it keeps falling for a while after the flux turns positive.</p>
<p>This is not an effect the authors missed. The very next paragraph, the Fig. 9 discussion quoted above, gives the correct mechanism in terms of the signs of the gradient and of <img src="https://latex.codecogs.com/png.latex?(T_w%5E%7B%5Cast%7D-%5Cbar%20T_G%5E%7B%5Cast%7D)">. What is wrong is the one-sentence summary, and the bracket that paragraph implies for the pole.</p>
<p><strong>The anomaly itself is real and reproduces.</strong> It is also <em>normalisation-invariant</em>: the problem is linear in <img src="https://latex.codecogs.com/png.latex?T">, so scaling <img src="https://latex.codecogs.com/png.latex?Q_w"> scales the field and leaves the pole where it is. Whatever convention the paper used for the magnitude of <img src="https://latex.codecogs.com/png.latex?Q_w">, which it never states, the landmark positions are unchanged.</p>
</section>
<section id="a-simpler-one-dimensional-model-is-adequate-for-what-and-until-where" class="level3">
<h3 class="anchored" data-anchor-id="a-simpler-one-dimensional-model-is-adequate-for-what-and-until-where">3. “A simpler one-dimensional model is adequate”: for what, and until where</h3>
<p>The reacting comparison needs the two reconstructed groups. <strong>Nothing below is fitted to any result of the paper.</strong> The paper prints one fact that touches the reconstruction, the position of the rate maximum on the adiabatic locus, and the next cell measures how little it constrains.</p>
<div id="f5149806" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:34.597553Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:34.597422Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:52:34.612900Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:52:34.612058Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rate_claims(ch, scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb18-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The rate maximum on the adiabatic locus at Fig. 1's inlet, and what it constrains.</span></span>
<span id="cb18-3"></span>
<span id="cb18-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``scan=False`` skips the range of dT_AD that still rounds to the printed value.</span></span>
<span id="cb18-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb18-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cw_at_max(d):</span>
<span id="cb18-7">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(ch, dTad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d)</span>
<span id="cb18-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>c.r_of(x, T_IN), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, c.cg0),</span>
<span id="cb18-9">                                     method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)).x)</span>
<span id="cb18-10">    tgt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cw_at_rate_maximum"</span>)</span>
<span id="cb18-11">    half_unit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> np.floor(np.log10(tgt))     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the paper prints one figure</span></span>
<span id="cb18-12">    cmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cw_at_max(ch.dTad)</span>
<span id="cb18-13">    ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ch.kin.ka0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>ch.kin.ear <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.0</span>))</span>
<span id="cb18-14">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_Cw"</span>: cmax, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_Cw_printed_absdiff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tgt),</span>
<span id="cb18-15">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_at_dTad0"</span>: cw_at_max(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inverse_ka_at_inlet"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ka,</span>
<span id="cb18-16">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lit_wall_T_C"</span>: T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ch.dTad, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_half_unit"</span>: half_unit}</span>
<span id="cb18-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> scan:</span>
<span id="cb18-18">        d_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: cw_at_max(d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (tgt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> half_unit), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ch.dTad,</span>
<span id="cb18-19">                      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ch.dTad, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb18-20">        lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(cw_at_max, bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ch.dTad, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ch.dTad, ch.dTad),</span>
<span id="cb18-21">                             method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brent"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>))</span>
<span id="cb18-22">        out.update(rate_max_dTad_upper_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d_hi, rate_max_min_Cw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(lo.fun),</span>
<span id="cb18-23">                   rate_max_min_at_dTad_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(lo.x),</span>
<span id="cb18-24">                   rate_max_min_clearance<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(lo.fun) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (tgt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> half_unit))</span>
<span id="cb18-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb18-26"></span>
<span id="cb18-27"></span>
<span id="cb18-28">RC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rate_claims(CH)</span>
<span id="cb18-29">tgt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cw_at_rate_maximum"</span>)</span>
<span id="cb18-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""The paper states 'the rate reaches a maximum at C_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tgt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' for T_G0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C. The</span></span>
<span id="cb18-31"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">maximum of eq. (5) on the eq. (14) locus is at C_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_Cw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which rounds to the</span></span>
<span id="cb18-32"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">one significant figure printed.</span></span>
<span id="cb18-33"></span>
<span id="cb18-34"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">How much does that check? C_w at the maximum barely depends on dT_AD: it stays inside</span></span>
<span id="cb18-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tgt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_half_unit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tgt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_half_unit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">], so still rounds to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tgt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, for every dT_AD from 0 up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_dTad_upper_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K</span></span>
<span id="cb18-36"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(root-found); its minimum over that range is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_min_Cw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at dT_AD = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_min_at_dTad_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K,</span></span>
<span id="cb18-37"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_min_clearance'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inside the lower edge. So it does not check dT_AD. It checks the transcription</span></span>
<span id="cb18-38"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of the kinetics: at dT_AD = 0 the maximum is at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_max_at_dTad0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1/k_a(T_G0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inverse_ka_at_inlet'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb18-39"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and k_a0 and E_a/R are printed. beta does not enter it at all.</span></span>
<span id="cb18-40"></span>
<span id="cb18-41"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The same dT_AD puts a fully lit wall at T_G0 + dT_AD = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lit_wall_T_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C. The paper prints no</span></span>
<span id="cb18-42"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">adiabatic flame temperature in words anywhere in pp. 477-483 (the plateau exists</span></span>
<span id="cb18-43"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">only as a plotted curve), so this is a consequence of the</span></span>
<span id="cb18-44"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reconstruction, not a test of it."""</span>)</span>
<span id="cb18-45"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RC.items():</span>
<span id="cb18-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_half_unit"</span>:</span>
<span id="cb18-47">        claims.exact(k, v, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half the last printed place of 0.003"</span>)</span>
<span id="cb18-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb18-49">        claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_min_clearance"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The paper states 'the rate reaches a maximum at C_w = 0.003' for T_G0 = 316 C. The
maximum of eq. (5) on the eq. (14) locus is at C_w = 0.00261, which rounds to the
one significant figure printed.

How much does that check? C_w at the maximum barely depends on dT_AD: it stays inside
[0.0025, 0.0035], so still rounds to 0.003, for every dT_AD from 0 up to 1474 K
(root-found); its minimum over that range is 0.002509 at dT_AD = 205 K,
9.0e-06 inside the lower edge. So it does not check dT_AD. It checks the transcription
of the kinetics: at dT_AD = 0 the maximum is at 0.00299 = 1/k_a(T_G0) = 0.00299,
and k_a0 and E_a/R are printed. beta does not enter it at all.

The same dT_AD puts a fully lit wall at T_G0 + dT_AD = 741 C. The paper prints no
adiabatic flame temperature in words anywhere in pp. 477-483 (the plateau exists
only as a plotted curve), so this is a consequence of the
reconstruction, not a test of it.</code></pre>
</div>
</div>
<section id="what-light-off-threshold-has-to-mean" class="level4">
<h4 class="anchored" data-anchor-id="what-light-off-threshold-has-to-mean">What “light-off threshold” has to mean</h4>
<p>The paper quotes two windows, and each describes a different figure:</p>
<ul>
<li>1-D, p.&nbsp;479, about <strong>Fig. 2</strong>: “For inlet gas temperatures below <strong>304 °C</strong>, the monolith temperature does not rise significantly … between 304° and <strong>343 °C</strong>, the reaction lights-off at some point in the channel.”</li>
<li>2-D, p.&nbsp;481, about <strong>Fig. 11</strong>: “no reaction light-off for low inlet gas temperature (case 1), <img src="https://latex.codecogs.com/png.latex?T%5E%7Bo%7D_G%20%3C"> <strong>293 °C</strong>; light-off in the tube for intermediate inlet gas temperatures (case 2 and 3), 293 <img src="https://latex.codecogs.com/png.latex?%3C%20T%5E%7Bo%7D_G%20%3C"> <strong>343 °C</strong>.”</li>
</ul>
<p><strong>Neither is a root-found threshold.</strong> Each window is quoted from whichever of the four sampled cases of its figure happened to fall on the right side.</p>
<p><strong>And the two are quoted for channels of different length.</strong> “Lights off at some point in the channel” is a statement about a channel of some length, and the two figures do not share one: Fig. 2’s abscissa is labelled to <strong>0.20</strong> in <code>X/(D RE PR)</code>, Fig. 11’s to <strong>0.50</strong> (tick labels, transcribed as printed characters). A longer channel lights off at a lower inlet temperature, so a window read off the longer channel sits lower for that reason alone. The computation below runs each statement at the length of the figure it is made about, then decomposes the gap between the two windows into a length term and a model term.</p>
<p>Both thresholds are root-found, and both are defined without reference to any figure:</p>
<ul>
<li><strong>upper</strong>, light-off <em>at the inlet</em>: the inlet temperature at which the cold branch has already folded at <img src="https://latex.codecogs.com/png.latex?C_G%20=%20C_G%5E%7Bo%7D">. Length-independent.</li>
<li><strong>lower</strong>, light-off leaves the channel: the inlet temperature at which the light-off position <img src="https://latex.codecogs.com/png.latex?G%5E%7B%5Cast%7D"> equals the channel length <img src="https://latex.codecogs.com/png.latex?L%5E%7B%5Cast%7D">. This one needs a length, which the paper never states, so <img src="https://latex.codecogs.com/png.latex?L%5E%7B%5Cast%7D"> is swept over the lengths its own 1-D figures fix (0.20 for Fig. 2, 0.25 for Figs. 3 to 5) with 0.30 as a margin past both.</li>
</ul>
<p>The function below computes every reacting result of this section and of the Validation section from one <code>Channel</code>; a break row re-runs it with a defect.</p>
<div id="1c06477e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:52:34.614915Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:52:34.614737Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:53:55.693928Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:53:55.693161Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1">DG, GMAX, GMAX_LONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.40</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.90</span></span>
<span id="cb20-2">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axial_step_dG"</span>, DG, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the axial step of every 2-D result"</span>)</span>
<span id="cb20-3">L_F2, L_F3, L_F11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig2_abscissa_end"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig3_abscissa_end"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig11_abscissa_end"</span>)</span>
<span id="cb20-4">L_SWEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (L_F2, L_F3, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>)</span>
<span id="cb20-5">T_F2, T_F11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightoff_window_1D_low"</span>), pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightoff_window_2D_low"</span>)</span>
<span id="cb20-6">T_CASE4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightoff_window_2D_inlet_case"</span>)</span>
<span id="cb20-7">T_EQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">310.0</span>, T_IN, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">320.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">330.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">340.0</span>)</span>
<span id="cb20-8">T_ROUTE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">305.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">310.0</span>, T_IN, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">322.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">328.0</span>)</span>
<span id="cb20-9">DG_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>)</span>
<span id="cb20-10">CLAIM_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"adequacy_claim_degC"</span>)</span>
<span id="cb20-11">NU_GT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> correlation(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_GrigullTratz_Qw"</span>])        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># constant wall flux, X* = 1000 G</span></span>
<span id="cb20-12">NUF_GT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> G: NU_GT(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> G, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>))     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb20-13">NUF_CONST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> G: NU_SQ                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb20-14">RECON <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT_AD +10 %"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dT_AD -10 %"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>),</span>
<span id="cb20-15">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta x 1.5"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.50</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta / 1.5"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>))</span>
<span id="cb20-16">_MEMO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb20-17"></span>
<span id="cb20-18"></span>
<span id="cb20-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _fin(g):</span>
<span id="cb20-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span></span>
<span id="cb20-21"></span>
<span id="cb20-22"></span>
<span id="cb20-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rtag(lab):</span>
<span id="cb20-24">    lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lab.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plus"</span>).replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minus"</span>).replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over"</span>)</span>
<span id="cb20-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> re.sub(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[^0-9A-Za-z]</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>, lab).strip(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)</span>
<span id="cb20-26"></span>
<span id="cb20-27"></span>
<span id="cb20-28"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> reacting(ch, dG1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>DG, dG2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>DG, nu_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, nu_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb20-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Every reacting result of the page for one channel, as ``{claim: value}``.</span></span>
<span id="cb20-30"></span>
<span id="cb20-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``nu_scale`` multiplies every 1-D Nusselt number (a break-table defect).</span></span>
<span id="cb20-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb20-33">    nu_sq, nu_ci <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nu_scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NU_SQ, nu_scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NU_CI</span>
<span id="cb20-34">    gt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> G: nu_scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NUF_GT(G)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nu_scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> NUF_GT</span>
<span id="cb20-35"></span>
<span id="cb20-36">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> g1q(T, Sh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu_sq, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ch):</span>
<span id="cb20-37">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _fin(c.lightoff_quad(T, Sh))</span>
<span id="cb20-38"></span>
<span id="cb20-39">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> g1m(T, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>gt, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ch, dG<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dG1):</span>
<span id="cb20-40">        key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1d"</span>, c.kin, c.dTad, c.b0, T, nu, dG)</span>
<span id="cb20-41">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _MEMO:</span>
<span id="cb20-42">            _MEMO[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _fin(c.march_1d(T, nu, dG, GMAX))</span>
<span id="cb20-43">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _MEMO[key]</span>
<span id="cb20-44"></span>
<span id="cb20-45">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> g2(T, Gmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>GMAX, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ch, dG<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dG2):</span>
<span id="cb20-46">        key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2d"</span>, c.kin, c.dTad, c.b0, T, Gmax, dG, nu_r)</span>
<span id="cb20-47">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _MEMO:</span>
<span id="cb20-48">            _MEMO[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _fin(c.march_2d(T, dG, Gmax, nu_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu_r))</span>
<span id="cb20-49">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _MEMO[key]</span>
<span id="cb20-50"></span>
<span id="cb20-51">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> root(f, lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">280.0</span>, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">380.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>):</span>
<span id="cb20-52">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> f(lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f(hi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a defect can move a threshold out of range</span></span>
<span id="cb20-53">            lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">150.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">700.0</span></span>
<span id="cb20-54">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> brentq(f, lo, hi, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xtol)</span>
<span id="cb20-55"></span>
<span id="cb20-56">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb20-57">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two windows at their figures' own lengths, and the decomposition</span></span>
<span id="cb20-58">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_1d_at_window_low"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g1q(T_F2)</span>
<span id="cb20-59">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_window_low"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g2(T_F11, GMAX_LONG)</span>
<span id="cb20-60">    t1f2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1q(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F2)</span>
<span id="cb20-61">    t2f11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g2(T, GMAX_LONG) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F11)</span>
<span id="cb20-62">    t1f11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1q(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F11)</span>
<span id="cb20-63">    m.update(T_low_1d_at_fig2_length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1f2, T_low_2d_at_fig11_length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2f11,</span>
<span id="cb20-64">             T_low_1d_at_fig11_length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1f11, T_windows_length_artefact_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2f11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1f2,</span>
<span id="cb20-65">             T_windows_vs_paper_gap_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((t2f11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1f2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (T_F11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_F2)),</span>
<span id="cb20-66">             T_windows_length_term_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1f11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1f2, T_windows_model_term_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2f11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1f11)</span>
<span id="cb20-67">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># upper thresholds</span></span>
<span id="cb20-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, nu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, nu_sq), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circle"</span>, nu_ci)):</span>
<span id="cb20-69">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_up_1d_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: ch.fold_CG(T, ch.b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> nu) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ch.cg0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">280.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">420.0</span>,</span>
<span id="cb20-70">                                   xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>)</span>
<span id="cb20-71">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_up_1d_shape_effect"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_up_1d_circle"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_up_1d_square"</span>]</span>
<span id="cb20-72">    first <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: ch.first_step_margin(T, d, nu_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu_r), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">280.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">520.0</span>)</span>
<span id="cb20-73">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DG_LADDER]</span>
<span id="cb20-74">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(DG_LADDER, first):</span>
<span id="cb20-75">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_up_2d_first_step_dG</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m"</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb20-76">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_up_2d_first_step_divergence_C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> first[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> first[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb20-77">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_up_2d_first_step_mean_per_halving_C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(np.diff(first)))</span>
<span id="cb20-78">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_case4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g2(T_CASE4)</span>
<span id="cb20-79">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_case4_over_fig11"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_case4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L_F11</span>
<span id="cb20-80">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># lower thresholds on common lengths</span></span>
<span id="cb20-81">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> L_SWEEP:</span>
<span id="cb20-82">        tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-83">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1q(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L)</span>
<span id="cb20-84">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1m(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L)</span>
<span id="cb20-85">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g2(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L)</span>
<span id="cb20-86">        m.update({<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_1d_const_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: a, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_1d_GT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: b, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: c,</span>
<span id="cb20-87">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_minus_1d_const_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_minus_1d_GT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b})</span>
<span id="cb20-88">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_1d_const_slope_per_005"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_1d_const_L020"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_1d_const_L030"</span>])</span>
<span id="cb20-89">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((L_SWEEP[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_SWEEP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>))</span>
<span id="cb20-90">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_2d_L025_dG5em5"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g2(T, dG<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>DG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F3)</span>
<span id="cb20-91">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># shape against entrance region and dimensionality, at L* = 0.25</span></span>
<span id="cb20-92">    t_ci <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1q(T, nu_ci) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F3)</span>
<span id="cb20-93">    m.update(T_low_1d_circle_L025<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_ci, T_low_shape_effect_L025<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_ci <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_1d_const_L025"</span>],</span>
<span id="cb20-94">             T_low_entrance_dim_L025<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_2d_L025"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t_ci)</span>
<span id="cb20-95">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_shape_share_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_shape_effect_L025"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m[</span>
<span id="cb20-96">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_2d_minus_1d_const_L025"</span>]</span>
<span id="cb20-97">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the paper's measure of adequacy: an equivalent inlet shift</span></span>
<span id="cb20-98">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_EQ:</span>
<span id="cb20-99">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g2(T2)</span>
<span id="cb20-100">        tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at316"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_IN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-101">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_G2d_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g</span>
<span id="cb20-102">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_shift_const_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1q(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">280.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">420.0</span>)</span>
<span id="cb20-103">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_shift_GT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1m(T) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">280.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">420.0</span>)</span>
<span id="cb20-104">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_Nu_at316"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_at316"</span>)</span>
<span id="cb20-105">    sc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_Nu_at316"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_IN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_shift_const_at</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb20-106">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_EQ]</span>
<span id="cb20-107">    sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_shift_GT_at</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'316'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_IN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_EQ]</span>
<span id="cb20-108">    m.update(equiv_shift_const_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sc), equiv_shift_GT_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sg),</span>
<span id="cb20-109">             equiv_shift_const_over_claim_at316<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_Nu_at316"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CLAIM_C,</span>
<span id="cb20-110">             equiv_shift_const_over_claim_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(sc) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CLAIM_C,</span>
<span id="cb20-111">             equiv_shift_const_over_claim_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sc) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CLAIM_C,</span>
<span id="cb20-112">             equiv_shift_GT_over_claim_at316<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_at316"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CLAIM_C,</span>
<span id="cb20-113">             equiv_shift_GT_over_claim_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(sg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CLAIM_C,</span>
<span id="cb20-114">             equiv_shift_GT_over_claim_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CLAIM_C,</span>
<span id="cb20-115">             equiv_shift_GT_minus_claim_at316<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_at316"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CLAIM_C)</span>
<span id="cb20-116">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the light-off position of the 2-D model against its axial step</span></span>
<span id="cb20-117">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DG_LADDER:</span>
<span id="cb20-118">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"G_lightoff_2d_316_dG</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m"</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g2(T_IN, dG<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d)</span>
<span id="cb20-119">    gl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"G_lightoff_2d_316_dG</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m"</span>)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DG_LADDER]</span>
<span id="cb20-120">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_316_dG_order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_order(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.diff(gl)))[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb20-121">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_316_richardson"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> richardson(gl, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb20-122">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_316_dG1em4_vs_richardson_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (gl[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m[</span>
<span id="cb20-123">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_316_richardson"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb20-124">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two routes to the 1-D light-off position, and the C_G parametrisation</span></span>
<span id="cb20-125">    n_giveup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb20-126">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_ROUTE:</span>
<span id="cb20-127">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g1m(T, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NUF_CONST <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nu_scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> G: nu_sq))</span>
<span id="cb20-128">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g1q(T)</span>
<span id="cb20-129">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> warnings.catch_warnings(record<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> wlog:</span>
<span id="cb20-130">            warnings.simplefilter(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"always"</span>)       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># scipy's subdivision warning, counted</span></span>
<span id="cb20-131">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ch.lightoff_quad_CG(T, nu_sq)</span>
<span id="cb20-132">        n_giveup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"subdivisions"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(w.message) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> wlog)</span>
<span id="cb20-133">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_march_minus_quad_steps_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dG1</span>
<span id="cb20-134">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_quad_CG_relerr_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b</span>
<span id="cb20-135">        m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_quad_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b</span>
<span id="cb20-136">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightoff_march_vs_quad_max_steps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_march_minus_quad_steps_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb20-137">                                                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_ROUTE)</span>
<span id="cb20-138">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_endpoint_error"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_quad_CG_relerr_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_ROUTE)</span>
<span id="cb20-139">    m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_rows_out_of_subdivisions"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_giveup</span>
<span id="cb20-140">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what the reconstruction moves</span></span>
<span id="cb20-141">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb20-142">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, f_dT, f_b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RECON:</span>
<span id="cb20-143">        cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(ch, dTad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ch.dTad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f_dT, b0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ch.b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f_b)</span>
<span id="cb20-144">        tu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: cv.fold_CG(T, cv.b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> nu_sq) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cv.cg0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">250.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">500.0</span>)</span>
<span id="cb20-145">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g2(T_IN, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cv)</span>
<span id="cb20-146">        t1c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1q(T, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">250.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">500.0</span>)</span>
<span id="cb20-147">        t1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: g1m(T, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">250.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">500.0</span>)</span>
<span id="cb20-148">        rows.append((lab, tu, g, T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1c, T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1v))</span>
<span id="cb20-149">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, tu, g, s1, s2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows:</span>
<span id="cb20-150">        tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rtag(lab)</span>
<span id="cb20-151">        m.update({<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_T_up"</span>: tu, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_G2d"</span>: g,</span>
<span id="cb20-152">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_shift_const"</span>: s1, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_shift_GT"</span>: s2})</span>
<span id="cb20-153">    tu_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows]</span>
<span id="cb20-154">    s1_all, s2_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows], [r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows]</span>
<span id="cb20-155">    m.update(recon_spread_upper_threshold_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(tu_all) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(tu_all),</span>
<span id="cb20-156">             recon_spread_equiv_shift_C<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(s1_all) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(s1_all),</span>
<span id="cb20-157">             recon_min_equiv_shift_const<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(s1_all), recon_min_equiv_shift_GT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(s2_all),</span>
<span id="cb20-158">             recon_rows_GT_shift_above_claim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> CLAIM_C <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> s2_all)),</span>
<span id="cb20-159">             recon_rows_const_shift_above_claim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> CLAIM_C <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> s1_all)))</span>
<span id="cb20-160">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m</span>
<span id="cb20-161"></span>
<span id="cb20-162"></span>
<span id="cb20-163">R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reacting(CH)</span>
<span id="cb20-164"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reacting model: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> results"</span>)</span>
<span id="cb20-165">EXACT_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_rows_out_of_subdivisions"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon_rows_GT_shift_above_claim"</span>,</span>
<span id="cb20-166">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon_rows_const_shift_above_claim"</span>)</span>
<span id="cb20-167"></span>
<span id="cb20-168"></span>
<span id="cb20-169"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> register_reacting(m):</span>
<span id="cb20-170">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Register the reacting results: temperatures to 1e-5, the rest to 1e-4 (1e-3 when small)."""</span></span>
<span id="cb20-171">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> m.items():</span>
<span id="cb20-172">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXACT_R:</span>
<span id="cb20-173">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb20-174">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_316_dG_order"</span>:</span>
<span id="cb20-175">            claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb20-176">                         note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler in G is first order"</span>)</span>
<span id="cb20-177">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>:</span>
<span id="cb20-178">            claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb20-179">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> k.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_C"</span>):</span>
<span id="cb20-180">            claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb20-181">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb20-182">            claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb20-183">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kind <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GT"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"const"</span>):</span>
<span id="cb20-184">        gaps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rtag(lab)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_shift_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kind<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CLAIM_C <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, _, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RECON]</span>
<span id="cb20-185">        claims.exact(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_rows_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kind<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_shift_above_claim"</span>, m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_rows_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kind<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_shift_above_claim"</span>],</span>
<span id="cb20-186">                     margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(gaps))), min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb20-187">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin in degC to the 2 degC claim"</span>)</span>
<span id="cb20-188">    claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_rows_out_of_subdivisions"</span>, m[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_rows_out_of_subdivisions"</span>],</span>
<span id="cb20-189">                 structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scipy quad warnings, counted"</span>)</span>
<span id="cb20-190"></span>
<span id="cb20-191"></span>
<span id="cb20-192">register_reacting(R)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>reacting model: 116 results</code></pre>
</div>
</div>
<div id="954b7cbd" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:53:55.695989Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:53:55.695813Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:53:55.700879Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:53:55.700129Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""Fig. 2  (1-D) runs to L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The paper: below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C 'the monolith temperature does</span></span>
<span id="cb22-2"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        not rise significantly'. This model puts that case's light-off at G* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_1d_at_window_low'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb22-3"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beyond'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_1d_at_window_low'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> L_F2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inside'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the figure, so the statement holds.</span></span>
<span id="cb22-4"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 11 (2-D) runs to L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The paper: 'no reaction light-off' below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C. This model</span></span>
<span id="cb22-5"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">        puts that case's light-off at G* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_at_window_low'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beyond'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_at_window_low'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> L_F11 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inside'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the figure, so that holds too.</span></span>
<span id="cb22-6"></span>
<span id="cb22-7"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Root-found at each figure's own length:</span></span>
<span id="cb22-8"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  1-D, Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Fig. 2)    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_1d_at_fig2_length'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb22-9"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  2-D, round tube, L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Fig. 11)   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_2d_at_fig11_length'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb22-10"></span>
<span id="cb22-11"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The page's two models, on identical parameters, put the 2-D threshold </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_windows_length_artefact_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C from</span></span>
<span id="cb22-12"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the 1-D one when each is read at its own figure's length; the paper's two windows</span></span>
<span id="cb22-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">differ by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, reproduced to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_windows_vs_paper_gap_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C. Taking the same 1-D model out to Fig. 11's</span></span>
<span id="cb22-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">length separates the two effects:</span></span>
<span id="cb22-15"></span>
<span id="cb22-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  length alone, 1-D from L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_windows_length_term_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb22-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  model difference at the common L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_windows_model_term_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb22-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  ------------------------------------------------------</span></span>
<span id="cb22-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the gap between the two windows           </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_windows_length_artefact_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb22-20"></span>
<span id="cb22-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The length term dominates and fixes the sign. Both of the paper's statements are</span></span>
<span id="cb22-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">correct about their own figures and consistent with each other once the lengths are</span></span>
<span id="cb22-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">accounted for; the model term has the sign of the mechanism the paper derives on</span></span>
<span id="cb22-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">p. 482 ('lower Nusselt number means earlier light-off')."""</span>)</span>
<span id="cb22-25">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_1d_case_beyond_fig2"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_1d_at_window_low"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> L_F2),</span>
<span id="cb22-26">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_1d_at_window_low"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F2), min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb22-27">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_2d_case_beyond_fig11"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_window_low"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> L_F11),</span>
<span id="cb22-28">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_window_low"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L_F11), min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Fig. 2  (1-D) runs to L* = 0.20. The paper: below 304 C 'the monolith temperature does
        not rise significantly'. This model puts that case's light-off at G* = 0.2405,
        beyond the figure, so the statement holds.
Fig. 11 (2-D) runs to L* = 0.50. The paper: 'no reaction light-off' below 293 C. This model
        puts that case's light-off at G* = 0.5768, beyond the figure, so that holds too.

Root-found at each figure's own length:
  1-D, Nu = 3.608, L* = 0.20 (Fig. 2)     306.44 C
  2-D, round tube, L* = 0.50 (Fig. 11)    295.61 C

The page's two models, on identical parameters, put the 2-D threshold -10.83 C from
the 1-D one when each is read at its own figure's length; the paper's two windows
differ by -11 C, reproduced to 0.17 C. Taking the same 1-D model out to Fig. 11's
length separates the two effects:

  length alone, 1-D from L* = 0.20 to 0.50    -13.42 C
  model difference at the common L* = 0.50      +2.59 C
  ------------------------------------------------------
  the gap between the two windows             -10.83 C

The length term dominates and fixes the sign. Both of the paper's statements are
correct about their own figures and consistent with each other once the lengths are
accounted for; the model term has the sign of the mechanism the paper derives on
p. 482 ('lower Nusselt number means earlier light-off').</code></pre>
</div>
</div>
<div id="36448bb2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:53:55.702409Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:53:55.702290Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:53:55.706323Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:53:55.705584Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""Upper threshold, light-off at the inlet:</span></span>
<span id="cb24-2"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  1-D, Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (square)   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_up_1d_square'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb24-3"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  1-D, Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_CI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (circle)   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_up_1d_circle'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C     shape effect </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_up_1d_shape_effect'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb24-4"></span>
<span id="cb24-5"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The paper's 1-D bracket for this, from its running text alone, is (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lightoff_window_1D_high'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] C.</span></span>
<span id="cb24-6"></span>
<span id="cb24-7"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The 2-D model has no such threshold. A round tube has an infinite local Sherwood</span></span>
<span id="cb24-8"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">number at X* = 0, so light-off always occurs at some X* &gt; 0; what a march can report</span></span>
<span id="cb24-9"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is the inlet temperature at which light-off enters the first axial step, a number</span></span>
<span id="cb24-10"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">set by the step:"""</span>)</span>
<span id="cb24-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DG_LADDER:</span>
<span id="cb24-12">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_up_2d_first_step_dG</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m"</span>)</span>
<span id="cb24-13">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  dG = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   light-off inside the first step from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span></span>
<span id="cb24-14">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   (the dG used everywhere else)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> DG <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb24-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb24-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_up_2d_first_step_mean_per_halving_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C per halving on average, the last halving </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_up_2d_first_step_divergence_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C: it diverges as</span></span>
<span id="cb24-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  dG -&gt; 0, as the explanation requires, and is reported as the value at its step.</span></span>
<span id="cb24-18"></span>
<span id="cb24-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 11's case 4 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CASE4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, 'light-off at the tube inlet') lights off at G* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_at_case4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> here:</span></span>
<span id="cb24-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">nonzero, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_at_case4'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the abscissa of its figure, so the paper's 'at the inlet' is</span></span>
<span id="cb24-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">visual, not a threshold."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Upper threshold, light-off at the inlet:
  1-D, Nu = 3.608 (square)    329.92 C
  1-D, Nu = 4.364 (circle)    335.21 C     shape effect +5.29 C

The paper's 1-D bracket for this, from its running text alone, is (304, 343] C.

The 2-D model has no such threshold. A round tube has an infinite local Sherwood
number at X* = 0, so light-off always occurs at some X* &gt; 0; what a march can report
is the inlet temperature at which light-off enters the first axial step, a number
set by the step:
  dG = 4.0e-04   light-off inside the first step from  378.86 C
  dG = 2.0e-04   light-off inside the first step from  386.90 C
  dG = 1.0e-04   light-off inside the first step from  395.05 C   (the dG used everywhere else)
  dG = 5.0e-05   light-off inside the first step from  403.33 C

  +8.2 C per halving on average, the last halving +8.28 C: it diverges as
  dG -&gt; 0, as the explanation requires, and is reported as the value at its step.

Fig. 11's case 4 (349 C, 'light-off at the tube inlet') lights off at G* = 0.01008 here:
nonzero, 0.020 of the abscissa of its figure, so the paper's 'at the inlet' is
visual, not a threshold.</code></pre>
</div>
</div>
<div id="f6cb2a4f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:53:55.708224Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:53:55.708077Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:53:55.715188Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:53:55.714804Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1">low <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([(L, R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_1d_const_L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb26-2">                     R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_1d_GT_L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>], R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb26-3">                     R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_minus_1d_const_L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb26-4">                     R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_minus_1d_GT_L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> L_SWEEP],</span>
<span id="cb26-5">                   columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L*"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D const Nu"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D Grigull-Tratz Nu(X*)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D"</span>,</span>
<span id="cb26-6">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D minus 1-D const"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D minus 1-D G-T"</span>])</span>
<span id="cb26-7">show(low.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_lowthr"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb26-8">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L*"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D const Nu"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D Grigull-Tratz Nu(X*)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb26-9">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D minus 1-D const"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D minus 1-D G-T"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb26-10">pos <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> low[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D minus 1-D const"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D minus 1-D G-T"</span>]].to_numpy()</span>
<span id="cb26-11">claims.count(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower_threshold_2d_above_both_1d"</span>, pos.ravel(), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb26-12">             relative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin in degC"</span>)</span>
<span id="cb26-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""The 2-D model needs a higher inlet temperature than either 1-D model in</span></span>
<span id="cb26-14"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((pos <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pos<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> comparisons, at every channel length (the direction p. 482 requires).</span></span>
<span id="cb26-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The magnitude depends on L*: the 1-D threshold falls </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_1d_const_slope_per_005'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C per 0.05 of L*,</span></span>
<span id="cb26-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which is why the paper's two windows, read off figures whose abscissae differ by a</span></span>
<span id="cb26-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, cannot be compared with each other as thresholds. The 2-D minus 1-D</span></span>
<span id="cb26-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">column shrinks with length, +</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_2d_minus_1d_const_L020'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C at L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and +</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_windows_model_term_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C at L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb26-19"></span>
<span id="cb26-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">None of these absolute temperatures is the paper's number: the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_1d_const_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C of the first</span></span>
<span id="cb26-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">column is not evidence for the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C it lands near. Two of the model's groups are</span></span>
<span id="cb26-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reconstructed (the Validation section moves this column by tens of degrees), and the</span></span>
<span id="cb26-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">paper's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is a sampled case. Only differences between columns, which share those</span></span>
<span id="cb26-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">groups, are claimed."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_lowthr" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_lowthr_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">L*</th>
<th id="T_i13_lowthr_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">1-D const Nu</th>
<th id="T_i13_lowthr_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">1-D Grigull-Tratz Nu(X*)</th>
<th id="T_i13_lowthr_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">2-D</th>
<th id="T_i13_lowthr_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">2-D minus 1-D const</th>
<th id="T_i13_lowthr_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">2-D minus 1-D G-T</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_lowthr_row0_col0" class="data row0 col0">0.20</td>
<td id="T_i13_lowthr_row0_col1" class="data row0 col1">306.44</td>
<td id="T_i13_lowthr_row0_col2" class="data row0 col2">308.89</td>
<td id="T_i13_lowthr_row0_col3" class="data row0 col3">311.18</td>
<td id="T_i13_lowthr_row0_col4" class="data row0 col4">+4.74</td>
<td id="T_i13_lowthr_row0_col5" class="data row0 col5">+2.29</td>
</tr>
<tr class="even">
<td id="T_i13_lowthr_row1_col0" class="data row1 col0">0.25</td>
<td id="T_i13_lowthr_row1_col1" class="data row1 col1">303.47</td>
<td id="T_i13_lowthr_row1_col2" class="data row1 col2">305.65</td>
<td id="T_i13_lowthr_row1_col3" class="data row1 col3">307.60</td>
<td id="T_i13_lowthr_row1_col4" class="data row1 col4">+4.13</td>
<td id="T_i13_lowthr_row1_col5" class="data row1 col5">+1.95</td>
</tr>
<tr class="odd">
<td id="T_i13_lowthr_row2_col0" class="data row2 col0">0.30</td>
<td id="T_i13_lowthr_row2_col1" class="data row2 col1">300.89</td>
<td id="T_i13_lowthr_row2_col2" class="data row2 col2">302.87</td>
<td id="T_i13_lowthr_row2_col3" class="data row2 col3">304.56</td>
<td id="T_i13_lowthr_row2_col4" class="data row2 col4">+3.67</td>
<td id="T_i13_lowthr_row2_col5" class="data row2 col5">+1.70</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The 2-D model needs a higher inlet temperature than either 1-D model in
6 of 6 comparisons, at every channel length (the direction p. 482 requires).
The magnitude depends on L*: the 1-D threshold falls 2.8 C per 0.05 of L*,
which is why the paper's two windows, read off figures whose abscissae differ by a
factor of 2.5, cannot be compared with each other as thresholds. The 2-D minus 1-D
column shrinks with length, +4.74 C at L* = 0.20 and +2.59 C at L* = 0.50.

None of these absolute temperatures is the paper's number: the 303.5 C of the first
column is not evidence for the 304 C it lands near. Two of the model's groups are
reconstructed (the Validation section moves this column by tens of degrees), and the
paper's 304 is a sampled case. Only differences between columns, which share those
groups, are claimed.</code></pre>
</div>
</div>
</section>
<section id="shape-or-dimensionality-split-like-for-like-on-one-threshold" class="level4">
<h4 class="anchored" data-anchor-id="shape-or-dimensionality-split-like-for-like-on-one-threshold">Shape or dimensionality, split like-for-like on one threshold</h4>
<p>The paper’s 1-D runs use the <em>square</em>-channel Nusselt number of its own Table 1, while its 2-D model is a <em>round</em> tube. Two different things are therefore bundled into “the 1-D/2-D difference”, and they separate by running the 1-D model at the round-tube Nusselt number, on the same threshold and the same length.</p>
<div id="e957c3da" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:53:55.717609Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:53:55.717432Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:53:55.720901Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:53:55.720296Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""at L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, all three on identical parameters:</span></span>
<span id="cb28-2"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  1-D, Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (square, what the paper's 1-D uses)  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_1d_const_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb28-3"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  1-D, Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_CI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (round tube, shape matched to 2-D)   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_1d_circle_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb28-4"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  2-D  (round tube, entrance region resolved)        </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_2d_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb28-5"></span>
<span id="cb28-6"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  channel shape alone               </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_shape_effect_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb28-7"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  entrance region + dimensionality  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_entrance_dim_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb28-8"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  -------------------------------------------</span></span>
<span id="cb28-9"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the whole gap                     </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_2d_minus_1d_const_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb28-10"></span>
<span id="cb28-11"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_shape_share_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the "1-D/2-D difference" here is the Nusselt number of a square channel</span></span>
<span id="cb28-12"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">compared with a round one. The paper's own runs carry the same mismatch: its Figs. 2</span></span>
<span id="cb28-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to 6 use </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NU_SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and its Fig. 11 is a cylinder."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>at L* = 0.25, all three on identical parameters:
  1-D, Nu = 3.608 (square, what the paper's 1-D uses)   303.47 C
  1-D, Nu = 4.364 (round tube, shape matched to 2-D)    305.54 C
  2-D  (round tube, entrance region resolved)         307.60 C

  channel shape alone               +2.07 C
  entrance region + dimensionality  +2.05 C
  -------------------------------------------
  the whole gap                     +4.13 C

50 % of the "1-D/2-D difference" here is the Nusselt number of a square channel
compared with a round one. The paper's own runs carry the same mismatch: its Figs. 2
to 6 use 3.608 and its Fig. 11 is a cylinder.</code></pre>
</div>
</div>
<div id="69003ca9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:53:55.722700Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:53:55.722582Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:53:55.728738Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:53:55.728366Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1">eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([(T2, R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_G2d_at316"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_IN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_G2d_at</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb30-2">                    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_Nu_at316"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_IN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_shift_const_at</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb30-3">                    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_at316"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_IN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equiv_shift_GT_at</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb30-4">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_EQ],</span>
<span id="cb30-5">                  columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D inlet T (C)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D light-off G*"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, const-Nu 1-D (C)"</span>,</span>
<span id="cb30-6">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, Grigull-Tratz 1-D (C)"</span>])</span>
<span id="cb30-7">show(eq.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_equiv"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb30-8">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D inlet T (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.0f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D light-off G*"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb30-9">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, const-Nu 1-D (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, Grigull-Tratz 1-D (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb30-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""The paper: the 1-D/2-D difference is 'equivalent to less than a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLAIM_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C difference in inlet</span></span>
<span id="cb30-11"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gas temperature', said of the Grigull-Tratz 1-D model of its Fig. 12. Measured:</span></span>
<span id="cb30-12"></span>
<span id="cb30-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">                     shift at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C   / claim at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C   / claim over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_EQ[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_EQ[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C</span></span>
<span id="cb30-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Grigull-Tratz 1-D: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_GT_at316'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C       </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_GT_over_claim_at316'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">             </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_GT_over_claim_min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_GT_over_claim_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span></span>
<span id="cb30-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  constant-Nu 1-D:   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_Nu_at316'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C       </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_over_claim_at316'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">             </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_over_claim_min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_over_claim_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span></span>
<span id="cb30-16"></span>
<span id="cb30-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The Grigull-Tratz model is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_GT_minus_claim_at316'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C over the claim at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C; the constant-Nu model,</span></span>
<span id="cb30-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which produced most of the paper's figures, is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_over_claim_at316'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the claim at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C and</span></span>
<span id="cb30-19"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_over_claim_min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equiv_shift_const_over_claim_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times over the range. 'Adequate' is a property of the Fig. 12 procedure,</span></span>
<span id="cb30-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">not of one-dimensionality."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_equiv" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_equiv_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">2-D inlet T (C)</th>
<th id="T_i13_equiv_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">2-D light-off G*</th>
<th id="T_i13_equiv_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">shift, const-Nu 1-D (C)</th>
<th id="T_i13_equiv_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">shift, Grigull-Tratz 1-D (C)</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_equiv_row0_col0" class="data row0 col0">310</td>
<td id="T_i13_equiv_row0_col1" class="data row0 col1">0.21547</td>
<td id="T_i13_equiv_row0_col2" class="data row0 col2">+4.53</td>
<td id="T_i13_equiv_row0_col3" class="data row0 col3">+2.17</td>
</tr>
<tr class="even">
<td id="T_i13_equiv_row1_col0" class="data row1 col0">316</td>
<td id="T_i13_equiv_row1_col1" class="data row1 col1">0.14576</td>
<td id="T_i13_equiv_row1_col2" class="data row1 col2">+5.72</td>
<td id="T_i13_equiv_row1_col3" class="data row1 col3">+2.85</td>
</tr>
<tr class="odd">
<td id="T_i13_equiv_row2_col0" class="data row2 col0">320</td>
<td id="T_i13_equiv_row2_col1" class="data row2 col1">0.11028</td>
<td id="T_i13_equiv_row2_col2" class="data row2 col2">+6.69</td>
<td id="T_i13_equiv_row2_col3" class="data row2 col3">+3.41</td>
</tr>
<tr class="even">
<td id="T_i13_equiv_row3_col0" class="data row3 col0">330</td>
<td id="T_i13_equiv_row3_col1" class="data row3 col1">0.05137</td>
<td id="T_i13_equiv_row3_col2" class="data row3 col2">+10.12</td>
<td id="T_i13_equiv_row3_col3" class="data row3 col3">+5.15</td>
</tr>
<tr class="odd">
<td id="T_i13_equiv_row4_col0" class="data row4 col0">340</td>
<td id="T_i13_equiv_row4_col1" class="data row4 col1">0.02225</td>
<td id="T_i13_equiv_row4_col2" class="data row4 col2">+15.48</td>
<td id="T_i13_equiv_row4_col3" class="data row4 col3">+6.83</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The paper: the 1-D/2-D difference is 'equivalent to less than a 2 C difference in inlet
gas temperature', said of the Grigull-Tratz 1-D model of its Fig. 12. Measured:

                     shift at 316 C   / claim at 316 C   / claim over 310 to 340 C
  Grigull-Tratz 1-D:  +2.85 C        1.43             1.09 to 3.41
  constant-Nu 1-D:    +5.72 C        2.86             2.26 to 7.74

The Grigull-Tratz model is +0.85 C over the claim at 316 C; the constant-Nu model,
which produced most of the paper's figures, is 2.9 times the claim at 316 C and
2.3 to 7.7 times over the range. 'Adequate' is a property of the Fig. 12 procedure,
not of one-dimensionality.</code></pre>
</div>
</div>
</section>
<section id="where-the-difference-comes-from" class="level4">
<h4 class="anchored" data-anchor-id="where-the-difference-comes-from">Where the difference comes from</h4>
<p>The three sources are separable, and two of them are not about dimensionality:</p>
<ol type="1">
<li><strong>Channel shape.</strong> The paper’s 1-D runs use the square-channel Nusselt number; the 2-D model is a round tube, whose asymptote is higher. The split above measures it on the same threshold and length as the gap itself.</li>
<li><strong>The thermal entrance region.</strong> The 2-D model starts with an infinite local Nusselt number and relaxes towards the asymptote. A constant-<img src="https://latex.codecogs.com/png.latex?Nu"> 1-D model never has that, which is why the paper’s Fig. 12 procedure (the Grigull-Tratz correlation before light-off) closes most of the gap.</li>
<li><strong>Dimensionality proper</strong>, what is left once 1 and 2 are matched.</li>
</ol>
<p>With the entrance region put back in, the two models differ by a few degrees of inlet temperature, close to the paper’s conclusion. What does not survive is the way the conclusion is stated, as a property of <em>one-dimensional models</em>, when the model that carries the paper’s own parametric study (Figs. 2 to 6, constant <img src="https://latex.codecogs.com/png.latex?Nu">) is several times further off than the claim allows.</p>
</section>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<section id="which-x-the-papers-2-d-results-use-decided-by-its-own-printed-number" class="level3">
<h3 class="anchored" data-anchor-id="which-x-the-papers-2-d-results-use-decided-by-its-own-printed-number">Which X* the paper’s 2-D results use, decided by its own printed number</h3>
<p>The Notation defines <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D%20=%204x/(D%5C,Re%5C,Pr)">; eq. (15) requires <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D%20=%20x/(D%5C,Re%5C,Pr)">. The paper prints one number that separates them: for the constant-wall-temperature Graetz problem with <img src="https://latex.codecogs.com/png.latex?%5Cbar%20T_G%5E%7B%5Cast%7D%20=%201"> at the inlet and <img src="https://latex.codecogs.com/png.latex?T_w%5E%7B%5Cast%7D%20=%200">, “at the point <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D%20=%200.25">, <img src="https://latex.codecogs.com/png.latex?%5Cbar%20T_G%5E%7B%5Cast%7D"> is 0.0224”. The same number decides whether the overbar is the mixing-cup or the area mean.</p>
<div id="d96de917" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:53:55.731044Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:53:55.730874Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:09.348578Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:09.347742Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1">TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_at_X_0p25"</span>)</span>
<span id="cb32-2"></span>
<span id="cb32-3"></span>
<span id="cb32-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> tbar(half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>):</span>
<span id="cb32-5">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r, half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>half, x_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r_grade).solve(</span>
<span id="cb32-6">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"temp"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), inlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb32-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.interp(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s[mean]))</span>
<span id="cb32-8"></span>
<span id="cb32-9"></span>
<span id="cb32-10">TB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_eq15"</span>: tbar(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_notation"</span>: tbar(half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.40</span>),</span>
<span id="cb32-11">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_area"</span>: tbar(mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>)}</span>
<span id="cb32-12">TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_eq15_over_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_eq15"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR</span>
<span id="cb32-13">TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_notation_over_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_notation"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR</span>
<span id="cb32-14">TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_area_over_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_area"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR</span>
<span id="cb32-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""eq. (15) as printed,     mixing cup: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_eq15'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_eq15_over_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TBAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb32-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Notation, 4x/(D Re Pr),  mixing cup: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_notation'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_notation_over_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x)</span></span>
<span id="cb32-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eq. (15), area mean:                 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_area'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_area_over_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x)</span></span>
<span id="cb32-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So the 2-D results use eq. (15)'s scaling and the overbar is the mixing-cup mean."""</span>)</span>
<span id="cb32-19">LAD_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb32-20">lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [tbar(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAD_R]</span>
<span id="cb32-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial grid, Tbar_cup(X* = 0.25)  (the paper states ten radial points):"</span>)</span>
<span id="cb32-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n_r = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, grading </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (n, g), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LAD_R, lad)))</span>
<span id="cb32-23">TB.update({<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Tbar_X025_nr</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_g</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (n, g), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LAD_R, lad)})</span>
<span id="cb32-24">TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_converged"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lad[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb32-25">TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_paper_grid_error"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lad[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb32-26">TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_nr10_clustered_error"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lad[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb32-27">inside10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb32-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb32-29"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Converged: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lad[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. On ten radial points the answer lies between </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (uniform)</span></span>
<span id="cb32-30"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (wall-clustered), and the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TBAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lies'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inside10 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'does not lie'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inside that interval. The</span></span>
<span id="cb32-31"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">wall-clustered ten-point solve is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_nr10_clustered_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % above converged and the printed value</span></span>
<span id="cb32-32"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tbar_X025_paper_grid_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % above it. So the printed number measures the radial discretisation error of</span></span>
<span id="cb32-33"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the paper's 2-D model, an error of the same order as the 1-D/2-D difference the model</span></span>
<span id="cb32-34"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is used to adjudicate. That is why every adequacy statement here is a difference</span></span>
<span id="cb32-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">between two models on one grid."""</span>)</span>
<span id="cb32-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TB.items():</span>
<span id="cb32-37">    claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"error"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb32-38">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_printed_inside_ten_point_interval"</span>, inside10,</span>
<span id="cb32-39">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR), min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (15) as printed,     mixing cup: 0.021147  (0.94 x the printed 0.0224)
Notation, 4x/(D Re Pr),  mixing cup: 0.328686  (14.67 x)
eq. (15), area mean:                 0.015004  (0.67 x)
So the 2-D results use eq. (15)'s scaling and the overbar is the mixing-cup mean.
radial grid, Tbar_cup(X* = 0.25)  (the paper states ten radial points):
  n_r =  10, grading 1.0   0.021575
  n_r =  10, grading 2.0   0.022451
  n_r =  20, grading 1.0   0.021252
  n_r =  40, grading 1.0   0.021171
  n_r =  80, grading 2.0   0.021164
  n_r = 200, grading 2.0   0.021147

Converged: 0.021147. On ten radial points the answer lies between 0.021575 (uniform)
and 0.022451 (wall-clustered), and the printed 0.0224 lies inside that interval. The
wall-clustered ten-point solve is 6.2 % above converged and the printed value
5.9 % above it. So the printed number measures the radial discretisation error of
the paper's 2-D model, an error of the same order as the 1-D/2-D difference the model
is used to adjudicate. That is why every adequacy statement here is a difference
between two models on one grid.</code></pre>
</div>
</div>
</section>
<section id="refinement-every-axis-that-carries-error" class="level3">
<h3 class="anchored" data-anchor-id="refinement-every-axis-that-carries-error">Refinement: every axis that carries error</h3>
<div id="8ae01537" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:09.350454Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:09.350329Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:12.748700Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:12.747892Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> square_orders(n_ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">384</span>):</span>
<span id="cb34-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Observed order at 48 -&gt; 96 of each axis, the other axis at the reference count."""</span></span>
<span id="cb34-3">    ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duct(n_ref, n_ref)</span>
<span id="cb34-4">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb34-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> axis <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb34-6">        eH, eT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb34-7">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span>):</span>
<span id="cb34-8">            d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duct(n, n_ref) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> axis <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> duct(n_ref, n)</span>
<span id="cb34-9">            eH.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H1"</span>]))</span>
<span id="cb34-10">            eT.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>]))</span>
<span id="cb34-11">        out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"order_square_NuH1_axis</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>axis<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_order(eH)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb34-12">        out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"order_square_NuT_axis</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>axis<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_order(eT)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb34-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb34-14"></span>
<span id="cb34-15"></span>
<span id="cb34-16">SQ_ORD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> square_orders()</span>
<span id="cb34-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square duct, each axis refined against a (384, 384) reference, order at 48 -&gt; 96:"</span>)</span>
<span id="cb34-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SQ_ORD.items()))</span>
<span id="cb34-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The square is symmetric under swapping the axes, so the two axes must agree; the "</span></span>
<span id="cb34-20">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pair of axes on this page is the Graetz solve below."</span>)</span>
<span id="cb34-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SQ_ORD.items():</span>
<span id="cb34-22">    claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb34-23">                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second-order finite volumes; the reference error alone lifts 2 to about 2.07"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>square duct, each axis refined against a (384, 384) reference, order at 48 -&gt; 96:
  order_square_NuH1_axis0 2.12, order_square_NuT_axis0 2.11, order_square_NuH1_axis1 2.12, order_square_NuT_axis1 2.11
The square is symmetric under swapping the axes, so the two axes must agree; the independent
pair of axes on this page is the Graetz solve below.</code></pre>
</div>
</div>
<div id="65a97808" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:12.750967Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:12.750786Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:46.341365Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:46.340501Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb36-1">QW9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> wall_flux(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>QW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>])</span>
<span id="cb36-2"></span>
<span id="cb36-3"></span>
<span id="cb36-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pole_of(n_x, n_r, tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb36-5">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_x, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_r, half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>half, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9), tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tvd, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb36-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> cross(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>])</span>
<span id="cb36-7"></span>
<span id="cb36-8"></span>
<span id="cb36-9">REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pole_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">320</span>)</span>
<span id="cb36-10">AX_NS, RAD_NS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>)</span>
<span id="cb36-11">AX_BASE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pole_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span>
<span id="cb36-12"></span>
<span id="cb36-13"></span>
<span id="cb36-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> radial_errors(ref, wall_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"face"</span>):</span>
<span id="cb36-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pole_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>, n, wall_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>wall_read) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RAD_NS]</span>
<span id="cb36-16"></span>
<span id="cb36-17"></span>
<span id="cb36-18">rad_err <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> radial_errors(REF_POLE)</span>
<span id="cb36-19"></span>
<span id="cb36-20"></span>
<span id="cb36-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> axial_order(tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb36-22">    errs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pole_of(n, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tvd) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> AX_BASE) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> AX_NS]</span>
<span id="cb36-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> fitted_order(AX_NS, errs), errs</span>
<span id="cb36-24"></span>
<span id="cb36-25"></span>
<span id="cb36-26">ax_ord, ax_err <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> axial_order()</span>
<span id="cb36-27">GR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_X_fig9_refined"</span>: REF_POLE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_radial"</span>: fitted_order(RAD_NS, rad_err),</span>
<span id="cb36-28">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_axial"</span>: ax_ord, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_axial_over_radial_err_coarsest"</span>: ax_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rad_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]}</span>
<span id="cb36-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reference pole (n_x = 6400, n_r = 320): X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF_POLE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"radial ladder n_r = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">map</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, RAD_NS))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: least-squares order "</span></span>
<span id="cb36-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'order_pole_radial'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"axial ladder n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">map</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, AX_NS))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: least-squares order "</span></span>
<span id="cb36-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'order_pole_axial'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""The axial ladder is noisy and its slope comes out above 2. That is not third-order</span></span>
<span id="cb36-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">accuracy: the pole is located on this axis, so the locator's own interpolation error</span></span>
<span id="cb36-36"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is inside the ladder, and the axial errors are </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_axial_over_radial_err_coarsest'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the radial ones at the</span></span>
<span id="cb36-37"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">coarsest rung, so it is not the limiting axis. With the TVD correction off the same</span></span>
<span id="cb36-38"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">fit gives first order (break table)."""</span>)</span>
<span id="cb36-39"></span>
<span id="cb36-40"></span>
<span id="cb36-41"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> paper_scheme(tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb36-42">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The paper's stated counts: ten radial points and its axial step."""</span></span>
<span id="cb36-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> pole_of(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axial_step_2D"</span>))), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial_points_2D"</span>)), tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tvd)</span>
<span id="cb36-44"></span>
<span id="cb36-45"></span>
<span id="cb36-46">p_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> paper_scheme()</span>
<span id="cb36-47">lo_pg, hi_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(p_pg, pole_10r), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(p_pg, pole_10r)</span>
<span id="cb36-48">GR.update(nu_pole_X_fig9_paper_scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p_pg,</span>
<span id="cb36-49">          pole_paper_scheme_dev_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb36-50">          pole_paper_counts_short_min_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb36-51">          pole_paper_counts_short_max_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb36-52">          pole_paper_counts_max_dev_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb36-53">                                                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pole_10r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb36-54">          pole_to_0p032_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb36-55">GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_reach_over_grid_error"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_to_0p032_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_max_dev_pct"</span>]</span>
<span id="cb36-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb36-57"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The paper's stated discretisation is ten radial points and dX* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'axial_step_2D'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; with the TVD</span></span>
<span id="cb36-58"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">correction off as well (a first-order marching scheme) the pole is at X* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p_pg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb36-59"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_paper_scheme_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from converged and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % short of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. That is this page's radial operator on</span></span>
<span id="cb36-60"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the paper's counts, not the paper's code, so the conclusion is a margin: the two</span></span>
<span id="cb36-61"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">paper-count solves lie </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_paper_counts_short_min_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_paper_counts_short_max_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % short of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_paper_counts_max_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of converged,</span></span>
<span id="cb36-62"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">while reaching </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> takes </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_to_0p032_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_reach_over_grid_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times that discretisation error."""</span>)</span>
<span id="cb36-63"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GR.items():</span>
<span id="cb36-64">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_radial"</span>:</span>
<span id="cb36-65">        claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb36-66">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order radially"</span>)</span>
<span id="cb36-67">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_axial"</span>:</span>
<span id="cb36-68">        claims.bound(k, v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb36-69">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer, located on this axis, so noisy above 2"</span>)</span>
<span id="cb36-70">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb36-71">        claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>reference pole (n_x = 6400, n_r = 320): X* = 0.0311833
radial ladder n_r = 10, 20, 40, 80: least-squares order 2.25
axial ladder n_x = 50, 100, 200, 400: least-squares order 2.68
The axial ladder is noisy and its slope comes out above 2. That is not third-order
accuracy: the pole is located on this axis, so the locator's own interpolation error
is inside the ladder, and the axial errors are 0.32 times the radial ones at the
coarsest rung, so it is not the limiting axis. With the TVD correction off the same
fit gives first order (break table).

The paper's stated discretisation is ten radial points and dX* = 0.00025; with the TVD
correction off as well (a first-order marching scheme) the pole is at X* = 0.031241,
+0.2 % from converged and 2.4 % short of 0.032. That is this page's radial operator on
the paper's counts, not the paper's code, so the conclusion is a margin: the two
paper-count solves lie 2.2 to 2.4 % short of 0.032 and within 0.3 % of converged,
while reaching 0.032 takes +2.6 %, 8 times that discretisation error.</code></pre>
</div>
</div>
</section>
<section id="two-solvers-for-the-same-discrete-graetz-equations" class="level3">
<h3 class="anchored" data-anchor-id="two-solvers-for-the-same-discrete-graetz-equations">Two solvers for the same discrete Graetz equations</h3>
<p>The production route is deferred correction (the van Leer correction in the residual, one LU of the upwind operator, under-relaxed). An independent route solves the same equations by Newton with the exact van Leer Jacobian from <code>ConvFluxTVD</code>. Each Newton iteration factorises the whole Jacobian, so on the production grid it costs several times the deferred correction’s single factorisation, which is why the comparison runs on a coarser grid.</p>
<div id="b78da7db" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:46.343644Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:46.343512Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:51.315154Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:51.314295Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1">GV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-2">s_dc, s_nw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GV.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9)), GV.solve_newton((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9))</span>
<span id="cb38-3">s_dc1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GV.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9), omega<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, accept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.inf)</span>
<span id="cb38-4">NW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_field"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s_dc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T"</span>]))),</span>
<span id="cb38-5">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_pole"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cross(s_dc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s_dc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_dc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>])</span>
<span id="cb38-6">                                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cross(s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]))}</span>
<span id="cb38-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x = 1000, n_r = 40, Fig. 9's flux:"</span>)</span>
<span id="cb38-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  deferred correction, omega = 0.6: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_dc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sweeps"</span>)</span>
<span id="cb38-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Newton with ConvFluxTVD, damping='monotone': </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> iterations"</span>)</span>
<span id="cb38-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  largest field difference (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'graetz_newton_vs_deferred_field'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), pole difference "</span></span>
<span id="cb38-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'graetz_newton_vs_deferred_pole'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), both below 1e-9"</span>)</span>
<span id="cb38-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  without under-relaxation (omega = 1) the correction still changes by "</span></span>
<span id="cb38-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_dc1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'incr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> after </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_dc1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sweeps"</span>)</span>
<span id="cb38-14">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_field"</span>, NW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_field"</span>],</span>
<span id="cb38-15">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both solvers stop at 1e-10"</span>)</span>
<span id="cb38-16">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_pole"</span>, NW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_pole"</span>],</span>
<span id="cb38-17">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both solvers stop at 1e-10"</span>)</span>
<span id="cb38-18">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_deferred_sweeps"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(s_dc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nit"</span>]))</span>
<span id="cb38-19">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_iterations"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nit"</span>]))</span>
<span id="cb38-20">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_omega1_last_change"</span>, s_dc1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"incr"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb38-21">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_omega1_sweeps"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(s_dc1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nit"</span>]))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>n_x = 1000, n_r = 40, Fig. 9's flux:
  deferred correction, omega = 0.6: 49 sweeps
  Newton with ConvFluxTVD, damping='monotone': 8 iterations
  largest field difference (here 2.5e-10), pole difference (here 6.9e-18), both below 1e-9
  without under-relaxation (omega = 1) the correction still changes by 4.5e-05 after 600 sweeps</code></pre>
</div>
</div>
</section>
<section id="the-grigull-tratz-correlation-against-the-solve-and-a-third-x" class="level3">
<h3 class="anchored" data-anchor-id="the-grigull-tratz-correlation-against-the-solve-and-a-third-x">The Grigull-Tratz correlation against the solve, and a third X*</h3>
<p>The paper reprints two correlations from Grigull and Tratz (1965) and uses the constant-flux one as the Nusselt number of its Fig. 12 one-dimensional model. They are printed without a definition of the <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D"> they use, and it is neither of the two already in play. The correlation is read from the CSV as printed.</p>
<div id="a4b22a82" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:51.317171Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:51.316996Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:58.257181Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:58.256265Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1">s_gt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.06</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4000</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, x_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>).solve(</span>
<span id="cb40-2">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> X: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.ones_like(X)))                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># constant wall flux</span></span>
<span id="cb40-3">NU_NUM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> local_nusselt(s_gt)       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># q &lt; 0 and (Tw - Tbar) &lt; 0, so positive</span></span>
<span id="cb40-4">G_GT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.002</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb40-5"></span>
<span id="cb40-6"></span>
<span id="cb40-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> gt_ratio(scale):</span>
<span id="cb40-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [NU_GT(scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.interp(g, s_gt[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], NU_NUM)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> G_GT]</span>
<span id="cb40-9"></span>
<span id="cb40-10"></span>
<span id="cb40-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> gt_dev(scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>):</span>
<span id="cb40-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> gt_ratio(scale)))</span>
<span id="cb40-13"></span>
<span id="cb40-14"></span>
<span id="cb40-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> gt_factor(scale):</span>
<span id="cb40-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(gt_ratio(scale)))</span>
<span id="cb40-17"></span>
<span id="cb40-18"></span>
<span id="cb40-19">GTC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_max_reldev"</span>: gt_dev(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_X_eq_G_min_factor"</span>: gt_factor(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb40-20">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_X_eq_4G_min_factor"</span>: gt_factor(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)}</span>
<span id="cb40-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""Over G = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_GT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_GT[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the correlation reproduces this page's solve to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> GTC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'grigull_tratz_max_reldev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % with</span></span>
<span id="cb40-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">X* = 1000 x/(D Re Pr), and overpredicts by at least a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GTC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'grigull_tratz_X_eq_4G_min_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (X* = 4x/(D Re Pr)) or</span></span>
<span id="cb40-23"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GTC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'grigull_tratz_X_eq_G_min_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (X* = x/(D Re Pr)) under the paper's own two meanings. So the paper carries three</span></span>
<span id="cb40-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">definitions of one symbol: 4x/(D Re Pr) in the Notation and eq. (9), x/(D Re Pr) in</span></span>
<span id="cb40-25"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eqs. (15)-(16) and on every figure abscissa, and 1000 x/(D Re Pr) in the reprinted</span></span>
<span id="cb40-26"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">correlations. The page uses each equation with the scaling it requires."""</span>)</span>
<span id="cb40-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GTC.items():</span>
<span id="cb40-28">    claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Over G = 0.001 to 0.05 the correlation reproduces this page's solve to 1.26 % with
X* = 1000 x/(D Re Pr), and overpredicts by at least a factor 5.3 (X* = 4x/(D Re Pr)) or
9.7 (X* = x/(D Re Pr)) under the paper's own two meanings. So the paper carries three
definitions of one symbol: 4x/(D Re Pr) in the Notation and eq. (9), x/(D Re Pr) in
eqs. (15)-(16) and on every figure abscissa, and 1000 x/(D Re Pr) in the reprinted
correlations. The page uses each equation with the scaling it requires.</code></pre>
</div>
</div>
</section>
<section id="light-off-positions-two-routes-in-1-d-and-the-axial-step-in-2-d" class="level3">
<h3 class="anchored" data-anchor-id="light-off-positions-two-routes-in-1-d-and-the-axial-step-in-2-d">Light-off positions: two routes in 1-D, and the axial step in 2-D</h3>
<p>The constant-<img src="https://latex.codecogs.com/png.latex?Nu"> 1-D light-off position is computed two ways that share no discretisation and no parametrisation: an explicit march of <img src="https://latex.codecogs.com/png.latex?dC_G/dG">, with the position root-found inside the step that crosses the fold, and a Gauss-Legendre quadrature of <img src="https://latex.codecogs.com/png.latex?dG/dC_w"> along the cold branch. A third route, the same integral parametrised by <img src="https://latex.codecogs.com/png.latex?C_G"> with scipy’s adaptive <code>quad</code>, has a square-root endpoint, because <img src="https://latex.codecogs.com/png.latex?dC_G/dC_w"> vanishes at the fold. For the 2-D model the light-off position is followed over four axial steps.</p>
<div id="d7912c1f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:58.259434Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:58.259293Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:58.267675Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:58.267084Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb42-1">rt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([(T, R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_quad_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>], R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_march_minus_quad_steps_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb42-2">                    R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route_quad_CG_relerr_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_ROUTE],</span>
<span id="cb42-3">                  columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_G0 (C)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G* quadrature in C_w"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march minus quadrature (steps)"</span>,</span>
<span id="cb42-4">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad in C_G, rel. error"</span>])</span>
<span id="cb42-5">show(rt.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_routes"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb42-6">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_G0 (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.0f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G* quadrature in C_w"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb42-7">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march minus quadrature (steps)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.3f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad in C_G, rel. error"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb42-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""The march (dG = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) and the quadrature agree to within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lightoff_march_vs_quad_max_steps'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> axial steps: the</span></span>
<span id="cb42-9"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">explicit march's own first-order error, which the dG row of the break table scales.</span></span>
<span id="cb42-10"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The C_G parametrisation is up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'quad_CG_endpoint_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % out; scipy's quad ran out of its 600</span></span>
<span id="cb42-11"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">subdivisions on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'quad_CG_rows_out_of_subdivisions'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T_ROUTE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows. Had that form been the reference, an error of that</span></span>
<span id="cb42-12"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">size would have sat under every threshold on this page."""</span>)</span>
<span id="cb42-13">gl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"G_lightoff_2d_316_dG</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m"</span>)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DG_LADDER]</span>
<span id="cb42-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb42-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">2-D light-off position at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, root-found in the crossing step:</span></span>
<span id="cb42-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  dG = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   G* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(DG_LADDER, gl)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb42-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_316_dG_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (backward Euler: 1); first-order Richardson on the last two</span></span>
<span id="cb42-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">steps </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_316_richardson'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so the dG = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> value is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'G_lightoff_2d_316_dG1em4_vs_richardson_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from it. The lower 2-D</span></span>
<span id="cb42-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold at L* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_F3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> moves from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_2d_L025'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T_low_2d_L025_dG5em5'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C when the step is halved.</span></span>
<span id="cb42-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Every 2-D result on this page is the value at dG = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_routes" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_routes_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">T_G0 (C)</th>
<th id="T_i13_routes_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">G* quadrature in C_w</th>
<th id="T_i13_routes_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">march minus quadrature (steps)</th>
<th id="T_i13_routes_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">quad in C_G, rel. error</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_routes_row0_col0" class="data row0 col0">305</td>
<td id="T_i13_routes_row0_col1" class="data row0 col1">0.223270</td>
<td id="T_i13_routes_row0_col2" class="data row0 col2">+0.927</td>
<td id="T_i13_routes_row0_col3" class="data row0 col3">1.80e-03</td>
</tr>
<tr class="even">
<td id="T_i13_routes_row1_col0" class="data row1 col0">310</td>
<td id="T_i13_routes_row1_col1" class="data row1 col1">0.149398</td>
<td id="T_i13_routes_row1_col2" class="data row1 col2">+0.798</td>
<td id="T_i13_routes_row1_col3" class="data row1 col3">9.66e-04</td>
</tr>
<tr class="odd">
<td id="T_i13_routes_row2_col0" class="data row2 col0">316</td>
<td id="T_i13_routes_row2_col1" class="data row2 col1">0.083408</td>
<td id="T_i13_routes_row2_col2" class="data row2 col2">+0.632</td>
<td id="T_i13_routes_row2_col3" class="data row2 col3">1.76e-03</td>
</tr>
<tr class="even">
<td id="T_i13_routes_row3_col0" class="data row3 col0">322</td>
<td id="T_i13_routes_row3_col1" class="data row3 col1">0.036929</td>
<td id="T_i13_routes_row3_col2" class="data row3 col2">+0.446</td>
<td id="T_i13_routes_row3_col3" class="data row3 col3">9.67e-03</td>
</tr>
<tr class="odd">
<td id="T_i13_routes_row4_col0" class="data row4 col0">328</td>
<td id="T_i13_routes_row4_col1" class="data row4 col1">0.006393</td>
<td id="T_i13_routes_row4_col2" class="data row4 col2">+0.195</td>
<td id="T_i13_routes_row4_col3" class="data row4 col3">1.22e-03</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>The march (dG = 1e-04) and the quadrature agree to within 0.93 axial steps: the
explicit march's own first-order error, which the dG row of the break table scales.
The C_G parametrisation is up to 0.97 % out; scipy's quad ran out of its 600
subdivisions on 5 of the 5 rows. Had that form been the reference, an error of that
size would have sat under every threshold on this page.

2-D light-off position at 316 C, root-found in the crossing step:
  dG = 4.0e-04   G* = 0.144989
  dG = 2.0e-04   G* = 0.145486
  dG = 1.0e-04   G* = 0.145756
  dG = 5.0e-05   G* = 0.145895
observed order 0.96 (backward Euler: 1); first-order Richardson on the last two
steps 0.146035, so the dG = 1e-04 value is -0.191 % from it. The lower 2-D
threshold at L* = 0.25 moves from 307.597 to 307.608 C when the step is halved.
Every 2-D result on this page is the value at dG = 1e-04.</code></pre>
</div>
</div>
</section>
<section id="what-the-reconstruction-moves" class="level3">
<h3 class="anchored" data-anchor-id="what-the-reconstruction-moves">What the reconstruction moves</h3>
<p>Two groups were reconstructed. The thresholds depend on them strongly; the difference between the two models, which is what the page concludes about, much less. The table re-runs the comparison at the paper’s Fig. 1 inlet temperature with each group varied.</p>
<div id="9c95c7a2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:58.269888Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:58.269764Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:54:58.276444Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:54:58.275714Z&quot;}}" data-execution_count="23">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb44-1">sens <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([(lab,) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recon_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rtag(lab)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb44-2">                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_up"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G2d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_const"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift_GT"</span>))</span>
<span id="cb44-3">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, _, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RECON],</span>
<span id="cb44-4">                    columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reconstruction"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D upper threshold (C)"</span>,</span>
<span id="cb44-5">                             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"2-D light-off G* at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, const-Nu 1-D (C)"</span>,</span>
<span id="cb44-6">                             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, G-T 1-D (C)"</span>])</span>
<span id="cb44-7">show(sens.style.set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i13_sens"</span>).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb44-8">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D upper threshold (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"2-D light-off G* at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-9">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, const-Nu 1-D (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shift, G-T 1-D (C)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}))</span>
<span id="cb44-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""A +/-10 % change in dT_AD and a factor 1.5 either way in beta move the absolute upper</span></span>
<span id="cb44-11"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recon_spread_upper_threshold_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C and the constant-Nu equivalent shift over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recon_spread_equiv_shift_C'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C.</span></span>
<span id="cb44-12"></span>
<span id="cb44-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Against the paper's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLAIM_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C: the constant-Nu 1-D shift exceeds it in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recon_rows_const_shift_above_claim'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(RECON)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> variations</span></span>
<span id="cb44-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(smallest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recon_min_equiv_shift_const'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C); the Grigull-Tratz 1-D shift exceeds it in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recon_rows_GT_shift_above_claim'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(RECON)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb44-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(smallest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recon_min_equiv_shift_GT'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C). So the statement that the constant-Nu model misses the claim does</span></span>
<span id="cb44-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">not depend on the reconstruction, while whether the Grigull-Tratz model meets it does.</span></span>
<span id="cb44-17"></span>
<span id="cb44-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">What no perturbation of this kind can test is whether the model structure is the</span></span>
<span id="cb44-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">paper's: constant oxygen, Le = 1 and Sh = Nu are the paper's assumptions, and the</span></span>
<span id="cb44-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">first is a break-table row."""</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_i13_sens" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_i13_sens_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">reconstruction</th>
<th id="T_i13_sens_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">1-D upper threshold (C)</th>
<th id="T_i13_sens_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">2-D light-off G* at 316 C</th>
<th id="T_i13_sens_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">shift, const-Nu 1-D (C)</th>
<th id="T_i13_sens_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">shift, G-T 1-D (C)</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_i13_sens_row0_col0" class="data row0 col0">baseline</td>
<td id="T_i13_sens_row0_col1" class="data row0 col1">329.92</td>
<td id="T_i13_sens_row0_col2" class="data row0 col2">0.14576</td>
<td id="T_i13_sens_row0_col3" class="data row0 col3">+5.72</td>
<td id="T_i13_sens_row0_col4" class="data row0 col4">+2.85</td>
</tr>
<tr class="even">
<td id="T_i13_sens_row1_col0" class="data row1 col0">dT_AD +10 %</td>
<td id="T_i13_sens_row1_col1" class="data row1 col1">327.44</td>
<td id="T_i13_sens_row1_col2" class="data row1 col2">0.12370</td>
<td id="T_i13_sens_row1_col3" class="data row1 col3">+6.22</td>
<td id="T_i13_sens_row1_col4" class="data row1 col4">+3.15</td>
</tr>
<tr class="odd">
<td id="T_i13_sens_row2_col0" class="data row2 col0">dT_AD -10 %</td>
<td id="T_i13_sens_row2_col1" class="data row2 col1">332.67</td>
<td id="T_i13_sens_row2_col2" class="data row2 col2">0.17317</td>
<td id="T_i13_sens_row2_col3" class="data row2 col3">+5.21</td>
<td id="T_i13_sens_row2_col4" class="data row2 col4">+2.56</td>
</tr>
<tr class="even">
<td id="T_i13_sens_row3_col0" class="data row3 col0">beta x 1.5</td>
<td id="T_i13_sens_row3_col1" class="data row3 col1">341.31</td>
<td id="T_i13_sens_row3_col2" class="data row3 col2">0.28278</td>
<td id="T_i13_sens_row3_col3" class="data row3 col3">+3.96</td>
<td id="T_i13_sens_row3_col4" class="data row3 col4">+1.85</td>
</tr>
<tr class="odd">
<td id="T_i13_sens_row4_col0" class="data row4 col0">beta / 1.5</td>
<td id="T_i13_sens_row4_col1" class="data row4 col1">318.97</td>
<td id="T_i13_sens_row4_col2" class="data row4 col2">0.06604</td>
<td id="T_i13_sens_row4_col3" class="data row4 col3">+8.52</td>
<td id="T_i13_sens_row4_col4" class="data row4 col4">+4.40</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>A +/-10 % change in dT_AD and a factor 1.5 either way in beta move the absolute upper
threshold over 22.3 C and the constant-Nu equivalent shift over 4.55 C.

Against the paper's 2 C: the constant-Nu 1-D shift exceeds it in 5 of 5 variations
(smallest +3.96 C); the Grigull-Tratz 1-D shift exceeds it in 4 of 5
(smallest +1.85 C). So the statement that the constant-Nu model misses the claim does
not depend on the reconstruction, while whether the Grigull-Tratz model meets it does.

What no perturbation of this kind can test is whether the model structure is the
paper's: constant oxygen, Le = 1 and Sh = Nu are the paper's assumptions, and the
first is a break-table row.</code></pre>
</div>
</div>
</section>
<section id="the-boundary-read" class="level3">
<h3 class="anchored" data-anchor-id="the-boundary-read">The boundary read</h3>
<p>Both tube models take their wall value from <code>compute_boundary_values</code>, not from the last cell centre. For a Neumann wall the two differ at first order in the near-wall spacing. On the Graetz problem the wall value sits in the denominator of the Nusselt number, so the pole moves when it is read from the last cell; the cell below re-runs the pole that way on the production grid and on the paper’s ten radial points, and compares the two reads on a test profile of the reacting channel’s radial grid.</p>
<div id="9efe1834" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:54:58.278252Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:54:58.278108Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:55:21.874886Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:55:21.873975Z&quot;}}" data-execution_count="24">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cell_read_shifts(r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb46-2">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb46-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, nx, nr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prod"</span>, GZ_PROD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>], GZ_PROD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_r"</span>]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nr10"</span>, G10[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>], N_R10)):</span>
<span id="cb46-4">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nx, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nr, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r_grade)</span>
<span id="cb46-5">        sf, sc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9)), g.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9), wall_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>)</span>
<span id="cb46-6">        out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pole_cell_read_shift_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (cross(sc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], sc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>])</span>
<span id="cb46-7">                                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cross(sf[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], sf[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sf[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]))</span>
<span id="cb46-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb46-9"></span>
<span id="cb46-10"></span>
<span id="cb46-11">N_R10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial_points_2D"</span>))</span>
<span id="cb46-12">CS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cell_read_shifts()</span>
<span id="cb46-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pole read from the last cell instead of the face: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_cell_read_shift_prod'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on "</span></span>
<span id="cb46-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GZ_PROD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_x'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GZ_PROD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_r'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pole_cell_read_shift_nr10'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the paper's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_R10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> radial points"</span>)</span>
<span id="cb46-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CS.items():</span>
<span id="cb46-16">    claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb46-17"></span>
<span id="cb46-18"></span>
<span id="cb46-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> boundary_reads(grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb46-20">    rad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Radial(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>, grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>grade)</span>
<span id="cb46-21">    c_test <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rad.r_c)).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a smooth test profile</span></span>
<span id="cb46-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"boundary_read_vs_lastcell</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> q <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_q0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>:</span>
<span id="cb46-23">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rad.wall_value(c_test, q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_test[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)}</span>
<span id="cb46-24"></span>
<span id="cb46-25"></span>
<span id="cb46-26">BR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> boundary_reads()</span>
<span id="cb46-27">sd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>).solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"temp"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>), inlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb46-28">dirich <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>)))</span>
<span id="cb46-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"test profile exp(-3(1-R)) on the reacting channel's 48 graded cells, face against last cell: "</span></span>
<span id="cb46-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'boundary_read_vs_lastcell_q0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at q = 0, "</span></span>
<span id="cb46-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'boundary_read_vs_lastcell'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at q = -0.7"</span>)</span>
<span id="cb46-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Dirichlet wall at 0.37: largest deviation of the read value over the tube "</span></span>
<span id="cb46-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dirich<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), below 1e-14"</span>)</span>
<span id="cb46-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BR.items():</span>
<span id="cb46-35">    claims.value(k, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb46-36">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary_read_dirichlet_exact"</span>, dirich, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb46-37">             structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the boundary reconstruction returns a Dirichlet value"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pole read from the last cell instead of the face: +2.20e-05 on 6000 x 200 cells, +5.13e-04 on the paper's 10 radial points
test profile exp(-3(1-R)) on the reacting channel's 48 graded cells, face against last cell: 1.08e-04 at q = 0, 1.83e-05 at q = -0.7
Dirichlet wall at 0.37: largest deviation of the read value over the tube (here 0.0e+00), below 1e-14</code></pre>
</div>
</div>
</section>
<section id="the-defect-injection-table" class="level3">
<h3 class="anchored" data-anchor-id="the-defect-injection-table">The defect-injection table</h3>
<p>Each row breaks one thing on purpose, <strong>re-runs</strong> the computation behind its claims with the defect in place, and hands the result to <code>claims.breaks</code>, which records whether the claim’s own check catches it. The cell after the table prints the uncaught pairs.</p>
<div id="a0530c31" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:55:21.877063Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:55:21.876873Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:55:25.027474Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:55:25.026654Z&quot;}}" data-execution_count="25">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb48-1">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb48-2"></span>
<span id="cb48-3"></span>
<span id="cb48-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(row, values):</span>
<span id="cb48-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> values.items():</span>
<span id="cb48-6">        BREAK.append((row, name, claims.breaks(row, name, v)))</span>
<span id="cb48-7"></span>
<span id="cb48-8"></span>
<span id="cb48-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Table 1</span></span>
<span id="cb48-10">PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_square_printed_relerr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_printed_relerr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_circle_printed_relerr"</span>,</span>
<span id="cb48-11">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_cells_within_printed_digits"</span>)</span>
<span id="cb48-12">du_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> duct_ladders(plug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb48-13">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug velocity instead of Poiseuille"</span>, table1_claims(du_p))</span>
<span id="cb48-14">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug velocity instead of Poiseuille"</span>,</span>
<span id="cb48-15">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_square_two_routes_reldiff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SPEC[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> du_p[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> du_p[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square_Nu_H1"</span>]})</span>
<span id="cb48-16">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unweighted eigenproblem (drop u)"</span>, table1_claims(duct_ladders(weight_eigen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)))</span>
<span id="cb48-17">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu=0 (Cartesian) in the radial div"</span>, table1_claims(duct_ladders(nu_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)))</span>
<span id="cb48-18">row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 columns swapped (Nu_T read as Nu_H)"</span></span>
<span id="cb48-19">brk(row, {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> table1_claims(DU, col_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>, col_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_H"</span>).items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PRINTED})</span>
<span id="cb48-20">brk(row, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_circle_printed_relerr"</span>: printed_relerr(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_c_exact), t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circular"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>)),</span>
<span id="cb48-21">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_triangle_printed_relerr"</span>: printed_relerr(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nu_t_exact),</span>
<span id="cb48-22">                                                          t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equilateral triangle"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>))})</span>
<span id="cb48-23">sp_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spectral_ladder(weight_eigen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb48-24">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unweighted eigenproblem (drop u)"</span>,</span>
<span id="cb48-25">    {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nu_t_square_spectral_N</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: b <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N, (_, b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(SPEC_N, sp_w)}</span>
<span id="cb48-26">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_spectral_last_increment"</span>: sp_w[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp_w[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb48-27">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_spectral_above_interval"</span>: sp_w[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (t1(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_T"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>)})</span></code></pre></div></div>
</div>
<div id="dfe7e820" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:55:25.029745Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:55:25.029618Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T05:57:58.253995Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T05:57:58.253014Z&quot;}}" data-execution_count="26">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb49-1">N_R10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial_points_2D"</span>))</span>
<span id="cb49-2">row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the paper's own 10 radial points"</span></span>
<span id="cb49-3">AN10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {nm: anomaly(coef, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(GZ_PROD, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_R10)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, coef <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QW.items()}</span>
<span id="cb49-4">brk(row, {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> anomaly_claims(AN10, pole_10r).items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_r10"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k})</span>
<span id="cb49-5">ref10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pole_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, N_R10)</span>
<span id="cb49-6">brk(row, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_X_fig9_refined"</span>: ref10, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_to_0p032_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ref10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)})</span>
<span id="cb49-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QW:</span>
<span id="cb49-8">    a, b, p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> QW[nm]</span>
<span id="cb49-9">    tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nm.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig"</span>)</span>
<span id="cb49-10">    row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> flux read with exponent 6 for 8"</span></span>
<span id="cb49-11">    an6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(AN, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{nm: anomaly((a, b, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>))})</span>
<span id="cb49-12">    p10_6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> anomaly((a, b, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>), G10)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> pole_10r</span>
<span id="cb49-13">    other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9"</span></span>
<span id="cb49-14">    brk(row, {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> anomaly_claims(an6, p10_6).items()</span>
<span id="cb49-15">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> other <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (tag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k)})</span>
<span id="cb49-16">row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half = 2 (the Notation's X*)"</span></span>
<span id="cb49-17">AN2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {nm: anomaly(coef, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2500</span>, n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb49-18">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, coef <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QW.items()}</span>
<span id="cb49-19">brk(row, {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> anomaly_claims(AN2, pole_10r).items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_r10"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k})</span>
<span id="cb49-20">s_neg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Graetz(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>GZ_PROD).solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> X: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>QW9(X)))</span>
<span id="cb49-21">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall flux with the sign of eq. (17) as printed"</span>, sign_claims(sign_rows(s_neg)))</span>
<span id="cb49-22">tb2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>: tbar(half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>: tbar(half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>)}</span>
<span id="cb49-23">brk(row, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_eq15"</span>: tb2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_eq15_over_printed"</span>: tb2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR,</span>
<span id="cb49-24">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_area"</span>: tb2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_area_over_printed"</span>: tb2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR})</span>
<span id="cb49-25">tbn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tbar(X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.40</span>)</span>
<span id="cb49-26">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (15)'s coefficient for the Notation's run"</span>,</span>
<span id="cb49-27">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_notation"</span>: tbn, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_notation_over_printed"</span>: tbn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TBAR})</span>
<span id="cb49-28">row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the paper's own 10 radial points"</span></span>
<span id="cb49-29">lad10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [tbar(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_R10, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAD_R]</span>
<span id="cb49-30">brk(row, {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Tbar_X025_nr</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_g</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (n, g), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LAD_R, lad10) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> N_R10}</span>
<span id="cb49-31">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_converged"</span>: lad10[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_paper_grid_error"</span>: TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lad10[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-32">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_nr10_clustered_error"</span>: lad10[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lad10[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>})</span>
<span id="cb49-33">v_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tbar(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_R10, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb49-34">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ten-point grid graded for the uniform run"</span>,</span>
<span id="cb49-35">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_nr10_g1"</span>: v_g,</span>
<span id="cb49-36">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_printed_inside_ten_point_interval"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v_g, lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v_g, lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))})</span>
<span id="cb49-37">p10g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> anomaly(QW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 9"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(G10, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole"</span>]</span>
<span id="cb49-38">lo_g, hi_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(p_pg, p10g), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(p_pg, p10g)</span>
<span id="cb49-39">dev_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p_pg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p10g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb49-40">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ten-point grid graded for the uniform run"</span>,</span>
<span id="cb49-41">    {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> anomaly_claims(AN, p10g).items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_r10"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k}</span>
<span id="cb49-42">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_short_min_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb49-43">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_short_max_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb49-44">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_max_dev_pct"</span>: dev_g, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_reach_over_grid_error"</span>: GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_to_0p032_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dev_g})</span>
<span id="cb49-45">v_u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tbar(n_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_R10, r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb49-46">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ten-point grid not graded"</span>,</span>
<span id="cb49-47">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_nr10_g2"</span>: v_u, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_nr10_clustered_error"</span>: v_u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lad[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb49-48">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_printed_inside_ten_point_interval"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], v_u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> TBAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(lad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], v_u))})</span>
<span id="cb49-49">ax_off, ax_err_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> axial_order(tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb49-50">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TVD correction off"</span>, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_axial"</span>: ax_off,</span>
<span id="cb49-51">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_axial_over_radial_err_coarsest"</span>: ax_err_off[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rad_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]})</span>
<span id="cb49-52">p_pg_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> paper_scheme(tvd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb49-53">lo_t, hi_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(p_pg_t, pole_10r), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(p_pg_t, pole_10r)</span>
<span id="cb49-54">dev_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p_pg_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pole_10r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb49-55">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper's counts with the TVD correction on"</span>,</span>
<span id="cb49-56">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_X_fig9_paper_scheme"</span>: p_pg_t,</span>
<span id="cb49-57">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_scheme_dev_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (p_pg_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_POLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb49-58">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_short_min_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb49-59">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_short_max_pct"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X_SIGN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb49-60">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_max_dev_pct"</span>: dev_t,</span>
<span id="cb49-61">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_reach_over_grid_error"</span>: GR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_to_0p032_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dev_t})</span>
<span id="cb49-62">s_dc3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GV.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9), maxit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, accept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.inf)</span>
<span id="cb49-63">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred correction stopped after 3 sweeps"</span>,</span>
<span id="cb49-64">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_field"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s_dc3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T"</span>]))),</span>
<span id="cb49-65">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_pole"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cross(s_dc3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s_dc3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_dc3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>])</span>
<span id="cb49-66">                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cross(s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_nw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>])),</span>
<span id="cb49-67">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_deferred_sweeps"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(s_dc3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nit"</span>])})</span>
<span id="cb49-68">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Newton started from the inlet value instead of the upwind solution"</span>,</span>
<span id="cb49-69">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_iterations"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(GV.solve_newton((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9), guess<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nit"</span>])})</span>
<span id="cb49-70">s_dc1b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GV.solve((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux"</span>, QW9), omega<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, accept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.inf)</span>
<span id="cb49-71">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"omega = 0.8 for the unrelaxed run"</span>, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_omega1_last_change"</span>: s_dc1b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"incr"</span>],</span>
<span id="cb49-72">                                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_omega1_sweeps"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(s_dc1b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nit"</span>])})</span>
<span id="cb49-73">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X* = G in Grigull-Tratz"</span>, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_max_reldev"</span>: gt_dev(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)})</span>
<span id="cb49-74">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X* = 1000 G for the paper's own two meanings"</span>,</span>
<span id="cb49-75">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_X_eq_G_min_factor"</span>: gt_factor(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>),</span>
<span id="cb49-76">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_X_eq_4G_min_factor"</span>: gt_factor(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>)})</span>
<span id="cb49-77">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reacting channel's radial grid not graded"</span>, boundary_reads(grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-78">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall-graded Graetz radial grids"</span>, cell_read_shifts(r_grade<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb49-79">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"square reference grid one rung too coarse (192)"</span>, square_orders(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">192</span>))</span>
<span id="cb49-80">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial reference grid one rung too coarse (160)"</span>,</span>
<span id="cb49-81">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_radial"</span>: fitted_order(RAD_NS, radial_errors(pole_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>)))})</span>
<span id="cb49-82">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall value read from the last cell"</span>, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_pole_radial"</span>: fitted_order(</span>
<span id="cb49-83">    RAD_NS, radial_errors(pole_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">320</span>, wall_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>), wall_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>))})</span></code></pre></div></div>
</div>
<div id="1f83c8bc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T05:57:58.256716Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T05:57:58.256512Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T06:02:15.295526Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T06:02:15.294663Z&quot;}}" data-execution_count="27">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb50-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the reconstruction and the reacting model</span></span>
<span id="cb50-2">groups <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_H"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>, CG0, pf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"channel_diameter"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, NU_SQ, T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.0</span>)</span>
<span id="cb50-3">dT_m, _, b0_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reconstruct_groups(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>groups, molar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb50-4">_, beta_n, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reconstruct_groups(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>groups, n_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb50-5">row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_PG read as molar (M_G dropped)"</span></span>
<span id="cb50-6">ch_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(CH, dTad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dT_m)</span>
<span id="cb50-7">g_m1, g_m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ch_m.lightoff_quad(T_F2, NU_SQ), ch_m.march_2d(T_F11, DG, GMAX_LONG)</span>
<span id="cb50-8">brk(row, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dTad_reconstructed"</span>: dT_m, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_1d_at_window_low"</span>: g_m1,</span>
<span id="cb50-9">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_at_window_low"</span>: g_m2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_1d_case_beyond_fig2"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(g_m1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> L_F2),</span>
<span id="cb50-10">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_2d_case_beyond_fig11"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(g_m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> L_F11), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lit_wall_T_C"</span>: T_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dT_m})</span>
<span id="cb50-11">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"diffusivity left at 300 K"</span>, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_reconstructed"</span>: beta_n})</span>
<span id="cb50-12">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_a sign flipped (+961)"</span>, rate_claims(replace(CH, kin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>replace(KIN, ear<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>KIN.ear)), scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb50-13">CH_O2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(CH, kin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>replace(KIN, o2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"depleted"</span>))</span>
<span id="cb50-14">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen depleted stoichiometrically"</span>, rate_claims(CH_O2))</span>
<span id="cb50-15"></span>
<span id="cb50-16"></span>
<span id="cb50-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> low_count(m):</span>
<span id="cb50-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(m[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"T_low_2d_minus_1d_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_L</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:03d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb50-19">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> L_SWEEP <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"const"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GT"</span>)))</span>
<span id="cb50-20"></span>
<span id="cb50-21"></span>
<span id="cb50-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> row, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"oxygen depleted stoichiometrically"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CH_O2)),</span>
<span id="cb50-23">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu=0 (Cartesian) in the 2-D radial div"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CH, nu_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb50-24">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dG x 10 (1e-3) in the 1-D march"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CH, dG1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)),</span>
<span id="cb50-25">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1-D Nusselt number on the radius (x 2)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CH, nu_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))):</span>
<span id="cb50-26">    Rb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reacting(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb50-27">    brk(row, Rb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower_threshold_2d_above_both_1d"</span>: low_count(Rb)})</span>
<span id="cb50-28">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad subdivision limit 600 -&gt; 30"</span>,</span>
<span id="cb50-29">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_endpoint_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CH.lightoff_quad_CG(T, NU_SQ, limit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>)</span>
<span id="cb50-30">                                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CH.lightoff_quad(T, NU_SQ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb50-31">                                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> T <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T_ROUTE))})</span>
<span id="cb50-32"></span>
<span id="cb50-33">tbl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAK, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"caught"</span>])</span>
<span id="cb50-34">summary <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tbl.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, sort<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).agg(pairs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>), caught<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"caught"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sum"</span>))</span>
<span id="cb50-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(summary.to_string())</span>
<span id="cb50-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(summary)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tbl)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (row, claim) pairs, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(tbl.caught.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> caught"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stderr">
<pre><code>/home/eajfpeters/Code/pymrm_suite/pymrm-gallery/pages/I1.3-heck-wei-katzer-monolith/model.py:676: IntegrationWarning: The maximum number of subdivisions (30) has been achieved.
  If increasing the limit yields no improvement it is advised to analyze 
  the integrand in order to determine the difficulties.  If the position of a 
  local difficulty can be determined (singularity, discontinuity) one will 
  probably gain from splitting up the interval and calling the integrator 
  on the subranges.  Perhaps a special-purpose integrator should be used.
  return quad(f, CGs * (1.0 + 1e-12), self.cg0, limit=limit)[0]</code></pre>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>                                                                    pairs  caught
row                                                                              
plug velocity instead of Poiseuille                                    13      13
unweighted eigenproblem (drop u)                                       18      12
nu=0 (Cartesian) in the radial div                                     12       7
Table 1 columns swapped (Nu_T read as Nu_H)                             6       6
the paper's own 10 radial points                                       22      18
Fig. 8 flux read with exponent 6 for 8                                  6       6
Fig. 9 flux read with exponent 6 for 8                                 10      10
half = 2 (the Notation's X*)                                           17      14
wall flux with the sign of eq. (17) as printed                          2       2
eq. (15)'s coefficient for the Notation's run                           2       2
ten-point grid graded for the uniform run                               9       9
ten-point grid not graded                                               3       3
TVD correction off                                                      2       2
paper's counts with the TVD correction on                               6       3
deferred correction stopped after 3 sweeps                              3       3
Newton started from the inlet value instead of the upwind solution      1       1
omega = 0.8 for the unrelaxed run                                       2       2
X* = G in Grigull-Tratz                                                 1       1
X* = 1000 G for the paper's own two meanings                            2       2
reacting channel's radial grid not graded                               2       2
wall-graded Graetz radial grids                                         2       2
square reference grid one rung too coarse (192)                         4       4
radial reference grid one rung too coarse (160)                         1       1
wall value read from the last cell                                      1       1
C_PG read as molar (M_G dropped)                                        6       6
diffusivity left at 300 K                                               1       1
E_a sign flipped (+961)                                                 6       4
oxygen depleted stoichiometrically                                    127     121
nu=0 (Cartesian) in the 2-D radial div                                117      75
dG x 10 (1e-3) in the 1-D march                                       117      28
1-D Nusselt number on the radius (x 2)                                117      85
quad subdivision limit 600 -&gt; 30                                        1       1
32 rows, 639 (row, claim) pairs, 447 caught</code></pre>
</div>
</div>
<p>A row leaves a pair inside the claim’s check wherever its defect does not enter the quantity, and the rows that re-run a whole computation report every claim of it. The four rows that re-run the reacting model: the 2-D slab leaves every 1-D and quadrature result where it was; the 1-D step leaves every 2-D and quadrature result; the doubled 1-D Nusselt number leaves every 2-D result; oxygen depletion leaves <img src="https://latex.codecogs.com/png.latex?1/k_a">, the lit-wall temperature (which contains only <img src="https://latex.codecogs.com/png.latex?%5CDelta%20T_%7BAD%7D">) and the counts, whose margins it does not cross. On Table 1 the unweighted eigenproblem leaves the constant-flux numbers and fRe, which contain no eigenvalue, and the circle’s geometry factor does not reach the square. The rows that change the Graetz grid or its axial coefficient leave the flux zeros, which are roots of the printed polynomials, and the Nusselt zeros, which equal them by construction up to interpolation. The paper’s counts with the TVD correction on leave the claims set by the uniform ten-point solve, which is the larger of the two paper-count poles. The flipped activation energy leaves the lit-wall temperature, and the structural half unit of the printed rate maximum and the scipy subdivision count move under no row. The cell below lists every uncaught pair and the claims, if any, that no row catches.</p>
<div id="0d520f6e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T06:02:15.297695Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T06:02:15.297394Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T06:02:15.306732Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T06:02:15.306173Z&quot;}}" data-execution_count="28">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb53-1">unc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tbl[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>tbl.caught]</span>
<span id="cb53-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(tbl.caught.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tbl)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs caught; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(unc)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> uncaught, by row:"</span>)</span>
<span id="cb53-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((unc.row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(unc.claim[unc.row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r])</span>
<span id="cb53-4">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>.fromkeys(unc.row)))</span>
<span id="cb53-5">unbroken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [n <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>)</span>
<span id="cb53-6">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(caught <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, n2, caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n)]</span>
<span id="cb53-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"claims without a catching row: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(unbroken)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">": "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(unbroken) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> unbroken <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb53-8">n_struct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb53-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_struct<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> structural"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>447 of 639 pairs caught; 192 uncaught, by row:
  unweighted eigenproblem (drop u) (6): nu_h1_square_pymrm, nu_h1_circle_pymrm, fre_square, fre_circle_vs_16, nu_h1_circle_solve_vs_exact, nu_h1_square_printed_relerr
  nu=0 (Cartesian) in the radial div (5): nu_h1_square_pymrm, nu_t_square_pymrm, fre_square, nu_h1_square_printed_relerr, nu_t_square_printed_relerr
  the paper's own 10 radial points (4): fluxzero_X_fig8, fluxzero_X_fig9, nu_zero_X_fig8, nu_zero_X_fig9
  half = 2 (the Notation's X*) (3): fluxzero_X_fig8, fluxzero_X_fig9, nu_zero_X_fig9
  paper's counts with the TVD correction on (3): pole_paper_counts_short_min_pct, pole_paper_counts_max_dev_pct, pole_reach_over_grid_error
  E_a sign flipped (+961) (2): lit_wall_T_C, rate_max_half_unit
  oxygen depleted stoichiometrically (6): inverse_ka_at_inlet, lit_wall_T_C, rate_max_half_unit, recon_rows_GT_shift_above_claim, recon_rows_const_shift_above_claim, lower_threshold_2d_above_both_1d
  nu=0 (Cartesian) in the 2-D radial div (42): G_lightoff_1d_at_window_low, T_low_1d_at_fig2_length, T_low_1d_at_fig11_length, T_windows_length_term_C, T_up_1d_square, T_up_1d_circle, T_up_1d_shape_effect, T_low_1d_const_L020, T_low_1d_GT_L020, T_low_1d_const_L025, T_low_1d_GT_L025, T_low_1d_const_L030, T_low_1d_GT_L030, T_low_1d_const_slope_per_005, T_low_1d_circle_L025, T_low_shape_effect_L025, route_march_minus_quad_steps_305, route_quad_CG_relerr_305, route_quad_305, route_march_minus_quad_steps_310, route_quad_CG_relerr_310, route_quad_310, route_march_minus_quad_steps_316, route_quad_CG_relerr_316, route_quad_316, route_march_minus_quad_steps_322, route_quad_CG_relerr_322, route_quad_322, route_march_minus_quad_steps_328, route_quad_CG_relerr_328, route_quad_328, lightoff_march_vs_quad_max_steps, quad_CG_endpoint_error, quad_CG_rows_out_of_subdivisions, recon_baseline_T_up, recon_dT_AD_plus10_T_up, recon_dT_AD_minus10_T_up, recon_beta_x_1_5_T_up, recon_beta_over_1_5_T_up, recon_spread_upper_threshold_C, recon_rows_const_shift_above_claim, lower_threshold_2d_above_both_1d
  dG x 10 (1e-3) in the 1-D march (89): G_lightoff_1d_at_window_low, G_lightoff_2d_at_window_low, T_low_1d_at_fig2_length, T_low_2d_at_fig11_length, T_low_1d_at_fig11_length, T_windows_length_artefact_C, T_windows_vs_paper_gap_C, T_windows_length_term_C, T_windows_model_term_C, T_up_1d_square, T_up_1d_circle, T_up_1d_shape_effect, T_up_2d_first_step_dG4em4, T_up_2d_first_step_dG2em4, T_up_2d_first_step_dG1em4, T_up_2d_first_step_dG5em5, T_up_2d_first_step_divergence_C, T_up_2d_first_step_mean_per_halving_C, G_lightoff_2d_at_case4, G_lightoff_2d_at_case4_over_fig11, T_low_1d_const_L020, T_low_2d_L020, T_low_2d_minus_1d_const_L020, T_low_1d_const_L025, T_low_2d_L025, T_low_2d_minus_1d_const_L025, T_low_1d_const_L030, T_low_2d_L030, T_low_2d_minus_1d_const_L030, T_low_1d_const_slope_per_005, T_low_2d_L025_dG5em5, T_low_1d_circle_L025, T_low_shape_effect_L025, T_low_entrance_dim_L025, T_low_shape_share_pct, equiv_G2d_at310, equiv_shift_const_at310, equiv_G2d_at316, equiv_G2d_at320, equiv_shift_const_at320, equiv_G2d_at330, equiv_shift_const_at330, equiv_G2d_at340, equiv_shift_const_at340, equiv_shift_const_Nu_at316, equiv_shift_const_max, equiv_shift_const_over_claim_at316, equiv_shift_const_over_claim_min, equiv_shift_const_over_claim_max, G_lightoff_2d_316_dG4em4, G_lightoff_2d_316_dG2em4, G_lightoff_2d_316_dG1em4, G_lightoff_2d_316_dG5em5, G_lightoff_2d_316_dG_order, G_lightoff_2d_316_richardson, G_lightoff_2d_316_dG1em4_vs_richardson_pct, route_quad_CG_relerr_305, route_quad_305, route_quad_CG_relerr_310, route_quad_310, route_quad_CG_relerr_316, route_quad_316, route_quad_CG_relerr_322, route_quad_322, route_quad_CG_relerr_328, route_quad_328, quad_CG_endpoint_error, quad_CG_rows_out_of_subdivisions, recon_baseline_T_up, recon_baseline_G2d, recon_baseline_shift_const, recon_dT_AD_plus10_T_up, recon_dT_AD_plus10_G2d, recon_dT_AD_plus10_shift_const, recon_dT_AD_minus10_T_up, recon_dT_AD_minus10_G2d, recon_dT_AD_minus10_shift_const, recon_beta_x_1_5_T_up, recon_beta_x_1_5_G2d, recon_beta_x_1_5_shift_const, recon_beta_over_1_5_T_up, recon_beta_over_1_5_G2d, recon_beta_over_1_5_shift_const, recon_spread_upper_threshold_C, recon_spread_equiv_shift_C, recon_min_equiv_shift_const, recon_rows_GT_shift_above_claim, recon_rows_const_shift_above_claim, lower_threshold_2d_above_both_1d
  1-D Nusselt number on the radius (x 2) (32): G_lightoff_2d_at_window_low, T_low_2d_at_fig11_length, T_up_2d_first_step_dG4em4, T_up_2d_first_step_dG2em4, T_up_2d_first_step_dG1em4, T_up_2d_first_step_dG5em5, T_up_2d_first_step_divergence_C, T_up_2d_first_step_mean_per_halving_C, G_lightoff_2d_at_case4, G_lightoff_2d_at_case4_over_fig11, T_low_2d_L020, T_low_2d_L025, T_low_2d_L030, T_low_2d_L025_dG5em5, equiv_G2d_at310, equiv_G2d_at316, equiv_G2d_at320, equiv_G2d_at330, equiv_G2d_at340, G_lightoff_2d_316_dG4em4, G_lightoff_2d_316_dG2em4, G_lightoff_2d_316_dG1em4, G_lightoff_2d_316_dG5em5, G_lightoff_2d_316_dG_order, G_lightoff_2d_316_richardson, G_lightoff_2d_316_dG1em4_vs_richardson_pct, quad_CG_rows_out_of_subdivisions, recon_baseline_G2d, recon_dT_AD_plus10_G2d, recon_dT_AD_minus10_G2d, recon_beta_x_1_5_G2d, recon_beta_over_1_5_G2d
claims without a catching row: 0
277 claims, 65 structural</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>What is pymrm’s here.</strong> Every field on this page is discretised with pymrm operators assembled once: <code>construct_grad</code> and <code>construct_div</code> for the duct cross-sections (Cartesian and cylindrical through <code>nu</code>) and for the radial diffusion of both tube models, <code>construct_convflux_upwind</code> and <code>interp_cntr_to_stagg_tvd</code> for the van Leer convection along the tube, with <code>{"outflow": True}</code> as the outlet a convection-only direction needs. The wall flux that varies along the tube is an array-valued boundary <code>d</code>. In the reacting channel the wall flux enters through <code>shapes_d</code>, whose boundary vector per unit flux equals the plain boundary vector of the dictionary with <code>d = 1</code>; what makes each light-off step one linear solve is that the interior is linear in that flux, not the API. <code>compute_boundary_values</code> supplies every wall value, which is what the kinetics are evaluated at. <code>ConvFluxTVD</code> with <code>newton(damping="monotone")</code> provides an independent solver for the same discrete Graetz equations, which converges in a handful of iterations and agrees with the deferred correction to the solvers’ tolerance.</p>
<p><strong>What is not pymrm’s.</strong> The closed forms (sympy), the spectral square-duct route (numpy and scipy), every root, the quadrature of the light-off integral and the analysis of the paper are this page’s own work on top of scipy; they would read the same with any discretisation library. The physics is entirely the paper’s.</p>
<p><strong>What the page establishes about the paper:</strong></p>
<ul>
<li><strong>Table 1 stops being a citation.</strong> Five of its eight cells are derived, two in closed form, and one printed cell (the square duct at constant wall temperature) disagrees with two converged routes by more than its printed digits allow; the page does not attribute it, because the cited 1971 source was not consulted.</li>
<li><strong>The Nusselt singularity is root-found and its cause corrected.</strong> At the flux zero the Nusselt number passes through zero; the pole is the zero of <img src="https://latex.codecogs.com/png.latex?T_w%20-%20%5Cbar%20T_G">, downstream of it in both printed flux functions. The paper’s next paragraph gives the correct mechanism, so this is a wrong summary rather than a missed effect.</li>
<li><strong>The 1-D/2-D thresholds are root-found instead of sampled, and on a common length.</strong> The paper’s two windows are quoted at different channel lengths; run at each figure’s own length, the models reproduce both, and the gap between them decomposes into a dominant length term and a model term of the sign the paper’s mechanism requires. About half of the remaining 1-D/2-D difference on a common length is channel shape, not dimensionality.</li>
<li><strong>“Adequate” is given a number and a scope.</strong> The “less than 2 °C” claim is measured as an equivalent inlet shift for both 1-D models, at the inlet temperature of Fig. 1 and over the range of the paper’s cases, and printed as a ratio to the claim in the Results.</li>
<li><strong>Three meanings of <img src="https://latex.codecogs.com/png.latex?X%5E%7B%5Cast%7D"> are separated</strong>, each against a computation, and the printed check value that settles one of them measures the paper’s own radial grid.</li>
</ul>
<section id="what-this-page-cannot-conclude" class="level3">
<h3 class="anchored" data-anchor-id="what-this-page-cannot-conclude">What this page cannot conclude</h3>
<ul>
<li><strong>Nothing about any figure.</strong> Figures are used only for characters printed inside their frames, each listed and counted in <em>The data</em>. No profile shape, no light-off position against the paper’s own, and none of the conversion curves of Figs. 4 to 6 and 12 is checked.</li>
<li><strong>The channel length is not printed.</strong> The lower threshold needs one, so it is swept and every conclusion is checked over the sweep; no single “the” lower threshold is claimed.</li>
<li><strong>There is no 2-D inlet light-off threshold</strong>; the number reported for it is the value at its axial step and diverges as the step shrinks.</li>
<li><strong>Two dimensional groups are reconstructions</strong>, so no absolute threshold here should be read as the paper’s number; only differences between models on the same parameters are claimed.</li>
<li><strong>The square-duct <img src="https://latex.codecogs.com/png.latex?Nu_T"> discrepancy is not attributed</strong>, and three of Table 1’s cells are not reproduced (one cannot be).</li>
<li><strong>The transient model (eqs. 1 to 4, Fig. 7) is not built.</strong> Its only quantitative statement, the time by which the transient is almost complete, needs the solid heat capacity and the monolith dimensions, none of which is printed. <code>I1.2</code> does transient monolith light-off against a printed table.</li>
</ul>
</section>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><code>Graetz</code> (in <code>model.py</code>) is a general developing-flow solver for a round tube: pick the wall condition with <code>("flux", f)</code> or <code>("temp", value)</code> and the axial coefficient with <code>half</code>. The wall flux may be any function of the axial coordinate, because pymrm takes an array-valued <code>d</code> in the boundary dictionary. On a large grid keep the deferred correction <strong>with its under-relaxation</strong> (<img src="https://latex.codecogs.com/png.latex?%5Comega%20=%200.6">; without it the correction does not settle, as printed above), and use <code>solve_newton</code> (<code>ConvFluxTVD</code>, <code>newton(damping="monotone")</code>) where the grid is small enough to refactorise every iteration or the profile is not as smooth as this one (pitfall P10).</p>
<p><code>Channel.march_2d</code> is the piece worth copying for a reacting wall. The interior is linear in the wall flux, so the response to a unit flux is computed once per step length, and each implicit step needs one linear solve and a <strong>scalar</strong> root for the wall value. A 2-D nonlinear boundary problem becomes the same algebra as Fig. 1’s mass-transfer line with an effective <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, the fold is explicit, and light-off is root-found inside its step. It needs <img src="https://latex.codecogs.com/png.latex?Le%20=%201"> (one field); with <img src="https://latex.codecogs.com/png.latex?Le%20%5Cne%201"> temperature and concentration are two fields with the field axis last, and the step becomes a two-unknown wall problem.</p>
<p>Read wall values with <code>compute_boundary_values</code>, never from the last cell centre: read from the last cell, the Graetz pole moves as printed in the boundary-read check, by far more on a ten-point radial grid than on the production grid, and the radial convergence order drops to about one (break table).</p>
<p>Related pages: <a href="../A3.15-graetz-nusselt/"><code>A3.15</code></a> for the Graetz eigenvalue route to the same circular-duct limit, <a href="../I1.2-catalytic-converter-lightoff/"><code>I1.2</code></a> for transient monolith light-off, <a href="../D2.2-van-welsenaere-froment-runaway/"><code>D2.2</code></a> for a threshold located as a root on a single-valued branch.</p>
</section>
<section id="cite-the-source-not-this-page" class="level2">
<h2 class="anchored" data-anchor-id="cite-the-source-not-this-page">Cite the source, not this page</h2>
<p>Heck, R. H., Wei, J. &amp; Katzer, J. R., <em>Mathematical Modeling of Monolithic Catalysts</em>, AIChE Journal <strong>22</strong>(3) 477-484 (1976), doi:10.1002/aic.690220310.</p>
<p>Table 1 is attributed by the paper to Shah and London (1971), Stanford University Dept. of Mechanical Engineering Tech. Rept. No.&nbsp;75, <strong>not consulted here</strong>. The kinetics are Voltz, Morgan, Liederman &amp; Jacob, <em>Ind. Eng. Chem. Prod. Res. Develop.</em> <strong>12</strong>, 295 (1973), <strong>not consulted</strong> either; the four constants are used exactly as Heck et al.&nbsp;print them, the reprint route of <code>AGENTS.md</code>. The two Nusselt correlations are Grigull &amp; Tratz, <em>Intern. J. Heat Mass Transfer</em> <strong>8</strong>, 669 (1965), not consulted; they are used as the paper reprints them.</p>
<div id="e90432e8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T06:02:15.309003Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T06:02:15.308827Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T06:02:15.314945Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T06:02:15.314219Z&quot;}}" data-execution_count="29">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb55-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># prose literals of the notebook text</span></span>
<span id="cb55-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb55-3">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"304"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_lightoff_window_1D_low"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"343"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_lightoff_window_1D_high"</span>),</span>
<span id="cb55-4">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"293"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_lightoff_window_2D_low"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.029"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_Qw_zero_stated"</span>),</span>
<span id="cb55-5">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.20"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_fig2_abscissa_end"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.50"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_fig11_abscissa_end"</span>),</span>
<span id="cb55-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.25"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_fig3_abscissa_end"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0224"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_Tbar_at_X_0p25"</span>),</span>
<span id="cb55-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.976"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_table1_square_Nu_T"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.9775"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_pymrm"</span>),</span>
<span id="cb55-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_adequacy_claim_degC"</span>),</span>
<span id="cb55-9">]:</span>
<span id="cb55-10">    claims.says(lit, name)</span>
<span id="cb55-11">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.7 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_downstream_fig9"</span>)</span>
<span id="cb55-12">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.7 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_downstream_fig8"</span>)</span>
<span id="cb55-13">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred_omega"</span>)</span>
<span id="cb55-14">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.30"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep_L_margin"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="29">
<pre><code>True</code></pre>
</div>
</div>
<div id="e0cd3a1b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T06:02:15.316626Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T06:02:15.316455Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T06:02:15.321539Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T06:02:15.320827Z&quot;}}" data-execution_count="30">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb57" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb57-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># meta.yaml (validation, adds, agreement, caveats) and the models.yaml entry</span></span>
<span id="cb57-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb57-3">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.607950"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_h1_square_pymrm"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.608"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_table1_square_Nu_H"</span>),</span>
<span id="cb57-4">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.977523"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_square_pymrm"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.976"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_table1_square_Nu_T"</span>),</span>
<span id="cb57-5">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_t_circle_vs_A315"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.7 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_downstream_fig9"</span>),</span>
<span id="cb57-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.7 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_pole_downstream_fig8"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_short_min_pct"</span>),</span>
<span id="cb57-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_short_max_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pole_paper_counts_max_dev_pct"</span>),</span>
<span id="cb57-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0224"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_Tbar_at_X_0p25"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.9 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_paper_grid_error"</span>),</span>
<span id="cb57-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.021147"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tbar_X025_converged"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.26 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grigull_tratz_max_reldev"</span>),</span>
<span id="cb57-10">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_field"</span>),</span>
<span id="cb57-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graetz_newton_vs_deferred_pole"</span>),</span>
<span id="cb57-12">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.96"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G_lightoff_2d_316_dG_order"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.93"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightoff_march_vs_quad_max_steps"</span>),</span>
<span id="cb57-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.97 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad_CG_endpoint_error"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-10.83"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_windows_length_artefact_C"</span>),</span>
<span id="cb57-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-13.42"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_windows_length_term_C"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+2.59"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_windows_model_term_C"</span>),</span>
<span id="cb57-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+4.13"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_2d_minus_1d_const_L025"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.25"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_fig3_abscissa_end"</span>),</span>
<span id="cb57-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+2.85"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_at316"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"316"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_TG_inlet_fig1"</span>),</span>
<span id="cb57-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.86"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_over_claim_at316"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.26"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_over_claim_min"</span>),</span>
<span id="cb57-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.74"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_over_claim_max"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.43"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_over_claim_at316"</span>),</span>
<span id="cb57-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.09"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_over_claim_min"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.41"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_GT_over_claim_max"</span>),</span>
<span id="cb57-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.028680"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fluxzero_X_fig9"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.028789"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fluxzero_X_fig8"</span>),</span>
<span id="cb57-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.029"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_Qw_zero_stated"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.003"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_Cw_at_rate_maximum"</span>),</span>
<span id="cb57-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.00261"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_max_Cw"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+5.72"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equiv_shift_const_Nu_at316"</span>),</span>
<span id="cb57-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_adequacy_claim_degC"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"22.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon_spread_upper_threshold_C"</span>),</span>
<span id="cb57-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.55"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon_spread_equiv_shift_C"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"303.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_low_1d_const_L025"</span>),</span>
<span id="cb57-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"304"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_lightoff_window_1D_low"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.20"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_fig2_abscissa_end"</span>),</span>
<span id="cb57-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.30"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep_L_margin"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.50"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_fig11_abscissa_end"</span>),</span>
<span id="cb57-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1e-4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axial_step_dG"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.032"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_X_sign_negative_Nu"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.033"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"paper_X_sign_positive_Nu"</span>),</span>
<span id="cb57-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"33"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data_rows"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows_naming_a_figure"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows_inside_a_frame"</span>),</span>
<span id="cb57-29">]:</span>
<span id="cb57-30">    claims.says(lit, name)</span></code></pre></div></div>
</div>
<div id="975bd0d3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T06:02:15.323062Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T06:02:15.322940Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T06:02:15.332758Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T06:02:15.331978Z&quot;}}" data-execution_count="31">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb58-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb58-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb58-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for I1.3:
  paper_k_r0                                 = 4.14e+08         exact  exact
  paper_k_a0                                 = 65.5             exact  exact
  paper_Er_over_R                            = 12600            exact  exact
  paper_Ea_over_R                            = -961             exact  exact
  paper_CG_CO_inlet                          = 0.04             exact  exact
  paper_CG_O2_inlet                          = 0.04             exact  exact
  paper_TG_inlet_fig1                        = 316              exact  exact
  paper_Cw_at_rate_maximum                   = 0.003            exact  exact
  paper_delta_H                              = 336.9            exact  exact
  paper_channel_diameter                     = 1.52             exact  exact
  paper_Nu_used_1D                           = 3.608            exact  exact
  paper_lightoff_window_1D_low               = 304              exact  exact
  paper_lightoff_window_1D_high              = 343              exact  exact
  paper_lightoff_window_2D_low               = 293              exact  exact
  paper_lightoff_window_2D_high              = 343              exact  exact
  paper_lightoff_window_2D_inlet_case        = 349              exact  exact
  paper_fig2_abscissa_end                    = 0.2              exact  exact
  paper_fig3_abscissa_end                    = 0.25             exact  exact
  paper_fig11_abscissa_end                   = 0.5              exact  exact
  paper_axial_step_1D                        = 0.0005           exact  exact
  paper_axial_step_1D_metric                 = 0.0076           exact  exact
  paper_radial_points_2D                     = 10               exact  exact
  paper_axial_step_2D                        = 0.00025          exact  exact
  paper_Qw_zero_stated                       = 0.029            exact  exact
  paper_X_sign_negative_Nu                   = 0.032            exact  exact
  paper_X_sign_positive_Nu                   = 0.033            exact  exact
  paper_Tbar_at_X_0p25                       = 0.0224           exact  exact
  paper_adequacy_claim_degC                  = 2                exact  exact
  paper_compute_time_ratio                   = 10               exact  exact
  paper_table1_circular_Nu_H                 = 4.364            exact  exact
  paper_table1_circular_Nu_T                 = 3.657            exact  exact
  paper_table1_square_Nu_H                   = 3.608            exact  exact
  paper_table1_square_Nu_T                   = 2.976            exact  exact
  paper_table1_equilateral_triangle_Nu_H     = 3.111            exact  exact
  paper_table1_equilateral_triangle_Nu_T     = 2.47             exact  exact
  paper_table1_sinusoidal_Nu_H               = 2.617            exact  exact
  paper_table1_sinusoidal_Nu_T               = 2.12             exact  exact
  input_M_G                                  = 29               exact  exact
  input_C_PG                                 = 1093             exact  exact
  input_P                                    = 1.0132e+05       exact  exact
  input_R_g                                  = 8314             exact  exact
  input_D_AB300                              = 2.08e-05         exact  exact
  input_n_T                                  = 1.75             exact  exact
  deferred_omega                             = 0.6              exact  exact
  sweep_L_margin                             = 0.3              exact  exact
  dTad_reconstructed                         = 425.15           value  rtol 1e-09
  beta_reconstructed                         = 0.0033267        value  rtol 1e-09
  data_rows                                  = 33               exact  exact
  table1_rows                                = 4                exact  exact
  rows_naming_a_figure                       = 15               exact  exact
  rows_inside_a_frame                        = 11               exact  exact
  rows_only_in_a_frame                       = 9                exact  exact
  rows_annotation_box                        = 6                exact  exact
  rows_abscissa_tick_labels                  = 3                exact  exact
  rows_curve_label                           = 1                exact  exact
  rows_case_label                            = 1                exact  exact
  nu_h1_circle_exact                         = 4.3636           exact  exact
  nu_h1_triangle_exact                       = 3.1111           exact  exact
  nu_h1_circle_printed_relerr                = 8.3333e-05       value  rtol 1e-06
  nu_h1_triangle_printed_relerr              = 3.5714e-05       value  rtol 1e-06
  nu_h1_square_pymrm                         = 3.608            value  rtol 1e-06
  nu_t_square_pymrm                          = 2.9775           value  rtol 1e-06
  nu_t_circle_pymrm                          = 3.6568           value  rtol 1e-06
  nu_h1_circle_pymrm                         = 4.3636           value  rtol 1e-06
  fre_square                                 = 14.227           value  rtol 1e-06
  fre_circle_vs_16                           = (here 1.5e-11)   bound  bound &lt;= 1e-06 [theory]
  nu_h1_circle_solve_vs_exact                = (here 8.1e-09)   bound  bound &lt;= 1e-07 [theory]
  nu_h1_square_printed_relerr                = 1.3748e-05       value  rtol 1e-05
  nu_t_square_printed_relerr                 = 0.00051149       value  rtol 1e-05
  nu_t_circle_printed_relerr                 = 5.648e-05        value  rtol 1e-05
  nu_t_circle_vs_A315                        = (here 1.8e-09)   bound  bound &lt;= 1e-06 [chosen]
  table1_cells_within_printed_digits         = 4                exact  exact, margin 0.273
  nu_t_square_spectral_N12                   = 2.9762           value  rtol 1e-06
  nu_t_square_spectral_N16                   = 2.977            value  rtol 1e-06
  nu_t_square_spectral_N20                   = 2.9772           value  rtol 1e-06
  nu_t_square_spectral_N24                   = 2.9774           value  rtol 1e-06
  nu_t_square_spectral_last_increment        = 0.00011771       value  rtol 0.0001
  nu_h1_square_two_routes_reldiff            = 0.00010967       value  rtol 0.0001
  nu_t_square_spectral_above_interval        = 0.00085927       value  rtol 0.0001
  fluxzero_X_fig8                            = 0.028789         value  rtol 1e-06
  fluxzero_X_fig9                            = 0.02868          value  rtol 1e-06
  nu_zero_X_fig8                             = 0.028789         value  rtol 1e-06
  nu_zero_X_fig9                             = 0.02868          value  rtol 1e-06
  nu_pole_X_fig8                             = 0.0313           value  rtol 1e-06
  nu_pole_X_fig9                             = 0.031183         value  rtol 1e-06
  nu_pole_area_X_fig8                        = 0.030916         value  rtol 1e-06
  nu_pole_area_X_fig9                        = 0.0308           value  rtol 1e-06
  nu_pole_over_fluxzero_fig8                 = 1.0872           value  rtol 1e-06
  nu_pole_over_fluxzero_fig9                 = 1.0873           value  rtol 1e-06
  nu_pole_downstream_fig8                    = 0.087209         value  rtol 1e-06
  nu_pole_downstream_fig9                    = 0.087284         value  rtol 1e-06
  nu_pole_below_bracket_centre_pct           = 4.0511           value  rtol 1e-05
  nu_pole_X_fig9_n_r10                       = 0.031285         value  rtol 1e-06
  pole_n_r10_dev_pct                         = 0.32682          value  rtol 1e-05
  pole_n_r10_short_of_0p032_pct              = 2.2335           value  rtol 1e-05
  nu_zero_minus_fluxzero_fig8                = (here 4.4e-09)   bound  bound &lt;= 1e-07 [identity]
  nu_at_fluxzero_fig8                        = (here 1.2e-05)   bound  bound &lt;= 0.001 [identity]
  nu_zero_minus_fluxzero_fig9                = (here 2.7e-09)   bound  bound &lt;= 1e-07 [identity]
  nu_at_fluxzero_fig9                        = (here 7.5e-06)   bound  bound &lt;= 0.001 [identity]
  pole_normalisation_gap                     = (here 3.5e-18)   bound  bound &lt;= 1e-12 [identity]
  fig9_sign_0p032_matches_paper              = False            exact  exact, margin 0.294
  fig9_sign_0p033_matches_paper              = True             exact  exact, margin 0.74
  rate_max_Cw                                = 0.0026108        value  rtol 1e-05
  rate_max_Cw_printed_absdiff                = 0.00038922       value  rtol 1e-05
  rate_max_at_dTad0                          = 0.0029866        value  rtol 1e-05
  inverse_ka_at_inlet                        = 0.0029866        value  rtol 1e-05
  lit_wall_T_C                               = 741.15           value  rtol 1e-05
  rate_max_half_unit                         = 0.0005           exact  exact
  rate_max_dTad_upper_K                      = 1473.8           value  rtol 1e-05
  rate_max_min_Cw                            = 0.002509         value  rtol 1e-05
  rate_max_min_at_dTad_K                     = 204.98           value  rtol 1e-05
  rate_max_min_clearance                     = 8.9683e-06       value  rtol 0.001
  axial_step_dG                              = 0.0001           exact  exact
  G_lightoff_1d_at_window_low                = 0.2405           value  rtol 0.0001
  G_lightoff_2d_at_window_low                = 0.57679          value  rtol 0.0001
  T_low_1d_at_fig2_length                    = 306.44           value  rtol 1e-05
  T_low_2d_at_fig11_length                   = 295.61           value  rtol 1e-05
  T_low_1d_at_fig11_length                   = 293.02           value  rtol 1e-05
  T_windows_length_artefact_C                = -10.829          value  rtol 0.0001
  T_windows_vs_paper_gap_C                   = 0.17102          value  rtol 0.001
  T_windows_length_term_C                    = -13.419          value  rtol 0.0001
  T_windows_model_term_C                     = 2.5903           value  rtol 0.0001
  T_up_1d_square                             = 329.92           value  rtol 1e-05
  T_up_1d_circle                             = 335.21           value  rtol 1e-05
  T_up_1d_shape_effect                       = 5.2865           value  rtol 0.0001
  T_up_2d_first_step_dG4em4                  = 378.86           value  rtol 1e-05
  T_up_2d_first_step_dG2em4                  = 386.9            value  rtol 1e-05
  T_up_2d_first_step_dG1em4                  = 395.05           value  rtol 1e-05
  T_up_2d_first_step_dG5em5                  = 403.33           value  rtol 1e-05
  T_up_2d_first_step_divergence_C            = 8.2782           value  rtol 0.0001
  T_up_2d_first_step_mean_per_halving_C      = 8.1558           value  rtol 0.0001
  G_lightoff_2d_at_case4                     = 0.010082         value  rtol 0.0001
  G_lightoff_2d_at_case4_over_fig11          = 0.020165         value  rtol 0.0001
  T_low_1d_const_L020                        = 306.44           value  rtol 1e-05
  T_low_1d_GT_L020                           = 308.89           value  rtol 1e-05
  T_low_2d_L020                              = 311.18           value  rtol 1e-05
  T_low_2d_minus_1d_const_L020               = 4.7386           value  rtol 0.0001
  T_low_2d_minus_1d_GT_L020                  = 2.2919           value  rtol 0.0001
  T_low_1d_const_L025                        = 303.47           value  rtol 1e-05
  T_low_1d_GT_L025                           = 305.65           value  rtol 1e-05
  T_low_2d_L025                              = 307.6            value  rtol 1e-05
  T_low_2d_minus_1d_const_L025               = 4.1271           value  rtol 0.0001
  T_low_2d_minus_1d_GT_L025                  = 1.9488           value  rtol 0.0001
  T_low_1d_const_L030                        = 300.89           value  rtol 1e-05
  T_low_1d_GT_L030                           = 302.87           value  rtol 1e-05
  T_low_2d_L030                              = 304.56           value  rtol 1e-05
  T_low_2d_minus_1d_const_L030               = 3.6711           value  rtol 0.0001
  T_low_2d_minus_1d_GT_L030                  = 1.698            value  rtol 0.0001
  T_low_1d_const_slope_per_005               = 2.7726           value  rtol 0.0001
  T_low_2d_L025_dG5em5                       = 307.61           value  rtol 1e-05
  T_low_1d_circle_L025                       = 305.54           value  rtol 1e-05
  T_low_shape_effect_L025                    = 2.0743           value  rtol 0.0001
  T_low_entrance_dim_L025                    = 2.0528           value  rtol 0.0001
  T_low_shape_share_pct                      = 50.261           value  rtol 0.0001
  equiv_G2d_at310                            = 0.21547          value  rtol 0.0001
  equiv_shift_const_at310                    = 4.5296           value  rtol 0.0001
  equiv_shift_GT_at310                       = 2.1748           value  rtol 0.0001
  equiv_G2d_at316                            = 0.14576          value  rtol 0.0001
  equiv_shift_GT_at316                       = 2.8525           value  rtol 0.0001
  equiv_G2d_at320                            = 0.11028          value  rtol 0.0001
  equiv_shift_const_at320                    = 6.6893           value  rtol 0.0001
  equiv_shift_GT_at320                       = 3.4097           value  rtol 0.0001
  equiv_G2d_at330                            = 0.051372         value  rtol 0.0001
  equiv_shift_const_at330                    = 10.117           value  rtol 0.0001
  equiv_shift_GT_at330                       = 5.1536           value  rtol 0.0001
  equiv_G2d_at340                            = 0.022253         value  rtol 0.0001
  equiv_shift_const_at340                    = 15.475           value  rtol 0.0001
  equiv_shift_GT_at340                       = 6.8269           value  rtol 0.0001
  equiv_shift_const_Nu_at316                 = 5.7157           value  rtol 0.0001
  equiv_shift_const_max                      = 15.475           value  rtol 0.0001
  equiv_shift_GT_max                         = 6.8269           value  rtol 0.0001
  equiv_shift_const_over_claim_at316         = 2.8578           value  rtol 0.0001
  equiv_shift_const_over_claim_min           = 2.2648           value  rtol 0.0001
  equiv_shift_const_over_claim_max           = 7.7376           value  rtol 0.0001
  equiv_shift_GT_over_claim_at316            = 1.4262           value  rtol 0.0001
  equiv_shift_GT_over_claim_min              = 1.0874           value  rtol 0.0001
  equiv_shift_GT_over_claim_max              = 3.4135           value  rtol 0.0001
  equiv_shift_GT_minus_claim_at316           = 0.85245          value  rtol 0.0001
  G_lightoff_2d_316_dG4em4                   = 0.14499          value  rtol 0.0001
  G_lightoff_2d_316_dG2em4                   = 0.14549          value  rtol 0.0001
  G_lightoff_2d_316_dG1em4                   = 0.14576          value  rtol 0.0001
  G_lightoff_2d_316_dG5em5                   = 0.1459           value  rtol 0.0001
  G_lightoff_2d_316_dG_order                 = (here 9.6e-01)   bound  bound [0.8, 1.2] [theory]
  G_lightoff_2d_316_richardson               = 0.14603          value  rtol 0.0001
  G_lightoff_2d_316_dG1em4_vs_richardson_pct = -0.19099         value  rtol 0.0001
  route_march_minus_quad_steps_305           = 0.92734          value  rtol 0.0001
  route_quad_CG_relerr_305                   = 0.0017957        value  rtol 0.0001
  route_quad_305                             = 0.22327          value  rtol 0.0001
  route_march_minus_quad_steps_310           = 0.79837          value  rtol 0.0001
  route_quad_CG_relerr_310                   = 0.00096608       value  rtol 0.0001
  route_quad_310                             = 0.1494           value  rtol 0.0001
  route_march_minus_quad_steps_316           = 0.63226          value  rtol 0.0001
  route_quad_CG_relerr_316                   = 0.0017649        value  rtol 0.0001
  route_quad_316                             = 0.083408         value  rtol 0.0001
  route_march_minus_quad_steps_322           = 0.44625          value  rtol 0.0001
  route_quad_CG_relerr_322                   = 0.0096658        value  rtol 0.0001
  route_quad_322                             = 0.036929         value  rtol 0.0001
  route_march_minus_quad_steps_328           = 0.1947           value  rtol 0.0001
  route_quad_CG_relerr_328                   = 0.0012186        value  rtol 0.0001
  route_quad_328                             = 0.0063932        value  rtol 0.0001
  lightoff_march_vs_quad_max_steps           = 0.92734          value  rtol 0.0001
  quad_CG_endpoint_error                     = 0.0096658        value  rtol 0.0001
  recon_baseline_T_up                        = 329.92           value  rtol 1e-05
  recon_baseline_G2d                         = 0.14576          value  rtol 0.0001
  recon_baseline_shift_const                 = 5.7157           value  rtol 0.0001
  recon_baseline_shift_GT                    = 2.8525           value  rtol 0.0001
  recon_dT_AD_plus10_T_up                    = 327.44           value  rtol 1e-05
  recon_dT_AD_plus10_G2d                     = 0.1237           value  rtol 0.0001
  recon_dT_AD_plus10_shift_const             = 6.2241           value  rtol 0.0001
  recon_dT_AD_plus10_shift_GT                = 3.1471           value  rtol 0.0001
  recon_dT_AD_minus10_T_up                   = 332.67           value  rtol 1e-05
  recon_dT_AD_minus10_G2d                    = 0.17317          value  rtol 0.0001
  recon_dT_AD_minus10_shift_const            = 5.2099           value  rtol 0.0001
  recon_dT_AD_minus10_shift_GT               = 2.5573           value  rtol 0.0001
  recon_beta_x_1_5_T_up                      = 341.31           value  rtol 1e-05
  recon_beta_x_1_5_G2d                       = 0.28278          value  rtol 0.0001
  recon_beta_x_1_5_shift_const               = 3.9629           value  rtol 0.0001
  recon_beta_x_1_5_shift_GT                  = 1.8464           value  rtol 0.0001
  recon_beta_over_1_5_T_up                   = 318.97           value  rtol 1e-05
  recon_beta_over_1_5_G2d                    = 0.066039         value  rtol 0.0001
  recon_beta_over_1_5_shift_const            = 8.5176           value  rtol 0.0001
  recon_beta_over_1_5_shift_GT               = 4.3965           value  rtol 0.0001
  recon_spread_upper_threshold_C             = 22.338           value  rtol 0.0001
  recon_spread_equiv_shift_C                 = 4.5548           value  rtol 0.0001
  recon_min_equiv_shift_const                = 3.9629           value  rtol 0.0001
  recon_min_equiv_shift_GT                   = 1.8464           value  rtol 0.0001
  recon_rows_GT_shift_above_claim            = 4                exact  exact, margin 0.154
  recon_rows_const_shift_above_claim         = 5                exact  exact, margin 1.96
  quad_CG_rows_out_of_subdivisions           = 5                exact  exact
  window_1d_case_beyond_fig2                 = True             exact  exact, margin 0.0405
  window_2d_case_beyond_fig11                = True             exact  exact, margin 0.0768
  lower_threshold_2d_above_both_1d           = 6                exact  exact, margin 1.7
  Tbar_X025_eq15                             = 0.021147         value  rtol 1e-06
  Tbar_X025_notation                         = 0.32869          value  rtol 1e-06
  Tbar_X025_area                             = 0.015004         value  rtol 1e-06
  Tbar_X025_eq15_over_printed                = 0.94407          value  rtol 1e-06
  Tbar_X025_notation_over_printed            = 14.673           value  rtol 1e-06
  Tbar_X025_area_over_printed                = 0.66982          value  rtol 1e-06
  Tbar_X025_nr10_g1                          = 0.021575         value  rtol 1e-06
  Tbar_X025_nr10_g2                          = 0.022451         value  rtol 1e-06
  Tbar_X025_nr20_g1                          = 0.021252         value  rtol 1e-06
  Tbar_X025_nr40_g1                          = 0.021171         value  rtol 1e-06
  Tbar_X025_nr80_g2                          = 0.021164         value  rtol 1e-06
  Tbar_X025_nr200_g2                         = 0.021147         value  rtol 1e-06
  Tbar_X025_converged                        = 0.021147         value  rtol 1e-06
  Tbar_X025_paper_grid_error                 = 0.059245         value  rtol 1e-05
  Tbar_X025_nr10_clustered_error             = 0.061662         value  rtol 1e-05
  Tbar_printed_inside_ten_point_interval     = True             exact  exact, margin 0.00228
  order_square_NuH1_axis0                    = (here 2.1e+00)   bound  bound [1.9, 2.3] [theory]
  order_square_NuT_axis0                     = (here 2.1e+00)   bound  bound [1.9, 2.3] [theory]
  order_square_NuH1_axis1                    = (here 2.1e+00)   bound  bound [1.9, 2.3] [theory]
  order_square_NuT_axis1                     = (here 2.1e+00)   bound  bound [1.9, 2.3] [theory]
  nu_pole_X_fig9_refined                     = 0.031183         value  rtol 1e-06
  order_pole_radial                          = (here 2.3e+00)   bound  bound [1.9, 2.3] [theory]
  order_pole_axial                           = (here 2.7e+00)   bound  bound [1.6, 3.5] [theory]
  pole_axial_over_radial_err_coarsest        = 0.32456          value  rtol 0.0001
  nu_pole_X_fig9_paper_scheme                = 0.031241         value  rtol 1e-06
  pole_paper_scheme_dev_pct                  = 0.18494          value  rtol 0.0001
  pole_paper_counts_short_min_pct            = 2.2335           value  rtol 0.0001
  pole_paper_counts_short_max_pct            = 2.372            value  rtol 0.0001
  pole_paper_counts_max_dev_pct              = 0.32711          value  rtol 0.0001
  pole_to_0p032_pct                          = 2.6191           value  rtol 0.0001
  pole_reach_over_grid_error                 = 8.0067           value  rtol 0.0001
  graetz_newton_vs_deferred_field            = (here 2.5e-10)   bound  bound &lt;= 1e-09 [tolerance]
  graetz_newton_vs_deferred_pole             = (here 6.9e-18)   bound  bound &lt;= 1e-09 [tolerance]
  graetz_deferred_sweeps                     = 49               exact  exact
  graetz_newton_iterations                   = 8                exact  exact
  graetz_omega1_last_change                  = 4.4584e-05       value  rtol 0.001
  graetz_omega1_sweeps                       = 600              exact  exact
  grigull_tratz_max_reldev                   = 0.012552         value  rtol 1e-06
  grigull_tratz_X_eq_G_min_factor            = 9.7047           value  rtol 1e-06
  grigull_tratz_X_eq_4G_min_factor           = 5.273            value  rtol 1e-06
  pole_cell_read_shift_prod                  = 2.2038e-05       value  rtol 0.0001
  pole_cell_read_shift_nr10                  = 0.00051321       value  rtol 0.0001
  boundary_read_vs_lastcell                  = 1.8296e-05       value  rtol 1e-06
  boundary_read_vs_lastcell_q0               = 0.0001083        value  rtol 1e-06
  boundary_read_dirichlet_exact              = (here 0.0e+00)   bound  bound &lt;= 1e-14 [identity]</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:I</category>
  <category>struct:S6</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/I1.3-heck-wei-katzer-monolith/</guid>
  <pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Van Krevelen-Hoftijzer: the chart replaced by a solve, and the assumption behind it measured</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/F3.2-van-krevelen-hoftijzer/</link>
  <description><![CDATA[ 




<section id="van-krevelen-hoftijzer-the-chart-replaced-by-a-solve-and-the-assumption-behind-it-measured" class="level1">
<h1>Van Krevelen-Hoftijzer: the chart replaced by a solve, and the assumption behind it measured</h1>
<p><strong>Catalog ID:</strong> <code>F3.2</code> · <strong>Structures:</strong> <code>S3</code> (1-D steady BVP) · <strong>Tier:</strong> T0</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>A gas <img src="https://latex.codecogs.com/png.latex?A"> dissolving into a liquid that holds a reactant <img src="https://latex.codecogs.com/png.latex?B"> is absorbed faster than it would be by dissolution alone. The ratio is the <strong>enhancement factor</strong>, and for a genuinely second-order reaction it has no closed form: the two film equations are coupled and nonlinear, and every design chart in the field descends from one approximate solution of them.</p>
<p>That approximation is <strong>Van Krevelen and Hoftijzer’s (1948)</strong>. This page does two things with it that a chart cannot: it <em>solves</em> the implicit relation instead of reading it off, and it <em>measures the assumption</em> the approximation is built on.</p>
<section id="the-source-situation-stated-plainly" class="level3">
<h3 class="anchored" data-anchor-id="the-source-situation-stated-plainly">The source situation, stated plainly</h3>
<p><strong>The 1948 origin was not consulted.</strong> Van Krevelen, D. W. and Hoftijzer, P. J., <em>Kinetics of gas-liquid reactions. Part I. General theory</em>, Recueil des Travaux Chimiques des Pays-Bas <strong>67</strong>, 563 (1948), is not on disk and was not read. Every equation on this page is transcribed from a monograph that restates it with attribution, and the transcription is named equation by equation below.</p>
<p><strong>The text read is Froment, De Wilde and Bischoff.</strong> <em>Chemical Reactor Analysis and Design</em>, 3rd edition, John Wiley &amp; Sons (2011), ISBN 978-0-470-56541-4, Chapter 6 <em>Gas-Liquid Reactions</em>. It qualifies as a source for a page <em>about this result</em> rather than merely a book that mentions it: section 6.3.2 (book p.&nbsp;331) says the diagram is “as first given by Van Krevelen and Hoftijzer [1948]”; section 6.3.3 (book p.&nbsp;335) says the intermediate curves “were calculated by Van Krevelen and Hoftijzer [1948] under the assumption that B is only weakly depleted near the interface”; and section 6.3.5 (book p.&nbsp;340) derives the approximation itself and prints its accuracy claim. Named, attributed, derived, and its assumption stated.</p>
<p><strong>Levenspiel is a cross-check, not a second source.</strong> <em>Chemical Reaction Engineering</em>, 3rd edition, John Wiley &amp; Sons (1999), Chapter 23, carries the same result as a chart in a different notation with three asymptotic expansions printed in its annotation boxes. Those expansions are used here to check Froment’s constants independently and to reconcile the two notations. Nothing on this page adjudicates between the books.</p>
</section>
<section id="every-equation-was-read-on-a-render-and-here-is-why-that-matters" class="level3">
<h3 class="anchored" data-anchor-id="every-equation-was-read-on-a-render-and-here-is-why-that-matters">Every equation was read on a render, and here is why that matters</h3>
<p>The Froment file is born-digital and its prose extracts cleanly, <strong>but its equations do not survive extraction and the failure is silent</strong>. Every Symbol-font operator becomes an unmappable Private-Use-Area glyph - <code>U+F02D</code> for minus, <code>U+F03D</code> for equals, <code>U+F02B</code> for plus - which renders as nothing. The extraction of the central equation of this page, (6.3.5-1), reads exactly</p>
<pre><code>  '    1   FA   1

b D A C Ai
a DB C Bb</code></pre>
<p>Seven characters have gone: <code>U+F067</code> (the leading <img src="https://latex.codecogs.com/png.latex?%5Cgamma">), <code>U+F03D</code> (the equals), <code>U+F067</code> again, <code>U+F02D</code> (a minus), <code>U+F028</code> (an opening bracket), <code>U+F02D</code> (the second minus) and <code>U+F029</code>. The square root sign has no character at all - it is drawn, not typeset - and the fraction bar is a line. What is left looks like a complete equation and contains no operator whatsoever. Every equation and every numeral used here was read on a 300 ppi render (Levenspiel: 600 ppi, his file’s native resolution), cropped and enlarged.</p>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<section id="the-film-equations-froment-section-6.3.1" class="level3">
<h3 class="anchored" data-anchor-id="the-film-equations-froment-section-6.3.1">The film equations (Froment, section 6.3.1)</h3>
<p>A stagnant liquid film of thickness <img src="https://latex.codecogs.com/png.latex?y_L"> at the interface, everything beyond it well mixed, and an irreversible reaction <img src="https://latex.codecogs.com/png.latex?aA%20+%20bB%20%5Crightarrow"> products. With <img src="https://latex.codecogs.com/png.latex?%5Cxi%20=%20y/y_L">, <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%20C_A/C_%7BAi%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%20C_B/C_%7BBb%7D">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cfrac%7B%5Cmathrm%7Bd%7D%5E2%5Calpha%7D%7B%5Cmathrm%7Bd%7D%5Cxi%5E2%7D%20=%20%5Cgamma%5E2%5C,%5Calpha%5Cbeta,%0A%5Cqquad%0A%5Cfrac%7B%5Cmathrm%7Bd%7D%5E2%5Cbeta%7D%7B%5Cmathrm%7Bd%7D%5Cxi%5E2%7D%20=%20%5Cfrac%7B%5Cgamma%5E2%7D%7Bq%7D%5C,%5Calpha%5Cbeta%20,%0A"></p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cgamma%20=%20%5Cfrac%7B%5Csqrt%7Bk%20D_A%7D%7D%7Bk_L%7D,%0A%5Cqquad%0Aq%20=%20%5Cfrac%7Ba%5C,D_B%5C,C_%7BBb%7D%7D%7Bb%5C,D_A%5C,C_%7BAi%7D%7D%20,%0A"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Calpha(0)%20=%201"> (saturated interface), <img src="https://latex.codecogs.com/png.latex?%5Calpha(1)%20=%200"> - Van Krevelen and Hoftijzer “could set <img src="https://latex.codecogs.com/png.latex?C_%7BAb%7D%20=%200">”, book p.&nbsp;340 - <img src="https://latex.codecogs.com/png.latex?%5Cbeta'(0)%20=%200"> (<img src="https://latex.codecogs.com/png.latex?B"> is non-volatile) and <img src="https://latex.codecogs.com/png.latex?%5Cbeta(1)%20=%201">. The enhancement factor is the interfacial flux divided by the purely diffusive one,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AF_A%20=%20%5Cfrac%7BN_A%7D%7Bk_L%20(C_%7BAi%7D%20-%20C_%7BAb%7D)%7D%0A=%20-%5Cleft.%5Cfrac%7B%5Cmathrm%7Bd%7D%5Calpha%7D%7B%5Cmathrm%7Bd%7D%5Cxi%7D%5Cright%7C_%7B%5Cxi%20=%200%7D%20.%0A"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cgamma"> is Froment’s symbol and his eq. (6.3.2-1) <em>et seq.</em>; he notes it “is sometimes called the Hatta number” (book p.&nbsp;328). <img src="https://latex.codecogs.com/png.latex?q"> is the group his Fig. 6.3.2-1 carries as its right-hand axis title, and his eq. (6.3.3-10) makes the instantaneous ceiling <img src="https://latex.codecogs.com/png.latex?F_A%20=%201%20+%20q">.</p>
</section>
<section id="the-approximation-this-page-is-about" class="level3">
<h3 class="anchored" data-anchor-id="the-approximation-this-page-is-about">The approximation this page is about</h3>
<p><strong>Pseudo-first-order</strong>, exact when <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20%5Cequiv%201"> - Froment (6.3.2-11):</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AF_A%20=%20%5Cfrac%7B%5Cgamma%7D%7B%5Ctanh%5Cgamma%7D%0A"></p>
<p><strong>Van Krevelen-Hoftijzer</strong>, “entirely analogous with that obtained for a pseudo-first-order reaction (6.3.2-11), but with <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> replaced by <img src="https://latex.codecogs.com/png.latex?%5Cgamma'">” - Froment (6.3.5-1), book p.&nbsp;340, read on a 300 ppi crop enlarged 2x:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cgamma'%20=%20%5Cgamma%5Csqrt%7B1%20-%20(F_A%20-%201)%5C,%5Cfrac%7Bb%5C,D_A%5C,C_%7BAi%7D%7D%7Ba%5C,D_B%5C,C_%7BBb%7D%7D%7D%0A%5C;=%5C;%20%5Cgamma%5Csqrt%7B1%20-%20%5Cfrac%7BF_A%20-%201%7D%7Bq%7D%7D%20,%0A%5Cqquad%0AF_A%20=%20%5Cfrac%7B%5Cgamma'%7D%7B%5Ctanh%5Cgamma'%7D%20.%0A"></p>
<p><img src="https://latex.codecogs.com/png.latex?F_A"> appears on both sides: this is the implicit relation, and solving it is what the chart exists to avoid. The sentence that follows it in the book is the claim this page measures: <em>“This approximate solution is valid to within 10 percent of the numerical solution.”</em></p>
<p>And the sentence three sections earlier, book p.&nbsp;335, is the assumption this page tests: the intermediate curves <em>“were calculated by Van Krevelen and Hoftijzer [1948] under the assumption that B is only weakly depleted near the interface. For moderately fast reactions, this assumption was reasonably confirmed by more rigorous computations.”</em></p>
</section>
<section id="the-same-result-in-levenspiels-notation" class="level3">
<h3 class="anchored" data-anchor-id="the-same-result-in-levenspiels-notation">The same result in Levenspiel’s notation</h3>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Froment</th>
<th>Levenspiel</th>
<th>this page</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Cgamma%20=%20%5Csqrt%7BkD_A%7D/k_L"></td>
<td><img src="https://latex.codecogs.com/png.latex?M_H%20=%20%5Csqrt%7B%5Cmathcal%7BD%7D_A%20k%20C_B%7D/k_%7BAl%7D"></td>
<td><code>gamma</code></td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?F_A"></td>
<td><img src="https://latex.codecogs.com/png.latex?E"></td>
<td><code>f_a</code></td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?q%20=%20aD_BC_%7BBb%7D/(bD_AC_%7BAi%7D)"></td>
<td><img src="https://latex.codecogs.com/png.latex?E_i%20-%201">, from <img src="https://latex.codecogs.com/png.latex?E_i%20=%201%20+%20%5Cmathcal%7BD%7D_BC_BH_A/(b%5Cmathcal%7BD%7D_Ap_%7BAi%7D)"></td>
<td><code>q</code></td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?F_A%20%5Cto%201%20+%20q"></td>
<td><img src="https://latex.codecogs.com/png.latex?E%20%5Cto%20E_i"></td>
<td>the plateau</td>
</tr>
</tbody>
</table>
<p>The two groups are the same objects written differently - <img src="https://latex.codecogs.com/png.latex?p_%7BAi%7D%20=%20C_%7BAi%7D/H_A"> turns Levenspiel’s <img src="https://latex.codecogs.com/png.latex?E_i"> into Froment’s <img src="https://latex.codecogs.com/png.latex?1%20+%20q"> - <strong>but the curve labels on the two charts are not.</strong> Froment’s Fig. 6.3.2-1 labels its curves with <img src="https://latex.codecogs.com/png.latex?q">; Levenspiel’s Fig. 23.4 labels the same family with <img src="https://latex.codecogs.com/png.latex?E_i">. Both print the same ten numerals. A curve labelled 1 plateaus at <img src="https://latex.codecogs.com/png.latex?F_A%20=%202"> in one book and at <img src="https://latex.codecogs.com/png.latex?E%20=%201"> in the other, and the page computes what that costs.</p>
<p>Levenspiel’s Fig. 23.4 also prints three asymptotic expansions in its annotation boxes, and every constant in them is checked here against the implicit relation above and against the film equations themselves:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AE%20%5Ccong%201%20+%20%5Cfrac%7BM_H%5E2%7D%7B3%7D%20+%20%5Cdots%0A%5Cqquad%0AE%20=%20M_H%5Cleft(1%20-%20%5Cfrac%7BM_H%20-%201%7D%7B2E_i%7D%5Cright)%20+%20%5Cdots%0A%5Cqquad%0AE%20%5Ccong%20E_i%20-%20%5Cfrac%7BE_i%5E2(E_i-1)%7D%7BM_H%5E2%7D%20+%20%5Cdots%0A"></p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Assumptions</strong>, all of them the source’s: steady state; a stagnant film with no surface renewal; irreversible second-order kinetics, first order in each reactant; constant diffusivities; <img src="https://latex.codecogs.com/png.latex?C_%7BAb%7D%20=%200">, so no reaction in the bulk; <img src="https://latex.codecogs.com/png.latex?B"> non-volatile. The problem is then dimensionless and has exactly two parameters, <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> and <img src="https://latex.codecogs.com/png.latex?q">.</p>
<p><strong>Nothing here is fitted, and nothing here is measured.</strong> Both sides of every comparison on this page are equations: an approximation on one side and the equations it approximates on the other. This is provenance tier 6. The page therefore establishes nothing whatever about how well the film model describes a real absorber - only how well one solution of it describes another.</p>
<p><strong>The search domain</strong>, and each end taken from the row that actually carries it. <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20%5Cin%20%5B0.5,%201000%5D"> is Froment’s own printed <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> axis, transcribed. The <img src="https://latex.codecogs.com/png.latex?q"> range comes from the printed <strong>curve labels</strong> - <img src="https://latex.codecogs.com/png.latex?q"> is what those labels are - so its upper end is the largest of them, and its lower end goes one decade below the smallest, because <img src="https://latex.codecogs.com/png.latex?q"> is a physical ratio and not a drawn curve. The two ends happen to coincide numerically with the <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> axis; they are looked up from different rows all the same. The worst point turns out to lie in the interior of both, so widening the domain cannot move it.</p>
<p><strong>Where this page stops, and what <code>F3.1</code> owns.</strong> <code>F3.1</code> owns the Hatta number and the regime map, and it already reports a maximum Van Krevelen-Hoftijzer error of about 2.1 % over the three <img src="https://latex.codecogs.com/png.latex?E_i"> values it sweeps. That number is loaded from <code>F3.1</code>’s own <code>agreement.json</code> in the Validation section, recomputed under this page’s definitions, and reconciled - not retyped. This page does not restate the regime picture, and it does not touch DeCoursey, which is <code>F3.3</code>.</p>
<div id="8f011590" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:30.131512Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:30.131292Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:38:30.546768Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:38:30.545913Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb2-2">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb2-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb2-4">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm pyyaml</span></code></pre></div></div>
</div>
<div id="ad178012" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:30.549453Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:30.549250Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:38:30.861195Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:38:30.860338Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys</span>
<span id="cb3-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb3-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb3-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb3-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_bvp</span>
<span id="cb3-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb3-9"></span>
<span id="cb3-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (NumJac, clip_approach, compute_boundary_values,</span>
<span id="cb3-11">                   construct_div, construct_grad, newton)</span>
<span id="cb3-12"></span>
<span id="cb3-13">RAW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb3-14">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main"</span>)</span>
<span id="cb3-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb3-16">    urllib.request.urlretrieve(RAW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/shared/gallery_utils.py"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb3-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb3-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents):</span>
<span id="cb3-19">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb3-20">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))</span>
<span id="cb3-21">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb3-22"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, cite_data, load_data, load_meta, load_claims</span>
<span id="cb3-23"></span>
<span id="cb3-24">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F3.2-van-krevelen-hoftijzer"</span></span>
<span id="cb3-25">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb3-26">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>})</span>
<span id="cb3-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, assigned in fixed order and never cycled</span></span>
<span id="cb3-28">C_BLUE, C_ORANGE, C_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span></span>
<span id="cb3-29">C_PURPLE, C_YELLOW, C_GREY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span></span>
<span id="cb3-30"></span>
<span id="cb3-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: nothing on this page is stochastic.  No sampling, no random</span></span>
<span id="cb3-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># initial guess, and no warm start - every film solve begins from a closed-form</span></span>
<span id="cb3-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># profile that depends on nothing but its own (gamma, q).  Two consecutive</span></span>
<span id="cb3-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># executions give an identical agreement.json.</span></span>
<span id="cb3-35">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span></code></pre></div></div>
</div>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>There is no experimental dataset here and there could not be: the case is an approximation to a pair of differential equations. What the two CSVs carry is <strong>transcription</strong> - the numbers and sentences the two books print around this result - so that the notebook tests them instead of retyping them.</p>
<p>Both books were read on renders at their files’ native resolutions, and the page/PDF mapping is recorded in the sidecars so any reader can re-render exactly what was read (Froment: book = PDF <img src="https://latex.codecogs.com/png.latex?-"> 42; Levenspiel: book = PDF <img src="https://latex.codecogs.com/png.latex?-"> 16, both confirmed on printed running heads).</p>
<p>One caution about the figure, because it is the exact trap the house rule exists for. The Froment file is born-digital and its equations and prose are vector text at any resolution - <strong>but its figure is not</strong>. <code>pdfimages -list</code> shows Fig. 6.3.2-1, on PDF p.&nbsp;373, as an embedded <img src="https://latex.codecogs.com/png.latex?536%5Ctimes771"> greyscale JPEG at 148 ppi, so a 300 ppi page render is a 2x interpolation of a 148 ppi raster. The raster was extracted and the ten curve labels, the four axis ends and both axis titles read at native resolution enlarged 4x.</p>
<div id="145b5aef" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:30.863936Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:30.863582Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:38:31.005709Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:38:31.004536Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">PRN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claim_id"</span>)</span>
<span id="cb4-2">PMETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-3">LAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"enhancement-chart-labels.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-4">LMETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"enhancement-chart-labels.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-5"></span>
<span id="cb4-6"></span>
<span id="cb4-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> printed(key, field<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>):</span>
<span id="cb4-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A printed constant, looked up - never retyped in a cell."""</span></span>
<span id="cb4-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PRN.loc[key, field])</span>
<span id="cb4-10"></span>
<span id="cb4-11"></span>
<span id="cb4-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> quoted(key):</span>
<span id="cb4-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(PRN.loc[key, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"verbatim"</span>])</span>
<span id="cb4-14"></span>
<span id="cb4-15"></span>
<span id="cb4-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(PMETA))</span>
<span id="cb4-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PRN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> transcribed rows, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(LAB)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> chart labels</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_vkh_validity_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_film_completion_gamma"</span>,</span>
<span id="cb4-19">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_bulk_reaction_gamma"</span>):</span>
<span id="cb4-20">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   book p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_page"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span></span>
<span id="cb4-21">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quoted(k)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span>
<span id="cb4-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_small_M_coeff"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_correction_denom"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_correction_offset"</span>,</span>
<span id="cb4-23">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_correction_power"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_threshold"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_threshold"</span>):</span>
<span id="cb4-24">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   book p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_page"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span></span>
<span id="cb4-25">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quoted(k)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span>
<span id="cb4-26"></span>
<span id="cb4-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the domain of every search on this page, read off the printed axes -----</span></span>
<span id="cb4-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gamma comes from the printed gamma AXIS; q comes from the printed curve</span></span>
<span id="cb4-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># LABELS, which is what q is drawn as - two different transcribed sources, and</span></span>
<span id="cb4-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># each is looked up from the row that actually carries it.</span></span>
<span id="cb4-31">LABELS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>]]</span>
<span id="cb4-32">G_LO, G_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_gamma_axis_lo"</span>), printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_gamma_axis_hi"</span>)</span>
<span id="cb4-33">Q_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(LABELS))</span>
<span id="cb4-34">Q_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(LABELS)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one decade below the smallest printed label</span></span>
<span id="cb4-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">search domain: gamma in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] (Froment's printed gamma axis),"</span></span>
<span id="cb4-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  q in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span>)</span>
<span id="cb4-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed curve labels, both books: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LABELS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  q's range comes from those labels, not from the gamma axis: the largest"</span></span>
<span id="cb4-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed label is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(LABELS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and the search goes one decade below the smallest, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(LABELS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, because"</span></span>
<span id="cb4-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" q is a physical ratio"</span>)</span>
<span id="cb4-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and not a drawn curve.  The worst point turns out to be interior in both"</span></span>
<span id="cb4-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" directions, so"</span></span>
<span id="cb4-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  widening the domain cannot move it."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Froment, G. F.; De Wilde, J.; Bischoff, K. B. (2011) — "Chemical Reactor Analysis and Design", 3rd edition, John Wiley &amp; Sons (2011), ISBN 978-0-470-56541-4, Chapter 6 "Gas-Liquid Reactions", sections 6.3.2 (book pp. 328-332), 6.3.3 (book p. 335) and 6.3.5 (book pp. 340-341), reference list book p. 365
 — transcription
25 transcribed rows, 10 chart labels

  froment_vkh_validity_pct             10.0   book p.340  "This approximate solution is valid to within 10 percent of the numerical solution."
  froment_film_completion_gamma         3.0   book p.331  "The reaction is essentially completed in the film when gamma &gt; 3"
  froment_bulk_reaction_gamma           0.3   book p.331  "whereas it takes place mainly in the bulk when gamma &lt; 0.3"
  lev_small_M_coeff                     3.0   book p.530  "E = 1 + M_H^2/3 + ..."
  lev_pfo_correction_denom              2.0   book p.530  "More precisely  E = M_H(1 - (M_H - 1)/(2 E_i)) + ..."
  lev_pfo_correction_offset             1.0   book p.530  "the (M_H - 1) of E = M_H(1 - (M_H - 1)/(2 E_i)) + ..."
  lev_inst_correction_power             2.0   book p.530  "More precisely:  E = E_i - E_i^2 (E_i - 1)/M_H^2 + ..."
  lev_pfo_threshold                     5.0   book p.530  "If E_i &gt; 5 M_H we then have pseudo first order reaction by the G/L interface in which case E = M_H"
  lev_inst_threshold                    5.0   book p.530  "If E_i &lt; M_H/5 then we have instantaneous reaction at a plane on the L film in which case E = E_i"

search domain: gamma in [0.5, 1000] (Froment's printed gamma axis),  q in [0.1, 1000]
printed curve labels, both books: [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000]
  q's range comes from those labels, not from the gamma axis: the largest printed label is 1000
  and the search goes one decade below the smallest, 1, because q is a physical ratio
  and not a drawn curve.  The worst point turns out to be interior in both directions, so
  widening the domain cannot move it.</code></pre>
</div>
</div>
<section id="one-printed-defect-reported-and-not-repaired" class="level3">
<h3 class="anchored" data-anchor-id="one-printed-defect-reported-and-not-repaired">One printed defect, reported and not repaired</h3>
<p>Levenspiel spells the first author <strong>“van Krevelens”</strong>, with a terminal <em>s</em>, in both places he names him. It is settled against another document rather than against memory: Froment cites the same paper - same journal, same volume 67, same page 563 - and spells it <em>Van Krevelen</em>.</p>
<p>This is a defect in the cross-check source, not in the E1.1 target, and it changes nothing computed here. The two books’ <em>citations</em> do not conflict: Froment cites the 1948 <em>Rec. Trav. Chim.</em> paper, Levenspiel’s chart caption credits a 1954 <em>Trans. I. Chem. E.</em> paper, and Levenspiel’s own reference list carries <strong>both</strong>. Those are two publications, not a discrepancy. Neither is on disk.</p>
<div id="6dfd3ae4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:31.008658Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:31.008441Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:38:31.014764Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:38:31.014094Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_surname_in_text"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_surname_in_reflist"</span>,</span>
<span id="cb6-2">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_caption"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_reflist"</span>):</span>
<span id="cb6-3">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"source"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> book p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_page"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quoted(k)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span>
<span id="cb6-4"></span>
<span id="cb6-5">FROMENT_SPELLING <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Van Krevelen"</span></span>
<span id="cb6-6">LEV_SPELLING <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Krevelens"</span></span>
<span id="cb6-7">SPELLING_DIFFERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (FROMENT_SPELLING.lower() <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span></span>
<span id="cb6-8">                    [quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_caption"</span>).split()[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-9">                     quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_caption"</span>).split()[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb6-10">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_caption"</span>).split()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)])</span>
<span id="cb6-11">IN_FROMENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(FROMENT_SPELLING <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> quoted(k)</span>
<span id="cb6-12">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_surname_in_text"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_surname_in_reflist"</span>))</span>
<span id="cb6-13">IN_LEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(LEV_SPELLING <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> quoted(k)</span>
<span id="cb6-14">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_caption"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_reflist"</span>))</span>
<span id="cb6-15">SAME_PAPER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel_surname_in_reflist"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"67"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"563"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1948"</span>))</span>
<span id="cb6-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FROMENT_SPELLING<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>IN_FROMENT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the 2 Froment rows;"</span></span>
<span id="cb6-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEV_SPELLING<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>IN_LEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the 2 Levenspiel rows."</span>)</span>
<span id="cb6-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"both reference lists carry volume 67, page 563, year 1948: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SAME_PAPER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> IN_FROMENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> IN_LEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> SAME_PAPER</span>
<span id="cb6-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-&gt; one paper, two spellings.  This page uses the spelling without the s,"</span></span>
<span id="cb6-21">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">   which is the one the E1.1 target and the catalogue use."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>froment     book p. 331  "as first given by Van Krevelen and Hoftijzer [1948]"
froment     book p. 365  "Van Krevelen, D.W., and Hoftijzer, P.J., Rec. Trav. Chim. Pays-Bas, 67, 563 (1948)."
levenspiel  book p. 530  "modified from the numerical solution of van Krevelens and Hoftijzer (1954)."
levenspiel  book p. 537  "van Krevelens, D. W., and Hoftijzer, P. J., Rec. Trav. Chim., 67, 563 (1948); Trans. I. Chem. E., 32, 5360 (1954)."

'Van Krevelen' in 2 of the 2 Froment rows;  'van Krevelens' in 2 of the 2 Levenspiel rows.
both reference lists carry volume 67, page 563, year 1948: True
-&gt; one paper, two spellings.  This page uses the spelling without the s,
   which is the one the E1.1 target and the catalogue use.</code></pre>
</div>
</div>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Three solvers, and they are kept apart on purpose.</p>
<ol type="1">
<li><strong>The film equations, in pymrm.</strong> Finite volumes on a slab (<code>nu=0</code>) with a graded grid clustered at the interface, per-species boundary conditions in one pair of <code>{"a","b","d"}</code> dictionaries, and <code>newton</code> + <code>NumJac</code> on the pointwise reaction term. This is the “numerical solution” Froment’s accuracy claim is made against.</li>
<li><strong>The same equations by collocation.</strong> <code>scipy.integrate.solve_bvp</code>, adaptive mesh, fourth order, sharing no assembly, no Jacobian and no mesh with (1). Every headline that depends on the film solution is computed both ways.</li>
<li><strong>The implicit relation</strong>, solved twice: for <img src="https://latex.codecogs.com/png.latex?F_A"> by Brent, and again for <img src="https://latex.codecogs.com/png.latex?%5Cgamma'"> with <img src="https://latex.codecogs.com/png.latex?F_A"> eliminated - a different unknown and a different residual for the same pair of printed equations.</li>
</ol>
<p>Two details that are not decoration. The grid is <strong>graded</strong>: with <img src="https://latex.codecogs.com/png.latex?x_f%20=%20(%5Cmathrm%7Be%7D%5E%7Bs%20t%7D%20-%201)/(%5Cmathrm%7Be%7D%5E%7Bs%7D%20-%201)"> and <img src="https://latex.codecogs.com/png.latex?s%20=%208"> the reaction layer near <img src="https://latex.codecogs.com/png.latex?%5Cxi%20=%200"> is resolved at <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20=%201000">, where a uniform grid of the same size is not - <code>construct_grad</code> and <code>construct_div</code> take arbitrary face positions, so this costs one line. And <code>NumJac</code> is given <code>(n_x, 2)</code> and never a bare <code>(n_x,)</code>: the reaction term is pointwise in the two fields, which is exactly the default stencil, while a bare 1-D shape would declare every cell coupled to every other and build a dense Jacobian.</p>
<p><strong>The reference is not a single solve.</strong> Grading is not free: it buys the high-<img src="https://latex.codecogs.com/png.latex?%5Cgamma"> end and it <em>costs</em> accuracy at moderate <img src="https://latex.codecogs.com/png.latex?%5Cgamma">, which is exactly where this page’s headline sits, because the outer cells of a graded grid are several times wider than a uniform one’s. Both effects are measured below. So the baseline every error here is quoted against is a <strong>Richardson extrapolation of the same graded film on <img src="https://latex.codecogs.com/png.latex?n_x%20=%20400"> and <img src="https://latex.codecogs.com/png.latex?n_x%20=%20800"></strong>, <img src="https://latex.codecogs.com/png.latex?F(2n)%20+%20%5BF(2n)%20-%20F(n)%5D/3">, which the observed order 2.0000 licenses. A single graded solve at <img src="https://latex.codecogs.com/png.latex?n_x%20=%20800"> is <em>not</em> converged at the fourth decimal of the headline; the break table’s “extrapolation switched off” row is that defect, and the extrapolated baseline is checked against collocation and against a finer extrapolation in the Validation section.</p>
<p>Every solve is a <strong>cold start</strong> from a closed-form profile that depends only on its own <img src="https://latex.codecogs.com/png.latex?(%5Cgamma,%20q)">. Nothing on this page is continued from a neighbouring solve, so no reported number can inherit a warm-start history.</p>
<div id="aa5f03c7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:31.017112Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:31.016936Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:38:32.254138Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:38:32.253339Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">XTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb8-2"></span>
<span id="cb8-3"></span>
<span id="cb8-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------- Froment (6.3.2-11) + (6.3.5-1)</span></span>
<span id="cb8-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_a_vkh(gamma, q, sign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, offset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"q"</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb8-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""F_A = gamma'/tanh(gamma') with gamma' from (6.3.5-1), solved for F_A.</span></span>
<span id="cb8-7"></span>
<span id="cb8-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `sign`, `offset`, `denom` and `xtol` exist so that the break table can</span></span>
<span id="cb8-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    mistranscribe the printed equation or under-solve it; the page always calls</span></span>
<span id="cb8-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    this with the printed form and the tight tolerance.</span></span>
<span id="cb8-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-12">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> q <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> denom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"q"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q</span>
<span id="cb8-13">    tol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> XTOL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> xtol <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xtol, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb8-14"></span>
<span id="cb8-15">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(F):</span>
<span id="cb8-16">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sign <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> offset) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))</span>
<span id="cb8-17">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gamma <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s</span>
<span id="cb8-18">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb8-19"></span>
<span id="cb8-20">    hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q</span>
<span id="cb8-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> resid(hi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>:      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a broken form can exceed the ceiling</span></span>
<span id="cb8-22">        hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb8-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> brentq(resid, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, hi, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>tol, maxiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb8-24"></span>
<span id="cb8-25"></span>
<span id="cb8-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_a_vkh_route_b(gamma, q):</span>
<span id="cb8-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The SAME two printed equations, solved for gamma' instead of for F_A.</span></span>
<span id="cb8-28"></span>
<span id="cb8-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    F = u/tanh u and F = 1 + q(1 - u^2/gamma^2) with u = gamma'; eliminating F</span></span>
<span id="cb8-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    leaves one scalar equation in u.  Different unknown, different residual.</span></span>
<span id="cb8-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-32">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(u):</span>
<span id="cb8-33">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> gamma) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb8-34"></span>
<span id="cb8-35">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(resid, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, gamma, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>XTOL, maxiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb8-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(u)</span>
<span id="cb8-37"></span>
<span id="cb8-38"></span>
<span id="cb8-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------- the film, in pymrm</span></span>
<span id="cb8-40"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> faces(n, stretch):</span>
<span id="cb8-41">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Faces graded towards xi = 0, the interface, where the reaction layer is."""</span></span>
<span id="cb8-42">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> t <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> stretch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.expm1(stretch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.expm1(stretch)</span>
<span id="cb8-44"></span>
<span id="cb8-45"></span>
<span id="cb8-46"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Film:</span>
<span id="cb8-47">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Stagnant film on xi in [0, 1], fields (alpha, beta) = (A, B)."""</span></span>
<span id="cb8-48"></span>
<span id="cb8-49">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, bc_beta_bulk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dirichlet"</span>):</span>
<span id="cb8-50">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.n_x, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.stretch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_x, stretch</span>
<span id="cb8-51">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._memo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb8-52">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (n_x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb8-53">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> faces(n_x, stretch)</span>
<span id="cb8-54">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb8-55">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a . dc/dn + b . c = d, with n the OUTWARD normal.</span></span>
<span id="cb8-56">        right <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]]}</span>
<span id="cb8-57">                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    alpha = 0 (C_Ab = 0)     beta = 1 (bulk value)</span></span>
<span id="cb8-58">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bc_beta_bulk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dirichlet"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb8-59">                 {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]]})</span>
<span id="cb8-60">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#        the break-table alternative: dbeta/dn = 0 at the bulk edge</span></span>
<span id="cb8-61">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: [[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]]}, right)</span>
<span id="cb8-62">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#            alpha = 1 (saturated)     dbeta/dn = 0 (B non-volatile)</span></span>
<span id="cb8-63">        grad_mat, grad_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_grad(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c,</span>
<span id="cb8-64">                                           <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-65">        div_mat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># slab</span></span>
<span id="cb8-66">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flux_mat, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flux_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>grad_mat, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>grad_bc</span>
<span id="cb8-67">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.jac_diff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> div_mat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flux_mat</span>
<span id="cb8-68">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g_diff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (div_mat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flux_bc).toarray().ravel()</span>
<span id="cb8-69">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F_A lives in the first face row of the flux operator</span></span>
<span id="cb8-70">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.iface <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flux_mat[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], :].todense()).ravel()</span>
<span id="cb8-71">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.iface_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flux_bc.toarray().ravel()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-72">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (n_x, 2), never a bare (n_x,): the rate is pointwise in the fields</span></span>
<span id="cb8-73">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((n_x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb8-74"></span>
<span id="cb8-75">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> enhancement(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, u):</span>
<span id="cb8-76">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.iface <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> np.asarray(u).ravel() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.iface_bc)</span>
<span id="cb8-77"></span>
<span id="cb8-78">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, gamma, q, frozen_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>):</span>
<span id="cb8-79">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rate(u):</span>
<span id="cb8-80">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># frozen_b is the break table's "no depletion of B at all": B is held</span></span>
<span id="cb8-81">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at its bulk value in the rate AND its own consumption is dropped,</span></span>
<span id="cb8-82">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so beta = 1 identically and the film IS pseudo-first-order.</span></span>
<span id="cb8-83">            b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.ones_like(u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> frozen_b <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.clip(u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb8-84">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b</span>
<span id="cb8-85">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.stack([gamma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r,</span>
<span id="cb8-86">                             np.zeros_like(r) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> frozen_b <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (gamma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r],</span>
<span id="cb8-87">                            axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-88"></span>
<span id="cb8-89">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># COLD START from a closed form, not from a neighbouring solve: the</span></span>
<span id="cb8-90">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pseudo-first-order profile at this same gamma.</span></span>
<span id="cb8-91">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(gamma, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">700.0</span>)                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sinh overflows past ~710</span></span>
<span id="cb8-92">        u0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.stack([np.sinh(g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sinh(g),</span>
<span id="cb8-93">                       np.ones_like(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c)], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-94"></span>
<span id="cb8-95">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> residual(u):</span>
<span id="cb8-96">            g_r, jac_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(rate, u)</span>
<span id="cb8-97">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.jac_diff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> u.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-98">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g_diff.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-99">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> g_r.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.jac_diff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> jac_r</span>
<span id="cb8-100"></span>
<span id="cb8-101">        res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(residual, u0, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tol, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>,</span>
<span id="cb8-102">                     callback<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x, r: clip_approach(x, r, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>))</span>
<span id="cb8-103">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> res.success, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"film solve failed at gamma=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gamma<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, q=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-104">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.asarray(res.x).reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb8-105"></span>
<span id="cb8-106">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> beta_interface(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, u):</span>
<span id="cb8-107">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""beta at xi = 0 through compute_boundary_values, not off a cell centre."""</span></span>
<span id="cb8-108">        v, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> compute_boundary_values(u, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb8-109">                                       bound_id<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-110">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.asarray(v).ravel()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb8-111"></span>
<span id="cb8-112">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> beta_constancy(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb8-113">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Rate-weighted mean of beta over the reaction zone, over beta(0).</span></span>
<span id="cb8-114"></span>
<span id="cb8-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        The book states its assumption TWICE and the two statements are not the</span></span>
<span id="cb8-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        same test.  Book p. 335 is about the LEVEL of depletion at the</span></span>
<span id="cb8-117"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        interface, which beta(0) measures.  Book p. 340 - the page the equation</span></span>
<span id="cb8-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        itself is printed on - is about beta staying "approximately constant</span></span>
<span id="cb8-119"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        close to the interface", which beta(0) does not measure at all.  This</span></span>
<span id="cb8-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        is the second test: weight beta by the local rate alpha*beta, where the</span></span>
<span id="cb8-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        approximation is actually being made, and divide by beta(0).  It is 1</span></span>
<span id="cb8-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        exactly when beta does not vary over the reaction zone.</span></span>
<span id="cb8-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        """</span></span>
<span id="cb8-124">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.solve(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-125">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb8-126">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb8-127">        w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.diff(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b</span>
<span id="cb8-128">        s, b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.beta_interface(u)</span>
<span id="cb8-129">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A break row CAN make this undefined rather than large: the</span></span>
<span id="cb8-130">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># zero-gradient-bulk row removes the supply of B entirely, so beta and</span></span>
<span id="cb8-131">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the rate go to zero everywhere and there is no reaction zone to</span></span>
<span id="cb8-132">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># average over.  Return nan explicitly, so the row records no move on</span></span>
<span id="cb8-133">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this metric instead of raising a warning and dividing 0 by 0.</span></span>
<span id="cb8-134">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> (s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>:</span>
<span id="cb8-135">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nan"</span>)</span>
<span id="cb8-136">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> s) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b0</span>
<span id="cb8-137"></span>
<span id="cb8-138">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_a(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb8-139">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A pure-function memo.  f_a depends on nothing but (gamma, q, kw) and</span></span>
<span id="cb8-140">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the operators built once in __init__, and the root-finders ask for the</span></span>
<span id="cb8-141">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># same point repeatedly.  It changes no number - only the runtime.</span></span>
<span id="cb8-142">        key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (gamma, q, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(kw.items())))</span>
<span id="cb8-143">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._memo:</span>
<span id="cb8-144">            u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.solve(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-145">            <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._memo[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.enhancement(u), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.beta_interface(u))</span>
<span id="cb8-146">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._memo[key]</span>
<span id="cb8-147"></span>
<span id="cb8-148"></span>
<span id="cb8-149"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Extrapolated:</span>
<span id="cb8-150">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Richardson extrapolation of the SAME film on two grids: the reference.</span></span>
<span id="cb8-151"></span>
<span id="cb8-152"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The graded discretisation converges at order 2 - observed 2.0000 in the</span></span>
<span id="cb8-153"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Validation section - so F(2n) + [F(2n) - F(n)]/3 removes its leading error</span></span>
<span id="cb8-154"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    term.  Everything this page reports about the approximation is measured</span></span>
<span id="cb8-155"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    against this, not against a single solve, because a single graded solve at</span></span>
<span id="cb8-156"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    n_x = 800 is wrong in the fourth decimal of the headline error.  The break</span></span>
<span id="cb8-157"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    table's "extrapolation switched off" row is exactly that defect.</span></span>
<span id="cb8-158"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-159"></span>
<span id="cb8-160">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, coarse, fine, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb8-161">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.coarse, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.fine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> coarse, fine</span>
<span id="cb8-162">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.n_x, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.stretch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fine.n_x, fine.stretch</span>
<span id="cb8-163">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>order <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb8-164"></span>
<span id="cb8-165">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_a(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb8-166">        f_c, b_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.coarse.f_a(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-167">        f_f, b_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.fine.f_a(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-168">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> f_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (f_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f_c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.w, b_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (b_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b_c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.w</span>
<span id="cb8-169"></span>
<span id="cb8-170">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb8-171">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Profiles are drawn from the fine grid; only scalars are extrapolated."""</span></span>
<span id="cb8-172">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.fine.solve(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-173"></span>
<span id="cb8-174">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> beta_constancy(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb8-175">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A ratio of two integrals of the SAME profile, so the grid partly</span></span>
<span id="cb8-176">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cancels - but only partly, and least of all at the top of the gamma</span></span>
<span id="cb8-177">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># range, where beta is a thin exponential and the rate weight sits in</span></span>
<span id="cb8-178">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the first few cells.  Taking this diagnostic from the fine grid alone,</span></span>
<span id="cb8-179">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># on the ground that the grid "cancels to five digits", is true at the</span></span>
<span id="cb8-180">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># worst point and false by orders of magnitude at gamma = 100.  The gap</span></span>
<span id="cb8-181">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is PRINTED below</span></span>
<span id="cb8-182">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rather than asserted here, and the ratio is extrapolated exactly like</span></span>
<span id="cb8-183">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F_A: same two grids, same order.</span></span>
<span id="cb8-184">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.coarse.beta_constancy(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-185">        f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.fine.beta_constancy(gamma, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-186">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.w</span>
<span id="cb8-187"></span>
<span id="cb8-188"></span>
<span id="cb8-189"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------ the film, by collocation</span></span>
<span id="cb8-190"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f_a_bvp(gamma, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, n0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>):</span>
<span id="cb8-191">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The same two-point problem, adaptive 4th-order collocation."""</span></span>
<span id="cb8-192">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fun(x, y):</span>
<span id="cb8-193">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gamma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-194">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.vstack([y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], r, y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> q])</span>
<span id="cb8-195"></span>
<span id="cb8-196">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bc(ya, yb):</span>
<span id="cb8-197">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([ya[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, yb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], ya[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], yb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>])</span>
<span id="cb8-198"></span>
<span id="cb8-199">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.expm1(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n0)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.expm1(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>)</span>
<span id="cb8-200">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, x.size))</span>
<span id="cb8-201">    y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb8-202">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_bvp(fun, bc, x, y, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tol, max_nodes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400000</span>)</span>
<span id="cb8-203">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.status <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"solve_bvp failed at gamma=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gamma<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, q=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-204">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.sol(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb8-205"></span>
<span id="cb8-206"></span>
<span id="cb8-207"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------------------------------------- root-find helpers</span></span>
<span id="cb8-208"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> argext_log(f, lo, hi, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb8-209">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""An interior extremum of f on [lo, hi], ROOT-FOUND from f' = 0.</span></span>
<span id="cb8-210"></span>
<span id="cb8-211"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The scan only brackets; the value returned is f at a root of the central</span></span>
<span id="cb8-212"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    difference of f in ln x.  Returns (x, f(x), was_root_found).</span></span>
<span id="cb8-213"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-214">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(lo, hi, n_scan)</span>
<span id="cb8-215">    fs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([f(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xs])</span>
<span id="cb8-216">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(fs)))</span>
<span id="cb8-217">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> rootfind <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, n_scan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb8-218">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(xs[i]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fs[i]), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb8-219"></span>
<span id="cb8-220">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dfd(lx):</span>
<span id="cb8-221">        x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(lx)</span>
<span id="cb8-222">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> f(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(h)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>h))</span>
<span id="cb8-223"></span>
<span id="cb8-224">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(xs[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), np.log(xs[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb8-225">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dfd(a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dfd(b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb8-226">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(xs[i]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fs[i]), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span></span>
<span id="cb8-227">    lx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(dfd, a, b, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>XTOL, maxiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb8-228">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(lx)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f(np.exp(lx))), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb8-229"></span>
<span id="cb8-230"></span>
<span id="cb8-231"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> root_log(f, lo, hi):</span>
<span id="cb8-232">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> lx: f(np.exp(lx)), np.log(lo), np.log(hi),</span>
<span id="cb8-233">                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>XTOL, maxiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)))</span>
<span id="cb8-234"></span>
<span id="cb8-235"></span>
<span id="cb8-236"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> root_or_edge(f, lo, hi):</span>
<span id="cb8-237">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""root_log where a root exists, and the nearer end where it does not.</span></span>
<span id="cb8-238"></span>
<span id="cb8-239"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Only the break table ever reaches the fallback: the baseline's two</span></span>
<span id="cb8-240"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    depletion roots are genuine, and the notebook prints their residuals.</span></span>
<span id="cb8-241"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-242">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f(lo), f(hi)</span>
<span id="cb8-243">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb8-244">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(hi <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> lo)</span>
<span id="cb8-245">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> root_log(f, lo, hi)</span>
<span id="cb8-246"></span>
<span id="cb8-247"></span>
<span id="cb8-248">_GRIDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb8-249"></span>
<span id="cb8-250"></span>
<span id="cb8-251"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> graded_film(n_x, stretch):</span>
<span id="cb8-252">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One Film object per (n_x, stretch), so its solve memo is shared."""</span></span>
<span id="cb8-253">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _GRIDS.setdefault((n_x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(stretch)), Film(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_x, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>stretch))</span>
<span id="cb8-254"></span>
<span id="cb8-255"></span>
<span id="cb8-256">FILM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> graded_film(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the fine grid of the pair</span></span>
<span id="cb8-257">FILM_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> graded_film(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># its coarse partner</span></span>
<span id="cb8-258">REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Extrapolated(FILM_C, FILM)             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE BASELINE OF THIS PAGE</span></span>
<span id="cb8-259">REF_FINE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Extrapolated(FILM, graded_film(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only to check REF</span></span>
<span id="cb8-260"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"film: n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, grading s = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>stretch<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb8-261">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" first cell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> wide, last </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>x_f[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-262"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the reference is Richardson(n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) on that grid,"</span></span>
<span id="cb8-263">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" order 2, NOT a single solve"</span>)</span>
<span id="cb8-264"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"F_A at (gamma, q) = (10, 4):  pymrm n_x = 800 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>f_a(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-265">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   extrapolated </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>f_a(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-266"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:29s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">collocation </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>f_a_bvp(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-267">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   VKH </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>f_a_vkh(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>film: n_x = 800, grading s = 8, first cell 3.373e-06 wide, last 9.954e-03
the reference is Richardson(n_x = 400, 800) on that grid, order 2, NOT a single solve
F_A at (gamma, q) = (10, 4):  pymrm n_x = 800 4.3605456963   extrapolated 4.3605539658
                             collocation 4.3605539659   VKH 4.2709355463</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-chart-computed" class="level3">
<h3 class="anchored" data-anchor-id="the-chart-computed">1. The chart, computed</h3>
<p>Froment’s Fig. 6.3.2-1 and Levenspiel’s Fig. 23.4 are the same picture: the implicit relation, solved once and drawn as a family of curves so that nobody has to solve it again. Here it is solved - the curves below are computed from the equations at the ten labels both books print, and nothing is traced.</p>
<p>The plateau check is the point of the notation table above: at the <em>same</em> printed label, Froment’s curve levels off at <img src="https://latex.codecogs.com/png.latex?1%20+%20q"> and Levenspiel’s at <img src="https://latex.codecogs.com/png.latex?E_i">.</p>
<div id="9a5ba84e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:32.256287Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:32.256155Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:38:33.204229Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:38:33.203411Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">GAMMA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(G_LO, G_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb10-2">CURVES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {L: np.array([f_a_vkh(g, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GAMMA]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS}</span>
<span id="cb10-3">SOLVED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {L: np.array([REF.f_a(g, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GAMMA[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]])</span>
<span id="cb10-4">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>)}</span>
<span id="cb10-5"></span>
<span id="cb10-6">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>))</span>
<span id="cb10-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS:</span>
<span id="cb10-8">    ax.loglog(GAMMA, CURVES[L], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>)</span>
<span id="cb10-9">    ax.annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, (GAMMA[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], CURVES[L][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>,</span>
<span id="cb10-10">                xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), textcoords<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"offset points"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE)</span>
<span id="cb10-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L, mk <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D"</span>)):</span>
<span id="cb10-12">    ax.loglog(GAMMA[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>], SOLVED[L], mk, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>,</span>
<span id="cb10-13">              color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"film solve, q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb10-14">ax.loglog(GAMMA, GAMMA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(GAMMA), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>,</span>
<span id="cb10-15">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">anh</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2-11</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-16">ax.set_xlim(G_LO, G_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)</span>
<span id="cb10-17">ax.set_ylim(printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_FA_axis_lo"</span>), printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_FA_axis_hi"</span>))</span>
<span id="cb10-18">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma = </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt{kD_A}/k_L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">M_H</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in Levenspiel's notation</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-19">ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">F_A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">E</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in Levenspiel's notation</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-20">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The enhancement chart, solved rather than read</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-21">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curves: VKH (6.3.5-1) at the ten printed labels, as q"</span>,</span>
<span id="cb10-22">             fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb10-23">ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb10-24">fig.tight_layout()</span>
<span id="cb10-25">plt.show()</span>
<span id="cb10-26"></span>
<span id="cb10-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the plateau each book's own label implies -----------------------------</span></span>
<span id="cb10-28">PLATEAU_FR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> L <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Froment: label = q</span></span>
<span id="cb10-29">PLATEAU_LEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS])   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Levenspiel: label = E_i</span></span>
<span id="cb10-30">LABEL_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PLATEAU_FR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PLATEAU_LEV</span>
<span id="cb10-31">CHART_LABEL_MAX_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(LABEL_RATIO.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same printed label, the two books' plateaux"</span>)</span>
<span id="cb10-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Froment 1+q"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Levenspiel E_i"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb10-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L, a, b, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LABELS, PLATEAU_FR, PLATEAU_LEV, LABEL_RATIO):</span>
<span id="cb10-35">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7d}{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.0f}{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.0f}{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">worst at the smallest label: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CHART_LABEL_MAX_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span></span>
<span id="cb10-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (CHART_LABEL_MAX_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %);"</span></span>
<span id="cb10-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" least at the largest: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LABEL_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the same abscissa is drawn over different ranges: Froment"</span></span>
<span id="cb10-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'froment_gamma_axis_lo'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'froment_gamma_axis_hi'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb10-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Levenspiel </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_MH_axis_lo'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_MH_axis_hi'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(this page searches Froment's, the narrower one)"</span>)</span>
<span id="cb10-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the computed curve must actually reach the plateau its label implies</span></span>
<span id="cb10-44">PLATEAU_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f_a_vkh(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS)</span>
<span id="cb10-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"computed VKH curves reach 1 + q at gamma = 1e6 to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PLATEAU_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/F3.2-van-krevelen-hoftijzer/index_files/figure-html/cell-7-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>the same printed label, the two books' plateaux
  label  Froment 1+q  Levenspiel E_i    ratio
      1            2               1   2.0000
      2            3               2   1.5000
      5            6               5   1.2000
     10           11              10   1.1000
     20           21              20   1.0500
     50           51              50   1.0200
    100          101             100   1.0100
    200          201             200   1.0050
    500          501             500   1.0020
   1000         1001            1000   1.0010

worst at the smallest label: 2x   (100 %); least at the largest: 1.0010
the same abscissa is drawn over different ranges: Froment 0.5 to 1000, Levenspiel 0.1 to 1000
(this page searches Froment's, the narrower one)
computed VKH curves reach 1 + q at gamma = 1e6 to 1.00e-06 relative</code></pre>
</div>
</div>
</section>
<section id="where-the-approximation-is-worst-root-found" class="level3">
<h3 class="anchored" data-anchor-id="where-the-approximation-is-worst-root-found">2. Where the approximation is worst, root-found</h3>
<p>The error <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon(%5Cgamma,%20q)%20=%20F_A%5E%7B%5Cmathrm%7BVKH%7D%7D/F_A%5E%7B%5Cmathrm%7Bfilm%7D%7D%20-%201"> is a smooth surface with one interior extremum. It is located by root-finding <img src="https://latex.codecogs.com/png.latex?%5Cpartial%5Cvarepsilon/%5Cpartial%5Cln%5Cgamma%20=%200"> at fixed <img src="https://latex.codecogs.com/png.latex?q">, and then <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%5Cvarepsilon%5E%5C*/%5Cmathrm%7Bd%7D%5Cln%20q%20=%200"> over <img src="https://latex.codecogs.com/png.latex?q"> - <strong>not</strong> by taking the largest value on a sweep. The difference is not cosmetic: the same search with the root-finds disabled is one of the rows in the break table below.</p>
<div id="13272e8f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:38:33.206310Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:38:33.206178Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:39:10.734281Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:39:10.733367Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> err_pct(g, q, film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb12-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""100 (F_VKH/F_film - 1) at one point of the chart."""</span></span>
<span id="cb12-3">    film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> film <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> film</span>
<span id="cb12-4">    vkh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_a_vkh <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> vkh <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> vkh</span>
<span id="cb12-5">    F, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> film.f_a(g, q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb12-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (vkh(g, q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F</span>
<span id="cb12-7"></span>
<span id="cb12-8"></span>
<span id="cb12-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_worst(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb12-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The worst point of the chart, and the depletion diagnostics there."""</span></span>
<span id="cb12-11">    film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> film <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> film</span>
<span id="cb12-12">    labels <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> LABELS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> labels <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> labels</span>
<span id="cb12-13"></span>
<span id="cb12-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eps(g, q):</span>
<span id="cb12-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> err_pct(g, q, film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>film, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>vkh, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb12-16"></span>
<span id="cb12-17">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> worst_at(q):</span>
<span id="cb12-18">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> argext_log(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: eps(g, q), G_LO, G_HI, n_scan,</span>
<span id="cb12-19">                          rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rootfind)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb12-20"></span>
<span id="cb12-21">    q_star, _, ok_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> argext_log(worst_at, Q_LO, Q_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rootfind)</span>
<span id="cb12-22">    g_star, e_star, ok_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> argext_log(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: eps(g, q_star), G_LO, G_HI,</span>
<span id="cb12-23">                                      n_scan, rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rootfind)</span>
<span id="cb12-24">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>: e_star,</span>
<span id="cb12-25">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_gamma"</span>: g_star,</span>
<span id="cb12-26">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_q"</span>: q_star,</span>
<span id="cb12-27">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_10pct_claim_margin"</span>:</span>
<span id="cb12-28">               printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_vkh_validity_pct"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e_star),</span>
<span id="cb12-29">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_interface_at_worst"</span>: film.f_a(g_star, q_star, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb12-30">           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the p. 340 wording of the same assumption, measured where the</span></span>
<span id="cb12-31">           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># p. 335 wording is most badly violated</span></span>
<span id="cb12-32">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>: film.beta_constancy(g_star, q_star, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw),</span>
<span id="cb12-33">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_on_printed_labels_pct"</span>:</span>
<span id="cb12-34">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>((argext_log(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: eps(g, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L)), G_LO, G_HI,</span>
<span id="cb12-35">                                     n_scan, rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rootfind)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb12-36">                          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> labels), key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>)),</span>
<span id="cb12-37">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_root_found"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(ok_q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ok_g)}</span>
<span id="cb12-38"></span>
<span id="cb12-39">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> beta_at(g):</span>
<span id="cb12-40">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> film.f_a(g, q_star, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb12-41"></span>
<span id="cb12-42">    g_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root_or_edge(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: beta_at(g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, G_LO, G_HI)</span>
<span id="cb12-43">    g_99 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root_or_edge(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: beta_at(g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, G_LO, G_HI)</span>
<span id="cb12-44">    out.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>: g_half,</span>
<span id="cb12-45">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>: g_99,</span>
<span id="cb12-46">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_half_depletion_pct"</span>: eps(g_half, q_star),</span>
<span id="cb12-47">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_99pct_depletion_pct"</span>: eps(g_99, q_star),</span>
<span id="cb12-48">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_full_depletion_pct"</span>: eps(G_HI, q_star),</span>
<span id="cb12-49">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_99pct_depletion"</span>:</span>
<span id="cb12-50">                    film.beta_constancy(g_99, q_star, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw),</span>
<span id="cb12-51">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta_constancy_at_half"</span>: film.beta_constancy(g_half, q_star, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw),</span>
<span id="cb12-52">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta_at_full_depletion"</span>: beta_at(G_HI)})</span>
<span id="cb12-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb12-54"></span>
<span id="cb12-55"></span>
<span id="cb12-56">W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_worst()</span>
<span id="cb12-57">G_STAR, Q_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_gamma"</span>], W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_q"</span>]</span>
<span id="cb12-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"worst error on the chart: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb12-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb12-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (E_i = 1 + q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Q_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb12-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  found by root-finding, not by sampling: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_root_found'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  worst over the ten PRINTED curve labels only:"</span></span>
<span id="cb12-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_on_printed_labels_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb12-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the book's printed claim is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'froment_vkh_validity_pct'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> percent;"</span></span>
<span id="cb12-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" margin </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'froment_10pct_claim_margin'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb12-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">VKH is an UNDER-estimate everywhere it was evaluated:"</span></span>
<span id="cb12-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" sign of the worst error </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sign(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_rel_error_pct'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-68"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, Q_STAR, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">500.0</span>):</span>
<span id="cb12-69">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> argext_log(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: err_pct(g, q), G_LO, G_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb12-70">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   worst over gamma </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>worst error on the chart: -2.7955 %  at gamma = 4.7279, q = 1.5217  (E_i = 1 + q = 2.5217)
  found by root-finding, not by sampling: True
  worst over the ten PRINTED curve labels only: -2.7294 %
  the book's printed claim is 10 percent; margin 3.5772x

VKH is an UNDER-estimate everywhere it was evaluated: sign of the worst error -1
   q =   0.0500   worst over gamma  -0.3134 %
   q =   0.1000   worst over gamma  -0.5928 %
   q =   0.5000   worst over gamma  -1.9984 %
   q =   1.5217   worst over gamma  -2.7955 %
   q =   5.0000   worst over gamma  -1.8067 %
   q =  50.0000   worst over gamma  -0.2769 %
   q = 500.0000   worst over gamma  -0.0282 %</code></pre>
</div>
</div>
</section>
<section id="the-assumption-measured---in-both-of-the-books-wordings" class="level3">
<h3 class="anchored" data-anchor-id="the-assumption-measured---in-both-of-the-books-wordings">3. The assumption, measured - in both of the book’s wordings</h3>
<p><strong>The book states the assumption twice, and the two statements are not the same test.</strong> Book p.&nbsp;335, beside the chart, says the intermediate curves <em>“were calculated by Van Krevelen and Hoftijzer [1948] under the assumption that B is only weakly depleted near the interface”</em> - and adds, in the same breath, <em>“For moderately fast reactions, this assumption was reasonably confirmed by more rigorous computations.”</em> Book p.&nbsp;340, five lines above (6.3.5-1) itself, says they proceeded <em>“by assuming that the concentration of B remains approximately constant close to the interface”</em>.</p>
<p>The first wording is about the <strong>level</strong> of depletion at the interface, which <img src="https://latex.codecogs.com/png.latex?%5Cbeta(0)"> measures exactly. The second is about the <strong>constancy</strong> of <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> over the zone where the reaction happens, which <img src="https://latex.codecogs.com/png.latex?%5Cbeta(0)"> does not measure at all: it is measured here by the rate-weighted mean <img src="https://latex.codecogs.com/png.latex?%5Cbar%5Cbeta%20=%20%5Cint%20%5Calpha%5Cbeta%5Ccdot%5Cbeta%5C,%5Cmathrm%7Bd%7D%5Cxi%20%5Cbig/%0A%5Cint%20%5Calpha%5Cbeta%5C,%5Cmathrm%7Bd%7D%5Cxi"> divided by <img src="https://latex.codecogs.com/png.latex?%5Cbeta(0)">, which is 1 when <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> is constant where it matters. Both are printed below, so the finding does not depend on which wording is tested.</p>
<p><strong>Neither survives as an explanation of the error.</strong> At the worst point <img src="https://latex.codecogs.com/png.latex?B"> at the interface is already down to a sixth of its bulk value and <img src="https://latex.codecogs.com/png.latex?%5Cbar%5Cbeta"> is twice <img src="https://latex.codecogs.com/png.latex?%5Cbeta(0)"> - neither wording is nearly satisfied there - and yet as <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> grows further, with <img src="https://latex.codecogs.com/png.latex?B"> consumed <em>completely</em> and <img src="https://latex.codecogs.com/png.latex?%5Cbar%5Cbeta/%5Cbeta(0)"> running away without bound, the approximation becomes <strong>exact</strong>. The error vanishes at both ends and peaks in between, and the two assumption measures are monotone in <img src="https://latex.codecogs.com/png.latex?%5Cgamma">, so no monotone function of either can order it.</p>
<p>The reason is visible in the profiles: at large <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> the reaction collapses onto a plane and <img src="https://latex.codecogs.com/png.latex?F_A%20%5Cto%201%20+%20q">, a limit the approximation reproduces by construction whatever it assumed on the way there. Note also what the page is <em>not</em> saying: Froment’s own claim on p.&nbsp;335 is qualified to <em>moderately fast</em> reactions, and the worst point found above sits inside that band - between his printed <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20%3E%203"> line and the instantaneous ones - and still errs by less than the 10 percent he prints. Measured, his qualified sentence stands. What fails is the unqualified reading of it, that weak depletion is <em>why</em> the approximation works.</p>
<div id="c177fd54" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:39:10.736420Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:39:10.736183Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:39:15.416484Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:39:15.415672Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two wordings, printed from the CSV rather than retyped here</span></span>
<span id="cb14-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_assumption_p335"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_assumption_p340"</span>):</span>
<span id="cb14-3">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'book p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_page"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quoted(k)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb14-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weakly depleted"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_assumption_p335"</span>)</span>
<span id="cb14-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reasonably confirmed"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_assumption_p335"</span>)</span>
<span id="cb14-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remains approximately constant"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_assumption_p340"</span>)</span>
<span id="cb14-7"></span>
<span id="cb14-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the worst curve of the whole chart:"</span>)</span>
<span id="cb14-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:26s}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta(0)"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_w/beta(0)"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span></span>
<span id="cb14-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_A film"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VKH error"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb14-11">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B half gone"</span>, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb14-12">         W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta_constancy_at_half"</span>], W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_half_depletion_pct"</span>]),</span>
<span id="cb14-13">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the worst point"</span>, G_STAR, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_interface_at_worst"</span>],</span>
<span id="cb14-14">         W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>], W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>]),</span>
<span id="cb14-15">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B 99 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% g</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">one"</span>, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb14-16">         W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_99pct_depletion"</span>],</span>
<span id="cb14-17">         W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_99pct_depletion_pct"</span>]),</span>
<span id="cb14-18">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B gone (axis end)"</span>, G_HI, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta_at_full_depletion"</span>],</span>
<span id="cb14-19">         <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_full_depletion_pct"</span>])]</span>
<span id="cb14-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, g, b, c, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows:</span>
<span id="cb14-21">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:24s}{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-22">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'-'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-23">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>f_a(g, Q_STAR)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.5f}{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+11.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb14-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  p.335's test, beta(0), falls monotonically;  p.340's test,"</span></span>
<span id="cb14-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" beta_w/beta(0), rises monotonically;"</span>)</span>
<span id="cb14-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the error does NEITHER - it peaks at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and vanishes"</span></span>
<span id="cb14-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at both ends of the range."</span>)</span>
<span id="cb14-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  beta(0) at the axis end is numerically zero: the solve returns"</span></span>
<span id="cb14-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_beta_at_full_depletion'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, whose"</span>)</span>
<span id="cb14-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  magnitude is far below anything this discretisation resolves and whose"</span></span>
<span id="cb14-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" sign is round-off, so the"</span>)</span>
<span id="cb14-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  page states the order and not a bound with digits - and the constancy"</span></span>
<span id="cb14-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ratio, which divides by"</span>)</span>
<span id="cb14-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  it, is left out of that row rather than printed as a number."</span>)</span>
<span id="cb14-35">G_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb14-36">B_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF.f_a(G_MID, Q_STAR)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb14-37">C_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF.beta_constancy(G_MID, Q_STAR)</span>
<span id="cb14-38">E_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> err_pct(G_MID, Q_STAR)</span>
<span id="cb14-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  One decade lower, where beta(0) is still meaningful:  at gamma ="</span></span>
<span id="cb14-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, beta(0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and beta_w/beta(0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so p.340's constancy assumption is out by"</span></span>
<span id="cb14-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(C_MID)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> orders of"</span>)</span>
<span id="cb14-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  magnitude - and the error there is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,"</span></span>
<span id="cb14-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_rel_error_pct'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E_MID)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times SMALLER"</span></span>
<span id="cb14-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" than at the worst point."</span>)</span>
<span id="cb14-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The constancy ratio is EXTRAPOLATED like everything else, and it has to be:</span></span>
<span id="cb14-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a ratio of two integrals of the same profile does NOT cancel the grid once</span></span>
<span id="cb14-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># beta is a thin exponential.  Both gaps are measured here, not asserted.</span></span>
<span id="cb14-49">C_FINE_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FILM.beta_constancy(G_STAR, Q_STAR)</span>
<span id="cb14-50">C_FINE_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FILM.beta_constancy(G_MID, Q_STAR)</span>
<span id="cb14-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the constancy ratio is Richardson-extrapolated on the same two grids"</span></span>
<span id="cb14-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" as F_A, and needs to be:"</span>)</span>
<span id="cb14-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    at the worst point the fine n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grid alone gives"</span></span>
<span id="cb14-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_FINE_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beta_constancy_at_worst'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(C_FINE_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beta_constancy_at_worst'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> it gives"</span></span>
<span id="cb14-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_FINE_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(C_FINE_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> C_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  so the grid all but cancels where the headline lives and does NOT at the"</span></span>
<span id="cb14-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" top of the range: the"</span>)</span>
<span id="cb14-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  one-grid shortcut on this diagnostic would cost"</span></span>
<span id="cb14-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(C_FINE_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> C_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(C_FINE_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beta_constancy_at_worst'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" times more at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  than at the point it would be justified on, which is why it is not taken."</span>)</span>
<span id="cb14-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the two depletion thresholds are ROOT-FOUND on beta(0), not sampled:"</span></span>
<span id="cb14-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  beta(0) = 0.5  at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gamma_at_half_depletion'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>f_a(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gamma_at_half_depletion'</span>], Q_STAR)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb14-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  beta(0) = 0.01 at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gamma_at_99pct_depletion'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>f_a(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gamma_at_99pct_depletion'</span>], Q_STAR)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-70"></span>
<span id="cb14-71"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the error map, and the depletion contours on top of it ----------------</span></span>
<span id="cb14-72">GG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(G_LO, G_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>)</span>
<span id="cb14-73">QQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(Q_LO, Q_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>)</span>
<span id="cb14-74">EPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((QQ.size, GG.size))</span>
<span id="cb14-75">BET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros_like(EPS)</span>
<span id="cb14-76"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(QQ):</span>
<span id="cb14-77">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(GG):</span>
<span id="cb14-78">        F, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FILM.f_a(g, q)</span>
<span id="cb14-79">        EPS[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (f_a_vkh(g, q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F</span>
<span id="cb14-80">        BET[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b</span>
<span id="cb14-81"></span>
<span id="cb14-82">EPS_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EPS.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb14-83">VKH_ALWAYS_UNDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(EPS_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb14-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">over the whole </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-point map the largest error is"</span></span>
<span id="cb14-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EPS_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %: VKH under-estimates everywhere it was evaluated"</span></span>
<span id="cb14-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VKH_ALWAYS_UNDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this one is a THEOREM and the map only illustrates it, so it is a check that"</span></span>
<span id="cb14-88">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">could only fail by numerical accident:  alpha'' = gamma^2 alpha beta &gt;= 0,"</span></span>
<span id="cb14-89">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" so alpha' rises"</span></span>
<span id="cb14-90">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">from alpha'(0) = -F_A and beta' = (alpha' + F_A)/q &gt;= 0, i.e. beta(xi) &gt;="</span></span>
<span id="cb14-91">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" beta(0) everywhere."</span></span>
<span id="cb14-92">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Write T(F) for the pseudo-first-order enhancement with beta frozen at"</span></span>
<span id="cb14-93">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1 - (F-1)/q, which is"</span></span>
<span id="cb14-94">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">exactly beta(0); (6.3.5-1) says F_VKH = T(F_VKH).  The true film sees"</span></span>
<span id="cb14-95">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" beta &gt;= beta(0), hence"</span></span>
<span id="cb14-96">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">F_film &gt;= T(F_film); T is strictly decreasing, so F - T(F) is strictly"</span></span>
<span id="cb14-97">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" increasing and"</span></span>
<span id="cb14-98">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">F_film &gt;= F_VKH for EVERY (gamma, q).  The map is drawn on the single"</span></span>
<span id="cb14-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> graded"</span></span>
<span id="cb14-100">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">grid, which is enough for a sign; every NUMBER reported comes from the"</span></span>
<span id="cb14-101">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" extrapolated reference."</span>)</span>
<span id="cb14-102"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the worst point sits at gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, on the film side of the"</span></span>
<span id="cb14-103">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" book's own regime line - it prints"</span></span>
<span id="cb14-104">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f' "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_film_completion_gamma"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">" (book p.'</span></span>
<span id="cb14-105">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_film_completion_gamma"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_page"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) and'</span></span>
<span id="cb14-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f' "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quoted(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_bulk_reaction_gamma"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span>
<span id="cb14-107"></span>
<span id="cb14-108">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.4</span>))</span>
<span id="cb14-109">cf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].contourf(GG, QQ, EPS, levels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>), cmap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"viridis"</span>)</span>
<span id="cb14-110"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _g, _ls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_bulk_reaction_gamma"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>),</span>
<span id="cb14-111">                (printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_film_completion_gamma"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-."</span>)):</span>
<span id="cb14-112">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> G_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> _g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> G_HI:</span>
<span id="cb14-113">        axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axvline(_g, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"w"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_ls)</span>
<span id="cb14-114">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].contour(GG, QQ, BET, levels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>], colors<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[C_ORANGE, C_YELLOW],</span>
<span id="cb14-115">                linewidths<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>)</span>
<span id="cb14-116">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot([G_STAR], [Q_STAR], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, mec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb14-117">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_yscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb14-118">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$q = E_i - 1$"</span>)</span>
<span id="cb14-119">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VKH error [%]; orange $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">beta(0)=0.01$, yellow $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">beta(0)=0.5$,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-120">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"star = the root-found worst point"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb14-121">fig.colorbar(cf, ax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb14-122"></span>
<span id="cb14-123"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, g, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B half gone"</span>, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>], C_YELLOW),</span>
<span id="cb14-124">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"worst point"</span>, G_STAR, C_ORANGE),</span>
<span id="cb14-125">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B 99 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% g</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">one"</span>, W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>], C_BLUE)):</span>
<span id="cb14-126">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FILM.solve(g, Q_STAR)</span>
<span id="cb14-127">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(FILM.x_c, u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb14-128">                 label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">lpha</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-129">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(FILM.x_c, u[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)</span>
<span id="cb14-130">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb14-131">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">xi = y/y_L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-132">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dimensionless concentration"</span>)</span>
<span id="cb14-133">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"profiles at q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb14-134">                  <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"solid </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">lpha</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gas </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, dashed </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">reactant </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">B</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-135">                  fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb14-136">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>)</span>
<span id="cb14-137">fig.tight_layout()</span>
<span id="cb14-138">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>book p.335  "They were calculated by Van Krevelen and Hoftijzer [1948] under the assumption that B is only weakly depleted near the interface. For moderately fast reactions, this assumption was reasonably confirmed by more rigorous computations."

book p.340  "Van Krevelen and Hoftijzer [1948] dealt with this situation in a way analogous to that applied to pseudo-first-order kinetics, namely, by assuming that the concentration of B remains approximately constant close to the interface."

at q = 1.5217, the worst curve of the whole chart:
                               gamma     beta(0)  beta_w/beta(0)    F_A film   VKH error
  B half gone                 2.2036  5.0000e-01           1.208     1.76086   -1.83044 %
  the worst point             4.7279  1.6474e-01           2.115     2.27104   -2.79546 %
  B 99 % gone                13.0378  1.0000e-02            19.2     2.50651   -1.50346 %
  B gone (axis end)        1000.0000 -9.2757e-58               -     2.52173   -0.00037 %

  p.335's test, beta(0), falls monotonically;  p.340's test, beta_w/beta(0), rises monotonically;
  the error does NEITHER - it peaks at gamma = 4.7279 and vanishes at both ends of the range.
  beta(0) at the axis end is numerically zero: the solve returns -9.3e-58, whose
  magnitude is far below anything this discretisation resolves and whose sign is round-off, so the
  page states the order and not a bound with digits - and the constancy ratio, which divides by
  it, is left out of that row rather than printed as a number.

  One decade lower, where beta(0) is still meaningful:  at gamma = 100, beta(0) = 1.367e-11
  and beta_w/beta(0) = 3.684e+09, so p.340's constancy assumption is out by 10 orders of
  magnitude - and the error there is -0.0373 %, 75 times SMALLER than at the worst point.

  the constancy ratio is Richardson-extrapolated on the same two grids as F_A, and needs to be:
    at the worst point the fine n_x = 800 grid alone gives 2.11523 against 2.11523   (2.4e-06)
    at gamma = 100 it gives 3.65698e+09 against 3.68373e+09   (7.3e-03)
  so the grid all but cancels where the headline lives and does NOT at the top of the range: the
  one-grid shortcut on this diagnostic would cost 3030 times more at gamma = 100
  than at the point it would be justified on, which is why it is not taken.

the two depletion thresholds are ROOT-FOUND on beta(0), not sampled:
  beta(0) = 0.5  at gamma = 2.203565   (residual +2.83e-11)
  beta(0) = 0.01 at gamma = 13.037820   (residual -1.76e-13)

over the whole 612-point map the largest error is -2.780e-06 %: VKH under-estimates everywhere it was evaluated (True)
this one is a THEOREM and the map only illustrates it, so it is a check that
could only fail by numerical accident:  alpha'' = gamma^2 alpha beta &gt;= 0, so alpha' rises
from alpha'(0) = -F_A and beta' = (alpha' + F_A)/q &gt;= 0, i.e. beta(xi) &gt;= beta(0) everywhere.
Write T(F) for the pseudo-first-order enhancement with beta frozen at 1 - (F-1)/q, which is
exactly beta(0); (6.3.5-1) says F_VKH = T(F_VKH).  The true film sees beta &gt;= beta(0), hence
F_film &gt;= T(F_film); T is strictly decreasing, so F - T(F) is strictly increasing and
F_film &gt;= F_VKH for EVERY (gamma, q).  The map is drawn on the single n_x = 800 graded
grid, which is enough for a sign; every NUMBER reported comes from the extrapolated reference.
the worst point sits at gamma = 4.7279, on the film side of the book's own regime line - it prints "The reaction is essentially completed in the film when gamma &gt; 3" (book p.331) and "whereas it takes place mainly in the bulk when gamma &lt; 0.3"</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/F3.2-van-krevelen-hoftijzer/index_files/figure-html/cell-9-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="levenspiels-three-expansions-and-what-each-one-expands" class="level3">
<h3 class="anchored" data-anchor-id="levenspiels-three-expansions-and-what-each-one-expands">4. Levenspiel’s three expansions, and what each one expands</h3>
<p>Levenspiel prints three “more precisely” corrections in the annotation boxes of Fig. 23.4. They are an independent transcription of the same result by a different author in a different notation, so every constant in them checks a constant in Froment’s equation - and the two of them that can be checked against the <em>film equations</em> as well turn out to behave very differently.</p>
<ul>
<li><strong>Small <img src="https://latex.codecogs.com/png.latex?M_H">:</strong> <img src="https://latex.codecogs.com/png.latex?E%20%5Ccong%201%20+%20M_H%5E2/3">. This is the Taylor series of <img src="https://latex.codecogs.com/png.latex?%5Cgamma/%5Ctanh%5Cgamma">, so the constant 3 checks Froment’s (6.3.2-11) directly. It is good to 1 % up to a root-found <img src="https://latex.codecogs.com/png.latex?M_H"> reported below.</li>
<li><strong>Pseudo-first-order branch,</strong> declared for <img src="https://latex.codecogs.com/png.latex?E_i%20%3E%205M_H">: <img src="https://latex.codecogs.com/png.latex?E%20=%20M_H%5Cleft(1%20-%20(M_H-1)/2E_i%5Cright)">. Expanding Froment’s (6.3.5-1) in the same limit gives the same expression with <img src="https://latex.codecogs.com/png.latex?E_i%20-%201"> where Levenspiel prints <img src="https://latex.codecogs.com/png.latex?E_i"> - the difference between the two books’ groups, second order in that branch. Both are evaluated against the film solve at the boundary of the declared domain.</li>
<li><strong>Instantaneous branch,</strong> declared for <img src="https://latex.codecogs.com/png.latex?E_i%20%3C%20M_H/5">: <img src="https://latex.codecogs.com/png.latex?E%20%5Ccong%20E_i%20-%20E_i%5E2(E_i-1)/M_H%5E2">. <strong>This one is the asymptote of the approximation, not of the equations,</strong> and both halves of that statement are exact rather than empirical. Put <img src="https://latex.codecogs.com/png.latex?F_A%20=%201%20+%20q%20-%20d"> into (6.3.5-1): for large <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> it gives <img src="https://latex.codecogs.com/png.latex?%5Cgamma%5Csqrt%7Bd/q%7D%20%5Cto%201%20+%20q">, i.e. <img src="https://latex.codecogs.com/png.latex?d%20%5Cto%20q(1+q)%5E2/%5Cgamma%5E2">, which in Levenspiel’s symbols <em>is</em> <img src="https://latex.codecogs.com/png.latex?E_i%5E2(E_i-1)/M_H%5E2">. The film’s own deficit, on the other hand, is fixed by the first integral of the two film equations, <img src="https://latex.codecogs.com/png.latex?q%5C,%5Cbeta(0)%20=%201%20+%20q%20-%20F_A">: it equals <img src="https://latex.codecogs.com/png.latex?q%5C,%5Cbeta(0)"> identically, and <img src="https://latex.codecogs.com/png.latex?%5Cbeta(0)"> is the interfacial value of a reaction layer whose thickness goes as <img src="https://latex.codecogs.com/png.latex?1/%5Cgamma">, so it is exponentially small and can follow no power law at all. The measured local exponent steepens over successive octaves, and the printed correction runs further and further above the truth.</li>
</ul>
<div id="2ab184ca" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:39:15.419592Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:39:15.419407Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:39:17.082627Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:39:17.081810Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1">DEFICIT_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">200.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>)</span>
<span id="cb16-2"></span>
<span id="cb16-3"></span>
<span id="cb16-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_lev(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, small_coeff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, pfo_denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb16-5">              pfo_offset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, inst_power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, deficit_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb16-6">              bvp_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb16-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel's three printed expansions, tested against both routes."""</span></span>
<span id="cb16-8">    film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> film <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> film</span>
<span id="cb16-9">    vkh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_a_vkh <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> vkh <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> vkh</span>
<span id="cb16-10">    c3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_small_M_coeff"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> small_coeff <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> small_coeff</span>
<span id="cb16-11">    c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_correction_denom"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pfo_denom <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> pfo_denom</span>
<span id="cb16-12">    c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_correction_offset"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pfo_offset <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> pfo_offset</span>
<span id="cb16-13">    cp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_correction_power"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inst_power <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> inst_power</span>
<span id="cb16-14">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb16-15"></span>
<span id="cb16-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) the small-M_H expansion, 1 % threshold ROOT-FOUND</span></span>
<span id="cb16-17">    q_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span></span>
<span id="cb16-18">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_small_M_1pct_threshold"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> root_log(</span>
<span id="cb16-19">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c3) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> film.f_a(m, q_a, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb16-20">        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb16-21"></span>
<span id="cb16-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) the pseudo-first-order branch, AT the boundary E_i = 5 M_H it declares</span></span>
<span id="cb16-23">    m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span></span>
<span id="cb16-24">    Ei_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_threshold"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> m_b</span>
<span id="cb16-25">    q_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ei_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb16-26">    F_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> film.f_a(m_b, q_b, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb16-27">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_expansion_err_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb16-28">        m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Ei_b)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb16-29">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_form_pfo_expansion_err_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb16-30">        m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> q_b)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb16-31">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uncorrected_E_eq_M_err_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb16-32"></span>
<span id="cb16-33">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (c) the instantaneous branch</span></span>
<span id="cb16-34">    Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span></span>
<span id="cb16-35">    q_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb16-36">    fd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> film <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> deficit_film <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> deficit_film</span>
<span id="cb16-37"></span>
<span id="cb16-38">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pred(m):</span>
<span id="cb16-39">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Ei_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>cp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-40"></span>
<span id="cb16-41">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dnum(m):</span>
<span id="cb16-42">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> fd.f_a(m, q_c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb16-43"></span>
<span id="cb16-44">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_vkh"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vkh(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>, q_c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pred(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>)</span>
<span id="cb16-45">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_num"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dnum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pred(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>)</span>
<span id="cb16-46">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_overstatement_factor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pred(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dnum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>)</span>
<span id="cb16-47">    dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [dnum(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DEFICIT_M]</span>
<span id="cb16-48">    dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vkh(m, q_c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DEFICIT_M]</span>
<span id="cb16-49">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># abs() only so that a break row which drives a deficit negative still</span></span>
<span id="cb16-50">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># returns a number instead of a nan; every baseline deficit is positive.</span></span>
<span id="cb16-51">    ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a[i]))</span>
<span id="cb16-52">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log(DEFICIT_M[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DEFICIT_M[i]))</span>
<span id="cb16-53">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (dn, dv) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DEFICIT_M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb16-54">    n_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DEFICIT_M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb16-55">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_num_steepest"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(ex[:n_gap])</span>
<span id="cb16-56">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_vkh_finest"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ex[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb16-57">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_exponents_num"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_exponents_vkh"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ex[:n_gap], ex[n_gap:]</span>
<span id="cb16-58">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_deficit_num"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_deficit_vkh"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dn, dv</span>
<span id="cb16-59">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># TWO INDEPENDENT METHODS, one of them also refined - not three routes.</span></span>
<span id="cb16-60">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pymrm finite volumes and scipy's collocation share no assembly; the</span></span>
<span id="cb16-61">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># middle entry is the same assembly on a finer, differently graded mesh, so</span></span>
<span id="cb16-62">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it prices the discretisation of the first and not its formulation.</span></span>
<span id="cb16-63">    alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> graded_film(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> fd.n_x, fd.stretch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb16-64">    three <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [dnum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>), Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> alt.f_a(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>, q_c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb16-65">             Ei_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f_a_bvp(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>, q_c, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bvp_tol)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb16-66">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(three) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(three) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb16-67">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_three"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> three</span>
<span id="cb16-68">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the EXACT reason the film deficit has no power law: the first integral of</span></span>
<span id="cb16-69">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two film equations makes it q*beta(0) identically, and beta(0) at the</span></span>
<span id="cb16-70">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interface is exponentially small in gamma.</span></span>
<span id="cb16-71">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta0_at_deficit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fd.f_a(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>, q_c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb16-72">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb16-73"></span>
<span id="cb16-74"></span>
<span id="cb16-75">L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_lev()</span>
<span id="cb16-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(a) 1 + M_H^2/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_small_M_coeff'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> stays within 1 % of the film"</span></span>
<span id="cb16-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" solve up to M_H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_small_M_1pct_threshold'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (root-found)"</span>)</span>
<span id="cb16-78">_m, _Ei <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_threshold"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span></span>
<span id="cb16-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(b) at the declared boundary E_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_pfo_threshold'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> M_H,"</span></span>
<span id="cb16-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" with M_H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and E_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_Ei<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb16-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      E = M_H                              </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'uncorrected_E_eq_M_err_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb16-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      Levenspiel, printed 2 E_i            </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_pfo_expansion_err_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb16-83"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      same expansion of (6.3.5-1), 2(E_i-1)</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_form_pfo_expansion_err_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb16-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    -&gt; the correction is worth"</span></span>
<span id="cb16-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'uncorrected_E_eq_M_err_pct'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_pfo_expansion_err_pct'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x,"</span></span>
<span id="cb16-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and the two books' groups differ by"</span></span>
<span id="cb16-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_pfo_expansion_err_pct'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_form_pfo_expansion_err_pct'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" percentage points there"</span>)</span>
<span id="cb16-89"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(c) instantaneous branch, E_i = 20:  deficit E_i - E against the printed"</span></span>
<span id="cb16-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" E_i^2(E_i-1)/M_H^2"</span>)</span>
<span id="cb16-91"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M_H"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film solve"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VKH"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed/film"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb16-92"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m, dn, dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(DEFICIT_M, L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_deficit_num"</span>], L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_deficit_vkh"</span>]):</span>
<span id="cb16-93">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-94">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.0f}{</span>dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.4e}{</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.4e}{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.4e}{</span>p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  local exponent d ln(deficit)/d ln M_H, octave by octave"</span>)</span>
<span id="cb16-96"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    film solve : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(e, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_exponents_num'</span>]]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-97"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    VKH        : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(e, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_exponents_vkh'</span>]]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-98"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the VKH deficit converges on the printed -2; the film solve's does not"</span></span>
<span id="cb16-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the M_H = 800 deficit by TWO INDEPENDENT METHODS, the first also refined:"</span></span>
<span id="cb16-100">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    pymrm FV, extrapolated (n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, s = 8)"</span></span>
<span id="cb16-101">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_three'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-102">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    pymrm FV, n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, s = 9 (the same assembly, refined)  "</span></span>
<span id="cb16-103">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_three'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-104">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    scipy collocation (no assembly in common)               "</span></span>
<span id="cb16-105">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_three'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  max relative spread below 1e-3 (here"</span></span>
<span id="cb16-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inst_deficit_routes_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the M_H = 800 deficit, E_i - F_A,"</span></span>
<span id="cb16-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  is about 1.3e-5 of F_A, so its last digits differ between BLAS"</span></span>
<span id="cb16-109">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" kernels) - far below the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_inst_overstatement_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x it is"</span></span>
<span id="cb16-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" being used to establish"</span>)</span>
<span id="cb16-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHY there can be no power law, exactly.  Subtracting the two film"</span></span>
<span id="cb16-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" equations gives"</span></span>
<span id="cb16-113">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (beta - alpha/q)'' = 0, and the four boundary conditions close it:"</span></span>
<span id="cb16-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" q beta(0) = 1 + q - F_A"</span></span>
<span id="cb16-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  identically, so the film deficit E_i - E IS q beta(0) - and beta(0) is"</span></span>
<span id="cb16-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the interfacial"</span></span>
<span id="cb16-117">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  value of a WKB-thin reaction layer, exponentially small in M_H."</span></span>
<span id="cb16-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  At M_H = 800 the film"</span></span>
<span id="cb16-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  solve gives beta(0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_beta0_at_deficit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so"</span></span>
<span id="cb16-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" q beta(0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_beta0_at_deficit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the deficit"</span></span>
<span id="cb16-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_three'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb16-122"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The VKH deficit, by contrast, is a power law exactly: putting"</span></span>
<span id="cb16-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" F_A = 1 + q - d in (6.3.5-1)"</span></span>
<span id="cb16-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  gives gamma sqrt(d/q) -&gt; 1 + q, i.e. d -&gt; q(1+q)^2/gamma^2, which in"</span></span>
<span id="cb16-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Levenspiel's symbols"</span></span>
<span id="cb16-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  IS E_i^2(E_i - 1)/M_H^2.  His 'more precisely' correction is the"</span></span>
<span id="cb16-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ALGEBRAIC ASYMPTOTE OF THE"</span></span>
<span id="cb16-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  APPROXIMATION, not of the equations - which is why it tracks VKH to"</span></span>
<span id="cb16-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_inst_asymptote_ratio_vkh'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and the film"</span></span>
<span id="cb16-130">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  solve to only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lev_inst_asymptote_ratio_num'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb16-131"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  And 44x too big is 44x of a small correction: at M_H = 800 the"</span></span>
<span id="cb16-132">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" uncorrected E = E_i is already"</span></span>
<span id="cb16-133">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_three'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the film solve, so"</span></span>
<span id="cb16-134">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Levenspiel's correction is there WORSE than"</span></span>
<span id="cb16-135">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  leaving it out - it moves E away from the truth by"</span></span>
<span id="cb16-136">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_three'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> percentage"</span></span>
<span id="cb16-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" points."</span>)</span>
<span id="cb16-138"></span>
<span id="cb16-139">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>))</span>
<span id="cb16-140">MM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>)</span>
<span id="cb16-141">ax.loglog(MM, [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f_a_vkh(m, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MM], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb16-142">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VKH (6.3.5-1)"</span>)</span>
<span id="cb16-143">ax.loglog(MM, [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF.f_a(m, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MM], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb16-144">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film solve (pymrm)"</span>)</span>
<span id="cb16-145">ax.loglog(MM, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> MM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>,</span>
<span id="cb16-146">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"printed </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">E_i</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">E_i-1</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/M_H</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-147">ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$M_H$"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$E_i - E$"</span>)</span>
<span id="cb16-148">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"What Levenspiel's instantaneous correction expands</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-149">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"($E_i$ = 20; the printed curve tracks the approximation)"</span>,</span>
<span id="cb16-150">             fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb16-151">ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb16-152">fig.tight_layout()</span>
<span id="cb16-153">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>(a) 1 + M_H^2/3 stays within 1 % of the film solve up to M_H = 0.7231  (root-found)

(b) at the declared boundary E_i = 5 M_H, with M_H = 10 and E_i = 50:
      E = M_H                               +9.3004 %
      Levenspiel, printed 2 E_i             -0.5366 %
      same expansion of (6.3.5-1), 2(E_i-1) -0.7374 %
    -&gt; the correction is worth 17.33x, and the two books' groups differ by 0.2008 percentage points there

(c) instantaneous branch, E_i = 20:  deficit E_i - E against the printed E_i^2(E_i-1)/M_H^2
     M_H    film solve           VKH       printed  printed/film
      50    2.2491e+00    2.3639e+00    3.0400e+00          1.35
     100    5.9591e-01    7.0720e-01    7.6000e-01          1.28
     200    1.0985e-01    1.8647e-01    1.9000e-01          1.73
     400    1.0860e-02    4.7276e-02    4.7500e-02          4.37
     800    2.6840e-04    1.1861e-02    1.1875e-02         44.24
  local exponent d ln(deficit)/d ln M_H, octave by octave
    film solve : [-1.9162, -2.4396, -3.3385, -5.3385]
    VKH        : [-1.7409, -1.9232, -1.9798, -1.9949]
  the VKH deficit converges on the printed -2; the film solve's does not
  the M_H = 800 deficit by TWO INDEPENDENT METHODS, the first also refined:
    pymrm FV, extrapolated (n_x = 400, 800, s = 8)  2.684e-04
    pymrm FV, n_x = 1600, s = 9 (the same assembly, refined)  2.684e-04
    scipy collocation (no assembly in common)               2.684e-04
  max relative spread below 1e-3 (here 8.6e-05; the M_H = 800 deficit, E_i - F_A,
  is about 1.3e-5 of F_A, so its last digits differ between BLAS kernels) - far below the
  44.2x it is being used to establish

  WHY there can be no power law, exactly.  Subtracting the two film equations gives
  (beta - alpha/q)'' = 0, and the four boundary conditions close it: q beta(0) = 1 + q - F_A
  identically, so the film deficit E_i - E IS q beta(0) - and beta(0) is the interfacial
  value of a WKB-thin reaction layer, exponentially small in M_H.  At M_H = 800 the film
  solve gives beta(0) = 1.4126e-05, so q beta(0) = 2.6840e-04 against the deficit 2.6840e-04.
  The VKH deficit, by contrast, is a power law exactly: putting F_A = 1 + q - d in (6.3.5-1)
  gives gamma sqrt(d/q) -&gt; 1 + q, i.e. d -&gt; q(1+q)^2/gamma^2, which in Levenspiel's symbols
  IS E_i^2(E_i - 1)/M_H^2.  His 'more precisely' correction is the ALGEBRAIC ASYMPTOTE OF THE
  APPROXIMATION, not of the equations - which is why it tracks VKH to 0.9953 and the film
  solve to only 0.2286.
  And 44x too big is 44x of a small correction: at M_H = 800 the uncorrected E = E_i is already
  within 0.00134 % of the film solve, so Levenspiel's correction is there WORSE than
  leaving it out - it moves E away from the truth by 0.05803 percentage points.</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/F3.2-van-krevelen-hoftijzer/index_files/figure-html/cell-10-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Six checks, none of which uses fitted data because there is none. Two of them are about the <strong>baseline itself</strong>, because the whole page is a set of errors quoted against it: the extrapolated reference is compared with an independent solver family and with a finer extrapolation of itself, and the grid study is run on the graded <em>and</em> the uniform grid so that what grading buys and what it costs are both on the page.</p>
<div id="3f2ae361" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:39:17.085007Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:39:17.084726Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:39:20.855099Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:39:20.854205Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_routes(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, newton_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>,</span>
<span id="cb18-2">                 bvp_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, bc_beta_bulk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dirichlet"</span>, n_grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>),</span>
<span id="cb18-3">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb18-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Two solvers for the film, two for the implicit relation, and the grid."""</span></span>
<span id="cb18-5">    film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FILM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> film <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> film</span>
<span id="cb18-6">    ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ref <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ref</span>
<span id="cb18-7">    vkh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_a_vkh <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> vkh <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> vkh</span>
<span id="cb18-8">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> film.stretch <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> stretch <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> stretch</span>
<span id="cb18-9">    pts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(g, q) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">99.0</span>)</span>
<span id="cb18-10">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)]</span>
<span id="cb18-11">    col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {p: f_a_bvp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>p, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bvp_tol) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts}</span>
<span id="cb18-12">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb18-13">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-14">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(film.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> col[(g, q)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb18-15">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts)),</span>
<span id="cb18-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_abs_diff_beta"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-17">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(film.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> col[(g, q)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb18-18">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts)),</span>
<span id="cb18-19">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the SAME comparison for the baseline this page actually reports</span></span>
<span id="cb18-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs_bvp_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-21">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ref.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> col[(g, q)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb18-22">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts)),</span>
<span id="cb18-23">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the baseline against a finer extrapolation of itself: the</span></span>
<span id="cb18-24">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># refinement evidence for the reference, not for one grid of it</span></span>
<span id="cb18-25">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_self_refinement_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-26">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ref.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-27">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_FINE.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb18-28">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts)),</span>
<span id="cb18-29">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the first integral of the two film equations, which no discretisation</span></span>
<span id="cb18-30">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is told about: q beta(0) = 1 + q - F_A.  Normalised by 1 + q because</span></span>
<span id="cb18-31">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at large gamma both sides are round-off.</span></span>
<span id="cb18-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_integral_max_abs_resid"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-33">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ref.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb18-34">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref.f_a(g, q, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q)</span>
<span id="cb18-35">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts)),</span>
<span id="cb18-36">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_two_routes_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-37">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vkh(g, q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> f_a_vkh_route_b(g, q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts)),</span>
<span id="cb18-38">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_pfo_limit_max_rel_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb18-39">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vkh(g, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e10</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb18-40">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.geomspace(G_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">300.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>))),</span>
<span id="cb18-41">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_instantaneous_limit_rel_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vkh(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb18-42">    }</span>
<span id="cb18-43">    g_ref, q_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span></span>
<span id="cb18-44">    exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_a_bvp(g_ref, q_ref, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-45"></span>
<span id="cb18-46">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> errs_on(st):</span>
<span id="cb18-47">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Film(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>st, bc_beta_bulk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bc_beta_bulk)</span>
<span id="cb18-48">                    .f_a(g_ref, q_ref, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>newton_tol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb18-49">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n_grid]</span>
<span id="cb18-50"></span>
<span id="cb18-51">    errs, errs_u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> errs_on(s), errs_on(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb18-52">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_convergence_order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb18-53">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb18-54">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT GRADING COSTS, at the same n and against the same reference</span></span>
<span id="cb18-55">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800_uniform"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(errs_u[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb18-56">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_grid_errs"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_grid_errs_uniform"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> errs, errs_u</span>
<span id="cb18-57">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb18-58"></span>
<span id="cb18-59"></span>
<span id="cb18-60">R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_routes()</span>
<span id="cb18-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1. the film, two solver families, over 20 points of the chart"</span>)</span>
<span id="cb18-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |pymrm n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / collocation - 1| on F_A :"</span></span>
<span id="cb18-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_vs_bvp_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |difference| on beta(0)                : "</span></span>
<span id="cb18-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_vs_bvp_max_abs_diff_beta'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">2. THE BASELINE ITSELF - Richardson(n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span></span>
<span id="cb18-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" which is what every"</span>)</span>
<span id="cb18-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   number on this page is quoted against"</span>)</span>
<span id="cb18-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |reference / collocation - 1|          : "</span></span>
<span id="cb18-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref_vs_bvp_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |reference / a finer extrapolation - 1|: "</span></span>
<span id="cb18-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref_self_refinement_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (Richardson </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb18-74"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   -&gt; the reference is converged </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_vs_bvp_max_rel_diff'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref_vs_bvp_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span></span>
<span id="cb18-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" better than the single n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> solve it"</span>)</span>
<span id="cb18-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      is built from, which is the whole reason it exists"</span>)</span>
<span id="cb18-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">3. the first integral q beta(0) = 1 + q - F_A, which the discretisation"</span></span>
<span id="cb18-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is never told"</span>)</span>
<span id="cb18-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |q beta(0) - (1 + q - F_A)| / (1 + q)  : "</span></span>
<span id="cb18-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'first_integral_max_abs_resid'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">4. grid refinement at (gamma, q) = (10, 4), against the collocation solve"</span>)</span>
<span id="cb18-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6s}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graded s = 8"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"graded/uniform"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;17}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb18-83"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, e, eu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>),</span>
<span id="cb18-84">                    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_grid_errs"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_grid_errs_uniform"</span>]):</span>
<span id="cb18-85">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6s}{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7d}{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.4e}{</span>eu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.4e}{</span>e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:17.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb18-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_convergence_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (expected 2)"</span>)</span>
<span id="cb18-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   AT THIS POINT GRADING IS A LIABILITY: at the same n_x the graded grid is"</span></span>
<span id="cb18-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_rel_error_n800'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_rel_error_n800_uniform'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x LESS"</span></span>
<span id="cb18-89">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" accurate than a uniform one, because its outer cells are"</span></span>
<span id="cb18-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FILM.x_f[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FILM.n_x)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x wider."</span></span>
<span id="cb18-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Grading earns its place at the other end of the chart"</span></span>
<span id="cb18-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (see the pseudo-first-order check below), and the extrapolated"</span></span>
<span id="cb18-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reference is how"</span></span>
<span id="cb18-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   this page has both."</span>)</span>
<span id="cb18-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">5. the implicit relation, two unknowns"</span>)</span>
<span id="cb18-96"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |solve-for-F_A / solve-for-gamma' - 1| : "</span></span>
<span id="cb18-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_two_routes_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-98"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">6. the two limits (6.3.5-1) must reproduce"</span>)</span>
<span id="cb18-99"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   q -&gt; inf gives gamma/tanh gamma, max rel : "</span></span>
<span id="cb18-100">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_pfo_limit_max_rel_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-101"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   gamma -&gt; inf gives 1 + q, rel            : "</span></span>
<span id="cb18-102">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_instantaneous_limit_rel_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>1. the film, two solver families, over 20 points of the chart
   max |pymrm n_x = 800 / collocation - 1| on F_A : 5.988e-06
   max |difference| on beta(0)                : 2.913e-06

2. THE BASELINE ITSELF - Richardson(n_x = 400, 800), which is what every
   number on this page is quoted against
   max |reference / collocation - 1|          : 4.369e-08
   max |reference / a finer extrapolation - 1|: 3.841e-08   (Richardson 800, 1600)
   -&gt; the reference is converged 137x better than the single n_x = 800 solve it
      is built from, which is the whole reason it exists

3. the first integral q beta(0) = 1 + q - F_A, which the discretisation is never told
   max |q beta(0) - (1 + q - F_A)| / (1 + q)  : 6.418e-10

4. grid refinement at (gamma, q) = (10, 4), against the collocation solve
          n_x    graded s = 8       uniform   graded/uniform
          100      1.2138e-04    2.0964e-06             57.9
          200      3.0344e-05    2.9753e-07            102.0
          400      7.5857e-06    4.5261e-08            167.6
          800      1.8964e-06    7.6251e-09            248.7
   observed order 2.0000   (expected 2)
   AT THIS POINT GRADING IS A LIABILITY: at the same n_x the graded grid is
   249x LESS accurate than a uniform one, because its outer cells are
   8.0x wider.  Grading earns its place at the other end of the chart
   (see the pseudo-first-order check below), and the extrapolated reference is how
   this page has both.

5. the implicit relation, two unknowns
   max |solve-for-F_A / solve-for-gamma' - 1| : 7.994e-15

6. the two limits (6.3.5-1) must reproduce
   q -&gt; inf gives gamma/tanh gamma, max rel : 1.495e-08
   gamma -&gt; inf gives 1 + q, rel            : 3.800e-10</code></pre>
</div>
</div>
<section id="reconciling-with-f3.1-which-owns-hatta" class="level3">
<h3 class="anchored" data-anchor-id="reconciling-with-f3.1-which-owns-hatta">5. Reconciling with <code>F3.1</code>, which owns Hatta</h3>
<p><code>F3.1</code> reports a maximum Van Krevelen-Hoftijzer error of about 2.1 %. That is a different number from this page’s headline and it should be: <code>F3.1</code> sweeps three fixed <img src="https://latex.codecogs.com/png.latex?E_i"> values on a fixed <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BHa%7D"> grid and takes the largest sampled value, while this page lets <img src="https://latex.codecogs.com/png.latex?q"> vary continuously and root-finds the extremum. How much of the gap is <em>root-finding</em> and how much is <em>letting <img src="https://latex.codecogs.com/png.latex?q"> move</em> is measured below rather than asserted.</p>
<p>The reconciliation is done by <strong>loading <code>F3.1</code>’s own <code>agreement.json</code> and recomputing its definition here</strong>, not by retyping its number. The residual that survives is then <em>attributed by measurement</em> rather than left to be guessed at, and it belongs to <code>F3.1</code>, not to this page: running the same recomputation <strong>cold on <code>F3.1</code>’s own grid</strong> - uniform, <img src="https://latex.codecogs.com/png.latex?n_x%20=%20400"> - lands on <code>F3.1</code>’s stored number, so the residual is that grid’s discretisation error and the warm start contributes nothing to it. That cold run is also what settles the half of the sentence a reader would otherwise have to take on trust: this is <strong>not</strong> a warm-start-versus-cold-start difference, which is the first thing <code>F3.1</code>’s continued sweep suggests. This page’s extrapolated reference is the accurate side of the residual, and a single graded grid, without the extrapolation, is on the wrong side of it by two orders of magnitude more.</p>
<div id="114425d4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:39:20.857252Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:39:20.857071Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:39:27.646151Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:39:27.645270Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_f31(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb20-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""F3.1's OWN definitions - its three E_i, its two Ha grids - recomputed here."""</span></span>
<span id="cb20-3">    film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> film <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> film</span>
<span id="cb20-4">    ha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">300.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">55</span>)</span>
<span id="cb20-5">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(err_pct(h, e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>film, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>vkh, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw))</span>
<span id="cb20-6">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ha))</span>
<span id="cb20-7">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>: v}</span>
<span id="cb20-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same three E_i, but with gamma ROOT-FOUND instead of sampled: this</span></span>
<span id="cb20-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># splits the gap to this page's headline into "root-finding" and "letting q</span></span>
<span id="cb20-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># move", which are not the same size at all.</span></span>
<span id="cb20-11">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_rootfound_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb20-12">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(argext_log(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: err_pct(g, e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>film, vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>vkh, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw),</span>
<span id="cb20-13">                       G_LO, G_HI, n_scan)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb20-14">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)))</span>
<span id="cb20-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F3.1's other overlapping check: the pseudo-first-order solve against</span></span>
<span id="cb20-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ha/tanh(Ha) over ITS Ha range.  Run on THREE single grids, because the</span></span>
<span id="cb20-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 893.9x is really grading TIMES a refinement: F3.1 uses n_x = 400 uniform and this page n_x = 800 graded.</span></span>
<span id="cb20-18">    ha1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">200.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>)</span>
<span id="cb20-19"></span>
<span id="cb20-20">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pfo(f):</span>
<span id="cb20-21">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f.f_a(h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"frozen_b"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>})[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb20-22">                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(h)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ha1))</span>
<span id="cb20-23"></span>
<span id="cb20-24">    n_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(film.n_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb20-25">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_graded"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfo(graded_film(film.n_x, film.stretch))</span>
<span id="cb20-26">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_same_n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfo(graded_film(film.n_x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))</span>
<span id="cb20-27">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_half_n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfo(graded_film(n_half, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))</span>
<span id="cb20-28">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_stored_vs_recomputed_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_max_error_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb20-29">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_first_order_error_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_order_max_rel_error"</span>]</span>
<span id="cb20-30">                                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_graded"</span>])</span>
<span id="cb20-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb20-32"></span>
<span id="cb20-33"></span>
<span id="cb20-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F3.1's committed numbers, {name: value} from either agreement.json format,</span></span>
<span id="cb20-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from the local checkout or else the raw URL.  They are REQUIRED: the set of</span></span>
<span id="cb20-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metrics this page reports is fixed and never depends on what is reachable,</span></span>
<span id="cb20-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so with no checkout and no network the page stops here rather than skipping</span></span>
<span id="cb20-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the reconciliation.  They were made on another machine, so every comparison</span></span>
<span id="cb20-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of a live number with one of them below is a BOUND, never an equality.</span></span>
<span id="cb20-40">F31 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F3.1-hatta-regimes"</span>)</span>
<span id="cb20-41"></span>
<span id="cb20-42">F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_f31()</span>
<span id="cb20-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same block on the single graded grid, without the extrapolation, so that</span></span>
<span id="cb20-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># shortcut's cost stays visible</span></span>
<span id="cb20-45">F_PLAIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_f31(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM)</span>
<span id="cb20-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the same block on F3.1's OWN grid - uniform, n_x = 400 - which is what</span></span>
<span id="cb20-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ATTRIBUTES the residual instead of hand-waving it.  A COLD run on that grid</span></span>
<span id="cb20-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reproduces F3.1's stored number, so the residual is neither the warm start</span></span>
<span id="cb20-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nor this page's numerics: it is F3.1's discretisation.</span></span>
<span id="cb20-50">FILM_F31 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> graded_film(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb20-51">F_F31GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_f31(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM_F31)</span>
<span id="cb20-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what F3.1 states about the rows this page overlaps with, and whether it bites"</span>)</span>
<span id="cb20-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  * its VKH error is a max over E_i in {5, 20, 100} on 55 Ha points, warm"</span>)</span>
<span id="cb20-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    started along each E_i - so it is a SAMPLED max on a continued sweep."</span>)</span>
<span id="cb20-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    Affects this page: the definitions differ, so the numbers must differ."</span>)</span>
<span id="cb20-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  * its first-order solve matches Ha/tanh(Ha) over 0.02 &lt;= Ha &lt;= 200 at"</span>)</span>
<span id="cb20-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    n_x = 400 UNIFORM, with the error 'concentrated at high Ha where the"</span>)</span>
<span id="cb20-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    reaction layer is thinner than a cell'.  Affects this page directly:"</span>)</span>
<span id="cb20-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    it is the reason this page grades its grid AT ALL, and the same check"</span>)</span>
<span id="cb20-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    is run here on three grids so that grading and refinement are separated"</span>)</span>
<span id="cb20-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    instead of being credited to grading together."</span>)</span>
<span id="cb20-62">F31_PFO_REPRO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_half_n"</span>]</span>
<span id="cb20-63">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_order_max_rel_error"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb20-64">F31_COLD_REPRO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> F_F31GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_stored_vs_recomputed_rel"</span>]</span>
<span id="cb20-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two reproductions of F3.1's committed numbers, as bounds: F3.1 made them</span></span>
<span id="cb20-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># on another machine.  Measured 6.3e-15 and 1.0e-11 on three BLAS kernels, and</span></span>
<span id="cb20-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F3.1's own vkh_max_error_pct spreads 5e-12 relative across kernels; each</span></span>
<span id="cb20-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># limit is about 100x what is measured.</span></span>
<span id="cb20-69">F31_PFO_REPRO_MAX, F31_COLD_REPRO_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span></span>
<span id="cb20-70"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  F3.1 agreement.json  first_order_max_rel_error ="</span></span>
<span id="cb20-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'first_order_max_rel_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (uniform, n_x = 400)"</span>)</span>
<span id="cb20-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the SAME check run here on a uniform n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(FILM.n_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grid ="</span></span>
<span id="cb20-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_uniform_half_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; F3.1 reproduced to below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F31_PFO_REPRO_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F31_PFO_REPRO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb20-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  DECOMPOSING THE 893.9x, WHICH IS NOT ALL GRADING:"</span>)</span>
<span id="cb20-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    uniform n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(FILM.n_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; uniform n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (refinement, no grading) "</span></span>
<span id="cb20-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_uniform_half_n'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_uniform_same_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb20-80"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    uniform n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; graded n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-81">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     (grading, same n_x)   "</span></span>
<span id="cb20-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_uniform_same_n'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_graded'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb20-83"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    product                                              "</span></span>
<span id="cb20-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_first_order_error_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb20-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  SO GRADING IS WORTH"</span></span>
<span id="cb20-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_uniform_same_n'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfo_max_rel_error_graded'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span></span>
<span id="cb20-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ON THIS CHECK, NOT </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_first_order_error_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x - and it is"</span></span>
<span id="cb20-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" worth it here because"</span>)</span>
<span id="cb20-89"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the check runs to Ha = 200, where the reaction layer is thinner than a"</span></span>
<span id="cb20-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" uniform cell."</span>)</span>
<span id="cb20-91"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  At the moderate gamma this page's headline lives at, the same grading"</span></span>
<span id="cb20-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" COSTS a factor"</span></span>
<span id="cb20-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_rel_error_n800'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_rel_error_n800_uniform'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Validation,"</span></span>
<span id="cb20-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" check 4), which is why the"</span>)</span>
<span id="cb20-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  baseline is an extrapolation of two graded grids rather than either grid"</span></span>
<span id="cb20-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" on its own."</span>)</span>
<span id="cb20-97"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">F3.1 agreement.json  vkh_max_error_pct  = "</span></span>
<span id="cb20-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_max_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-99"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recomputed here, same definition, cold  = "</span></span>
<span id="cb20-100">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_vkh_max_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-101">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (relative </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_stored_vs_recomputed_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb20-102"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the SAME recomputation, run COLD on F3.1's OWN grid (uniform,"</span></span>
<span id="cb20-103">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_F31<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = "</span></span>
<span id="cb20-104">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F_F31GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_vkh_max_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-105"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      -&gt; reproduces F3.1's stored value to below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F31_COLD_REPRO_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" relative (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F31_COLD_REPRO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb20-107"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; SO THE RESIDUAL IS F3.1's OWN GRID ERROR, not this page's numerics"</span></span>
<span id="cb20-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - and the cold run on"</span>)</span>
<span id="cb20-109"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     F3.1's grid PROVES the other half too: the warm start is worth"</span></span>
<span id="cb20-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" nothing here, since cold on"</span>)</span>
<span id="cb20-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     that grid lands on the warm-started stored number.  What is left,"</span></span>
<span id="cb20-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_stored_vs_recomputed_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, is the"</span>)</span>
<span id="cb20-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     uniform 400-cell discretisation; this page's extrapolated reference"</span></span>
<span id="cb20-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is the accurate side of"</span>)</span>
<span id="cb20-115"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     it, agreeing with scipy's collocation to"</span></span>
<span id="cb20-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref_vs_bvp_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over 20 points of the chart."</span>)</span>
<span id="cb20-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     (For scale: this page's OWN pre-extrapolation shortcut, a single"</span></span>
<span id="cb20-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> graded grid,"</span>)</span>
<span id="cb20-119"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      lands </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F_PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_vkh_max_error_pct'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_max_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" away - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F_PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_stored_vs_recomputed_rel'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_stored_vs_recomputed_rel'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" times the residual left here.)"</span>)</span>
<span id="cb20-122"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this page's root-found worst over the chart = "</span></span>
<span id="cb20-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_rel_error_pct'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-124"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the same three E_i, gamma root-found instead of sampled ="</span></span>
<span id="cb20-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_rootfound_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-126"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; of the"</span></span>
<span id="cb20-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_rel_error_pct'</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_vkh_max_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" extra points in this page's headline,"</span></span>
<span id="cb20-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_rootfound_pct'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_vkh_max_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-130">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" come from root-finding gamma"</span>)</span>
<span id="cb20-131"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     and"</span></span>
<span id="cb20-132">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vkh_worst_rel_error_pct'</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'f31_definition_rootfound_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-133">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" from letting q move off </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">4, 19, 99</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  It is almost all q."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>what F3.1 states about the rows this page overlaps with, and whether it bites
  * its VKH error is a max over E_i in {5, 20, 100} on 55 Ha points, warm
    started along each E_i - so it is a SAMPLED max on a continued sweep.
    Affects this page: the definitions differ, so the numbers must differ.
  * its first-order solve matches Ha/tanh(Ha) over 0.02 &lt;= Ha &lt;= 200 at
    n_x = 400 UNIFORM, with the error 'concentrated at high Ha where the
    reaction layer is thinner than a cell'.  Affects this page directly:
    it is the reason this page grades its grid AT ALL, and the same check
    is run here on three grids so that grading and refinement are separated
    instead of being credited to grading together.

  F3.1 agreement.json  first_order_max_rel_error = 6.3367e-03  (uniform, n_x = 400)
  the SAME check run here on a uniform n_x = 400 grid = 6.3367e-03  -&gt; F3.1 reproduced to below 1e-12 (here 6.3e-15)
  DECOMPOSING THE 893.9x, WHICH IS NOT ALL GRADING:
    uniform n_x = 400 -&gt; uniform n_x = 800   (refinement, no grading)      7.16x
    uniform n_x = 800 -&gt; graded n_x = 800     (grading, same n_x)      124.81x
    product                                                  893.9x
  SO GRADING IS WORTH 125x ON THIS CHECK, NOT 894x - and it is worth it here because
  the check runs to Ha = 200, where the reaction layer is thinner than a uniform cell.
  At the moderate gamma this page's headline lives at, the same grading COSTS a factor 249 (Validation, check 4), which is why the
  baseline is an extrapolation of two graded grids rather than either grid on its own.

F3.1 agreement.json  vkh_max_error_pct  = 2.076893
recomputed here, same definition, cold  = 2.076896   (relative 1.29e-06)
  the SAME recomputation, run COLD on F3.1's OWN grid (uniform, n_x = 400) = 2.076893246
      -&gt; reproduces F3.1's stored value to below 1e-09 relative (here 1.0e-11).
  -&gt; SO THE RESIDUAL IS F3.1's OWN GRID ERROR, not this page's numerics - and the cold run on
     F3.1's grid PROVES the other half too: the warm start is worth nothing here, since cold on
     that grid lands on the warm-started stored number.  What is left, 1.29e-06, is the
     uniform 400-cell discretisation; this page's extrapolated reference is the accurate side of
     it, agreeing with scipy's collocation to 4.37e-08 over 20 points of the chart.
     (For scale: this page's OWN pre-extrapolation shortcut, a single n_x = 800 graded grid,
      lands -0.000214 away - 80 times the residual left here.)

this page's root-found worst over the chart = 2.795463
  the same three E_i, gamma root-found instead of sampled = 2.078501
  -&gt; of the 0.7186 extra points in this page's headline, 0.0016 come from root-finding gamma
     and 0.7170 from letting q move off {4, 19, 99}.  It is almost all q.</code></pre>
</div>
</div>
</section>
<section id="the-break-table" class="level3">
<h3 class="anchored" data-anchor-id="the-break-table">The break table</h3>
<p>Every metric this page reports needs something that moves it. Each row below <strong>recomputes</strong> the metrics it claims to cover, under one injected defect, using the same functions; the coverage map printed underneath is generated from those measured moves and is never a hand-written claim. A static guard parses each row’s own source and rejects any metric returned as a typed constant - and the cell below states what that guard cannot do, because a guard trusted past its reach is worse than none.</p>
<p>Two rows are worth reading before the rest. <strong>“The reference taken as one graded solve”</strong> is the defect the extrapolated baseline exists to avoid, injected verbatim. And <strong>“uniform grid instead of graded”</strong> is <em>not</em> filed as a one-way defect: at high <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> it is one, and on the metrics that carry the headline it agrees with the extrapolated reference to within the move tolerance, which is why it stops appearing as cover for <em>those</em>. It still buys sub-CI links on the other moderate-<img src="https://latex.codecogs.com/png.latex?%5Cgamma"> metrics and large ones at high <img src="https://latex.codecogs.com/png.latex?%5Cgamma">; the split is printed under the coverage map rather than described.</p>
<div id="bdff37cc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:39:27.648262Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:39:27.648083Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:42:27.647846Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:42:27.646895Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1">BREAKS, BREAK_FNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb22-2">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb22-3"></span>
<span id="cb22-4"></span>
<span id="cb22-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(label, fn, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>):</span>
<span id="cb22-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb22-7">        got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn()</span>
<span id="cb22-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> exc:</span>
<span id="cb22-9">        got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_raised"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span>(exc)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">__name__</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>exc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}</span>
<span id="cb22-10">    BREAKS.append((label, got, note))</span>
<span id="cb22-11">    BREAK_FNS.append((label, fn))</span>
<span id="cb22-12"></span>
<span id="cb22-13"></span>
<span id="cb22-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _vkh_sign():</span>
<span id="cb22-15">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, q: f_a_vkh(g, q, sign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=+</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb22-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v),</span>
<span id="cb22-17">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: val <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> block_routes(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v).items()</span>
<span id="cb22-18">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_"</span>)}}</span>
<span id="cb22-19"></span>
<span id="cb22-20"></span>
<span id="cb22-21">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(6.3.5-1) transcribed with + where it prints -"</span>, _vkh_sign,</span>
<span id="cb22-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the sign under the square root is the whole content of the correction:"</span></span>
<span id="cb22-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" with it flipped gamma' exceeds gamma and the approximation over-shoots"</span>)</span>
<span id="cb22-24"></span>
<span id="cb22-25"></span>
<span id="cb22-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _vkh_offset():</span>
<span id="cb22-27">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, q: f_a_vkh(g, q, offset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb22-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v),</span>
<span id="cb22-29">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: val <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> block_routes(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v).items()</span>
<span id="cb22-30">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_"</span>)}}</span>
<span id="cb22-31"></span>
<span id="cb22-32"></span>
<span id="cb22-33">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(6.3.5-1) transcribed as F_A where it prints (F_A - 1)"</span>, _vkh_offset,</span>
<span id="cb22-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the -1 is what makes gamma' -&gt; gamma when there is no enhancement; without"</span></span>
<span id="cb22-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" it the pseudo-first-order limit is wrong too, which is why the limit"</span></span>
<span id="cb22-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" checks are metrics and not decoration"</span>)</span>
<span id="cb22-37"></span>
<span id="cb22-38"></span>
<span id="cb22-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _vkh_denom():</span>
<span id="cb22-40">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, q: f_a_vkh(g, q, denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ei"</span>)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb22-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v),</span>
<span id="cb22-42">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: val <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> block_routes(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v).items()</span>
<span id="cb22-43">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_"</span>)}}</span>
<span id="cb22-44"></span>
<span id="cb22-45"></span>
<span id="cb22-46">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"q read as E_i in (6.3.5-1) - the two books' groups swapped"</span>, _vkh_denom,</span>
<span id="cb22-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly the mistake the two charts invite, since they label the same"</span></span>
<span id="cb22-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" curves with q and with E_i; it is worth more than the whole error the"</span></span>
<span id="cb22-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" approximation makes"</span>)</span>
<span id="cb22-50"></span>
<span id="cb22-51"></span>
<span id="cb22-52"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _frozen_b():</span>
<span id="cb22-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(frozen_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(frozen_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>),</span>
<span id="cb22-54">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(frozen_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_routes(frozen_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)}</span>
<span id="cb22-55"></span>
<span id="cb22-56"></span>
<span id="cb22-57">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the depletion of B dropped from the FILM model (beta = 1 identically)"</span>,</span>
<span id="cb22-58">    _frozen_b,</span>
<span id="cb22-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the row that shows every error metric on this page is a MEASUREMENT OF"</span></span>
<span id="cb22-60">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" DEPLETION: take the depletion out of the film and the film becomes"</span></span>
<span id="cb22-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" pseudo-first-order, while (6.3.5-1) goes on correcting for a depletion"</span></span>
<span id="cb22-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" that no longer happens, so the reported error changes sign and size and"</span></span>
<span id="cb22-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" beta(0) becomes 1"</span>)</span>
<span id="cb22-64"></span>
<span id="cb22-65"></span>
<span id="cb22-66"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _coarse():</span>
<span id="cb22-67">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)</span>
<span id="cb22-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, deficit_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f),</span>
<span id="cb22-69">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f),</span>
<span id="cb22-70">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_routes(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, n_grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>))}</span>
<span id="cb22-71"></span>
<span id="cb22-72"></span>
<span id="cb22-73">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film solved on 100 cells instead of 800"</span>, _coarse,</span>
<span id="cb22-74">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the baseline against which a 2.8 % approximation error is quoted has to be"</span></span>
<span id="cb22-75">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" better than 2.8 %; this prices how much better"</span>)</span>
<span id="cb22-76"></span>
<span id="cb22-77"></span>
<span id="cb22-78"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _no_extrapolation():</span>
<span id="cb22-79">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The baseline as a SINGLE graded solve - what this page reported before."""</span></span>
<span id="cb22-80">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM, deficit_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM),</span>
<span id="cb22-81">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_routes(ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FILM)}</span>
<span id="cb22-82"></span>
<span id="cb22-83"></span>
<span id="cb22-84">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the reference taken as one graded solve at n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb22-85">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" instead of extrapolated"</span>, _no_extrapolation,</span>
<span id="cb22-86">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"THE ROW THIS PAGE EARNED THE HARD WAY.  A single graded solve at n_x = 800"</span></span>
<span id="cb22-87">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" is grid-limited exactly where the headline lives: it moves the worst error"</span></span>
<span id="cb22-88">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" into its fourth decimal, in the flattering direction, and it moves the"</span></span>
<span id="cb22-89">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" margin against the printed 10 percent, the location of the extremum, the"</span></span>
<span id="cb22-90">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" two depletion-curve errors, both Levenspiel expansion errors and the"</span></span>
<span id="cb22-91">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" recomputation of F3.1's definition.  Its error in F_A is smaller than this"</span></span>
<span id="cb22-92">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" page's own pymrm-versus-collocation agreement - the two are printed side"</span></span>
<span id="cb22-93">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" by side in the Validation section - which is exactly why it stayed"</span></span>
<span id="cb22-94">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" invisible until the baseline was extrapolated"</span>)</span>
<span id="cb22-95"></span>
<span id="cb22-96"></span>
<span id="cb22-97"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _uniform():</span>
<span id="cb22-98">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb22-99">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, deficit_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f),</span>
<span id="cb22-100">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_f31(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_routes(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)}</span>
<span id="cb22-101"></span>
<span id="cb22-102"></span>
<span id="cb22-103">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform grid instead of graded, at the same n_x"</span>, _uniform,</span>
<span id="cb22-104">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NOT A ONE-WAY DEFECT, and the page says so rather than filing it as one."</span></span>
<span id="cb22-105">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" At large gamma the reaction layer is thinner than a uniform cell - the"</span></span>
<span id="cb22-106">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" defect F3.1 names in its own first-order check - and this row prices it:"</span></span>
<span id="cb22-107">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the pseudo-first-order error to Ha = 200 is two orders worse without"</span></span>
<span id="cb22-108">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" grading.  But at the MODERATE gamma where this page's headline sits the"</span></span>
<span id="cb22-109">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" uniform grid is the better one, and on the metrics that carry the"</span></span>
<span id="cb22-110">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" headline - the worst error itself, the margin against the printed 10"</span></span>
<span id="cb22-111">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" percent, the two depletion thresholds and the worst over the printed"</span></span>
<span id="cb22-112">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" labels - it agrees with the extrapolated reference to within the move"</span></span>
<span id="cb22-113">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" tolerance below, so it does not appear as cover for THOSE.  It is not"</span></span>
<span id="cb22-114">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" cover-free:"</span></span>
<span id="cb22-115">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" on the other moderate-gamma metrics it sits just the other side of that"</span></span>
<span id="cb22-116">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" tolerance and still buys links, and on the high-gamma metrics it buys"</span></span>
<span id="cb22-117">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" large ones, which is the reason to keep it.  The split is printed under"</span></span>
<span id="cb22-118">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the coverage map.  The agreement is itself evidence:"</span></span>
<span id="cb22-119">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" two different discretisations, one of them extrapolated, landing on the"</span></span>
<span id="cb22-120">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" same fourth decimal"</span>)</span>
<span id="cb22-121"></span>
<span id="cb22-122"></span>
<span id="cb22-123"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _bc():</span>
<span id="cb22-124">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, bc_beta_bulk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"neumann"</span>)</span>
<span id="cb22-125">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_lev(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, deficit_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f),</span>
<span id="cb22-126">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_routes(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f, bc_beta_bulk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"neumann"</span>)}</span>
<span id="cb22-127"></span>
<span id="cb22-128"></span>
<span id="cb22-129">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta given a zero-gradient bulk edge instead of beta(1) = 1"</span>, _bc,</span>
<span id="cb22-130">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the bulk value of B is what q is defined against, so this is not a small"</span></span>
<span id="cb22-131">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" perturbation: it removes the supply of B entirely"</span>)</span>
<span id="cb22-132"></span>
<span id="cb22-133"></span>
<span id="cb22-134"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sampled():</span>
<span id="cb22-135">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_worst(rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb22-136"></span>
<span id="cb22-137"></span>
<span id="cb22-138">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"worst point SAMPLED on the scan grid instead of root-found"</span>, _sampled,</span>
<span id="cb22-139">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reason every extremum on this page is a root: the sampled maximum is"</span></span>
<span id="cb22-140">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" grid-limited, and both its location and its value move"</span>)</span>
<span id="cb22-141"></span>
<span id="cb22-142"></span>
<span id="cb22-143"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _coarse_scan():</span>
<span id="cb22-144">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_worst(n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb22-145"></span>
<span id="cb22-146"></span>
<span id="cb22-147">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the bracketing scan halved to 7 points"</span>, _coarse_scan,</span>
<span id="cb22-148">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a root-find is only as good as its bracket; this shows the answer does not"</span></span>
<span id="cb22-149">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" depend on the scan once the bracket holds"</span>)</span>
<span id="cb22-150"></span>
<span id="cb22-151"></span>
<span id="cb22-152"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lev_coeff():</span>
<span id="cb22-153">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_lev(small_coeff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb22-154"></span>
<span id="cb22-155"></span>
<span id="cb22-156">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Levenspiel's 1 + M_H^2/3 transcribed with a 2"</span>, _lev_coeff,</span>
<span id="cb22-157">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 3 is the Taylor coefficient of gamma/tanh gamma, so this row checks a"</span></span>
<span id="cb22-158">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" constant of FROMENT's equation through LEVENSPIEL's transcription"</span>)</span>
<span id="cb22-159"></span>
<span id="cb22-160"></span>
<span id="cb22-161"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lev_denom():</span>
<span id="cb22-162">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_lev(pfo_denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb22-163"></span>
<span id="cb22-164"></span>
<span id="cb22-165">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Levenspiel's 2 E_i transcribed as E_i"</span>, _lev_denom, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb22-166"></span>
<span id="cb22-167"></span>
<span id="cb22-168"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lev_offset():</span>
<span id="cb22-169">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_lev(pfo_offset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb22-170"></span>
<span id="cb22-171"></span>
<span id="cb22-172">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Levenspiel's (M_H - 1) transcribed as M_H"</span>, _lev_offset,</span>
<span id="cb22-173">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the -1 is worth little at M_H = 10 and everything at M_H = 1, which is why"</span></span>
<span id="cb22-174">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the expansion is evaluated at the boundary the book declares for it"</span>)</span>
<span id="cb22-175"></span>
<span id="cb22-176"></span>
<span id="cb22-177"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lev_power():</span>
<span id="cb22-178">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_lev(inst_power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb22-179"></span>
<span id="cb22-180"></span>
<span id="cb22-181">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Levenspiel's E_i^2(E_i - 1) transcribed as E_i(E_i - 1)"</span>, _lev_power,</span>
<span id="cb22-182">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the exponent is what the instantaneous asymptote ratio tests; without this"</span></span>
<span id="cb22-183">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" row that ratio would be an unchecked 0.995"</span>)</span>
<span id="cb22-184"></span>
<span id="cb22-185"></span>
<span id="cb22-186"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _labels_as_ei():</span>
<span id="cb22-187">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Froment's labels read as E_i: the implied plateau becomes L, not 1 + L."""</span></span>
<span id="cb22-188">    lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS]</span>
<span id="cb22-189">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chart_label_max_plateau_ratio"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LABELS)),</span>
<span id="cb22-190">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab)}</span>
<span id="cb22-191"></span>
<span id="cb22-192"></span>
<span id="cb22-193">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Froment's curve labels read as E_i, the way Levenspiel's are"</span>, _labels_as_ei,</span>
<span id="cb22-194">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the notation trap, priced: read both books' labels the same way and the"</span></span>
<span id="cb22-195">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" plateau ratio collapses to 1, which is exactly the mistake the metric"</span></span>
<span id="cb22-196">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" exists to record.  DECLARED LIMIT OF THIS ROW: max_L L/L is identically 1"</span></span>
<span id="cb22-197">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" for ANY label set, so for that one metric this row is an identity and not"</span></span>
<span id="cb22-198">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" a measurement; only the row below, which drops a transcribed label,"</span></span>
<span id="cb22-199">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" actually tests the CSV.  chart_label_max_plateau_ratio is itself"</span></span>
<span id="cb22-200">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" definitional - max_L (1+L)/L is 2 whenever the smallest printed label is 1"</span></span>
<span id="cb22-201">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" - and is reported as a property of the two notations, not as a result"</span>)</span>
<span id="cb22-202"></span>
<span id="cb22-203"></span>
<span id="cb22-204"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _labels_truncated():</span>
<span id="cb22-205">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The CSV's smallest curve label dropped."""</span></span>
<span id="cb22-206">    lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(LABELS)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]</span>
<span id="cb22-207">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chart_label_max_plateau_ratio"</span>:</span>
<span id="cb22-208">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lab)),</span>
<span id="cb22-209">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>block_worst(labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab)}</span>
<span id="cb22-210"></span>
<span id="cb22-211"></span>
<span id="cb22-212">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the smallest printed curve label dropped from the CSV"</span>, _labels_truncated,</span>
<span id="cb22-213">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the label-ratio metric is a property of the transcribed LABEL SET as much"</span></span>
<span id="cb22-214">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" as of the two notations, and this is what a dropped row costs it"</span>)</span>
<span id="cb22-215"></span>
<span id="cb22-216"></span>
<span id="cb22-217"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _vkh_loose():</span>
<span id="cb22-218">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, q: f_a_vkh(g, q, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb22-219">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {k: val <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> block_routes(vkh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v).items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_"</span>)}</span>
<span id="cb22-220"></span>
<span id="cb22-221"></span>
<span id="cb22-222">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the implicit relation solved to xtol = 1e-4"</span>, _vkh_loose,</span>
<span id="cb22-223">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the limit checks on (6.3.5-1) sit at 1e-8 and 1e-10, which is Brent's"</span></span>
<span id="cb22-224">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" tolerance and not physics; this is the row that moves them, and it is why"</span></span>
<span id="cb22-225">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" they are reported as solver checks rather than as agreement"</span>)</span>
<span id="cb22-226"></span>
<span id="cb22-227"></span>
<span id="cb22-228"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _newton_loose():</span>
<span id="cb22-229">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> block_routes(newton_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb22-230"></span>
<span id="cb22-231"></span>
<span id="cb22-232">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Newton stopped at an update of 1e-4"</span>, _newton_loose,</span>
<span id="cb22-233">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the second axis that carries error here is the solver tolerance, not a"</span></span>
<span id="cb22-234">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" time step - this page has no time axis"</span>)</span>
<span id="cb22-235"></span>
<span id="cb22-236"></span>
<span id="cb22-237"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _bvp_loose():</span>
<span id="cb22-238">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> block_routes(bvp_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>).items()</span>
<span id="cb22-239">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs"</span>))} <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> {</span>
<span id="cb22-240">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>:</span>
<span id="cb22-241">            block_lev(bvp_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>]}</span>
<span id="cb22-242"></span>
<span id="cb22-243"></span>
<span id="cb22-244">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collocation tolerance loosened to 1e-4"</span>, _bvp_loose,</span>
<span id="cb22-245">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an independent route is only independent if it is also accurate; this"</span></span>
<span id="cb22-246">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" prices the second solver's own error"</span>)</span>
<span id="cb22-247"></span>
<span id="cb22-248"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, got, note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb22-249">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-250">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)})<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-251">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> note:</span>
<span id="cb22-252">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>note<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>* (6.3.5-1) transcribed with + where it prints -
    {'vkh_worst_rel_error_pct': 909090727.3240324, 'vkh_worst_gamma': 1000.0, 'vkh_worst_q': 0.1, 'froment_10pct_claim_margin': 1.1000002199379648e-08, 'beta_interface_at_worst': 0.0, 'beta_constancy_at_worst': nan, 'vkh_worst_on_printed_labels_pct': 49999900.003395446, 'gamma_at_half_depletion': 0.5212124868712256, 'gamma_at_99pct_depletion': 2.3180857686562026, 'vkh_error_at_half_depletion_pct': 39.8768131899302, 'vkh_error_at_99pct_depletion_pct': 4706.152436605034, 'vkh_error_at_full_depletion_pct': 909090727.3240324, 'beta_constancy_at_99pct_depletion': 32.84342207284307, 'lev_small_M_1pct_threshold': 0.7230861468815154, 'lev_pfo_expansion_err_pct': -0.536624806035424, 'vkh_form_pfo_expansion_err_pct': -0.737380665363907, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': -177242.4067407548, 'lev_inst_asymptote_ratio_num': 0.2286236667842445, 'lev_inst_overstatement_factor': 44.24445191547594, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': 2.0002631717334296, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05, 'f31_definition_vkh_max_error_pct': 449959.9920248367, 'f31_definition_rootfound_pct': 4999959.999512851, 'pfo_max_rel_error_graded': 7.08847946950808e-06, 'pfo_max_rel_error_uniform_same_n': 0.0008846990694951762, 'pfo_max_rel_error_uniform_half_n': 0.0063367334444864865, 'f31_stored_vs_recomputed_rel': 216649.51533944104, 'f31_first_order_error_ratio': 893.9481974582452, 'vkh_two_routes_max_rel_diff': 4999.91657883224, 'vkh_pfo_limit_max_rel_error': 1.4950000126745522e-08, 'vkh_instantaneous_limit_rel_error': 2631578947.2684207}
    -&gt; the sign under the square root is the whole content of the correction: with it flipped gamma' exceeds gamma and the approximation over-shoots
* (6.3.5-1) transcribed as F_A where it prints (F_A - 1)
    {'vkh_worst_rel_error_pct': -49.99994604645064, 'vkh_worst_gamma': 79.37005259841, 'vkh_worst_q': 1.0000021605317546, 'froment_10pct_claim_margin': 0.20000021581443034, 'beta_interface_at_worst': 1.1446537725658269e-13, 'beta_constancy_at_worst': 581305796134.0979, 'vkh_worst_on_printed_labels_pct': -50.00000000339545, 'gamma_at_half_depletion': 1.7343235695870929, 'gamma_at_99pct_depletion': 9.319474501484185, 'vkh_error_at_half_depletion_pct': -33.33330923785032, 'vkh_error_at_99pct_depletion_pct': -49.748692787093944, 'vkh_error_at_full_depletion_pct': -49.99994598371317, 'beta_constancy_at_99pct_depletion': 24.499610533102864, 'lev_small_M_1pct_threshold': 0.7230861468815154, 'lev_pfo_expansion_err_pct': -0.536624806035424, 'vkh_form_pfo_expansion_err_pct': -0.737380665363907, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': 21.951081875171123, 'lev_inst_asymptote_ratio_num': 0.2286236667842445, 'lev_inst_overstatement_factor': 44.24445191547594, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': -0.04492932996454885, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05, 'f31_definition_vkh_max_error_pct': 20.623773335317004, 'f31_definition_rootfound_pct': 20.628469938090497, 'pfo_max_rel_error_graded': 7.08847946950808e-06, 'pfo_max_rel_error_uniform_same_n': 0.0008846990694951762, 'pfo_max_rel_error_uniform_half_n': 0.0063367334444864865, 'f31_stored_vs_recomputed_rel': 8.930107566304741, 'f31_first_order_error_ratio': 893.9481974582452, 'vkh_two_routes_max_rel_diff': 0.49990834211677593, 'vkh_pfo_limit_max_rel_error': 1.4999999908837935e-08, 'vkh_instantaneous_limit_rel_error': 0.050000000342950046}
    -&gt; the -1 is what makes gamma' -&gt; gamma when there is no enhancement; without it the pseudo-first-order limit is wrong too, which is why the limit checks are metrics and not decoration
* q read as E_i in (6.3.5-1) - the two books' groups swapped
    {'vkh_worst_rel_error_pct': 90.90867940662048, 'vkh_worst_gamma': 1000.0, 'vkh_worst_q': 0.1, 'froment_10pct_claim_margin': 0.11000049792024306, 'beta_interface_at_worst': 0.0, 'beta_constancy_at_worst': nan, 'vkh_worst_on_printed_labels_pct': 49.999109174954384, 'gamma_at_half_depletion': 0.5212124868712256, 'gamma_at_99pct_depletion': 2.3180857686562026, 'vkh_error_at_half_depletion_pct': 3.0857215434109087, 'vkh_error_at_99pct_depletion_pct': 49.8877068660537, 'vkh_error_at_full_depletion_pct': 90.90867940662048, 'beta_constancy_at_99pct_depletion': 32.84342207284307, 'lev_small_M_1pct_threshold': 0.7230861468815154, 'lev_pfo_expansion_err_pct': -0.536624806035424, 'vkh_form_pfo_expansion_err_pct': -0.737380665363907, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': -19.898158334142796, 'lev_inst_asymptote_ratio_num': 0.2286236667842445, 'lev_inst_overstatement_factor': 44.24445191547594, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': 0.061371675674019105, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05, 'f31_definition_vkh_max_error_pct': 19.960027636347565, 'f31_definition_rootfound_pct': 19.99640031008142, 'pfo_max_rel_error_graded': 7.08847946950808e-06, 'pfo_max_rel_error_uniform_same_n': 0.0008846990694951762, 'pfo_max_rel_error_uniform_half_n': 0.0063367334444864865, 'f31_stored_vs_recomputed_rel': 8.61052171359602, 'f31_first_order_error_ratio': 893.9481974582452, 'vkh_two_routes_max_rel_diff': 0.4993850542160052, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 0.04999999955900014}
    -&gt; exactly the mistake the two charts invite, since they label the same curves with q and with E_i; it is worth more than the whole error the approximation makes
* the depletion of B dropped from the FILM model (beta = 1 identically)
    {'vkh_worst_rel_error_pct': -99.89000000181063, 'vkh_worst_gamma': 1000.0, 'vkh_worst_q': 0.1, 'froment_10pct_claim_margin': 0.10011012113143195, 'beta_interface_at_worst': 1.0000000000318259, 'beta_constancy_at_worst': 0.9999999999997843, 'vkh_worst_on_printed_labels_pct': -99.80000036445115, 'gamma_at_half_depletion': 0.5, 'gamma_at_99pct_depletion': 0.5, 'vkh_error_at_half_depletion_pct': -3.3962383250486066, 'vkh_error_at_99pct_depletion_pct': -3.3962383250486066, 'vkh_error_at_full_depletion_pct': -99.89000000181063, 'beta_constancy_at_99pct_depletion': 0.9999999999892933, 'lev_small_M_1pct_threshold': 0.8808719572191812, 'lev_pfo_expansion_err_pct': -9.00000035330304, 'vkh_form_pfo_expansion_err_pct': -9.1836738219777, 'uncorrected_E_eq_M_err_pct': -3.8824509163148946e-07, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': -7999.999980378096, 'lev_inst_overstatement_factor': -1.5224359095930732e-05, 'inst_deficit_exponent_num_steepest': 1.0374746974367983, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': -1.0000003440973084, 'f31_definition_vkh_max_error_pct': 98.33370346939395, 'f31_definition_rootfound_pct': 99.50000999210039, 'pfo_max_rel_error_graded': 7.08847946950808e-06, 'pfo_max_rel_error_uniform_same_n': 0.0008846990694951762, 'pfo_max_rel_error_uniform_half_n': 0.0063367334444864865, 'f31_stored_vs_recomputed_rel': 46.34653726881578, 'f31_first_order_error_ratio': 893.9481974582452, 'fv_vs_bvp_max_rel_diff': 48.99966653389857, 'fv_vs_bvp_max_abs_diff_beta': 1.0000000000274825, 'ref_vs_bvp_max_rel_diff': 48.99999998258622, 'ref_self_refinement_max_rel_diff': 3.689784788818429e-08, 'first_integral_max_abs_resid': 49.49999998260213, 'vkh_two_routes_max_rel_diff': 7.993605777301127e-15, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 3.80000031441341e-10, 'fv_convergence_order': -4.828799044055547e-05, 'fv_rel_error_n800': 1.2932721851559914, 'fv_rel_error_n800_uniform': 1.2932863357372817}
    -&gt; the row that shows every error metric on this page is a MEASUREMENT OF DEPLETION: take the depletion out of the film and the film becomes pseudo-first-order, while (6.3.5-1) goes on correcting for a depletion that no longer happens, so the reported error changes sign and size and beta(0) becomes 1
* film solved on 100 cells instead of 800
    {'vkh_worst_rel_error_pct': -2.784442853892331, 'vkh_worst_gamma': 4.735933850870052, 'vkh_worst_q': 1.5175699157752345, 'froment_10pct_claim_margin': 3.5913827378504646, 'beta_interface_at_worst': 0.1637678319987058, 'beta_constancy_at_worst': 2.1264261428591347, 'vkh_worst_on_printed_labels_pct': -2.7171034787454276, 'gamma_at_half_depletion': 2.2009159876070146, 'gamma_at_99pct_depletion': 13.020825044740338, 'vkh_error_at_half_depletion_pct': -1.8129669340919246, 'vkh_error_at_99pct_depletion_pct': -1.4999804355663193, 'vkh_error_at_full_depletion_pct': -0.0003715423848882101, 'beta_constancy_at_99pct_depletion': 19.247494176778364, 'lev_small_M_1pct_threshold': 0.7213663326615476, 'lev_pfo_expansion_err_pct': -0.5004393039819477, 'vkh_form_pfo_expansion_err_pct': -0.7012681997577208, 'uncorrected_E_eq_M_err_pct': 9.340176589030836, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 0.22964902638800835, 'lev_inst_overstatement_factor': 43.471544273045886, 'inst_deficit_exponent_num_steepest': -5.3195020136623095, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 0.017777101002011575, 'f31_definition_vkh_max_error_pct': 2.062990091512427, 'f31_definition_rootfound_pct': 2.0639363927646976, 'pfo_max_rel_error_graded': 0.00045325570572463114, 'pfo_max_rel_error_uniform_same_n': 0.17157287525381004, 'pfo_max_rel_error_uniform_half_n': 0.4330847293182011, 'f31_stored_vs_recomputed_rel': 0.006694207511547923, 'f31_first_order_error_ratio': 13.980482461562913, 'fv_vs_bvp_max_rel_diff': 0.00038305273574879006, 'fv_vs_bvp_max_abs_diff_beta': 0.00020179692394586835, 'ref_vs_bvp_max_rel_diff': 4.3693968221347745e-08, 'ref_self_refinement_max_rel_diff': 3.841073770161074e-08, 'first_integral_max_abs_resid': 6.417639042410883e-10, 'vkh_two_routes_max_rel_diff': 7.993605777301127e-15, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 3.80000031441341e-10, 'fv_convergence_order': 2.000059043757401, 'fv_rel_error_n800': 3.0343989647296787e-05, 'fv_rel_error_n800_uniform': 2.9752955910122836e-07}
    -&gt; the baseline against which a 2.8 % approximation error is quoted has to be better than 2.8 %; this prices how much better
* the reference taken as one graded solve at n_x = 800 instead of extrapolated
    {'vkh_worst_rel_error_pct': -2.795295040164379, 'vkh_worst_gamma': 4.728009232620208, 'vkh_worst_q': 1.521652507428479, 'froment_10pct_claim_margin': 3.577439896795991, 'beta_interface_at_worst': 0.16472240583635292, 'beta_constancy_at_worst': 2.1153961781150437, 'vkh_worst_on_printed_labels_pct': -2.7292320001544685, 'gamma_at_half_depletion': 2.2035133927934494, 'gamma_at_99pct_depletion': 13.037471920583847, 'vkh_error_at_half_depletion_pct': -1.830176139862251, 'vkh_error_at_99pct_depletion_pct': -1.5034061078074368, 'vkh_error_at_full_depletion_pct': -0.0003732200555763616, 'beta_constancy_at_99pct_depletion': 19.20084051964301, 'lev_small_M_1pct_threshold': 0.7230615457182603, 'lev_pfo_expansion_err_pct': -0.5360593876284403, 'vkh_form_pfo_expansion_err_pct': -0.7368163881916523, 'uncorrected_E_eq_M_err_pct': 9.301033639968747, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 0.22863968471555332, 'lev_inst_overstatement_factor': 44.232163591250824, 'inst_deficit_exponent_num_steepest': -5.338171644706378, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 0.0002753361821266065, 'f31_definition_vkh_max_error_pct': 2.076678757334278, 'f31_definition_rootfound_pct': 2.078272032690435, 'pfo_max_rel_error_graded': 7.08847946950808e-06, 'pfo_max_rel_error_uniform_same_n': 0.0008846990694951762, 'pfo_max_rel_error_uniform_half_n': 0.0063367334444864865, 'f31_stored_vs_recomputed_rel': 0.00010327374593055438, 'f31_first_order_error_ratio': 893.9481974582452, 'fv_vs_bvp_max_rel_diff': 5.987876919966162e-06, 'fv_vs_bvp_max_abs_diff_beta': 2.91313328765197e-06, 'ref_vs_bvp_max_rel_diff': 5.987876919966162e-06, 'ref_self_refinement_max_rel_diff': 5.9879153889719205e-06, 'first_integral_max_abs_resid': 4.726726388071256e-10, 'vkh_two_routes_max_rel_diff': 7.993605777301127e-15, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 3.80000031441341e-10, 'fv_convergence_order': 1.9999825760999916, 'fv_rel_error_n800': 1.8964470563931357e-06, 'fv_rel_error_n800_uniform': 7.625140741041037e-09}
    -&gt; THE ROW THIS PAGE EARNED THE HARD WAY.  A single graded solve at n_x = 800 is grid-limited exactly where the headline lives: it moves the worst error into its fourth decimal, in the flattering direction, and it moves the margin against the printed 10 percent, the location of the extremum, the two depletion-curve errors, both Levenspiel expansion errors and the recomputation of F3.1's definition.  Its error in F_A is smaller than this page's own pymrm-versus-collocation agreement - the two are printed side by side in the Validation section - which is exactly why it stayed invisible until the baseline was extrapolated
* uniform grid instead of graded, at the same n_x
    {'vkh_worst_rel_error_pct': -2.7954612800391163, 'vkh_worst_gamma': 4.727915190661451, 'vkh_worst_q': 1.521727183505296, 'froment_10pct_claim_margin': 3.577227154389372, 'beta_interface_at_worst': 0.16473693629131597, 'beta_constancy_at_worst': 2.1152377091519794, 'vkh_worst_on_printed_labels_pct': -2.729420830048513, 'gamma_at_half_depletion': 2.20356390885277, 'gamma_at_99pct_depletion': 13.037828234575093, 'vkh_error_at_half_depletion_pct': -1.8304357198731687, 'vkh_error_at_99pct_depletion_pct': -1.5034526587944104, 'vkh_error_at_full_depletion_pct': -0.0003732672972026675, 'beta_constancy_at_99pct_depletion': 19.200277245134384, 'lev_small_M_1pct_threshold': 0.7230860227252368, 'lev_pfo_expansion_err_pct': -0.5366173642110117, 'vkh_form_pfo_expansion_err_pct': -0.7373732385600018, 'uncorrected_E_eq_M_err_pct': 9.300420478888993, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 0.22874880101689518, 'lev_inst_overstatement_factor': 43.99752644405657, 'inst_deficit_exponent_num_steepest': -5.331186598776558, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 0.005609766779923753, 'f31_definition_vkh_max_error_pct': 2.076895595924666, 'f31_definition_rootfound_pct': 2.078500611717025, 'pfo_max_rel_error_graded': 0.0008846990694951762, 'pfo_max_rel_error_uniform_same_n': 0.0008846990694951762, 'pfo_max_rel_error_uniform_half_n': 0.0063367334444864865, 'f31_stored_vs_recomputed_rel': 1.1315193944039237e-06, 'f31_first_order_error_ratio': 7.162586310961501, 'fv_vs_bvp_max_rel_diff': 1.5478358367015943e-05, 'fv_vs_bvp_max_abs_diff_beta': 9.701192043076734e-06, 'ref_vs_bvp_max_rel_diff': 1.5478358367015943e-05, 'ref_self_refinement_max_rel_diff': 1.5477934562579954e-05, 'first_integral_max_abs_resid': 1.2061178722433397e-11, 'vkh_two_routes_max_rel_diff': 7.993605777301127e-15, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 3.80000031441341e-10, 'fv_convergence_order': 2.5694284888667576, 'fv_rel_error_n800': 7.625140741041037e-09, 'fv_rel_error_n800_uniform': 7.625140741041037e-09}
    -&gt; NOT A ONE-WAY DEFECT, and the page says so rather than filing it as one. At large gamma the reaction layer is thinner than a uniform cell - the defect F3.1 names in its own first-order check - and this row prices it: the pseudo-first-order error to Ha = 200 is two orders worse without grading.  But at the MODERATE gamma where this page's headline sits the uniform grid is the better one, and on the metrics that carry the headline - the worst error itself, the margin against the printed 10 percent, the two depletion thresholds and the worst over the printed labels - it agrees with the extrapolated reference to within the move tolerance below, so it does not appear as cover for THOSE.  It is not cover-free: on the other moderate-gamma metrics it sits just the other side of that tolerance and still buys links, and on the high-gamma metrics it buys large ones, which is the reason to keep it.  The split is printed under the coverage map.  The agreement is itself evidence: two different discretisations, one of them extrapolated, landing on the same fourth decimal
* beta given a zero-gradient bulk edge instead of beta(1) = 1
    {'vkh_worst_rel_error_pct': 61748.11131544369, 'vkh_worst_gamma': 1000.0, 'vkh_worst_q': 1000.0, 'froment_10pct_claim_margin': 0.00016194827318546538, 'beta_interface_at_worst': 0.0, 'beta_constancy_at_worst': nan, 'vkh_worst_on_printed_labels_pct': 61748.11131544369, 'gamma_at_half_depletion': 0.5, 'gamma_at_99pct_depletion': 0.5, 'vkh_error_at_half_depletion_pct': 8.19700953409948, 'vkh_error_at_99pct_depletion_pct': 8.19700953409948, 'vkh_error_at_full_depletion_pct': 61748.11131544369, 'beta_constancy_at_99pct_depletion': nan, 'lev_small_M_1pct_threshold': 0.17320508055671197, 'lev_pfo_expansion_err_pct': 809.9999995762482, 'vkh_form_pfo_expansion_err_pct': 808.1632648832258, 'uncorrected_E_eq_M_err_pct': 899.9999995343387, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 400.00000000245086, 'lev_inst_overstatement_factor': 0.0006249999999923411, 'inst_deficit_exponent_num_steepest': -1.767907018936209e-11, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 70789.94769094948, 'fv_vs_bvp_max_rel_diff': 0.9838837187305034, 'fv_vs_bvp_max_abs_diff_beta': 0.9968463205991237, 'ref_vs_bvp_max_rel_diff': 4.3693968221347745e-08, 'ref_self_refinement_max_rel_diff': 3.841073770161074e-08, 'first_integral_max_abs_resid': 6.417639042410883e-10, 'vkh_two_routes_max_rel_diff': 7.993605777301127e-15, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 3.80000031441341e-10, 'fv_convergence_order': 1.249435642655333e-10, 'fv_rel_error_n800': 0.7706713394820348, 'fv_rel_error_n800_uniform': 0.7706713395110265}
    -&gt; the bulk value of B is what q is defined against, so this is not a small perturbation: it removes the supply of B entirely
* worst point SAMPLED on the scan grid instead of root-found
    {'vkh_worst_rel_error_pct': -2.6103079423025783, 'vkh_worst_gamma': 3.3437015248821096, 'vkh_worst_q': 1.0, 'froment_10pct_claim_margin': 3.830965625909601, 'beta_interface_at_worst': 0.1910076284920459, 'beta_constancy_at_worst': 2.007752864043423, 'vkh_worst_on_printed_labels_pct': -2.6947531751927745, 'gamma_at_half_depletion': 1.7343214837143033, 'gamma_at_99pct_depletion': 9.319459260974178, 'vkh_error_at_half_depletion_pct': -1.5515495248973772, 'vkh_error_at_99pct_depletion_pct': -1.5177113470185997, 'vkh_error_at_full_depletion_pct': -0.00018335519445102395, 'beta_constancy_at_99pct_depletion': 24.499634539981884}
    -&gt; the reason every extremum on this page is a root: the sampled maximum is grid-limited, and both its location and its value move
* the bracketing scan halved to 7 points
    {'vkh_worst_rel_error_pct': -2.795463320250191, 'vkh_worst_gamma': 4.727949047970863, 'vkh_worst_q': 1.5217275001832367, 'froment_10pct_claim_margin': 3.5772245436241352, 'beta_interface_at_worst': 0.16473464954825584, 'beta_constancy_at_worst': 2.1152530162563536, 'vkh_worst_on_printed_labels_pct': -2.72942229961614, 'gamma_at_half_depletion': 2.2035640658717592, 'gamma_at_99pct_depletion': 13.037809423607383, 'vkh_error_at_half_depletion_pct': -1.8304378573787885, 'vkh_error_at_99pct_depletion_pct': -1.5034591224143623, 'vkh_error_at_full_depletion_pct': -0.0003732603087999577, 'beta_constancy_at_99pct_depletion': 19.200219548449425}
    -&gt; a root-find is only as good as its bracket; this shows the answer does not depend on the scan once the bracket holds
* Levenspiel's 1 + M_H^2/3 transcribed with a 2
    {'lev_small_M_1pct_threshold': 0.24534331726835168, 'lev_pfo_expansion_err_pct': -0.536624806035424, 'vkh_form_pfo_expansion_err_pct': -0.737380665363907, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 0.2286236667842445, 'lev_inst_overstatement_factor': 44.24445191547594, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05}
    -&gt; the 3 is the Taylor coefficient of gamma/tanh gamma, so this row checks a constant of FROMENT's equation through LEVENSPIEL's transcription
* Levenspiel's 2 E_i transcribed as E_i
    {'lev_small_M_1pct_threshold': 0.7230861468815154, 'lev_pfo_expansion_err_pct': -10.373661913130805, 'vkh_form_pfo_expansion_err_pct': -10.775173631787771, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 0.2286236667842445, 'lev_inst_overstatement_factor': 44.24445191547594, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05}
* Levenspiel's (M_H - 1) transcribed as M_H
    {'lev_small_M_1pct_threshold': 0.7230861468815154, 'lev_pfo_expansion_err_pct': -1.629628929046023, 'vkh_form_pfo_expansion_err_pct': -1.852690994966566, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': 0.9952780169006072, 'lev_inst_asymptote_ratio_num': 0.2286236667842445, 'lev_inst_overstatement_factor': 44.24445191547594, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05}
    -&gt; the -1 is worth little at M_H = 10 and everything at M_H = 1, which is why the expansion is evaluated at the boundary the book declares for it
* Levenspiel's E_i^2(E_i - 1) transcribed as E_i(E_i - 1)
    {'lev_small_M_1pct_threshold': 0.7230861468815154, 'lev_pfo_expansion_err_pct': -0.536624806035424, 'vkh_form_pfo_expansion_err_pct': -0.737380665363907, 'uncorrected_E_eq_M_err_pct': 9.300412301059978, 'lev_inst_asymptote_ratio_vkh': 19.905560338012144, 'lev_inst_asymptote_ratio_num': 4.57247333568489, 'lev_inst_overstatement_factor': 2.212222595773797, 'inst_deficit_exponent_num_steepest': -5.33847131505646, 'inst_deficit_exponent_vkh_finest': -1.9948831601639323, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05}
    -&gt; the exponent is what the instantaneous asymptote ratio tests; without this row that ratio would be an unchecked 0.995
* Froment's curve labels read as E_i, the way Levenspiel's are
    {'chart_label_max_plateau_ratio': 1.0, 'vkh_worst_rel_error_pct': -2.7954633357038534, 'vkh_worst_gamma': 4.727910228526406, 'vkh_worst_q': 1.5217289736637973, 'froment_10pct_claim_margin': 3.577224523848802, 'beta_interface_at_worst': 0.1647374981668422, 'beta_constancy_at_worst': 2.11522919512376, 'vkh_worst_on_printed_labels_pct': -2.651813181709496, 'gamma_at_half_depletion': 2.2035653164066815, 'gamma_at_99pct_depletion': 13.037820053916313, 'vkh_error_at_half_depletion_pct': -1.8304383279474448, 'vkh_error_at_99pct_depletion_pct': -1.5034589551330495, 'vkh_error_at_full_depletion_pct': -0.0003732658372348927, 'beta_constancy_at_99pct_depletion': 19.200206605192175}
    -&gt; the notation trap, priced: read both books' labels the same way and the plateau ratio collapses to 1, which is exactly the mistake the metric exists to record.  DECLARED LIMIT OF THIS ROW: max_L L/L is identically 1 for ANY label set, so for that one metric this row is an identity and not a measurement; only the row below, which drops a transcribed label, actually tests the CSV.  chart_label_max_plateau_ratio is itself definitional - max_L (1+L)/L is 2 whenever the smallest printed label is 1 - and is reported as a property of the two notations, not as a result
* the smallest printed curve label dropped from the CSV
    {'chart_label_max_plateau_ratio': 1.5, 'vkh_worst_rel_error_pct': -2.7954633357038534, 'vkh_worst_gamma': 4.727910228526406, 'vkh_worst_q': 1.5217289736637973, 'froment_10pct_claim_margin': 3.577224523848802, 'beta_interface_at_worst': 0.1647374981668422, 'beta_constancy_at_worst': 2.11522919512376, 'vkh_worst_on_printed_labels_pct': -2.729422310099984, 'gamma_at_half_depletion': 2.2035653164066815, 'gamma_at_99pct_depletion': 13.037820053916313, 'vkh_error_at_half_depletion_pct': -1.8304383279474448, 'vkh_error_at_99pct_depletion_pct': -1.5034589551330495, 'vkh_error_at_full_depletion_pct': -0.0003732658372348927, 'beta_constancy_at_99pct_depletion': 19.200206605192175}
    -&gt; the label-ratio metric is a property of the transcribed LABEL SET as much as of the two notations, and this is what a dropped row costs it
* the implicit relation solved to xtol = 1e-4
    {'vkh_two_routes_max_rel_diff': 8.735155343608803e-06, 'vkh_pfo_limit_max_rel_error': 2.9800332534968277e-08, 'vkh_instantaneous_limit_rel_error': 0.0}
    -&gt; the limit checks on (6.3.5-1) sit at 1e-8 and 1e-10, which is Brent's tolerance and not physics; this is the row that moves them, and it is why they are reported as solver checks rather than as agreement
* Newton stopped at an update of 1e-4
    {'fv_vs_bvp_max_rel_diff': 5.987803904372591e-06, 'fv_vs_bvp_max_abs_diff_beta': 2.9130800109078425e-06, 'ref_vs_bvp_max_rel_diff': 4.3693968221347745e-08, 'ref_self_refinement_max_rel_diff': 3.8484861075716026e-08, 'first_integral_max_abs_resid': 5.544259218392966e-10, 'vkh_two_routes_max_rel_diff': 7.993605777301127e-15, 'vkh_pfo_limit_max_rel_error': 1.4949999904700917e-08, 'vkh_instantaneous_limit_rel_error': 3.80000031441341e-10, 'fv_convergence_order': 2.000063816950139, 'fv_rel_error_n800': 1.8963402669269769e-06, 'fv_rel_error_n800_uniform': 7.624097797531704e-09}
    -&gt; the second axis that carries error here is the solver tolerance, not a time step - this page has no time axis
* collocation tolerance loosened to 1e-4
    {'fv_vs_bvp_max_rel_diff': 5.976887103242845e-06, 'fv_vs_bvp_max_abs_diff_beta': 2.261248639168212e-06, 'ref_vs_bvp_max_rel_diff': 1.679451265834686e-06, 'inst_deficit_routes_max_rel_diff': 8.609855356600526e-05}
    -&gt; an independent route is only independent if it is also accurate; this prices the second solver's own error</code></pre>
</div>
</div>
<div id="74bd2779" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:42:27.650612Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:42:27.650413Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:42:27.775904Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:42:27.775156Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1">METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb24-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- where the approximation is worst, and the assumption behind it</span></span>
<span id="cb24-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>],</span>
<span id="cb24-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_gamma"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_gamma"</span>],</span>
<span id="cb24-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_q"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_q"</span>],</span>
<span id="cb24-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_on_printed_labels_pct"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_on_printed_labels_pct"</span>],</span>
<span id="cb24-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_10pct_claim_margin"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_10pct_claim_margin"</span>],</span>
<span id="cb24-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_interface_at_worst"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_interface_at_worst"</span>],</span>
<span id="cb24-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>],</span>
<span id="cb24-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>],</span>
<span id="cb24-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_half_depletion_pct"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_half_depletion_pct"</span>],</span>
<span id="cb24-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_99pct_depletion_pct"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_99pct_depletion_pct"</span>],</span>
<span id="cb24-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_full_depletion_pct"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_full_depletion_pct"</span>],</span>
<span id="cb24-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the OTHER wording of the same assumption, book p. 340</span></span>
<span id="cb24-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>],</span>
<span id="cb24-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_99pct_depletion"</span>: W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_99pct_depletion"</span>],</span>
<span id="cb24-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Levenspiel's three printed expansions</span></span>
<span id="cb24-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_small_M_1pct_threshold"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_small_M_1pct_threshold"</span>],</span>
<span id="cb24-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_expansion_err_pct"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_expansion_err_pct"</span>],</span>
<span id="cb24-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_form_pfo_expansion_err_pct"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_form_pfo_expansion_err_pct"</span>],</span>
<span id="cb24-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uncorrected_E_eq_M_err_pct"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uncorrected_E_eq_M_err_pct"</span>],</span>
<span id="cb24-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_vkh"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_vkh"</span>],</span>
<span id="cb24-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_num"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_num"</span>],</span>
<span id="cb24-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_overstatement_factor"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_overstatement_factor"</span>],</span>
<span id="cb24-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_num_steepest"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_num_steepest"</span>],</span>
<span id="cb24-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_vkh_finest"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_vkh_finest"</span>],</span>
<span id="cb24-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>: L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>],</span>
<span id="cb24-28">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the numerics, including the baseline's own error</span></span>
<span id="cb24-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_rel_diff"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_rel_diff"</span>],</span>
<span id="cb24-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_abs_diff_beta"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_abs_diff_beta"</span>],</span>
<span id="cb24-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs_bvp_max_rel_diff"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs_bvp_max_rel_diff"</span>],</span>
<span id="cb24-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_self_refinement_max_rel_diff"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_self_refinement_max_rel_diff"</span>],</span>
<span id="cb24-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_integral_max_abs_resid"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_integral_max_abs_resid"</span>],</span>
<span id="cb24-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_two_routes_max_rel_diff"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_two_routes_max_rel_diff"</span>],</span>
<span id="cb24-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_pfo_limit_max_rel_error"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_pfo_limit_max_rel_error"</span>],</span>
<span id="cb24-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_instantaneous_limit_rel_error"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_instantaneous_limit_rel_error"</span>],</span>
<span id="cb24-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_convergence_order"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_convergence_order"</span>],</span>
<span id="cb24-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800"</span>],</span>
<span id="cb24-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800_uniform"</span>: R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800_uniform"</span>],</span>
<span id="cb24-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the two charts, and the page next door</span></span>
<span id="cb24-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chart_label_max_plateau_ratio"</span>: CHART_LABEL_MAX_RATIO,</span>
<span id="cb24-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>],</span>
<span id="cb24-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_rootfound_pct"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_rootfound_pct"</span>],</span>
<span id="cb24-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_graded"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_graded"</span>],</span>
<span id="cb24-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_same_n"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_same_n"</span>],</span>
<span id="cb24-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_half_n"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_half_n"</span>],</span>
<span id="cb24-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_stored_vs_recomputed_rel"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_stored_vs_recomputed_rel"</span>],</span>
<span id="cb24-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_first_order_error_ratio"</span>: F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_first_order_error_ratio"</span>],</span>
<span id="cb24-49">}</span>
<span id="cb24-50"></span>
<span id="cb24-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- coverage: GENERATED from the break rows' measured moves ---------------</span></span>
<span id="cb24-52">COVERAGE, UNKNOWN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, []</span>
<span id="cb24-53"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _label, _got, _note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb24-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(_got, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>):</span>
<span id="cb24-55">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb24-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _got.items():</span>
<span id="cb24-57">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>):</span>
<span id="cb24-58">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb24-59">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb24-60">            UNKNOWN.append((_label, _k))</span>
<span id="cb24-61">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb24-62">        _b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> METRICS[_k]</span>
<span id="cb24-63">        _rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_b), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_v)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb24-64">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL:</span>
<span id="cb24-65">            COVERAGE.setdefault(_k, []).append((_label, _rel))</span>
<span id="cb24-66"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> UNKNOWN, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break rows recompute names that are not metrics: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UNKNOWN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-67"></span>
<span id="cb24-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- how much the unextrapolated baseline moves, COUNTED -------------------</span></span>
<span id="cb24-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># No reason to count them by hand: the "one graded solve" row IS the</span></span>
<span id="cb24-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># unextrapolated baseline, so the movers are a set difference over METRICS.</span></span>
<span id="cb24-71">_NOEXT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS</span>
<span id="cb24-72">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reference taken as one graded solve"</span>))</span>
<span id="cb24-73">_MOVERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(k, METRICS[k], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(_NOEXT.items())</span>
<span id="cb24-74">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS</span>
<span id="cb24-75">           <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> METRICS[k])</span>
<span id="cb24-76">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(METRICS[k]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL]</span>
<span id="cb24-77">N_MOVED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_MOVERS)</span>
<span id="cb24-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the headline's own move, which the prose quotes as "more than a unit in its</span></span>
<span id="cb24-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fourth decimal": 1.6e-4 against a spread of 1e-8 across BLAS kernels.  How</span></span>
<span id="cb24-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MANY metrics change in their fourth decimal is not counted any more: several</span></span>
<span id="cb24-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sit within a few kernel spreads of a rounding boundary (vkh_worst_gamma,</span></span>
<span id="cb24-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># vkh_worst_q), so that count is decided by round-off.</span></span>
<span id="cb24-83">HEADLINE_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_NOEXT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>])</span>
<span id="cb24-84">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>])</span>
<span id="cb24-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">what the pre-extrapolation baseline moved, counted rather than asserted:"</span></span>
<span id="cb24-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MOVED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics"</span>)</span>
<span id="cb24-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"move by more than the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOVE_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> coverage tolerance; the headline moves by"</span></span>
<span id="cb24-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HEADLINE_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points.  The marks below"</span>)</span>
<span id="cb24-89"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"are a rounding comparison, shown for reading and not counted: a metric near a"</span></span>
<span id="cb24-90">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" rounding boundary can"</span>)</span>
<span id="cb24-91"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flip its mark between BLAS kernels."</span>)</span>
<span id="cb24-92"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _b, _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _MOVERS:</span>
<span id="cb24-93">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;16.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-94">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'   4th decimal'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_b, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-95"></span>
<span id="cb24-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- and the rows must COMPUTE what they return ---------------------------</span></span>
<span id="cb24-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A row that returns a typed constant records a move of exactly 1.0 whatever</span></span>
<span id="cb24-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the reported value is, so its coverage links cannot fail: a hand-written</span></span>
<span id="cb24-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># coverage claim wearing the generator's clothes.  This guard parses each row's</span></span>
<span id="cb24-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># own source, plus one level of the notebook helpers it names, and rejects any</span></span>
<span id="cb24-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># agreement.json key bound to a numeric literal or to a local name that is only</span></span>
<span id="cb24-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ever assigned one.  It cannot say whether the expression is the RIGHT one -</span></span>
<span id="cb24-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># that is what the measured moves are for.</span></span>
<span id="cb24-104"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> ast</span>
<span id="cb24-105"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> inspect</span>
<span id="cb24-106"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> textwrap</span>
<span id="cb24-107"></span>
<span id="cb24-108"></span>
<span id="cb24-109"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _is_number(node):</span>
<span id="cb24-110">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.Constant):</span>
<span id="cb24-111">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.value, (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>)</span>
<span id="cb24-112">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.UnaryOp) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.op, (ast.UAdd, ast.USub))</span>
<span id="cb24-113">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _is_number(node.operand))</span>
<span id="cb24-114"></span>
<span id="cb24-115"></span>
<span id="cb24-116"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _key_bindings(src):</span>
<span id="cb24-117">    tree, out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ast.parse(textwrap.dedent(src)), []</span>
<span id="cb24-118">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(tree):</span>
<span id="cb24-119">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Dict):</span>
<span id="cb24-120">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(k.value, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(n.keys, n.values)</span>
<span id="cb24-121">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(k, ast.Constant) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(k.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)]</span>
<span id="cb24-122">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.DictComp):</span>
<span id="cb24-123">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># {k: -2.8 for k in ("metric_a", "metric_b")} - the keys are not</span></span>
<span id="cb24-124">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># literals, so bind every constant string in the comprehension's</span></span>
<span id="cb24-125">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># own iterables to its value expression; no row uses it.</span></span>
<span id="cb24-126">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> gen <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.generators:</span>
<span id="cb24-127">                out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(c.value, n.value) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(gen.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">iter</span>)</span>
<span id="cb24-128">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(c, ast.Constant) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(c.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)]</span>
<span id="cb24-129">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Call) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(n.func, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dict"</span>:</span>
<span id="cb24-130">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(kw.arg, kw.value) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.keywords <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kw.arg]</span>
<span id="cb24-131">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Assign):</span>
<span id="cb24-132">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.targets:</span>
<span id="cb24-133">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Subscript) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>, ast.Constant)</span>
<span id="cb24-134">                        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)):</span>
<span id="cb24-135">                    out.append((t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>.value, n.value))</span>
<span id="cb24-136">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb24-137"></span>
<span id="cb24-138"></span>
<span id="cb24-139"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sources(fn):</span>
<span id="cb24-140">    src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> textwrap.dedent(inspect.getsource(fn))</span>
<span id="cb24-141">    seen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [src]</span>
<span id="cb24-142">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(ast.parse(src)):</span>
<span id="cb24-143">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Name):</span>
<span id="cb24-144">            obj <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">globals</span>().get(n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>)</span>
<span id="cb24-145">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (inspect.isfunction(obj) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(obj, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__module__"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__main__"</span></span>
<span id="cb24-146">                    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> obj <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> fn):</span>
<span id="cb24-147">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb24-148">                    seen.append(textwrap.dedent(inspect.getsource(obj)))</span>
<span id="cb24-149">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> (<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">OSError</span>, <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">TypeError</span>):</span>
<span id="cb24-150">                    seen.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"# UNREADABLE SOURCE: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-151">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> seen</span>
<span id="cb24-152"></span>
<span id="cb24-153"></span>
<span id="cb24-154"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> literal_metrics(fn):</span>
<span id="cb24-155">    bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb24-156">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> src <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _sources(fn):</span>
<span id="cb24-157">        frozen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(ast.parse(src)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Assign)</span>
<span id="cb24-158">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.targets <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Name) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _is_number(n.value)}</span>
<span id="cb24-159">        bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _key_bindings(src) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS</span>
<span id="cb24-160">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (_is_number(v) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(v, ast.Name) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> v.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> frozen))]</span>
<span id="cb24-161">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(bad))</span>
<span id="cb24-162"></span>
<span id="cb24-163"></span>
<span id="cb24-164"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _negative_control():</span>
<span id="cb24-165">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""THE GUARD'S TEETH: a row that types its metrics instead of computing them."""</span></span>
<span id="cb24-166">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.8</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_overstatement_factor"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.0</span>,</span>
<span id="cb24-167">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the third form is a DICT COMPREHENSION</span></span>
<span id="cb24-168">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.115</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>,)},</span>
<span id="cb24-169">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_diagnostic"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(LABELS)}</span>
<span id="cb24-170"></span>
<span id="cb24-171"></span>
<span id="cb24-172">CAUGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> literal_metrics(_negative_control)</span>
<span id="cb24-173">LITERAL_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl: bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> bad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [literal_metrics(fn)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bad}</span>
<span id="cb24-174"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(CAUGHT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_overstatement_factor"</span>,</span>
<span id="cb24-175">                       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>}, (</span>
<span id="cb24-176">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the literal guard no longer catches the row it was written for"</span>)</span>
<span id="cb24-177"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> LITERAL_ROWS, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break rows returning typed constants: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LITERAL_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-178"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> break rows parsed; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(LITERAL_ROWS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> return a metric as a"</span></span>
<span id="cb24-179">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" typed constant.  Negative control caught: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAUGHT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-180"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHAT THE GUARD CANNOT DO, stated so it is not over-trusted: it rejects a"</span></span>
<span id="cb24-181">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" numeric LITERAL,"</span></span>
<span id="cb24-182">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">and a local name only ever bound to one, walking one level into the"</span></span>
<span id="cb24-183">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" helpers a row names."</span></span>
<span id="cb24-184">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">It sees literals in a dict display, in dict(...), in an out[k] = ..."</span></span>
<span id="cb24-185">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" assignment, through a"</span></span>
<span id="cb24-186">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">{**d} merge, and in a"</span></span>
<span id="cb24-187">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">DICT COMPREHENSION over literal key strings, which is the third form the"</span></span>
<span id="cb24-188">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" negative control uses."</span></span>
<span id="cb24-189">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">What still passes: a comprehension over a NAME rather than a literal,"</span></span>
<span id="cb24-190">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" float(-2.8), -2.8 * 1.0,"</span></span>
<span id="cb24-191">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">np.float64(-2.8), and a literal returned two call levels down.  And it can"</span></span>
<span id="cb24-192">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" never tell whether"</span></span>
<span id="cb24-193">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">a computed expression is the RIGHT expression -"</span></span>
<span id="cb24-194">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">only the measured moves below can, and only for rows that move something."</span></span>
<span id="cb24-195">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  All"</span></span>
<span id="cb24-196">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows"</span></span>
<span id="cb24-197">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">here perturb an input and re-enter block_worst / block_lev / block_f31 /"</span></span>
<span id="cb24-198">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" block_routes."</span>)</span>
<span id="cb24-199"></span>
<span id="cb24-200">UNCOVERED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE))</span>
<span id="cb24-201">BEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items()}</span>
<span id="cb24-202"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(COVERAGE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> covered by at least one measured"</span></span>
<span id="cb24-203">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" move, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(UNCOVERED)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> uncovered: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UNCOVERED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-204"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> measured row-metric links from"</span></span>
<span id="cb24-205">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows"</span>)</span>
<span id="cb24-206">CI_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># check_agreement.py's REL_TOL: a smaller move is invisible to CI</span></span>
<span id="cb24-207">WEAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BEST.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> CI_TOL)</span>
<span id="cb24-208"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metric'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rows'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'best move'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-209"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(METRICS):</span>
<span id="cb24-210">    n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(COVERAGE.get(k, []))</span>
<span id="cb24-211">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}{</span>BEST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(k, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-212">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'   &lt; CI 5 %'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WEAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-213"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">weakest cover: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(BEST.items(), key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-214"></span>
<span id="cb24-215"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- what the relabelled uniform row still buys, measured not asserted -----</span></span>
<span id="cb24-216">U_LABEL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform grid instead of graded, at the same n_x"</span></span>
<span id="cb24-217">U_LINKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(((r, k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v</span>
<span id="cb24-218">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> U_LABEL), reverse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb24-219">U_REAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(r, k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_LINKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> CI_TOL]</span>
<span id="cb24-220">U_NOISE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(r, k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_LINKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> CI_TOL]</span>
<span id="cb24-221">U_BEST_FOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_NOISE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> BEST[k]]</span>
<span id="cb24-222"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the relabelled uniform row, split by size: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(U_REAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> real links"</span></span>
<span id="cb24-223">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (&gt;= CI's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) - the high-gamma"</span>)</span>
<span id="cb24-224"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics grading exists for, which is why the row is kept - and"</span></span>
<span id="cb24-225">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(U_NOISE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> noise-scale links from"</span>)</span>
<span id="cb24-226"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_NOISE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_NOISE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb24-227">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" invisible to CI and none of them any metric's best cover"</span></span>
<span id="cb24-228">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> U_BEST_FOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">):"</span>)</span>
<span id="cb24-229"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_NOISE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-230"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(that none of them is a best cover is not a check that can fail: the WEAK"</span></span>
<span id="cb24-231">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" assertion above"</span>)</span>
<span id="cb24-232"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" already refuses any metric whose best cover is below CI's threshold.  It is"</span></span>
<span id="cb24-233">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" printed because"</span>)</span>
<span id="cb24-234"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the relabelling does not remove these links.)"</span>)</span>
<span id="cb24-235"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"What the row buys NOTHING on is the metrics that carry the headline, where it"</span></span>
<span id="cb24-236">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" agrees with the"</span>)</span>
<span id="cb24-237"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated reference to inside the move tolerance - which IS the claim its"</span></span>
<span id="cb24-238">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" note makes:"</span>)</span>
<span id="cb24-239">_U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_LINKS}</span>
<span id="cb24-240"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_10pct_claim_margin"</span>,</span>
<span id="cb24-241">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_on_printed_labels_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>,</span>
<span id="cb24-242">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>):</span>
<span id="cb24-243">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-244">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'   still covered, '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(_U[_k], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'.1e'</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _U <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'   no link'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-245"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> UNCOVERED, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"uncovered metrics: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UNCOVERED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-246"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> WEAK, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics whose best cover is below CI's 5 %: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-247"></span>
<span id="cb24-248"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- every metric registered ONCE, with how it is checked -------------------</span></span>
<span id="cb24-249"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (docs/claims-design.md).  A value is held to rtol 0.05 of the committed</span></span>
<span id="cb24-250"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># baseline; a bound is checked on every run and in CI.  Solver gaps, two-method</span></span>
<span id="cb24-251"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gaps, closures, the two limits and the grid order are BOUNDS whatever their</span></span>
<span id="cb24-252"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># size, and the comparison with F3.1's committed number is one too, because</span></span>
<span id="cb24-253"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F3.1 made it on another machine.  Every other metric is a physical or</span></span>
<span id="cb24-254"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># discretisation result whose spread across BLAS kernels is at most 8.4e-5</span></span>
<span id="cb24-255"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative (vkh_error_at_full_depletion_pct), far inside its 5 %.</span></span>
<span id="cb24-256">BOUNDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb24-257">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-258">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-259">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two methods on the M_H = 800 deficit E_i - F_A, about 1.3e-5 of F_A,"</span></span>
<span id="cb24-260">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" so kernel round-off in F_A is amplified; measured 8.4e-5 to 9.0e-5"</span></span>
<span id="cb24-261">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" across BLAS kernels, the bound is about 11x that and still far below"</span></span>
<span id="cb24-262">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the 44x it supports"</span>),</span>
<span id="cb24-263">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-264">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-265">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one graded n_x = 800 solve against collocation at tol 1e-10, set by"</span></span>
<span id="cb24-266">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" its second-order discretisation; measured 5.99e-6 on three kernels"</span>),</span>
<span id="cb24-267">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_abs_diff_beta"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-268">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-269">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta(0), the same two solvers; measured 2.91e-6 on three kernels"</span>),</span>
<span id="cb24-270">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs_bvp_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-271">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-272">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the Richardson reference against collocation at tol 1e-10; measured"</span></span>
<span id="cb24-273">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 4.37e-8 on three kernels"</span>),</span>
<span id="cb24-274">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_self_refinement_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-275">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-276">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reference against Richardson (800, 1600); measured 3.84e-8 on"</span></span>
<span id="cb24-277">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" three kernels"</span>),</span>
<span id="cb24-278">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_integral_max_abs_resid"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-279">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-280">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|q beta(0) - (1 + q - F_A)|/(1 + q) on the reference, never told to"</span></span>
<span id="cb24-281">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the discretisation; measured 6.4e-10 on three kernels"</span>),</span>
<span id="cb24-282">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_two_routes_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-283">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb24-284">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the implicit relation solved for F_A and for gamma', Brent at"</span></span>
<span id="cb24-285">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" xtol 1e-13, rtol 8.9e-16; measured 8.0e-15"</span>),</span>
<span id="cb24-286">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_pfo_limit_max_rel_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-287">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb24-288">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evaluated at q = 1e10, so the finite-q error is about gamma/(2q),"</span></span>
<span id="cb24-289">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1.5e-8 at gamma = 300"</span>),</span>
<span id="cb24-290">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_instantaneous_limit_rel_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-291">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb24-292">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evaluated at gamma = 1e6, where the deficit q(1+q)^2/gamma^2 is"</span></span>
<span id="cb24-293">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 3.8e-10 of 1 + q = 20"</span>),</span>
<span id="cb24-294">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_convergence_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-295">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb24-296">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second-order finite volumes; 2.0000 between n_x = 400 and 800 at"</span></span>
<span id="cb24-297">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (gamma, q) = (10, 4)"</span>),</span>
<span id="cb24-298">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_stored_vs_recomputed_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb24-299">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb24-300">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this page's recomputation of F3.1's definition against F3.1's"</span></span>
<span id="cb24-301">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" committed vkh_max_error_pct, made on another machine; the residual is"</span></span>
<span id="cb24-302">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" F3.1's uniform n_x = 400 discretisation, 1.29e-6 on three kernels,"</span></span>
<span id="cb24-303">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" and F3.1's own number spreads 5e-12 relative across kernels"</span>),</span>
<span id="cb24-304">}</span>
<span id="cb24-305">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F3.2"</span>)</span>
<span id="cb24-306"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.items():</span>
<span id="cb24-307">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS:</span>
<span id="cb24-308">        claims.bound(_k, _v, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>BOUNDS[_k])</span>
<span id="cb24-309">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb24-310">        claims.value(_k, _v)</span>
<span id="cb24-311"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break table, wired row by row to the claims it recomputes: a row breaks</span></span>
<span id="cb24-312"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a claim when the claim's own check (rtol or bound) fails on its value</span></span>
<span id="cb24-313"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _label, _got, _note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb24-314">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _got.items():</span>
<span id="cb24-315">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb24-316">            claims.breaks(_label, _k, _v)</span>
<span id="cb24-317">_kinds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {kd: [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kd]</span>
<span id="cb24-318">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)}</span>
<span id="cb24-319"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics registered as claims: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values,"</span></span>
<span id="cb24-320">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bound'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exact'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact.  The bounds:"</span>)</span>
<span id="cb24-321"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>]:</span>
<span id="cb24-322">    _c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[_k]</span>
<span id="cb24-323">    _rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-324">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:36s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_rng<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'basis'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-325"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claims.report() runs at the end of the prose cell below, after every number</span></span>
<span id="cb24-326"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the prose quotes has been checked against its claim with claims.says.</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>
what the pre-extrapolation baseline moved, counted rather than asserted: 27 of the 42 metrics
move by more than the 1e-06 coverage tolerance; the headline moves by 1.7e-04 points.  The marks below
are a rounding comparison, shown for reading and not counted: a metric near a rounding boundary can
flip its mark between BLAS kernels.
   beta_constancy_at_99pct_depletion                     19.2008 -&gt; 19.2002            4th decimal
   beta_constancy_at_worst                                2.1154 -&gt; 2.11523            4th decimal
   beta_interface_at_worst                              0.164722 -&gt; 0.164737        
   f31_definition_rootfound_pct                          2.07827 -&gt; 2.0785             4th decimal
   f31_definition_vkh_max_error_pct                      2.07668 -&gt; 2.0769             4th decimal
   f31_stored_vs_recomputed_rel                      0.000103274 -&gt; 1.29297e-06        4th decimal
   first_integral_max_abs_resid                      4.72673e-10 -&gt; 6.41764e-10     
   froment_10pct_claim_margin                            3.57744 -&gt; 3.57722            4th decimal
   gamma_at_99pct_depletion                              13.0375 -&gt; 13.0378            4th decimal
   gamma_at_half_depletion                               2.20351 -&gt; 2.20357            4th decimal
   inst_deficit_exponent_num_steepest                   -5.33817 -&gt; -5.33847           4th decimal
   inst_deficit_routes_max_rel_diff                  0.000275336 -&gt; 8.60986e-05        4th decimal
   lev_inst_asymptote_ratio_num                          0.22864 -&gt; 0.228624        
   lev_inst_overstatement_factor                         44.2322 -&gt; 44.2445            4th decimal
   lev_pfo_expansion_err_pct                           -0.536059 -&gt; -0.536625          4th decimal
   lev_small_M_1pct_threshold                           0.723062 -&gt; 0.723086        
   ref_self_refinement_max_rel_diff                  5.98792e-06 -&gt; 3.84107e-08     
   ref_vs_bvp_max_rel_diff                           5.98788e-06 -&gt; 4.3694e-08      
   uncorrected_E_eq_M_err_pct                            9.30103 -&gt; 9.30041            4th decimal
   vkh_error_at_99pct_depletion_pct                     -1.50341 -&gt; -1.50346           4th decimal
   vkh_error_at_full_depletion_pct                   -0.00037322 -&gt; -0.000373266    
   vkh_error_at_half_depletion_pct                      -1.83018 -&gt; -1.83044           4th decimal
   vkh_form_pfo_expansion_err_pct                      -0.736816 -&gt; -0.737381          4th decimal
   vkh_worst_gamma                                       4.72801 -&gt; 4.72791            4th decimal
   vkh_worst_on_printed_labels_pct                      -2.72923 -&gt; -2.72942           4th decimal
   vkh_worst_q                                           1.52165 -&gt; 1.52173         
   vkh_worst_rel_error_pct                               -2.7953 -&gt; -2.79546           4th decimal
19 break rows parsed; 0 return a metric as a typed constant.  Negative control caught: ['beta_constancy_at_worst', 'lev_inst_overstatement_factor', 'vkh_worst_rel_error_pct']
WHAT THE GUARD CANNOT DO, stated so it is not over-trusted: it rejects a numeric LITERAL,
and a local name only ever bound to one, walking one level into the helpers a row names.
It sees literals in a dict display, in dict(...), in an out[k] = ... assignment, through a
{**d} merge, and in a
DICT COMPREHENSION over literal key strings, which is the third form the negative control uses.
What still passes: a comprehension over a NAME rather than a literal, float(-2.8), -2.8 * 1.0,
np.float64(-2.8), and a literal returned two call levels down.  And it can never tell whether
a computed expression is the RIGHT expression -
only the measured moves below can, and only for rows that move something.  All 19 rows
here perturb an input and re-enter block_worst / block_lev / block_f31 / block_routes.

42 metrics, 42 covered by at least one measured move, 0 uncovered: []
240 measured row-metric links from 19 rows

metric                                        rows   best move
beta_constancy_at_99pct_depletion                8   9.479e-01
beta_constancy_at_worst                          7   1.000e+00
beta_interface_at_worst                         10   1.000e+00
chart_label_max_plateau_ratio                    2   5.000e-01
f31_definition_rootfound_pct                     6   1.000e+00
f31_definition_vkh_max_error_pct                 6   1.000e+00
f31_first_order_error_ratio                      2   9.920e-01
f31_stored_vs_recomputed_rel                     7   1.000e+00
first_integral_max_abs_resid                     4   1.000e+00
froment_10pct_claim_margin                       8   1.000e+00
fv_convergence_order                             5   1.000e+00
fv_rel_error_n800                                5   1.000e+00
fv_rel_error_n800_uniform                        4   1.000e+00
fv_vs_bvp_max_abs_diff_beta                      6   1.000e+00
fv_vs_bvp_max_rel_diff                           6   1.000e+00
gamma_at_99pct_depletion                         8   9.617e-01
gamma_at_half_depletion                          8   7.731e-01
inst_deficit_exponent_num_steepest               5   1.194e+00
inst_deficit_exponent_vkh_finest                 3   1.997e+00
inst_deficit_routes_max_rel_diff                 5   1.000e+00
lev_inst_asymptote_ratio_num                     6   1.000e+00
lev_inst_asymptote_ratio_vkh                     4   1.050e+00
lev_inst_overstatement_factor                    6   1.000e+00
lev_pfo_expansion_err_pct                        7   1.001e+00
lev_small_M_1pct_threshold                       5   7.605e-01
pfo_max_rel_error_graded                         2   9.920e-01
pfo_max_rel_error_uniform_half_n                 1   9.854e-01
pfo_max_rel_error_uniform_same_n                 1   9.948e-01
ref_self_refinement_max_rel_diff                 4   9.975e-01
ref_vs_bvp_max_rel_diff                          4   1.000e+00
uncorrected_E_eq_M_err_pct                       4   1.000e+00
vkh_error_at_99pct_depletion_pct                 9   1.183e+00
vkh_error_at_full_depletion_pct                 10   1.000e+00
vkh_error_at_half_depletion_pct                  9   1.593e+00
vkh_form_pfo_expansion_err_pct                   7   1.001e+00
vkh_instantaneous_limit_rel_error                4   1.000e+00
vkh_pfo_limit_max_rel_error                      2   4.983e-01
vkh_two_routes_max_rel_diff                      4   1.000e+00
vkh_worst_gamma                                 10   9.953e-01
vkh_worst_on_printed_labels_pct                  9   1.055e+00
vkh_worst_q                                      9   9.985e-01
vkh_worst_rel_error_pct                          8   1.031e+00

weakest cover: ('vkh_pfo_limit_max_rel_error', 0.49832774895520704)

the relabelled uniform row, split by size: 11 real links (&gt;= CI's 5%) - the high-gamma
metrics grading exists for, which is why the row is kept - and 13 noise-scale links from
 1.0e-06 to 5.6e-03, invisible to CI and none of them any metric's best cover (True):
   lev_inst_overstatement_factor, inst_deficit_exponent_num_steepest, lev_inst_asymptote_ratio_num, lev_pfo_expansion_err_pct, vkh_form_pfo_expansion_err_pct, vkh_error_at_99pct_depletion_pct, beta_constancy_at_worst, vkh_error_at_full_depletion_pct, beta_constancy_at_99pct_depletion, beta_interface_at_worst, vkh_error_at_half_depletion_pct, vkh_worst_q, vkh_worst_gamma
(that none of them is a best cover is not a check that can fail: the WEAK assertion above
 already refuses any metric whose best cover is below CI's threshold.  It is printed because
 the relabelling does not remove these links.)
What the row buys NOTHING on is the metrics that carry the headline, where it agrees with the
extrapolated reference to inside the move tolerance - which IS the claim its note makes:
   vkh_worst_rel_error_pct                        no link
   froment_10pct_claim_margin                     no link
   vkh_worst_on_printed_labels_pct                no link
   gamma_at_half_depletion                        no link
   gamma_at_99pct_depletion                       no link

42 metrics registered as claims: 31 values, 11 bounds, 0 exact.  The bounds:
  inst_deficit_routes_max_rel_diff     [0, 0.001]     [chosen]  here 8.61e-05
  fv_vs_bvp_max_rel_diff               &lt;= 1e-05       [chosen]  here 5.99e-06
  fv_vs_bvp_max_abs_diff_beta          &lt;= 5e-06       [chosen]  here 2.91e-06
  ref_vs_bvp_max_rel_diff              &lt;= 1e-07       [chosen]  here 4.37e-08
  ref_self_refinement_max_rel_diff     &lt;= 1e-07       [chosen]  here 3.84e-08
  first_integral_max_abs_resid         &lt;= 1e-08       [chosen]  here 6.42e-10
  vkh_two_routes_max_rel_diff          &lt;= 1e-12       [tolerance]  here 7.99e-15
  vkh_pfo_limit_max_rel_error          &lt;= 2e-08       [theory]  here 1.49e-08
  vkh_instantaneous_limit_rel_error    &lt;= 1e-09       [theory]  here 3.8e-10
  fv_convergence_order                 [1.9, 2.1]     [theory]  here 2
  f31_stored_vs_recomputed_rel         &lt;= 2e-05       [chosen]  here 1.29e-06</code></pre>
</div>
</div>
<div id="547bfa94" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:42:27.777983Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:42:27.777800Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:42:27.799821Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:42:27.799043Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number written in the markdown of this notebook, in meta.yaml, in</span></span>
<span id="cb26-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># README.md and in models.yaml is checked here against the live computation.</span></span>
<span id="cb26-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE NOTEBOOK FAILS TO EXECUTE if any of them drifts.</span></span>
<span id="cb26-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A number that is a registered claim is checked by claims.says, as written:</span></span>
<span id="cb26-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># within one unit of its last written place, or, for a bound phrase such as</span></span>
<span id="cb26-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "below 1e-12", at least as loose as the claim's declared bound.  Where the</span></span>
<span id="cb26-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># last written place was finer than 10x the spread across BLAS kernels the</span></span>
<span id="cb26-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># literal was rounded: the worst point's gamma and q (spread 2e-5 and 1.4e-5)</span></span>
<span id="cb26-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to three decimals, the two depletion thresholds to 2.204 and 13.038.  The</span></span>
<span id="cb26-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two-method gap on the deficit spreads 8.4e-5 to 9.0e-5 and is quoted as its</span></span>
<span id="cb26-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bound only.</span></span>
<span id="cb26-12">SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb26-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-2.7955"</span>],</span>
<span id="cb26-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_gamma"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.728"</span>],</span>
<span id="cb26-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_q"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.522"</span>],</span>
<span id="cb26-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_interface_at_worst"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.1647"</span>],</span>
<span id="cb26-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_worst"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.115"</span>],</span>
<span id="cb26-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_constancy_at_99pct_depletion"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"19.20"</span>],</span>
<span id="cb26-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_10pct_claim_margin"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.5772"</span>],</span>
<span id="cb26-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_on_printed_labels_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-2.7294"</span>],</span>
<span id="cb26-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_half_depletion"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.204"</span>],</span>
<span id="cb26-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_half_depletion_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1.8304"</span>],</span>
<span id="cb26-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_at_99pct_depletion"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13.038"</span>],</span>
<span id="cb26-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_99pct_depletion_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1.5035"</span>],</span>
<span id="cb26-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_error_at_full_depletion_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.00037"</span>],</span>
<span id="cb26-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_small_M_1pct_threshold"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7231"</span>],</span>
<span id="cb26-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_expansion_err_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.5366"</span>],</span>
<span id="cb26-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_form_pfo_expansion_err_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.7374"</span>],</span>
<span id="cb26-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uncorrected_E_eq_M_err_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.3004"</span>],</span>
<span id="cb26-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_vkh"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9953"</span>],</span>
<span id="cb26-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_asymptote_ratio_num"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.2286"</span>],</span>
<span id="cb26-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_inst_overstatement_factor"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44.24"</span>],</span>
<span id="cb26-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_num_steepest"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-5.3385"</span>],</span>
<span id="cb26-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_exponent_vkh_finest"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1.9949"</span>],</span>
<span id="cb26-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_deficit_routes_max_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-3"</span>],</span>
<span id="cb26-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.99e-6"</span>],</span>
<span id="cb26-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs_bvp_max_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.37e-8"</span>],</span>
<span id="cb26-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_self_refinement_max_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.84e-8"</span>],</span>
<span id="cb26-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_integral_max_abs_resid"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6.4e-10"</span>],</span>
<span id="cb26-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_two_routes_max_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-12"</span>],</span>
<span id="cb26-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_convergence_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0000"</span>],</span>
<span id="cb26-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.9e-6"</span>],</span>
<span id="cb26-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chart_label_max_plateau_ratio"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0"</span>],</span>
<span id="cb26-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0769"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.076896"</span>],</span>
<span id="cb26-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_graded"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.088e-6"</span>],</span>
<span id="cb26-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_same_n"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.847e-4"</span>],</span>
<span id="cb26-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_first_order_error_ratio"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"893.9"</span>],</span>
<span id="cb26-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_stored_vs_recomputed_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 2e-5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.29e-6"</span>],</span>
<span id="cb26-49">}</span>
<span id="cb26-50"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.items():</span>
<span id="cb26-51">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _lits:</span>
<span id="cb26-52">        claims.says(_lit, _k)</span>
<span id="cb26-53">N_SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.values())</span>
<span id="cb26-54"></span>
<span id="cb26-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># quoted numbers that are NOT metrics: ratios, points along the worst curve,</span></span>
<span id="cb26-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the local exponents, and F3.1's own committed numbers.  Each tolerance is at</span></span>
<span id="cb26-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># least 10x the quantity's spread across BLAS kernels.</span></span>
<span id="cb26-58">OTHER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb26-59">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_i at the worst point"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.522</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_q"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-60">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_w/beta(0) at half depletion"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.208</span>,</span>
<span id="cb26-61">     W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta_constancy_at_half"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-62">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta(0) at gamma = 100"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.37e-11</span>, B_MID, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-14</span>),</span>
<span id="cb26-63">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_w/beta(0) at gamma = 100"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.68e9</span>, C_MID, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span>),</span>
<span id="cb26-64">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the fine grid alone, same ratio, same point"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.66e9</span>, C_FINE_MID, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span>),</span>
<span id="cb26-65">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VKH error at gamma = 100 [%]"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0373</span>, E_MID, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb26-66">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"how much smaller that error is"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">75.0</span>,</span>
<span id="cb26-67">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E_MID), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb26-68">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two books' groups differ by [points]"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>,</span>
<span id="cb26-69">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lev_pfo_expansion_err_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_form_pfo_expansion_err_pct"</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb26-70">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all four local exponents, not only the steepest: the other three are</span></span>
<span id="cb26-71">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed in README.md and models.yaml</span></span>
<span id="cb26-72">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local exponent, octave 50 -&gt; 100"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9162</span>, L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_exponents_num"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-73">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local exponent, octave 100 -&gt; 200"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4396</span>, L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_exponents_num"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-74">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local exponent, octave 200 -&gt; 400"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3385</span>, L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_exponents_num"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-75">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local exponent, octave 400 -&gt; 800"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.3385</span>, L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_exponents_num"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-76">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the deficit E = E_i is already within [%]"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.00134</span>,</span>
<span id="cb26-77">     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_three"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb26-78">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"how much better the reference is than one grid"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">137.0</span>,</span>
<span id="cb26-79">     R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_vs_bvp_max_rel_diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref_vs_bvp_max_rel_diff"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb26-80">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what grading is worth on that check"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">124.8</span>,</span>
<span id="cb26-81">     F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_same_n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_graded"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb26-82">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what the 400 -&gt; 800 refinement is worth on it"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.163</span>,</span>
<span id="cb26-83">     F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_half_n"</span>]</span>
<span id="cb26-84">     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfo_max_rel_error_uniform_same_n"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb26-85">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what grading COSTS at the grid-study point"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">248.7</span>,</span>
<span id="cb26-86">     R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_n800_uniform"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb26-87">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F3.1's committed numbers, as loaded; F3.1's spread is at most 5e-12</span></span>
<span id="cb26-88">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative, so half a unit in the last written place holds on any machine</span></span>
<span id="cb26-89">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F3.1's stored first-order error"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.337e-3</span>,</span>
<span id="cb26-90">     F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first_order_max_rel_error"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb26-91">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F3.1's stored VKH error [%]"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.076893</span>, F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_max_error_pct"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb26-92">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the single-grid recomputation's offset from F3.1"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.000214</span>,</span>
<span id="cb26-93">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F_PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F31[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_max_error_pct"</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb26-94">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same recomputation on F3.1's OWN grid, cold [%]"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.076893</span>,</span>
<span id="cb26-95">     F_F31GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb26-96">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points bought by root-finding and by q"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7186</span>,</span>
<span id="cb26-97">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-98">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of which root-finding gamma"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0016</span>,</span>
<span id="cb26-99">     F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_rootfound_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_vkh_max_error_pct"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-100">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of which letting q move"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7170</span>,</span>
<span id="cb26-101">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vkh_worst_rel_error_pct"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f31_definition_rootfound_pct"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb26-102">]</span>
<span id="cb26-103">_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(n, w, g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OTHER <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> t]</span>
<span id="cb26-104"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OTHER:</span>
<span id="cb26-105">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ok '</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> t <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'DRIFT'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:42s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> written </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb26-106">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   computed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bounds and conditions stated in prose that are not metrics</span></span>
<span id="cb26-108">CONDITIONS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb26-109">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F3.1's first-order check reproduced to below 1e-12"</span>:</span>
<span id="cb26-110">        F31_PFO_REPRO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> F31_PFO_REPRO_MAX,</span>
<span id="cb26-111">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the cold run on F3.1's grid reproduces its stored value to below 1e-9"</span>:</span>
<span id="cb26-112">        F31_COLD_REPRO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> F31_COLD_REPRO_MAX,</span>
<span id="cb26-113">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the single graded solve moves the headline by more than a unit in its"</span></span>
<span id="cb26-114">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" fourth decimal"</span>: HEADLINE_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,</span>
<span id="cb26-115">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta(0) at gamma = 1000 is numerically zero"</span>:</span>
<span id="cb26-116">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_beta_at_full_depletion"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-40</span>,</span>
<span id="cb26-117">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VKH under-estimates over the whole map"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(VKH_ALWAYS_UNDER),</span>
<span id="cb26-118">}</span>
<span id="cb26-119">_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(n, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ok]</span>
<span id="cb26-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the count README.md and models.yaml quote for what the single-grid</span></span>
<span id="cb26-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># baseline moves: generated above, not counted by hand.  Its threshold is a</span></span>
<span id="cb26-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1e-6 relative move; the smallest move counted is 2e-5 relative and every</span></span>
<span id="cb26-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metric not counted moves by exactly 0, so the count is not decided by noise.</span></span>
<span id="cb26-124">_counts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics the single-grid baseline moves"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>, N_MOVED),</span>
<span id="cb26-125">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reported metrics"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)),</span>
<span id="cb26-126">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break rows"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS))}</span>
<span id="cb26-127">_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(n, w, g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, (w, g) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _counts.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> g]</span>
<span id="cb26-128"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _bad, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prose has drifted from the computation: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb26-129"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SAYS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose literals of registered claims checked by claims.says,"</span></span>
<span id="cb26-130">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(OTHER)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> other prose values, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CONDITIONS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> stated bounds and"</span></span>
<span id="cb26-131">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" conditions and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_counts)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> counts; all agree.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-132">claims.report()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  ok  E_i at the worst point                     written        2.522   computed 2.521728974
  ok  beta_w/beta(0) at half depletion           written        1.208   computed 1.20813483
  ok  beta(0) at gamma = 100                     written     1.37e-11   computed 1.366726946e-11
  ok  beta_w/beta(0) at gamma = 100              written 3680000000.0   computed 3683726738
  ok  the fine grid alone, same ratio, same point written 3660000000.0   computed 3656984670
  ok  VKH error at gamma = 100 [%]               written      -0.0373   computed -0.03729720987
  ok  how much smaller that error is             written         75.0   computed 74.95100426
  ok  the two books' groups differ by [points]   written          0.2   computed 0.2007558593
  ok  local exponent, octave 50 -&gt; 100           written      -1.9162   computed -1.916167239
  ok  local exponent, octave 100 -&gt; 200          written      -2.4396   computed -2.43956806
  ok  local exponent, octave 200 -&gt; 400          written      -3.3385   computed -3.338471456
  ok  local exponent, octave 400 -&gt; 800          written      -5.3385   computed -5.338471315
  ok  the deficit E = E_i is already within [%]  written      0.00134   computed 0.001341976167
  ok  how much better the reference is than one grid written        137.0   computed 137.0412705
  ok  what grading is worth on that check        written        124.8   computed 124.8080175
  ok  what the 400 -&gt; 800 refinement is worth on it written        7.163   computed 7.162586311
  ok  what grading COSTS at the grid-study point written        248.7   computed 248.7097774
  ok  F3.1's stored first-order error            written     0.006337   computed 0.006336733444
  ok  F3.1's stored VKH error [%]                written     2.076893   computed 2.076893246
  ok  the single-grid recomputation's offset from F3.1 written     0.000214   computed 0.0002144885454
  ok  the same recomputation on F3.1's OWN grid, cold [%] written     2.076893   computed 2.076893246
  ok  points bought by root-finding and by q     written       0.7186   computed 0.7185674045
  ok  of which root-finding gamma                written       0.0016   computed 0.001604880146
  ok  of which letting q move                    written        0.717   computed 0.7169625243

38 prose literals of registered claims checked by claims.says, 24 other prose values, 5 stated bounds and conditions and 3 counts; all agree.

Claims for F3.2:
  vkh_worst_rel_error_pct            = -2.7955          value  rtol 0.05
  vkh_worst_gamma                    = 4.7279           value  rtol 0.05
  vkh_worst_q                        = 1.5217           value  rtol 0.05
  vkh_worst_on_printed_labels_pct    = -2.7294          value  rtol 0.05
  froment_10pct_claim_margin         = 3.5772           value  rtol 0.05
  beta_interface_at_worst            = 0.16474          value  rtol 0.05
  gamma_at_half_depletion            = 2.2036           value  rtol 0.05
  gamma_at_99pct_depletion           = 13.038           value  rtol 0.05
  vkh_error_at_half_depletion_pct    = -1.8304          value  rtol 0.05
  vkh_error_at_99pct_depletion_pct   = -1.5035          value  rtol 0.05
  vkh_error_at_full_depletion_pct    = -0.00037327      value  rtol 0.05
  beta_constancy_at_worst            = 2.1152           value  rtol 0.05
  beta_constancy_at_99pct_depletion  = 19.2             value  rtol 0.05
  lev_small_M_1pct_threshold         = 0.72309          value  rtol 0.05
  lev_pfo_expansion_err_pct          = -0.53662         value  rtol 0.05
  vkh_form_pfo_expansion_err_pct     = -0.73738         value  rtol 0.05
  uncorrected_E_eq_M_err_pct         = 9.3004           value  rtol 0.05
  lev_inst_asymptote_ratio_vkh       = 0.99528          value  rtol 0.05
  lev_inst_asymptote_ratio_num       = 0.22862          value  rtol 0.05
  lev_inst_overstatement_factor      = 44.244           value  rtol 0.05
  inst_deficit_exponent_num_steepest = -5.3385          value  rtol 0.05
  inst_deficit_exponent_vkh_finest   = -1.9949          value  rtol 0.05
  inst_deficit_routes_max_rel_diff   = (here 8.6e-05)   bound  bound [0, 0.001] [chosen]
  fv_vs_bvp_max_rel_diff             = (here 6.0e-06)   bound  bound &lt;= 1e-05 [chosen]
  fv_vs_bvp_max_abs_diff_beta        = (here 2.9e-06)   bound  bound &lt;= 5e-06 [chosen]
  ref_vs_bvp_max_rel_diff            = (here 4.4e-08)   bound  bound &lt;= 1e-07 [chosen]
  ref_self_refinement_max_rel_diff   = (here 3.8e-08)   bound  bound &lt;= 1e-07 [chosen]
  first_integral_max_abs_resid       = (here 6.4e-10)   bound  bound &lt;= 1e-08 [chosen]
  vkh_two_routes_max_rel_diff        = (here 8.0e-15)   bound  bound &lt;= 1e-12 [tolerance]
  vkh_pfo_limit_max_rel_error        = (here 1.5e-08)   bound  bound &lt;= 2e-08 [theory]
  vkh_instantaneous_limit_rel_error  = (here 3.8e-10)   bound  bound &lt;= 1e-09 [theory]
  fv_convergence_order               = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  fv_rel_error_n800                  = 1.8964e-06       value  rtol 0.05
  fv_rel_error_n800_uniform          = 7.6251e-09       value  rtol 0.05
  chart_label_max_plateau_ratio      = 2                value  rtol 0.05
  f31_definition_vkh_max_error_pct   = 2.0769           value  rtol 0.05
  f31_definition_rootfound_pct       = 2.0785           value  rtol 0.05
  pfo_max_rel_error_graded           = 7.0885e-06       value  rtol 0.05
  pfo_max_rel_error_uniform_same_n   = 0.0008847        value  rtol 0.05
  pfo_max_rel_error_uniform_half_n   = 0.0063367        value  rtol 0.05
  f31_stored_vs_recomputed_rel       = (here 1.3e-06)   bound  bound &lt;= 2e-05 [chosen]
  f31_first_order_error_ratio        = 893.95           value  rtol 0.05</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="14">
<pre><code>{'page': 'F3.2',
 'format': 2,
 'env': {'pymrm': '3.2.0',
  'numpy': '2.5.4',
  'scipy': '1.18.1',
  'openblas_coretype': 'Haswell',
  'threads': '1'},
 'metrics': {'vkh_worst_rel_error_pct': {'kind': 'value',
   'value': -2.7954633357038534,
   'rtol': 0.05},
  'vkh_worst_gamma': {'kind': 'value',
   'value': 4.727910228526406,
   'rtol': 0.05},
  'vkh_worst_q': {'kind': 'value', 'value': 1.5217289736637973, 'rtol': 0.05},
  'vkh_worst_on_printed_labels_pct': {'kind': 'value',
   'value': -2.729422310099984,
   'rtol': 0.05},
  'froment_10pct_claim_margin': {'kind': 'value',
   'value': 3.577224523848802,
   'rtol': 0.05},
  'beta_interface_at_worst': {'kind': 'value',
   'value': 0.1647374981668422,
   'rtol': 0.05},
  'gamma_at_half_depletion': {'kind': 'value',
   'value': 2.2035653164066815,
   'rtol': 0.05},
  'gamma_at_99pct_depletion': {'kind': 'value',
   'value': 13.037820053916313,
   'rtol': 0.05},
  'vkh_error_at_half_depletion_pct': {'kind': 'value',
   'value': -1.8304383279474448,
   'rtol': 0.05},
  'vkh_error_at_99pct_depletion_pct': {'kind': 'value',
   'value': -1.5034589551330495,
   'rtol': 0.05},
  'vkh_error_at_full_depletion_pct': {'kind': 'value',
   'value': -0.0003732658372348927,
   'rtol': 0.05},
  'beta_constancy_at_worst': {'kind': 'value',
   'value': 2.11522919512376,
   'rtol': 0.05},
  'beta_constancy_at_99pct_depletion': {'kind': 'value',
   'value': 19.200206605192175,
   'rtol': 0.05},
  'lev_small_M_1pct_threshold': {'kind': 'value',
   'value': 0.7230861468815154,
   'rtol': 0.05},
  'lev_pfo_expansion_err_pct': {'kind': 'value',
   'value': -0.536624806035424,
   'rtol': 0.05},
  'vkh_form_pfo_expansion_err_pct': {'kind': 'value',
   'value': -0.737380665363907,
   'rtol': 0.05},
  'uncorrected_E_eq_M_err_pct': {'kind': 'value',
   'value': 9.300412301059978,
   'rtol': 0.05},
  'lev_inst_asymptote_ratio_vkh': {'kind': 'value',
   'value': 0.9952780169006072,
   'rtol': 0.05},
  'lev_inst_asymptote_ratio_num': {'kind': 'value',
   'value': 0.2286236667842445,
   'rtol': 0.05},
  'lev_inst_overstatement_factor': {'kind': 'value',
   'value': 44.24445191547594,
   'rtol': 0.05},
  'inst_deficit_exponent_num_steepest': {'kind': 'value',
   'value': -5.33847131505646,
   'rtol': 0.05},
  'inst_deficit_exponent_vkh_finest': {'kind': 'value',
   'value': -1.9948831601639323,
   'rtol': 0.05},
  'inst_deficit_routes_max_rel_diff': {'kind': 'bound',
   'value': 8.609855356600526e-05,
   'min': 0.0,
   'max': 0.001,
   'basis': 'chosen',
   'note': 'two methods on the M_H = 800 deficit E_i - F_A, about 1.3e-5 of F_A, so kernel round-off in F_A is amplified; measured 8.4e-5 to 9.0e-5 across BLAS kernels, the bound is about 11x that and still far below the 44x it supports'},
  'fv_vs_bvp_max_rel_diff': {'kind': 'bound',
   'value': 5.987876919966162e-06,
   'max': 1e-05,
   'basis': 'chosen',
   'note': 'one graded n_x = 800 solve against collocation at tol 1e-10, set by its second-order discretisation; measured 5.99e-6 on three kernels'},
  'fv_vs_bvp_max_abs_diff_beta': {'kind': 'bound',
   'value': 2.91313328765197e-06,
   'max': 5e-06,
   'basis': 'chosen',
   'note': 'beta(0), the same two solvers; measured 2.91e-6 on three kernels'},
  'ref_vs_bvp_max_rel_diff': {'kind': 'bound',
   'value': 4.3693968221347745e-08,
   'max': 1e-07,
   'basis': 'chosen',
   'note': 'the Richardson reference against collocation at tol 1e-10; measured 4.37e-8 on three kernels'},
  'ref_self_refinement_max_rel_diff': {'kind': 'bound',
   'value': 3.841073770161074e-08,
   'max': 1e-07,
   'basis': 'chosen',
   'note': 'the reference against Richardson (800, 1600); measured 3.84e-8 on three kernels'},
  'first_integral_max_abs_resid': {'kind': 'bound',
   'value': 6.417639042410883e-10,
   'max': 1e-08,
   'basis': 'chosen',
   'note': '|q beta(0) - (1 + q - F_A)|/(1 + q) on the reference, never told to the discretisation; measured 6.4e-10 on three kernels'},
  'vkh_two_routes_max_rel_diff': {'kind': 'bound',
   'value': 7.993605777301127e-15,
   'max': 1e-12,
   'basis': 'tolerance',
   'note': "the implicit relation solved for F_A and for gamma', Brent at xtol 1e-13, rtol 8.9e-16; measured 8.0e-15"},
  'vkh_pfo_limit_max_rel_error': {'kind': 'bound',
   'value': 1.4949999904700917e-08,
   'max': 2e-08,
   'basis': 'theory',
   'note': 'evaluated at q = 1e10, so the finite-q error is about gamma/(2q), 1.5e-8 at gamma = 300'},
  'vkh_instantaneous_limit_rel_error': {'kind': 'bound',
   'value': 3.80000031441341e-10,
   'max': 1e-09,
   'basis': 'theory',
   'note': 'evaluated at gamma = 1e6, where the deficit q(1+q)^2/gamma^2 is 3.8e-10 of 1 + q = 20'},
  'fv_convergence_order': {'kind': 'bound',
   'value': 1.9999825760999916,
   'min': 1.9,
   'max': 2.1,
   'basis': 'theory',
   'note': 'second-order finite volumes; 2.0000 between n_x = 400 and 800 at (gamma, q) = (10, 4)'},
  'fv_rel_error_n800': {'kind': 'value',
   'value': 1.8964470563931357e-06,
   'rtol': 0.05},
  'fv_rel_error_n800_uniform': {'kind': 'value',
   'value': 7.625140741041037e-09,
   'rtol': 0.05},
  'chart_label_max_plateau_ratio': {'kind': 'value',
   'value': 2.0,
   'rtol': 0.05},
  'f31_definition_vkh_max_error_pct': {'kind': 'value',
   'value': 2.076895931235552,
   'rtol': 0.05},
  'f31_definition_rootfound_pct': {'kind': 'value',
   'value': 2.078500811381268,
   'rtol': 0.05},
  'pfo_max_rel_error_graded': {'kind': 'value',
   'value': 7.08847946950808e-06,
   'rtol': 0.05},
  'pfo_max_rel_error_uniform_same_n': {'kind': 'value',
   'value': 0.0008846990694951762,
   'rtol': 0.05},
  'pfo_max_rel_error_uniform_half_n': {'kind': 'value',
   'value': 0.0063367334444864865,
   'rtol': 0.05},
  'f31_stored_vs_recomputed_rel': {'kind': 'bound',
   'value': 1.292967695576408e-06,
   'max': 2e-05,
   'basis': 'chosen',
   'note': "this page's recomputation of F3.1's definition against F3.1's committed vkh_max_error_pct, made on another machine; the residual is F3.1's uniform n_x = 400 discretisation, 1.29e-6 on three kernels, and F3.1's own number spreads 5e-12 relative across kernels"},
  'f31_first_order_error_ratio': {'kind': 'value',
   'value': 893.9481974582452,
   'rtol': 0.05}},
 'quoted': {'vkh_worst_rel_error_pct': ['-2.7955'],
  'vkh_worst_gamma': ['4.728'],
  'vkh_worst_q': ['1.522'],
  'beta_interface_at_worst': ['0.1647'],
  'beta_constancy_at_worst': ['2.115'],
  'beta_constancy_at_99pct_depletion': ['19.20'],
  'froment_10pct_claim_margin': ['3.5772'],
  'vkh_worst_on_printed_labels_pct': ['-2.7294'],
  'gamma_at_half_depletion': ['2.204'],
  'vkh_error_at_half_depletion_pct': ['-1.8304'],
  'gamma_at_99pct_depletion': ['13.038'],
  'vkh_error_at_99pct_depletion_pct': ['-1.5035'],
  'vkh_error_at_full_depletion_pct': ['-0.00037'],
  'lev_small_M_1pct_threshold': ['0.7231'],
  'lev_pfo_expansion_err_pct': ['-0.5366'],
  'vkh_form_pfo_expansion_err_pct': ['-0.7374'],
  'uncorrected_E_eq_M_err_pct': ['9.3004'],
  'lev_inst_asymptote_ratio_vkh': ['0.9953'],
  'lev_inst_asymptote_ratio_num': ['0.2286'],
  'lev_inst_overstatement_factor': ['44.24'],
  'inst_deficit_exponent_num_steepest': ['-5.3385'],
  'inst_deficit_exponent_vkh_finest': ['-1.9949'],
  'inst_deficit_routes_max_rel_diff': ['below 1e-3'],
  'fv_vs_bvp_max_rel_diff': ['5.99e-6'],
  'ref_vs_bvp_max_rel_diff': ['4.37e-8'],
  'ref_self_refinement_max_rel_diff': ['3.84e-8'],
  'first_integral_max_abs_resid': ['6.4e-10'],
  'vkh_two_routes_max_rel_diff': ['below 1e-12'],
  'fv_convergence_order': ['2.0000'],
  'fv_rel_error_n800': ['1.9e-6'],
  'chart_label_max_plateau_ratio': ['2.0'],
  'f31_definition_vkh_max_error_pct': ['2.0769', '2.076896'],
  'pfo_max_rel_error_graded': ['7.088e-6'],
  'pfo_max_rel_error_uniform_same_n': ['8.847e-4'],
  'f31_first_order_error_ratio': ['893.9'],
  'f31_stored_vs_recomputed_rel': ['below 2e-5', '1.29e-6']},
 'breaks': {'vkh_worst_rel_error_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'vkh_worst_gamma': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'vkh_worst_q': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'froment_10pct_claim_margin': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'beta_interface_at_worst': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'beta_constancy_at_worst': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'vkh_worst_on_printed_labels_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'gamma_at_half_depletion': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'gamma_at_99pct_depletion': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'vkh_error_at_half_depletion_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'vkh_error_at_99pct_depletion_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'vkh_error_at_full_depletion_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'beta_constancy_at_99pct_depletion': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   'worst point SAMPLED on the scan grid instead of root-found'],
  'lev_small_M_1pct_threshold': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   "Levenspiel's 1 + M_H^2/3 transcribed with a 2"],
  'lev_pfo_expansion_err_pct': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   "Levenspiel's 2 E_i transcribed as E_i",
   "Levenspiel's (M_H - 1) transcribed as M_H"],
  'vkh_form_pfo_expansion_err_pct': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   "Levenspiel's 2 E_i transcribed as E_i",
   "Levenspiel's (M_H - 1) transcribed as M_H"],
  'uncorrected_E_eq_M_err_pct': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'lev_inst_asymptote_ratio_vkh': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   "Levenspiel's E_i^2(E_i - 1) transcribed as E_i(E_i - 1)"],
  'lev_inst_asymptote_ratio_num': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   "Levenspiel's E_i^2(E_i - 1) transcribed as E_i(E_i - 1)"],
  'lev_inst_overstatement_factor': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1',
   "Levenspiel's E_i^2(E_i - 1) transcribed as E_i(E_i - 1)"],
  'inst_deficit_exponent_num_steepest': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'inst_deficit_exponent_vkh_finest': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped"],
  'inst_deficit_routes_max_rel_diff': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'uniform grid instead of graded, at the same n_x',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'f31_definition_vkh_max_error_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)'],
  'f31_definition_rootfound_pct': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)'],
  'pfo_max_rel_error_graded': ['film solved on 100 cells instead of 800',
   'uniform grid instead of graded, at the same n_x'],
  'pfo_max_rel_error_uniform_same_n': ['film solved on 100 cells instead of 800'],
  'pfo_max_rel_error_uniform_half_n': ['film solved on 100 cells instead of 800'],
  'f31_stored_vs_recomputed_rel': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'the reference taken as one graded solve at n_x = 800 instead of extrapolated'],
  'f31_first_order_error_ratio': ['film solved on 100 cells instead of 800',
   'uniform grid instead of graded, at the same n_x'],
  'vkh_two_routes_max_rel_diff': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped",
   'the implicit relation solved to xtol = 1e-4'],
  'vkh_pfo_limit_max_rel_error': ['the implicit relation solved to xtol = 1e-4'],
  'vkh_instantaneous_limit_rel_error': ['(6.3.5-1) transcribed with + where it prints -',
   '(6.3.5-1) transcribed as F_A where it prints (F_A - 1)',
   "q read as E_i in (6.3.5-1) - the two books' groups swapped"],
  'fv_vs_bvp_max_rel_diff': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'uniform grid instead of graded, at the same n_x',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'fv_vs_bvp_max_abs_diff_beta': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'uniform grid instead of graded, at the same n_x',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'ref_vs_bvp_max_rel_diff': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'the reference taken as one graded solve at n_x = 800 instead of extrapolated',
   'uniform grid instead of graded, at the same n_x',
   'collocation tolerance loosened to 1e-4'],
  'ref_self_refinement_max_rel_diff': ['the reference taken as one graded solve at n_x = 800 instead of extrapolated',
   'uniform grid instead of graded, at the same n_x'],
  'first_integral_max_abs_resid': ['the depletion of B dropped from the FILM model (beta = 1 identically)'],
  'fv_convergence_order': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'uniform grid instead of graded, at the same n_x',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'fv_rel_error_n800': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'uniform grid instead of graded, at the same n_x',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'fv_rel_error_n800_uniform': ['the depletion of B dropped from the FILM model (beta = 1 identically)',
   'film solved on 100 cells instead of 800',
   'beta given a zero-gradient bulk edge instead of beta(1) = 1'],
  'chart_label_max_plateau_ratio': ["Froment's curve labels read as E_i, the way Levenspiel's are",
   'the smallest printed curve label dropped from the CSV']}}</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Not the equation.</strong> Van Krevelen and Hoftijzer’s relation is arithmetic in one unknown and a bisection solves it; nothing in this repository is needed for that, and the page says so.</p>
<p><strong>The thing the chart cannot give you: the reference solution.</strong> The whole point of an approximate enhancement factor is that the film equations are coupled and nonlinear, so a designer has an approximation and no way to price it. Those equations are 30 lines of pymrm - two fields, per-species boundary conditions in one pair of dictionaries, a graded grid because the reaction layer is thin, <code>newton</code> and <code>NumJac</code> for the pointwise product. Once they are solved, three claims that have been printed and reprinted for decades become measurements:</p>
<ul>
<li>the accuracy claim is checked rather than believed: <img src="https://latex.codecogs.com/png.latex?-2.7955"> % worst against the printed 10 percent, over the chart’s whole printed domain, at a point found by root-finding and not by sampling;</li>
<li>the stated assumption is checked rather than repeated - in <strong>both</strong> of the book’s two wordings of it - and neither orders the error: at the worst point <img src="https://latex.codecogs.com/png.latex?B"> is at 0.1647 of bulk and <img src="https://latex.codecogs.com/png.latex?%5Cbar%5Cbeta"> is 2.115 times <img src="https://latex.codecogs.com/png.latex?%5Cbeta(0)">, while where <img src="https://latex.codecogs.com/png.latex?B"> is completely gone, and the constancy assumption is violated by orders of magnitude, the approximation is exact to <img src="https://latex.codecogs.com/png.latex?-0.00037"> %;</li>
<li>one of Levenspiel’s asymptotic corrections is shown to expand the approximation rather than the equations, which is only visible if you have the equations’ own solution to compare against - 44.24 times too large at <img src="https://latex.codecogs.com/png.latex?M_H%20=%20800">, on a deficit two independent methods agree on. And the reason is exact, not empirical: the film’s first integral makes the deficit <img src="https://latex.codecogs.com/png.latex?q%5C,%5Cbeta(0)">, which is exponentially small, while <img src="https://latex.codecogs.com/png.latex?E_i%5E2(E_i-1)/M_H%5E2"> is <em>algebraically</em> the large-<img src="https://latex.codecogs.com/png.latex?%5Cgamma"> asymptote of (6.3.5-1) itself.</li>
</ul>
<p><strong>And the grid is not a detail - in both directions.</strong> <code>F3.1</code> notes that its own first-order error is “concentrated at high Ha where the reaction layer is thinner than a cell”. Because <code>construct_grad</code> and <code>construct_div</code> take arbitrary face positions, moving to a graded grid is one line. How much that is worth is <em>measured</em> rather than asserted, and the measurement is split rather than lumped: on <code>F3.1</code>’s own first-order check, over its own <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BHa%7D"> range, grading at the same <img src="https://latex.codecogs.com/png.latex?n_x"> is worth <strong>124.8x</strong> and the refinement from <img src="https://latex.codecogs.com/png.latex?n_x%20=%20400"> to 800 a further 7.163x, which multiply to the 893.9x against the 6.337e-3 loaded from <code>F3.1</code>’s <code>agreement.json</code>. Crediting all 893.9x to grading is wrong by a factor of seven.</p>
<p>And grading is a <strong>liability</strong> at the moderate <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> where this page’s headline sits: at the grid-study point a graded grid of the same size is 248.7 times <em>less</em> accurate than a uniform one, because its outer cells are nearly eight times wider. That is why the baseline here is a Richardson extrapolation of two graded grids rather than either grid alone. A single graded solve is wrong in the fourth decimal of every moderate-<img src="https://latex.codecogs.com/png.latex?%5Cgamma"> number - by less than its own pymrm-versus-collocation agreement, which is precisely why a second solver family does not catch this class and a convergence study does. It is the “extrapolation switched off” row of the break table.</p>
<p><strong>What this page cannot conclude.</strong> Nothing about absorbers. Both sides of every comparison are equations, the film model itself is never tested against a measurement here, and the 1948 origin was not read - so nothing here is evidence about what Van Krevelen and Hoftijzer actually wrote, only about the equation two monographs attribute to them.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>Change</th>
<th>Where</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>A different reaction order</td>
<td>change <code>rate</code> in <code>Film.solve</code>; Froment book p.&nbsp;341 prints Hikita and Asai’s <img src="https://latex.codecogs.com/png.latex?m,n"> form</td>
</tr>
<tr class="even">
<td>Reaction in the bulk, <img src="https://latex.codecogs.com/png.latex?C_%7BAb%7D%20%3E%200"></td>
<td>change <code>d</code> in the right-hand boundary dictionary; Froment’s (6.3.2-10) is the pseudo-first-order version</td>
</tr>
<tr class="odd">
<td>Gas-side resistance</td>
<td>make the interface a Robin condition; Froment’s (6.3.2-12) is the lumped result</td>
</tr>
<tr class="even">
<td>Reversible reaction</td>
<td>add the product as a third field; the <code>NumJac</code> shape becomes <code>(n_x, 3)</code></td>
</tr>
<tr class="odd">
<td>Surface renewal instead of a film</td>
<td>replace the steady BVP with a transient penetration solve (<code>S4</code>) - that is <code>A3.2</code>/<code>A3.3</code></td>
</tr>
<tr class="even">
<td>A column, not a film</td>
<td>this is the local closure inside <code>F2.1</code>/<code>F3.5</code></td>
</tr>
</tbody>
</table>
<p><strong>Related pages:</strong> <code>F3.1</code> Hatta number and the regimes (owns Hatta, and the 2.1 % reconciled above) · <code>F3.3</code> DeCoursey · <code>F3.5</code> CO2-amine absorption · <code>B1.1</code> Thiele modulus, the same <code>S3</code> equation with the boundary conditions swapped · <code>A3.2</code>/<code>A3.3</code> the penetration and surface-renewal alternatives to the film.</p>
</section>
<section id="references" class="level2">
<h2 class="anchored" data-anchor-id="references">References</h2>
<p><strong>Origin, cited but not consulted.</strong> Van Krevelen, D. W. and Hoftijzer, P. J. (1948). <em>Kinetics of gas-liquid reactions. Part I. General theory.</em> Recueil des Travaux Chimiques des Pays-Bas <strong>67</strong>(7), 563-586. <a href="https://doi.org/10.1002/recl.19480670708">doi:10.1002/recl.19480670708</a>. Not on disk; not read. <strong>Where the extra bibliographic detail comes from:</strong> both books on disk print only “67, 563 (1948)”. The issue number, the end page 586 and the DOI are a <strong>Crossref record lookup</strong> (the DOI resolved through <code>api.crossref.org</code>, which returns volume 67, issue 7, pages 563-586, both authors and the 1948 date), not a reading of the article - on a page whose first section is about not writing anything it did not read, that distinction is worth making explicit. Crossref also gives the author’s name a third capitalisation, “D. W. van Krevelen”; see the printed-defect section.</p>
<p><strong>Read, and the source of every equation here.</strong> Froment, G. F., De Wilde, J. and Bischoff, K. B. (2011). <em>Chemical Reactor Analysis and Design</em>, 3rd edition. John Wiley &amp; Sons. ISBN 978-0-470-56541-4. Chapter 6, sections 6.3.1, 6.3.2 (book pp.&nbsp;328-332), 6.3.3 (book p.&nbsp;335) and 6.3.5 (book pp.&nbsp;340-341); reference list book p.&nbsp;365.</p>
<p><strong>Read, as an independent check on the constants.</strong> Levenspiel, O. (1999). <em>Chemical Reaction Engineering</em>, 3rd edition. John Wiley &amp; Sons. ISBN 0-471-25424-X. Chapter 23, Fig. 23.4 and its annotation boxes (book p.&nbsp;530); chapter reference list (book p.&nbsp;537).</p>
<p><strong>Named in the sources, not evaluated here.</strong> Porter, K. E. (1966). <em>Trans. Inst. Chem. Eng.</em> <strong>44</strong>, T25. Kishinevskii, M. Kh. <em>et al.</em> (1971). Alper, E. (1973). Hikita, H. and Asai, S. (1964). All four are cited on Froment book pp.&nbsp;340-341 as explicit alternatives to the implicit relation; this page solves the implicit one instead of replacing it, so none of them is computed.</p>


</section>
</section>

 ]]></description>
  <category>sec:F</category>
  <category>struct:S3</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/F3.2-van-krevelen-hoftijzer/</guid>
  <pubDate>Fri, 14 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Larkins: the authors’ own worked example redone, and the average-pressure shortcut under it priced</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/G1.1-larkins-two-phase-packed-bed/</link>
  <description><![CDATA[ 




<section id="larkins-the-authors-own-worked-example-redone-and-the-average-pressure-shortcut-under-it-priced" class="level1">
<h1>Larkins: the authors’ own worked example redone, and the average-pressure shortcut under it priced</h1>
<p><strong>Catalog ID:</strong> <code>G1.1</code> · <strong>Structures:</strong> <code>S3</code> (1-D steady BVP) · <strong>Tier:</strong> T0</p>
<p>Larkins, White and Jeffrey print Table 3 (measured) and Table 4 (their own calculation) for the same eight runs. This page redoes the chain cell by cell, recovers a constant the paper never prints, and solves the column with pymrm to price the shortcut the paper’s design procedure rests on: evaluating densities at the arithmetic mean of a section’s terminal pressures.</p>
<div id="ecf9ae8b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:17.778746Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:17.778529Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:17.793511Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:17.792611Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G1.1-larkins-two-phase-packed-bed"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="df9a5c26" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:17.795666Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:17.795434Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.599058Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.598041Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> dataclasses <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> dataclass, replace</span>
<span id="cb2-2"></span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> display</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb2-8"></span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> compute_boundary_values</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, cite_data, load_data, load_meta</span>
<span id="cb2-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (CP_LB_FT_MIN, SEC_PER_MIN2, Column, ColumnFV, Larkins,</span>
<span id="cb2-12">                   backward_euler_march, choking_length, quad_outlet, recipe_error,</span>
<span id="cb2-13">                   recipe_outlet, recover_mu_air, threshold_length)</span>
<span id="cb2-14"></span>
<span id="cb2-15">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-16">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.width"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb2-17">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>Gas and liquid running <strong>down</strong> a packed bed together lose more pressure than either would alone, and part of the void is occupied by liquid. In 1961 R. P. Larkins, R. R. White and D. W. Jeffrey measured both, over eight fluid systems and four packings, and correlated them the way Lockhart and Martinelli had correlated two-phase flow in open pipes: against a single variable built from the friction losses each phase would suffer <strong>flowing alone in the same bed</strong>.</p>
<p>What makes this paper worth a page is not the correlation. It is that the paper prints <strong>a worked example</strong>. Table 3 gives eight runs of measured data; Table 4 gives, run by run, the authors’ own arithmetic on those same eight rows: two Reynolds numbers, three friction losses, the liquid saturation, the independent variable <img src="https://latex.codecogs.com/png.latex?%5Cchi"> and the two-phase parameter. Every constant that turns one table into the other is printed somewhere in the nine pages. So the strongest validation available short of held-out data is here: <strong>reproduce the authors’ arithmetic step by step and see where it closes and where it does not.</strong></p>
<section id="what-this-page-does-and-in-what-order" class="level3">
<h3 class="anchored" data-anchor-id="what-this-page-does-and-in-what-order">What this page does, and in what order</h3>
<ol type="1">
<li><strong>Redo Table 4 from Table 3.</strong> Seven of the eight rows close on every column. Run 5 does not, and the page shows why, without repairing it.</li>
<li><strong>Recover a constant the paper never prints.</strong> The air viscosity used in Table 4 is not in Table 2 except at one temperature; it is determined, row by row, by Table 3 and Table 4 together.</li>
<li><strong>Test Eqs. (22) and (23) against Table 4, and say plainly that this is a goodness of fit, not a test</strong>, with a null baseline printed beside every agreement number.</li>
<li><strong>Solve a column with pymrm</strong> and price the shortcut the paper’s own design procedure rests on: that densities may be evaluated at the arithmetic mean of the terminal pressures of a section.</li>
</ol>
</section>
<section id="what-is-out-of-scope-and-why" class="level3">
<h3 class="anchored" data-anchor-id="what-is-out-of-scope-and-why">What is out of scope, and why</h3>
<p>The paper carries nine figures. Figures 2-9 are correlation plots whose curves are the printed equations, and the individual data points that fall around them are <strong>not tabulated anywhere</strong>. A worked example with printed intermediates ranks above a digitised figure, and it exists here, so nothing on this page is traced off a curve. The page can therefore say nothing about the 600+ points behind Figure 7, about the foaming deviations of Figure 8, or about the comparison with Lockhart-Martinelli in Figure 9 beyond what the prose states in words.</p>
<p>The paper’s own supporting document, “the complete tabulation of properties, data and results” (reference 4, Larkins’s 1959 Michigan PhD thesis, offered on microfilm), is <strong>not on disk and was not read</strong>. Where the paper defers to it, and it does so once for a result this page tests, that is said.</p>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Everything below was read on 300 ppi crops of the scan, which is its native resolution (<code>pdfimages -list</code>: CCITT-G4, 300x300, nine pages). Book page = PDF page + 230, confirmed on the printed running heads.</p>
<section id="the-friction-loss-eq.-5-book-p.-234" class="level3">
<h3 class="anchored" data-anchor-id="the-friction-loss-eq.-5-book-p.-234">The friction loss, Eq. (5), book p.&nbsp;234</h3>
<p>The energy balance integrated over a section, with shaft work zero for downward flow and the kinetic-energy term dropped:</p>
<p><img src="https://latex.codecogs.com/png.latex?-%5Cfrac%7B%5CDelta%20P%7D%7B%5CDelta%20L%7D%20+%20%5Crho%20%5C;=%5C;%20%5Cfrac%7B(%5CSigma%20F)%5Crho%7D%7B%5CDelta%20L%7D%20%5C;=%5C;%20%5Cdelta"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdelta"> is “the total frictional energy”, in lb-force per sq. in. per foot when the density is in suitable units. <strong>Note the sign</strong>: in downflow gravity <em>helps</em>, so the friction loss exceeds the measured pressure gradient by one static head. For horizontal flow the <img src="https://latex.codecogs.com/png.latex?%5Crho"> term is absent.</p>
</section>
<section id="the-single-phase-loss-eqs.-17-19-book-pp.-235-236" class="level3">
<h3 class="anchored" data-anchor-id="the-single-phase-loss-eqs.-17-19-book-pp.-235-236">The single-phase loss, Eqs. (17)-(19), book pp.&nbsp;235-236</h3>
<p>The Ergun equation, regrouped so that the packing enters through two constants:</p>
<p><img src="https://latex.codecogs.com/png.latex?(%5Cdelta)%5Cleft(%5Cfrac%7Bg_c%20%5Crho%20D_p%5E%7B3%7D%7D%7B%5Cmu%5E%7B2%7D%7D%5Cright)%5Cleft(%5Cfrac%7B%5Cepsilon%7D%7B1-%5Cepsilon%7D%5Cright)%5E%7B3%7D%20=%20N_%7BRe%7D%5C,(%5Calpha%20+%20%5Cbeta%20N_%7BRe%7D),%20%5Cqquad%0AN_%7BRe%7D%20=%20%5Cfrac%7BD_p%20G%7D%7B%5Cmu%5C,(1-%5Cepsilon)%7D,%20%5Cqquad%0AD_p%20=%20%5Cfrac%7B6(1-%5Cepsilon)%7D%7BS%7D"></p>
<p>This <em>is</em> Ergun: substituting <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> and rearranging returns <img src="https://latex.codecogs.com/png.latex?%5Calpha%5C,%5Cmu%20u%20(1-%5Cepsilon)%5E2/(%5Cepsilon%5E3%20D_p%5E2)%20+%20%5Cbeta%5C,%5Crho%20u%5E2%20(1-%5Cepsilon)/(%5Cepsilon%5E3%20D_p)">, so <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%20150">, <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%201.75"> is Ergun’s own pair. The page checks that identity numerically by evaluating <img src="https://latex.codecogs.com/png.latex?%5Cdelta_l"> both ways.</p>
<p>For the packing Tables 3 and 4 use, <strong>3/8-in. ceramic Raschig rings</strong>, the paper prints <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%20266"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%202.33"> (book p.&nbsp;236), <img src="https://latex.codecogs.com/png.latex?S%20=%20148"> sq. ft./cu. ft. and <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%200.520"> (book p.&nbsp;233). Note that <img src="https://latex.codecogs.com/png.latex?D_p/(1-%5Cepsilon)%20=%206/S"> exactly, so <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> does not depend on the porosity at all, only on the specific surface.</p>
</section>
<section id="the-two-phase-construction-eqs.-11-16-20-21" class="level3">
<h3 class="anchored" data-anchor-id="the-two-phase-construction-eqs.-11-16-20-21">The two-phase construction, Eqs. (11)-(16), (20)-(21)</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdelta_l"> and <img src="https://latex.codecogs.com/png.latex?%5Cdelta_g"> are the losses <strong>each phase would suffer flowing alone in the bed at the two-phase superficial rate and at the same temperature and pressure</strong> (the paper’s own subscript definitions, book p.&nbsp;239). From them,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cchi%20=%20%5Csqrt%7B%5Cdelta_l/%5Cdelta_g%7D%20%5Cqquad%20%5Ctext%7B(notation,%20book%20p.%20239,%20and%20the%20annotation%20inside%20Figs.%205%20and%207)%7D"></p>
<p>and the derivation’s result is that the <strong>liquid saturation</strong> <img src="https://latex.codecogs.com/png.latex?R_l"> and the <strong>two-phase parameter</strong> <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D/(%5Cdelta_l+%5Cdelta_g)"> are each functions of <img src="https://latex.codecogs.com/png.latex?%5Cchi"> alone for a given packing and mode of flow, Eqs. (15) and (16).</p>
<p>The measured two-phase loss comes from Eq. (20) with the mixture density Eq. (21):</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D%20=%20-%5Cleft(%5Cfrac%7B%5CDelta%20P%7D%7B%5CDelta%20L%7D%5Cright)_%7Blg%7D%20+%20%5Crho_m,%0A%5Cqquad%20%5Crho_m%20=%20%5Crho_l%20R_l%20+%20%5Crho_g%20R_g%20=%20%5Crho_l%20R_l%20+%20%5Crho_g(1%20-%20R_l)"></p>
<p>and one sentence on book p.&nbsp;236 that the reproduction below cannot do without:</p>
<blockquote class="blockquote">
<p>“The value of <img src="https://latex.codecogs.com/png.latex?%5CDelta%20P/%5CDelta%20L"> was corrected for the unequal manometer legs by reducing the pressure drops in Table 3 by the pressure equivalent to a foot of the liquid phase before substitution in Equation (20).”</p>
</blockquote>
</section>
<section id="the-two-correlations-eqs.-22-and-23-book-p.-237" class="level3">
<h3 class="anchored" data-anchor-id="the-two-correlations-eqs.-22-and-23-book-p.-237">The two correlations, Eqs. (22) and (23), book p.&nbsp;237</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D%5C!%5Cleft(%5Cfrac%7B%5Cdelta_%7Blg%7D%7D%7B%5Cdelta_l+%5Cdelta_g%7D%5Cright)%20=%20%5Cfrac%7B0.416%7D%7B(%5Clog_%7B10%7D%5Cchi)%5E2%20+%200.666%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D%20R_l%20=%20-0.774%20+%200.525%5C,(%5Clog_%7B10%7D%5Cchi)%20-%200.109%5C,(%5Clog_%7B10%7D%5Cchi)%5E2%0A%5Cqquad%20%5Ctext%7Bfor%20%7D%200.05%20%3C%20%5Cchi%20%3C%2030"></p>
<p><strong>Eq. (23) is printed twice on that page with two different constant terms.</strong> The typeset equation gives <img src="https://latex.codecogs.com/png.latex?-0.774">; the annotation inside Figure 7, on the facing column of the same page, gives <img src="https://latex.codecogs.com/png.latex?-0.744">, with <img src="https://latex.codecogs.com/png.latex?0.525">, <img src="https://latex.codecogs.com/png.latex?0.109"> and the whole of Eq. (22) identical in both places. Both readings were taken on 300 ppi crops enlarged to digit scale. The page carries both, measures both, and reports the discrepancy rather than choosing.</p>
<p>The paper is explicit about the difference in their status: “Equation (22) exhibits all properties of the friction loss correlation and may be extrapolated freely, but Equation (23) is a power series fit which is only good within the limits given” (book p.&nbsp;238).</p>
</section>
<section id="the-design-procedure-the-last-part-of-this-page-is-about" class="level3">
<h3 class="anchored" data-anchor-id="the-design-procedure-the-last-part-of-this-page-is-about">The design procedure the last part of this page is about</h3>
<p>Book p.&nbsp;239, “USE OF THE NONFOAMING CORRELATION”, five numbered steps. Step 1 opens:</p>
<blockquote class="blockquote">
<p>“The calculation of the single-phase friction loss for the gas requires a knowledge of the average pressure in the packed section. If the bed is of great length or the friction loss is large, the bed should be broken into smaller sections. The average column pressure must be assumed and then confirmed by the calculation.”</p>
</blockquote>
<p>and the licence for using one average per section is book p.&nbsp;236:</p>
<blockquote class="blockquote">
<p>“It can be shown that the use of the arithmetic average of terminal pressures to calculate densities for Equations (17) and (20) produces the correct average friction loss for a section (4).”</p>
</blockquote>
<p>Reference (4) is Larkins’s thesis. <strong>It is not on disk and was not read</strong>, so this page cannot say what is shown there or under what assumptions. It checks the claim as printed, two ways: algebraically for one phase, and by solving the column for two.</p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Everything from the paper.</strong> The packing constants, the fluid properties, the Ergun coefficients, both correlation constants, the two bed lengths and the inlet pressure of the demonstration column are all printed, and each is carried in <code>data/larkins1961-printed-constants.csv</code> with its book page and the string as printed.</p>
<p><strong>Three constants are NOT from the paper</strong>, and they are physical constants rather than model parameters (they live in <code>model.py</code>):</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Constant</th>
<th>Value</th>
<th>Why it is needed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Standard atmosphere</td>
<td>14.696 lb/sq.in.</td>
<td>Table 3’s pressures are <strong>gauge</strong>; Eq. (17) needs the gas density, which needs absolute pressure</td>
</tr>
<tr class="even">
<td>Rankine offset</td>
<td>459.67</td>
<td>Table 2’s air density is quoted at 32 degF; Table 3’s runs are at 59-79 degF</td>
</tr>
<tr class="odd">
<td>1 centipoise</td>
<td>6.71968975e-4 lb-mass/(ft.sec)</td>
<td>Table 2 and Table 3 quote viscosity in centipoise, Eq. (18) needs lb-mass/(ft.min)</td>
</tr>
</tbody>
</table>
<p><strong>A units point in the paper’s own notation, proved from its own numbers.</strong> The notation (book p.&nbsp;239) prints, verbatim:</p>
<ul>
<li><code>mu = viscosity, (lb. mass/ft.-min.)</code></li>
<li><code>G = mass velocity based on unpacked flow area, [(lb.mass)/(min.)(sq.ft.)]</code></li>
<li><code>g_c = conversion factor, 32.17 pdl./lb.-mass in English units</code></li>
</ul>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> is fine on those units: the minutes cancel. Eq. (17) is not: its group <img src="https://latex.codecogs.com/png.latex?g_c%5Crho%20D_p%5E3/%5Cmu%5E2"> carries <img src="https://latex.codecogs.com/png.latex?%5Cmu%5E%7B-2%7D">, so a <img src="https://latex.codecogs.com/png.latex?g_c"> whose value is 32.17 (which is <img src="https://latex.codecogs.com/png.latex?g_c"> per <strong>second</strong> squared) leaves a factor of <img src="https://latex.codecogs.com/png.latex?60%5E2%20=%203600"> standing. The page does not argue this from dimensions alone; it <strong>measures</strong> the factor Table 4 requires, and gets 3600 back. The label “pdl./lb.-mass” is also an acceleration rather than <img src="https://latex.codecogs.com/png.latex?g_c"> (<img src="https://latex.codecogs.com/png.latex?g_c"> is 32.17 poundals per pound-<strong>force</strong>), but that is a reading of the words, and the arithmetic is the evidence.</p>
<p><strong>Assumptions this page makes that the paper does not state:</strong></p>
<ul>
<li>the gas is ideal, so <img src="https://latex.codecogs.com/png.latex?%5Crho_g%20%5Cpropto%20P/T"> from Table 2’s single entry. The paper gives no compressibility and the pressures are below 100 psia.</li>
<li>air viscosity depends on temperature and not on pressure over the 2.8-53.7 psig of Table 3. The recovered values below are consistent with that to 0.026 %, which is evidence for it rather than an assumption defended in words.</li>
<li>the liquid is incompressible and its density is Table 2’s 62.4 lb/cu.ft.</li>
</ul>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Three CSVs, all transcribed from 300 ppi crops of the scan, cell by cell, at digit scale. Nothing is digitised from a figure anywhere on this page.</p>
<ul>
<li><code>larkins1961-table3-measured.csv</code>: Table 3, book p.&nbsp;234, “SAMPLE PROCESSED DATA FOR WATER ON 3/8-IN. RASCHIG RINGS IN 4-IN. PIPE”. Eight runs. The <strong>measured</strong> side: liquid and air rates, average column pressure (gauge), pressure drop, column temperature, liquid viscosity and liquid saturation. Two runs are single-phase: run 5 (no air) and run 160 (no liquid).</li>
<li><code>larkins1961-table4-calculated.csv</code>: Table 4, book p.&nbsp;235, “SAMPLE CALCULATED RESULTS FOR …” the same packing and pipe. The <strong>authors’ own arithmetic</strong> on the identically numbered Table 3 row.</li>
<li><code>larkins1961-printed-constants.csv</code>: every constant used here, with its book page and the printed string.</li>
</ul>
<p><strong>These rows are inside the correlations’ own fit.</strong> The paper calls Table 3 “a sample of the processed data” (book p.&nbsp;234) and says Figure 7 “summarizes all two-phase data” with “over 600 data points … represented” (book p.&nbsp;237), and Eqs. (22) and (23) are fits to that body. So every comparison below between a correlation and these eight rows is a <strong>goodness of fit, not a test</strong>, and each one is printed beside a null baseline that uses no correlation at all.</p>
<p><strong>No CSV is borrowed from another page</strong>, and no other page’s claims are loaded. <code>G1.7</code> (Wammes) and <code>G1.8</code> (Herskowitz &amp; Smith) are the two published trickle-bed neighbours; neither shares a dataset with this one.</p>
<div id="6742f78f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.601815Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.601532Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.621723Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.621326Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">T3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"larkins1961-table3-measured.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-2">T4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"larkins1961-table4-calculated.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-3">K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"larkins1961-printed-constants.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-4">KV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(K.quantity, K.value.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))</span>
<span id="cb3-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"larkins1961-table3-measured.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb3-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 3: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> runs, liquid rate "</span></span>
<span id="cb3-7">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>liquid_rate_lb_sqft_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>liquid_rate_lb_sqft_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-8">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" lb/(sq.ft.min), air rate </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_rate_lb_sqft_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-"</span></span>
<span id="cb3-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_rate_lb_sqft_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, pressure "</span></span>
<span id="cb3-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>average_pressure_psig<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>average_pressure_psig<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> psig,"</span></span>
<span id="cb3-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" T </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>column_temperature_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>column_temperature_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> F</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 4: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T4)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> runs, the same run numbers: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(T3.run) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(T4.run)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-13">display(T3)</span>
<span id="cb3-14">display(T4)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Larkins, R. P.; White, R. R.; Jeffrey, D. W. (1961) — AIChE Journal 7(2) 231-239 (1961), Table 3, book p. 234 — doi:10.1002/aic.690070213 — transcription
Table 3: 8 runs, liquid rate 0-2731 lb/(sq.ft.min), air rate 0-103.26, pressure 2.82-53.65 psig, T 59-79 F
Table 4: 8 runs, the same run numbers: True</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">run</th>
<th data-quarto-table-cell-role="th">liquid_rate_lb_sqft_min</th>
<th data-quarto-table-cell-role="th">air_rate_lb_sqft_min</th>
<th data-quarto-table-cell-role="th">average_pressure_psig</th>
<th data-quarto-table-cell-role="th">pressure_drop_psi_per_ft</th>
<th data-quarto-table-cell-role="th">column_temperature_F</th>
<th data-quarto-table-cell-role="th">liquid_viscosity_cP</th>
<th data-quarto-table-cell-role="th">liquid_saturation_pct</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>5</td>
<td>2458.00</td>
<td>0.00</td>
<td>17.29</td>
<td>2.321</td>
<td>76.0</td>
<td>0.901</td>
<td>100.0</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>23</td>
<td>1365.00</td>
<td>20.14</td>
<td>13.43</td>
<td>3.083</td>
<td>72.0</td>
<td>0.950</td>
<td>32.3</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>28</td>
<td>1365.00</td>
<td>80.98</td>
<td>30.23</td>
<td>5.940</td>
<td>76.0</td>
<td>0.900</td>
<td>15.0</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>57</td>
<td>2731.00</td>
<td>13.08</td>
<td>26.58</td>
<td>6.091</td>
<td>59.0</td>
<td>1.142</td>
<td>47.0</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>63</td>
<td>2731.00</td>
<td>78.85</td>
<td>53.65</td>
<td>10.377</td>
<td>70.0</td>
<td>0.975</td>
<td>26.6</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>86</td>
<td>97.93</td>
<td>21.47</td>
<td>2.82</td>
<td>0.802</td>
<td>79.0</td>
<td>0.870</td>
<td>9.9</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>90</td>
<td>97.93</td>
<td>80.62</td>
<td>9.53</td>
<td>2.176</td>
<td>76.0</td>
<td>0.901</td>
<td>4.8</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">7</th>
<td>160</td>
<td>0.00</td>
<td>103.26</td>
<td>11.63</td>
<td>2.391</td>
<td>59.0</td>
<td>1.000</td>
<td>0.0</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">run</th>
<th data-quarto-table-cell-role="th">reynolds_liquid</th>
<th data-quarto-table-cell-role="th">reynolds_air</th>
<th data-quarto-table-cell-role="th">delta_lg_psi_per_ft</th>
<th data-quarto-table-cell-role="th">delta_l_psi_per_ft</th>
<th data-quarto-table-cell-role="th">delta_g_psi_per_ft</th>
<th data-quarto-table-cell-role="th">liquid_saturation_pct</th>
<th data-quarto-table-cell-role="th">chi</th>
<th data-quarto-table-cell-role="th">two_phase_parameter</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>5</td>
<td>2739.0</td>
<td>0.0</td>
<td>2.4690</td>
<td>2.46700</td>
<td>0.0000</td>
<td>100.0</td>
<td>inf</td>
<td>1.001</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>23</td>
<td>1443.0</td>
<td>1058.0</td>
<td>2.7880</td>
<td>0.78870</td>
<td>0.0767</td>
<td>32.3</td>
<td>3.2050</td>
<td>3.222</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>28</td>
<td>1523.0</td>
<td>4231.0</td>
<td>5.5700</td>
<td>0.78570</td>
<td>0.7259</td>
<td>15.0</td>
<td>1.0400</td>
<td>3.685</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>57</td>
<td>2401.0</td>
<td>700.5</td>
<td>5.8600</td>
<td>3.06300</td>
<td>0.0226</td>
<td>47.0</td>
<td>11.6400</td>
<td>1.899</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>63</td>
<td>2813.0</td>
<td>4155.0</td>
<td>10.0570</td>
<td>3.04200</td>
<td>0.4475</td>
<td>26.6</td>
<td>2.6070</td>
<td>2.882</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>86</td>
<td>113.0</td>
<td>1117.0</td>
<td>0.4095</td>
<td>0.00755</td>
<td>0.1411</td>
<td>9.9</td>
<td>0.2313</td>
<td>2.753</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>90</td>
<td>109.1</td>
<td>4212.0</td>
<td>1.7610</td>
<td>0.00769</td>
<td>1.3340</td>
<td>4.8</td>
<td>0.0759</td>
<td>1.312</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">7</th>
<td>160</td>
<td>0.0</td>
<td>5530.0</td>
<td>1.9560</td>
<td>0.00000</td>
<td>1.9380</td>
<td>0.0</td>
<td>0.0000</td>
<td>1.009</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Two pieces, labelled for what they are. Both live in <code>model.py</code>.</p>
<p><strong>The reproduction of Table 4 is arithmetic, and pymrm is not involved in it.</strong> Eqs. (17)-(21) contain no derivatives, so the next cells are plain NumPy (<code>Larkins.reynolds</code>, <code>Larkins.delta</code>, <code>Larkins.rho_air</code>).</p>
<p><strong>The column is the <code>S3</code> solve.</strong> The paper’s design procedure (book p.&nbsp;239) is a <em>march</em>: assume the average pressure of a section, compute <img src="https://latex.codecogs.com/png.latex?%5Cdelta_l">, <img src="https://latex.codecogs.com/png.latex?%5Cdelta_g">, <img src="https://latex.codecogs.com/png.latex?%5Cchi">, <img src="https://latex.codecogs.com/png.latex?R_l">, <img src="https://latex.codecogs.com/png.latex?%5Crho_m">, step, confirm the assumption, repeat, and split the bed if it is long. Written as a differential equation that march is</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7DP%7D%7B%5Cmathrm%7Bd%7Dz%7D%20%5C;=%5C;%20%5Cfrac%7B%5Crho_m(P)%7D%7B144%7D%20-%20%5Cdelta_%7Blg%7D(P),%0A%5Cqquad%20P(0)%20=%20P_%7Bin%7D,"></p>
<p><img src="https://latex.codecogs.com/png.latex?z"> measured <strong>downward</strong> (the paper’s own <img src="https://latex.codecogs.com/png.latex?L">, “linear dimension measured downward”), <img src="https://latex.codecogs.com/png.latex?P"> in lb-force/sq.in. and <img src="https://latex.codecogs.com/png.latex?%5Crho_m"> in lb-mass/cu.ft. The right-hand side is a closed function of <img src="https://latex.codecogs.com/png.latex?P"> alone, because <img src="https://latex.codecogs.com/png.latex?%5Cdelta_l"> is pressure-independent, <img src="https://latex.codecogs.com/png.latex?%5Cdelta_g%20=%20K_g/P"> through the ideal gas in Eq. (17), and <img src="https://latex.codecogs.com/png.latex?%5Cchi">, the two-phase parameter and <img src="https://latex.codecogs.com/png.latex?R_l"> follow from those by Eqs. (22) and (23). <code>ColumnFV</code> discretises it with <code>construct_convflux_upwind</code> and <code>construct_div</code> at <img src="https://latex.codecogs.com/png.latex?v%20=%201">, assembled once, and closes it with <code>newton</code> and <code>NumJac((n, 1))</code>: the source is pointwise in <img src="https://latex.codecogs.com/png.latex?P">, so with the field on the last axis its Jacobian is diagonal.</p>
<p><strong>The outlet carries pymrm’s <code>{"outflow": True}</code>.</strong> A first-order equation takes one condition, at the inlet; the outflow marker puts none at the outlet and makes the outlet face value the last cell’s. The discrete system is then exactly backward Euler from <img src="https://latex.codecogs.com/png.latex?z%20=%200">, and every cell value approximates the pressure at its right-hand face. The outlet value is read with <code>compute_boundary_values</code> (pitfall P8), which here returns that last cell. A zero-gradient condition <img src="https://latex.codecogs.com/png.latex?%5C%7Ba:%201,%20b:%200,%20d:%200%5C%7D"> would instead impose <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dz%20=%200"> at <img src="https://latex.codecogs.com/png.latex?z%20=%20L">, which the problem does not have; the page measures what that does further down, because it also shows why a last-cell read and a face read differ.</p>
<p><code>ColumnFV.solve</code> raises unless <code>newton</code> converges, with <code>tol</code> 1e-10 on pressures near 100 psia (above the round-off floor) and <code>bounds=(0, None)</code>, which keeps iterates where the gas density and <img src="https://latex.codecogs.com/png.latex?%5Cchi"> are defined. The sectional recipe and the scalar backward-Euler march raise when their own iterations do not converge. There is no pseudo-time or continuation loop on the page: every Newton solve converges from a flat guess at the inlet pressure, and the searches below are scalar roots on independent solves, so <code>pseudo_transient</code> and <code>continuation</code> have nothing to follow.</p>
<div id="1ef05504" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.624267Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.624065Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.631154Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.630436Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@dataclass</span>(frozen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Cfg:</span>
<span id="cb5-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Everything the break table turns: the model (``m``), the tables, and the analysis."""</span></span>
<span id="cb5-4"></span>
<span id="cb5-5">    m: Larkins</span>
<span id="cb5-6">    t3: pd.DataFrame</span>
<span id="cb5-7">    t4: pd.DataFrame</span>
<span id="cb5-8">    manometer: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># book p. 236: one foot of liquid off Table 3's drop</span></span>
<span id="cb5-9">    rho_m_mode: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21"</span>        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "eq21" | "liquid"</span></span>
<span id="cb5-10">    mean_rule: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arithmetic"</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "arithmetic" | "geometric" | "inlet"</span></span>
<span id="cb5-11">    rootfind: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># extrema and thresholds root-found, not sampled</span></span>
<span id="cb5-12">    root_xtol: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span></span>
<span id="cb5-13">    n_fv: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)</span>
<span id="cb5-14">    outlet: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow"</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "outflow" | "zero_gradient"</span></span>
<span id="cb5-15">    read: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"face"</span>              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "face" (compute_boundary_values) | "cell"</span></span>
<span id="cb5-16">    newton_tol: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span></span>
<span id="cb5-17">    recipe_tol: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span></span>
<span id="cb5-18">    primitive_cp: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the ft-lb-s route with its own centipoise</span></span>
<span id="cb5-19">    demo_run: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">63</span></span>
<span id="cb5-20"></span>
<span id="cb5-21"></span>
<span id="cb5-22">MODEL_FIELDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(Larkins.__dataclass_fields__)</span>
<span id="cb5-23"></span>
<span id="cb5-24"></span>
<span id="cb5-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> make(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>changes):</span>
<span id="cb5-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The paper as printed, with ``changes`` routed to the model or the analysis.</span></span>
<span id="cb5-27"></span>
<span id="cb5-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The air-viscosity line is recovered from the (possibly changed) tables with</span></span>
<span id="cb5-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the (possibly changed) constants every time, as Table 4 requires.</span></span>
<span id="cb5-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb5-31">    mk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> changes.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODEL_FIELDS}</span>
<span id="cb5-32">    ak <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> changes.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODEL_FIELDS}</span>
<span id="cb5-33">    t3, t4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ak.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>, T3), ak.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4"</span>, T4)</span>
<span id="cb5-34">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Larkins.from_constants(KV, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>mk)</span>
<span id="cb5-35">    mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.air_rate_lb_sqft_min.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb5-36">    s, i, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> recover_mu_air(m, t3.air_rate_lb_sqft_min.values[mg],</span>
<span id="cb5-37">                                t3.column_temperature_F.values[mg],</span>
<span id="cb5-38">                                t4.reynolds_air.values[mg])</span>
<span id="cb5-39">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Cfg(m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>replace(m, mu_air_line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(s, i)), t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t3, t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t4, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>ak)</span>
<span id="cb5-40"></span>
<span id="cb5-41"></span>
<span id="cb5-42">BASE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> make()</span>
<span id="cb5-43">RUN5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span></span>
<span id="cb5-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"D_p from Eq. (19) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ft (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in) against a"</span></span>
<span id="cb5-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" nominal 3/8 in = 0.375 in</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D_p/(1-eps) = 6/S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>BASE.m.eps)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-46">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" ft, porosity-free"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>D_p from Eq. (19) = 0.019459 ft (0.2335 in) against a nominal 3/8 in = 0.375 in
D_p/(1-eps) = 6/S = 0.040541 ft, porosity-free</code></pre>
</div>
</div>
<section id="step-1-the-air-viscosity-the-paper-never-prints" class="level3">
<h3 class="anchored" data-anchor-id="step-1-the-air-viscosity-the-paper-never-prints">Step 1: the air viscosity the paper never prints</h3>
<p>Table 2 gives air at <strong>one</strong> temperature: 0.0192 centipoise at 80 degF. Table 3’s runs are at 59-79 degF. Table 4’s <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> column for air is therefore built on a viscosity that appears nowhere in the paper.</p>
<p>It is not lost, though: Eq. (18) ties <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D">, <img src="https://latex.codecogs.com/png.latex?G"> and <img src="https://latex.codecogs.com/png.latex?%5Cmu"> together, and Table 3 prints <img src="https://latex.codecogs.com/png.latex?G"> and <img src="https://latex.codecogs.com/png.latex?T"> while Table 4 prints <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D">. So the viscosity used is <strong>determined row by row</strong> (<code>recover_mu_air</code>), and the question is whether the seven recovered values are a function of temperature or noise.</p>
<p>This is a <strong>reconstruction, not a measurement</strong>: every input traces to something printed, but the output is inferred. Two things keep it honest. Its residual against a straight line is reported, so the reader can see whether the recovery has structure. And it is checked <strong>out of sample</strong>: extrapolated to 80 degF, a temperature no Table 3 row uses, against Table 2’s own printed 0.0192, which was not used to find it.</p>
<div id="28ba031f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.632862Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.632673Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.639181Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.638523Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_recon(cfg):</span>
<span id="cb7-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The recovered air viscosity, and the systematic offset of the liquid Reynolds column."""</span></span>
<span id="cb7-3">    t3, t4, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.t3, cfg.t4, cfg.m</span>
<span id="cb7-4">    mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.air_rate_lb_sqft_min.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb7-5">    TF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.column_temperature_F.values[mg]</span>
<span id="cb7-6">    s, i, resid, mu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> recover_mu_air(m, t3.air_rate_lb_sqft_min.values[mg], TF,</span>
<span id="cb7-7">                                     t4.reynolds_air.values[mg])</span>
<span id="cb7-8">    ml <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.liquid_rate_lb_sqft_min.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb7-9">    Rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.reynolds(t3.liquid_rate_lb_sqft_min.values[ml], t3.liquid_viscosity_cP.values[ml])</span>
<span id="cb7-10">    ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.reynolds_liquid.values[ml] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb7-11">    off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(ratio)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb7-12">    at80 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">80.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> i</span>
<span id="cb7-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb7-14">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_systematic_offset_pct"</span>: off,</span>
<span id="cb7-15">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_offset_spread_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.ptp(ratio)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>,</span>
<span id="cb7-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_offset_implied_specific_surface"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.s_surf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)),</span>
<span id="cb7-17">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_linear_fit_max_resid_pct"</span>: resid,</span>
<span id="cb7-18">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_slope_cP_per_degF"</span>: s,</span>
<span id="cb7-19">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_at_80F_vs_table2_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((at80 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m.mu_air_table2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>),</span>
<span id="cb7-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_at_80F_offset_corrected_vs_table2_pct"</span>:</span>
<span id="cb7-21">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((at80 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m.mu_air_table2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>),</span>
<span id="cb7-22">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_TF"</span>: TF, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_mu"</span>: mu, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_fit"</span>: (s, i),</span>
<span id="cb7-23">    }</span>
<span id="cb7-24"></span>
<span id="cb7-25"></span>
<span id="cb7-26">REC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_recon(BASE)</span>
<span id="cb7-27">s_, i_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_fit"</span>]</span>
<span id="cb7-28">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"air viscosity implied by Table 3 + Table 4, run by run:"</span>]</span>
<span id="cb7-29">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   T = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> F   mu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cP   (line: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>i_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb7-30">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_TF"</span>], REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_mu"</span>]))]</span>
<span id="cb7-31">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">straight line: mu[cP] = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> * T[F] + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb7-32">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  worst residual over the seven rows: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu_air_linear_fit_max_resid_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>,</span>
<span id="cb7-33">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Table 2 prints 0.0192 cP at 80 F; the line extrapolated to 80 F gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>i_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cP,"</span>,</span>
<span id="cb7-34">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu_air_at_80F_vs_table2_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from it, and"</span></span>
<span id="cb7-35">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu_air_at_80F_offset_corrected_vs_table2_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % once the systematic"</span></span>
<span id="cb7-36">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" offset measured on the liquid rows (below) is taken out."</span>,</span>
<span id="cb7-37">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 5 (book p. 237) prints the gas-viscosity range as 0.012 to 0.019 cP; the"</span></span>
<span id="cb7-38">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" recovered values span </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_mu'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_mu'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>]</span>
<span id="cb7-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(lines))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>air viscosity implied by Table 3 + Table 4, run by run:
   T = 59.0 F   mu = 0.018775 cP   (line: 0.018777)
   T = 59.0 F   mu = 0.018776 cP   (line: 0.018777)
   T = 70.0 F   mu = 0.019082 cP   (line: 0.019081)
   T = 72.0 F   mu = 0.019141 cP   (line: 0.019136)
   T = 76.0 F   mu = 0.019245 cP   (line: 0.019247)
   T = 76.0 F   mu = 0.019246 cP   (line: 0.019247)
   T = 79.0 F   mu = 0.019327 cP   (line: 0.019330)

straight line: mu[cP] = 2.764945e-05 * T[F] + 0.017145
  worst residual over the seven rows: 0.0259 %
  Table 2 prints 0.0192 cP at 80 F; the line extrapolated to 80 F gives 0.019357 cP,
  +0.819 % from it, and +0.672 % once the systematic offset measured on the liquid rows (below) is taken out.
Table 5 (book p. 237) prints the gas-viscosity range as 0.012 to 0.019 cP; the recovered values span 0.018775 to 0.019327.</code></pre>
</div>
</div>
</section>
<section id="step-2-the-reynolds-columns-and-a-systematic-0.15" class="level3">
<h3 class="anchored" data-anchor-id="step-2-the-reynolds-columns-and-a-systematic-0.15">Step 2: the Reynolds columns, and a systematic 0.15 %</h3>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D%20=%206G/(S%5Cmu)">: the porosity cancels, so the liquid Reynolds column depends on exactly three printed numbers, the mass rate, the liquid viscosity and the specific surface. There is no room for a modelling choice, which makes it the sharpest single test of the transcription on the page.</p>
<div id="0b3ffc98" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.640823Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.640694Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.652167Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.651439Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_repro(cfg):</span>
<span id="cb9-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 3 -&gt; Table 4: the authors' own arithmetic, redone."""</span></span>
<span id="cb9-3">    t3, t4, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.t3, cfg.t4, cfg.m</span>
<span id="cb9-4">    L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.liquid_rate_lb_sqft_min.values</span>
<span id="cb9-5">    Gg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.air_rate_lb_sqft_min.values</span>
<span id="cb9-6">    TF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.column_temperature_F.values</span>
<span id="cb9-7">    mul <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.liquid_viscosity_cP.values</span>
<span id="cb9-8">    Pa <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.average_pressure_psig.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m.p_atm</span>
<span id="cb9-9">    Rl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.liquid_saturation_pct.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb9-10">    ml, mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Gg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb9-11"></span>
<span id="cb9-12">    Rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(ml, m.reynolds(np.where(ml, L, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), mul), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb9-13">    Reg_t2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(mg, m.reynolds(np.where(mg, Gg, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), m.mu_air_table2), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb9-14">    mua <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.mu_air(TF)</span>
<span id="cb9-15">    Reg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(mg, m.reynolds(np.where(mg, Gg, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), mua), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb9-16">    rg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.rho_air(Pa, TF)</span>
<span id="cb9-17"></span>
<span id="cb9-18">    dl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(ml, m.delta(Rel, mul, m.rho_w), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb9-19">    dl_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(ml, m.delta_primitive(L, mul, m.rho_w, cp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.primitive_cp), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb9-20">    dg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(mg, m.delta(Reg, mua, rg), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb9-21">    rm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m.rho_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Rl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Rl) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg.rho_m_mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21"</span></span>
<span id="cb9-22">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.full_like(Rl, m.rho_w))</span>
<span id="cb9-23">    corr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.rho_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg.manometer <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb9-24">    dlg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.pressure_drop_psi_per_ft.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> corr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span></span>
<span id="cb9-25"></span>
<span id="cb9-26">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> err(comp, printed, mask):</span>
<span id="cb9-27">        p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(printed, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb9-28">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (comp[mask] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p[mask] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb9-29"></span>
<span id="cb9-30">    is5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.run.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> RUN5</span>
<span id="cb9-31">    e_dlg_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (dlg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.delta_lg_psi_per_ft.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb9-32">    e_dlg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e_dlg_all[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>is5]</span>
<span id="cb9-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb9-34">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_liquid_max_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(err(Rel, t4.reynolds_liquid, ml)))),</span>
<span id="cb9-35">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_liquid_rms_rel_error_pct"</span>:</span>
<span id="cb9-36">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(err(Rel, t4.reynolds_liquid, ml)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb9-37">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_air_table2_viscosity_max_rel_error_pct"</span>:</span>
<span id="cb9-38">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(err(Reg_t2, t4.reynolds_air, mg)))),</span>
<span id="cb9-39">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_max_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(err(dl, t4.delta_l_psi_per_ft, ml)))),</span>
<span id="cb9-40">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_rms_rel_error_pct"</span>:</span>
<span id="cb9-41">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(err(dl, t4.delta_l_psi_per_ft, ml)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb9-42">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_g_max_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(err(dg, t4.delta_g_psi_per_ft, mg)))),</span>
<span id="cb9-43">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg_max_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e_dlg))),</span>
<span id="cb9-44">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg_rms_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(e_dlg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb9-45">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_two_unit_systems_max_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dl_alt[ml] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dl[ml] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb9-46">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gc_minute_conversion_recovered"</span>:</span>
<span id="cb9-47">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(SEC_PER_MIN2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t4.delta_l_psi_per_ft.values[ml]</span>
<span id="cb9-48">                                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dl[ml])))),</span>
<span id="cb9-49">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_rate_range_fold"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L[ml].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L[ml].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()),</span>
<span id="cb9-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dp_nominal_over_effective_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.375</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m.dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb9-51">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dl"</span>: dl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dg"</span>: dg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dlg"</span>: dlg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Rel"</span>: Rel, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Reg"</span>: Reg,</span>
<span id="cb9-52">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rm"</span>: rm, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_e_dlg_all"</span>: e_dlg_all, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Reg_t2"</span>: Reg_t2,</span>
<span id="cb9-53">    }</span>
<span id="cb9-54"></span>
<span id="cb9-55"></span>
<span id="cb9-56">R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_repro(BASE)</span>
<span id="cb9-57"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> np.errstate(divide<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>, invalid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>):</span>
<span id="cb9-58">    tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({</span>
<span id="cb9-59">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>: T3.run,</span>
<span id="cb9-60">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_l printed"</span>: T4.reynolds_liquid, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_l here"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Rel"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb9-61">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_l err %"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.where(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T4.reynolds_liquid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb9-62">                                        np.nan), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb9-63">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_g printed"</span>: T4.reynolds_air,</span>
<span id="cb9-64">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_g here (Table 2 mu)"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Reg_t2"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb9-65">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_g err %"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.where(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Reg_t2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb9-66">                                        (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Reg_t2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T4.reynolds_air <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, np.nan), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)})</span>
<span id="cb9-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(tab.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"liquid Reynolds: worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_liquid_max_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,"</span></span>
<span id="cb9-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" r.m.s. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_liquid_rms_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the error is one constant, not scatter: seven rows spanning a"</span></span>
<span id="cb9-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mass_rate_range_fold'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-fold range of mass rate agree on"</span></span>
<span id="cb9-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reynolds_systematic_offset_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % to within"</span></span>
<span id="cb9-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reynolds_offset_spread_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and N_Re = 6G/(S mu), so the offset is exactly a specific surface of"</span></span>
<span id="cb9-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reynolds_offset_implied_specific_surface'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sq.ft./cu.ft.;"</span></span>
<span id="cb9-76">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the printed '148' covers any S in [147.5, 148.5].</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"air Reynolds with Table 2's single 0.0192 cP: worst"</span></span>
<span id="cb9-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_air_table2_viscosity_max_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, temperature-ordered,"</span></span>
<span id="cb9-79">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" which is what the recovery above is built on."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> run  Re_l printed  Re_l here  Re_l err %  Re_g printed  Re_g here (Table 2 mu)  Re_g err %
   5        2739.0     2743.1       0.151           0.0                     0.0         NaN
  23        1443.0     1444.8       0.123        1058.0                  1054.7      -0.308
  28        1523.0     1525.0       0.133        4231.0                  4241.0       0.236
  57        2401.0     2404.6       0.150         700.5                   685.0      -2.212
  63        2813.0     2816.5       0.124        4155.0                  4129.4      -0.616
  86         113.0      113.2       0.163        1117.0                  1124.4       0.662
  90         109.1      109.3       0.174        4212.0                  4222.1       0.240
 160           0.0        0.0         NaN        5530.0                  5407.8      -2.210
liquid Reynolds: worst 0.1741 %, r.m.s. 0.1465 %
  the error is one constant, not scatter: seven rows spanning a 27.887-fold range of mass rate agree on +0.1454 % to within 0.0515 points,
  and N_Re = 6G/(S mu), so the offset is exactly a specific surface of 148.22 sq.ft./cu.ft.; the printed '148' covers any S in [147.5, 148.5].
air Reynolds with Table 2's single 0.0192 cP: worst 2.212 %, temperature-ordered, which is what the recovery above is built on.</code></pre>
</div>
</div>
</section>
<section id="step-3-the-three-friction-losses-and-the-run-that-will-not-close" class="level3">
<h3 class="anchored" data-anchor-id="step-3-the-three-friction-losses-and-the-run-that-will-not-close">Step 3: the three friction losses, and the run that will not close</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdelta_l"> and <img src="https://latex.codecogs.com/png.latex?%5Cdelta_g"> come from Eq. (17) with the Raschig-ring constants; <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"> comes from the <em>measurement</em>, through Eq. (20) with Eq. (21)’s mixture density and the manometer correction quoted above.</p>
<p>Read the <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"> column carefully. Seven runs close. Run 5, the one with no air and the column full of liquid, is out by -5.99 %, and that is not a transcription error at either end: both cells were re-read on the 300 ppi crop.</p>
<div id="b8558a01" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.654194Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.654020Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.663609Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.662856Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_run5(cfg):</span>
<span id="cb11-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Run 5 and run 160, the two single-phase rows."""</span></span>
<span id="cb11-3">    t3, t4, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.t3, cfg.t4, cfg.m</span>
<span id="cb11-4">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_repro(cfg)</span>
<span id="cb11-5">    i5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.where(t3.run.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> RUN5)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb11-6">    i160 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.where(t3.run.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb11-7">    corr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.rho_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg.manometer <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb11-8">    implied <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t4.delta_lg_psi_per_ft.values[i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> corr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rm"</span>][i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span>)</span>
<span id="cb11-9">    par3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dlg"</span>][i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (t4.delta_l_psi_per_ft.values[i5]</span>
<span id="cb11-10">                                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t4.delta_g_psi_per_ft.values[i5]))</span>
<span id="cb11-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># run 160 is not the same reduction with the phases swapped: with no liquid</span></span>
<span id="cb11-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the manometer correction still applies and Eq. (21)'s rho_g still stands</span></span>
<span id="cb11-13">    dlg160_uncorrected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t3.pressure_drop_psi_per_ft.values[i160] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rm"</span>][i160] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span>)</span>
<span id="cb11-14">    r5_ergun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t4.delta_lg_psi_per_ft.values[i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.delta_l_psi_per_ft.values[i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb11-15">    r160_ergun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t4.delta_lg_psi_per_ft.values[i160] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.delta_g_psi_per_ft.values[i160]</span>
<span id="cb11-16">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb11-17">    par5_t4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4.delta_lg_psi_per_ft.values[i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (t4.delta_l_psi_per_ft.values[i5]</span>
<span id="cb11-18">                                                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t4.delta_g_psi_per_ft.values[i5])</span>
<span id="cb11-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb11-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_delta_lg_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_e_dlg_all"</span>][i5]),</span>
<span id="cb11-21">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_dpdl_implied_by_table4_psi_per_ft"</span>: implied,</span>
<span id="cb11-22">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_two_phase_parameter_from_table3"</span>: par3,</span>
<span id="cb11-23">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_parameter_gap_vs_printed"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t4.two_phase_parameter.values[i5] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> par3),</span>
<span id="cb11-24">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_parameter_gap_from_unity_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((par3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>),</span>
<span id="cb11-25">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_delta_lg_rel_error_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_e_dlg_all"</span>][i160]),</span>
<span id="cb11-26">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_manometer_correction_worth_pct"</span>:</span>
<span id="cb11-27">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((dlg160_uncorrected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.delta_lg_psi_per_ft.values[i160] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>),</span>
<span id="cb11-28">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_vs_ergun_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r5_ergun),</span>
<span id="cb11-29">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_vs_ergun_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r160_ergun),</span>
<span id="cb11-30">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_closer_factor"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r160_ergun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r5_ergun),</span>
<span id="cb11-31">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_parameter_off_unity_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((t4.two_phase_parameter.values[i160] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb11-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_ergun_residual_is_parameter_gap"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r5_ergun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(par5_t4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)),</span>
<span id="cb11-33">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_r"</span>: r, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_i5"</span>: i5, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_i160"</span>: i160,</span>
<span id="cb11-34">    }</span>
<span id="cb11-35"></span>
<span id="cb11-36"></span>
<span id="cb11-37">F5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_run5(BASE)</span>
<span id="cb11-38">d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({</span>
<span id="cb11-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>: T3.run,</span>
<span id="cb11-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_l printed"</span>: T4.delta_l_psi_per_ft, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_l here"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dl"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb11-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_g printed"</span>: T4.delta_g_psi_per_ft, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_g here"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dg"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>),</span>
<span id="cb11-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_lg printed"</span>: T4.delta_lg_psi_per_ft, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_lg here"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dlg"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb11-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_lg err %"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_e_dlg_all"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)})</span>
<span id="cb11-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(d.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"delta_l  : worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_l_max_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, r.m.s."</span></span>
<span id="cb11-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_l_rms_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % over the seven rows with liquid</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"delta_g  : worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_g_max_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % over the seven rows with air</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"delta_lg : worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_lg_max_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, r.m.s."</span></span>
<span id="cb11-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_lg_rms_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, run 5 excluded</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"           run 160 (all gas) closes at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run160_delta_lg_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %;"</span></span>
<span id="cb11-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" run 5 (all liquid) is out by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_delta_lg_rel_error_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two forms of Eq. (17), Reynolds-grouped in minute units and primitive Ergun in"</span></span>
<span id="cb11-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ft-lb-second units, agree to"</span></span>
<span id="cb11-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below 1e-13 relative, an identity (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_l_two_unit_systems_max_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the factor Table 4 requires on the printed g_c = 32.17 is"</span></span>
<span id="cb11-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gc_minute_conversion_recovered'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, against 60^2 = 3600:"</span></span>
<span id="cb11-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gc_minute_conversion_recovered'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. That residual is the"</span></span>
<span id="cb11-58">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" delta_l residual restated (a geometric mean of the same ratios); what it</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-59">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"establishes is the reading: only a g_c per minute squared reconciles the notation's"</span></span>
<span id="cb11-60">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" minute-based viscosity with Eq. (17)."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> run  d_l printed  d_l here  d_g printed  d_g here  d_lg printed  d_lg here  d_lg err %
   5      2.46700   2.47188       0.0000   0.00000        2.4690     2.3210      -5.994
  23      0.78870   0.78968       0.0767   0.07702        2.7880     2.7903       0.083
  28      0.78570   0.78663       0.7259   0.72807        5.5700     5.5730       0.054
  57      3.06300   3.06862       0.0226   0.02267        5.8600     5.8621       0.036
  63      3.04200   3.04828       0.4475   0.44887       10.0570    10.0607       0.037
  86      0.00755   0.00757       0.1411   0.14167        0.4095     0.4121       0.639
  90      0.00769   0.00770       1.3340   1.33835        1.7610     1.7643       0.186
 160      0.00000   0.00000       1.9380   1.94402        1.9560     1.9586       0.134
delta_l  : worst 0.2177 %, r.m.s. 0.1757 % over the seven rows with liquid
delta_g  : worst 0.4161 % over the seven rows with air
delta_lg : worst 0.6390 %, r.m.s. 0.2600 %, run 5 excluded
           run 160 (all gas) closes at +0.1339 %; run 5 (all liquid) is out by -5.9943 %
the two forms of Eq. (17), Reynolds-grouped in minute units and primitive Ergun in ft-lb-second units, agree to below 1e-13 relative, an identity (here 5.6e-16)
the factor Table 4 requires on the printed g_c = 32.17 is 3593.8, against 60^2 = 3600: -0.171 %. That residual is the delta_l residual restated (a geometric mean of the same ratios); what it
establishes is the reading: only a g_c per minute squared reconciles the notation's minute-based viscosity with Eq. (17).</code></pre>
</div>
</div>
<section id="run-5-stated-without-repairing-it" class="level4">
<h4 class="anchored" data-anchor-id="run-5-stated-without-repairing-it">Run 5, stated without repairing it</h4>
<p>The paper prints, for run 5:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th></th>
<th>Table 3, book p.&nbsp;234</th>
<th>Table 4, book p.&nbsp;235</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>pressure drop</td>
<td><code>2.321</code> lb/sq.in./ft</td>
<td></td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"></td>
<td></td>
<td><code>2.469</code></td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Cdelta_l"></td>
<td></td>
<td><code>2.467</code></td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D/(%5Cdelta_l+%5Cdelta_g)"></td>
<td></td>
<td><code>1.001</code></td>
</tr>
</tbody>
</table>
<p>Run 5 has no air, so <img src="https://latex.codecogs.com/png.latex?R_l%20=%20100%5C,%5C%25">, so <img src="https://latex.codecogs.com/png.latex?%5Crho_m%20=%20%5Crho_l">, so the manometer correction and Eq. (21)’s density <strong>cancel exactly</strong> and Eq. (20) reduces to <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D%20=%20%5CDelta%20P/%5CDelta%20L">. Table 3’s cell says 2.321. Table 4’s says 2.469. They cannot both be right.</p>
<p><strong>What is not free.</strong> The liquid rate 2,458 is corroborated twice inside Table 4: it reproduces the printed <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D%20=%202%7B,%7D739"> and, through Eq. (17), the printed <img src="https://latex.codecogs.com/png.latex?%5Cdelta_l%20=%202.467">. The procedure that fails on this row reproduces the other seven to 0.639 % or better, run 160 included. So neither the rate, nor the constants, nor the procedure is what breaks.</p>
<p><strong>Run 160 is not “the same reduction with the phases swapped”.</strong> It is the <em>mirror</em> single-phase row (all gas, no liquid), but nothing cancels there: with <img src="https://latex.codecogs.com/png.latex?R_l%20=%200"> the manometer correction still applies in full and Eq. (21) still contributes <img src="https://latex.codecogs.com/png.latex?%5Crho_g">, so <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D%20=%20%5CDelta%20P/%5CDelta%20L%20-%20%5Crho_l/144%20+%0A%5Crho_g/144"> and all three terms survive. What run 160 corroborates is the <em>ingredients</em> of run 5’s reduction, and it prices the correction: omitting it alone moves that row by +22.29 %. Run 5’s cancellation is a property of <img src="https://latex.codecogs.com/png.latex?R_l%20=%20100%5C,%5C%25"> and is not tested anywhere else in the table.</p>
<p><strong>What each reading implies, against the paper’s own scatter.</strong> Taking Table 3’s 2.321 makes run 5’s two-phase parameter 0.9408 rather than the printed 1.001, on a liquid-only run where <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%20%5Cinfty"> and the paper says the parameter approaches unity: book p.&nbsp;238, “Figure 7 confirms that the experimental values of the two-phase parameter approach unity smoothly as <img src="https://latex.codecogs.com/png.latex?%5Cchi"> approaches both zero and infinity”. <strong>That sentence is asymptotic and it is about the Figure 7 cloud, not a per-row requirement</strong>, and the same paper prints the scatter of that cloud on book p.&nbsp;237: a 13 % standard deviation with 87 % of points inside <img src="https://latex.codecogs.com/png.latex?%5Cpm%2020%5C,%5C%25">. Against that band, -5.92 % is comfortably inside it, and the page’s other single-phase row, run 160 at <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%200">, is itself +0.90 % off unity. Taking Table 4’s 2.469 removes the gap but requires Table 3’s cell to be wrong.</p>
<p><strong>The counter-evidence, and exactly what it rests on.</strong> Run 160’s measured <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"> sits 0.93 % from Ergun’s <img src="https://latex.codecogs.com/png.latex?%5Cdelta_g">, the sort of residual a measurement leaves against a correlation the paper says holds to about 20 %; run 5’s 2.469 sits 0.081 % from Ergun’s <img src="https://latex.codecogs.com/png.latex?%5Cdelta_l">, 11.5 times closer. Two things have to be said about that comparison.</p>
<p><em>The two arms are the same statistic.</em> Run 5 has no gas, so <img src="https://latex.codecogs.com/png.latex?%5Cdelta_g%20=%200"> and <img src="https://latex.codecogs.com/png.latex?%7C%5Cdelta_%7Blg%7D/%5Cdelta_l%20-%201%7C"> <strong>is</strong> Table 4’s own two-phase parameter minus one, the very quantity the <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%20%5Cinfty"> check reads. This is one datum read in two directions, and the page checks the identity rather than stating it.</p>
<p><em>And “improbably close” is not a conclusion from the band.</em> Against the paper’s 13 % scatter <strong>alone</strong>, a 0.081 % residual is the <em>more</em> probable of the two numbers. It becomes evidence only against a named alternative: <strong>that Table 4’s cell was back-computed from Eq. (17) rather than measured.</strong> Under that hypothesis a residual this small is what the cell would look like, and the calibration of “this small” rests on the one other single-phase row.</p>
<p><strong>This page does not choose.</strong> No footnote attaches to either table (both were checked on the crops), the only two places either table is discussed, “DESCRIPTION OF TABULATED PROCESSED DATA” (book p.&nbsp;234) and “EXPLANATION OF TABULATED RESULTS” (book p.&nbsp;236), say nothing about any individual run, and reference 4 is not on disk.</p>
<div id="f3c08c1e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.665402Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.665281Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.669605Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.669025Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">i5, i160 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_i5"</span>], F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_i160"</span>]</span>
<span id="cb13-2">MANOMETER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE.m.rho_w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span></span>
<span id="cb13-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"run 5, if Table 4's delta_lg is the measurement: dP/dL must be"</span></span>
<span id="cb13-4">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_dpdl_implied_by_table4_psi_per_ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> lb/sq.in./ft, not the printed"</span></span>
<span id="cb13-5">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pressure_drop_psi_per_ft<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values[i5]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"run 5, if Table 3's 2.321 is the measurement: the two-phase parameter is"</span></span>
<span id="cb13-7">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_two_phase_parameter_from_table3'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, not the printed"</span></span>
<span id="cb13-8">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>two_phase_parameter<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values[i5]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (gap </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_parameter_gap_vs_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e."</span></span>
<span id="cb13-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_parameter_gap_from_unity_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % off unity)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two single-phase rows against Eq. (17) as printed in Table 4 itself:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   run 160 (gas only)   : |d_lg/d_g - 1| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run160_vs_ergun_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   run   5 (liquid only): |d_lg/d_l - 1| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_vs_ergun_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb13-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_closer_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x closer)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on run 5 the second is Table 4's own two-phase parameter minus one: the two differ by"</span></span>
<span id="cb13-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" less than 1e-12, an identity (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run5_ergun_residual_is_parameter_gap'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"run 160 at chi -&gt; 0: parameter </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>two_phase_parameter<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values[i160]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as printed,"</span></span>
<span id="cb13-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run160_parameter_off_unity_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % off unity</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"run 160, all three terms of Eq. (20): d_lg = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pressure_drop_psi_per_ft<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values[i160]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MANOMETER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_rm'</span>][i160]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">144</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_dlg'</span>][i160]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against a printed"</span></span>
<span id="cb13-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>delta_lg_psi_per_ft<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values[i160]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; without the manometer correction the row"</span></span>
<span id="cb13-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" moves by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'run160_manometer_correction_worth_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>run 5, if Table 4's delta_lg is the measurement: dP/dL must be 2.4690 lb/sq.in./ft, not the printed 2.321
run 5, if Table 3's 2.321 is the measurement: the two-phase parameter is 0.9408, not the printed 1.001 (gap 0.0602, i.e. -5.92 % off unity)
the two single-phase rows against Eq. (17) as printed in Table 4 itself:
   run 160 (gas only)   : |d_lg/d_g - 1| = 0.929 %
   run   5 (liquid only): |d_lg/d_l - 1| = 0.081 %  (11.5x closer)
on run 5 the second is Table 4's own two-phase parameter minus one: the two differ by less than 1e-12, an identity (here 0.0e+00)
run 160 at chi -&gt; 0: parameter 1.0090 as printed, +0.90 % off unity
run 160, all three terms of Eq. (20): d_lg = 2.3910 - 0.43333 + 0.00095 = 1.9586 against a printed 1.9560; without the manometer correction the row moves by +22.29 %</code></pre>
</div>
</div>
</section>
</section>
<section id="step-4-chi-and-the-two-phase-parameter-and-why-they-are-not-evidence" class="level3">
<h3 class="anchored" data-anchor-id="step-4-chi-and-the-two-phase-parameter-and-why-they-are-not-evidence">Step 4: chi and the two-phase parameter, and why they are not evidence</h3>
<p>The last two columns of Table 4 are <img src="https://latex.codecogs.com/png.latex?%5Cchi%20=%20%5Csqrt%7B%5Cdelta_l/%5Cdelta_g%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D/(%5Cdelta_l+%5Cdelta_g)">. Recomputing them <strong>from Table 4’s own three <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> columns</strong> closes to a few hundredths of a percent, but that is arithmetic on the same table, not physics, and it is reported here as a transcription check on the CSV and nothing more. It cannot detect a wrong <img src="https://latex.codecogs.com/png.latex?%5Calpha">, a wrong <img src="https://latex.codecogs.com/png.latex?D_p"> or a wrong manometer correction, because all three cancel out of a ratio taken inside one row.</p>
<div id="c83bde5b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.671494Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.671376Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.676294Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.675584Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_selfcheck(cfg):</span>
<span id="cb15-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""chi and the parameter recomputed from Table 4's own delta columns."""</span></span>
<span id="cb15-3">    t4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.t4</span>
<span id="cb15-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> np.errstate(divide<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>, invalid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>):</span>
<span id="cb15-5">        chi_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(t4.delta_g_psi_per_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb15-6">                         np.sqrt(t4.delta_l_psi_per_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.delta_g_psi_per_ft), np.inf)</span>
<span id="cb15-7">    par_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4.delta_lg_psi_per_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (t4.delta_l_psi_per_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t4.delta_g_psi_per_ft)</span>
<span id="cb15-8">    fin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.isfinite(t4.chi.values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t4.chi.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb15-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_chi_selfcheck_max_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(chi_t[fin] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.chi.values[fin] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb15-10">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_parameter_selfcheck_max_pct"</span>:</span>
<span id="cb15-11">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(par_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t4.two_phase_parameter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>}</span>
<span id="cb15-12"></span>
<span id="cb15-13"></span>
<span id="cb15-14">SELF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_selfcheck(BASE)</span>
<span id="cb15-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"chi recomputed from Table 4's own delta columns: worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SELF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_chi_selfcheck_max_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"two-phase parameter, likewise                  : worst"</span></span>
<span id="cb15-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SELF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_parameter_selfcheck_max_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-18">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both are transcription checks on the CSV, not agreement: every constant cancels in a"</span></span>
<span id="cb15-19">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" ratio taken inside one row."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>chi recomputed from Table 4's own delta columns: worst 0.0530 %
two-phase parameter, likewise                  : worst 0.0651 %
both are transcription checks on the CSV, not agreement: every constant cancels in a ratio taken inside one row.</code></pre>
</div>
</div>
</section>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-correlations-against-table-4-a-goodness-of-fit-with-the-null-beside-it" class="level3">
<h3 class="anchored" data-anchor-id="the-correlations-against-table-4-a-goodness-of-fit-with-the-null-beside-it">The correlations against Table 4: a goodness of fit, with the null beside it</h3>
<p>Eqs. (22) and (23) were fitted to the body of data these eight rows are a sample of. Comparing them to these rows measures <strong>how well the fit fits</strong>, not whether it predicts. That is worth doing, because it is how the reader learns the size of the residuals the paper’s “13 %” and “16 %” standard deviations describe, but only next to a baseline that uses no correlation.</p>
<p>Two nulls are used:</p>
<ul>
<li>for the two-phase parameter, <strong>unity</strong>, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D%20=%20%5Cdelta_l%20+%0A%5Cdelta_g">, the “no interaction” model, which is also what Eq. (22) itself reduces to at both ends of <img src="https://latex.codecogs.com/png.latex?%5Cchi">;</li>
<li>for both, <strong>the best single constant</strong> on these same rows, fitted in the log the correlation works in. That null has one free parameter against Eq. (22)’s two and Eq. (23)’s three, so it is the fair comparison for a fit.</li>
</ul>
<p><strong>And one row set matters as much as the null does.</strong> Two of the eight rows, the liquid-only and gas-only runs, sit at <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%20%5Cinfty"> and <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%200">, where Eq. (22) returns <strong>exactly 1 whatever its two constants are</strong>. On those two rows the correlation is not free, so it is charged only the printed parameter’s own distance from unity while the best-constant null is charged in full. Eq. (22)’s gain is therefore printed <strong>twice</strong>: over all eight rows, and over the six rows that can actually discriminate. The second is the one to set beside the paper’s own 13 % standard deviation. Eq. (23)’s null needs no such split: all six of its rows are genuinely two-phase.</p>
<div id="96ceba81" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.677895Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.677771Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.689066Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.688437Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_corr(cfg):</span>
<span id="cb17-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eqs. (22)/(23) against the same eight rows they were fitted from."""</span></span>
<span id="cb17-3">    t3, t4, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.t3, cfg.t4, cfg.m</span>
<span id="cb17-4">    chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4.chi.values.copy()</span>
<span id="cb17-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m.chi_inverted:</span>
<span id="cb17-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> np.errstate(divide<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>):</span>
<span id="cb17-7">            chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.where(chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, chi, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb17-8">                           np.where(np.isinf(chi), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.inf))</span>
<span id="cb17-9">    obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4.two_phase_parameter.values</span>
<span id="cb17-10">    pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.f22(chi)</span>
<span id="cb17-11">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb17-12">    ldev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> obs)</span>
<span id="cb17-13">    null_unity <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> obs)</span>
<span id="cb17-14">    null_best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>np.mean(np.log10(obs)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> obs)</span>
<span id="cb17-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rows where the correlation is free: at chi -&gt; 0 and chi -&gt; infinity</span></span>
<span id="cb17-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Eq. (22) returns exactly 1 for any values of its two constants</span></span>
<span id="cb17-17">    free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.isfinite(chi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb17-18">    fdev, fldev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev[free], ldev[free]</span>
<span id="cb17-19">    fnull <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>np.mean(np.log10(obs[free])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> obs[free])</span>
<span id="cb17-20"></span>
<span id="cb17-21">    inr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.isfinite(chi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_min"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (chi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_max"</span>])</span>
<span id="cb17-22">    robs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.liquid_saturation_pct.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb17-23">    rpred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(inr, m.f23(np.where(inr, chi, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)), np.nan)</span>
<span id="cb17-24">    rdev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (rpred[inr] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> robs[inr] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb17-25">    rnull <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>np.mean(np.log10(robs[inr])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> robs[inr] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb17-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same equation as printed inside Figure 7</span></span>
<span id="cb17-27">    m7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(m, eq23_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c0_figure7"</span>], m.eq23_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], m.eq23_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb17-28">    f7pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(inr, m7.f23(np.where(inr, chi, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)), np.nan)</span>
<span id="cb17-29">    f7dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (f7pred[inr] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> robs[inr] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span></span>
<span id="cb17-30">    rms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(np.asarray(x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb17-31">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb17-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_max_abs_dev_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev))),</span>
<span id="cb17-33">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rms_dev_pct"</span>: rms(dev),</span>
<span id="cb17-34">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rms_log_dev"</span>: rms(ldev),</span>
<span id="cb17-35">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_null_unity_rms_log_dev"</span>: rms(null_unity),</span>
<span id="cb17-36">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_null_bestconst_rms_log_dev"</span>: rms(null_best),</span>
<span id="cb17-37">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_gain_over_bestconst"</span>: rms(null_best) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rms(ldev),</span>
<span id="cb17-38">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_rms_dev_pct"</span>: rms(fdev),</span>
<span id="cb17-39">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_rms_log_dev"</span>: rms(fldev),</span>
<span id="cb17-40">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_null_bestconst_rms_log_dev"</span>: rms(fnull),</span>
<span id="cb17-41">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_gain_over_bestconst"</span>: rms(fnull) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rms(fldev),</span>
<span id="cb17-42">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_max_abs_dev_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rdev))),</span>
<span id="cb17-43">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rms_dev_pct"</span>: rms(rdev),</span>
<span id="cb17-44">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_null_bestconst_rms_dev_pct"</span>: rms(rnull),</span>
<span id="cb17-45">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rows_outside_20pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rdev) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>)),</span>
<span id="cb17-46">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_rms_dev_pct"</span>: rms(f7dev),</span>
<span id="cb17-47">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_max_abs_dev_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f7dev))),</span>
<span id="cb17-48">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_rows_outside_20pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f7dev) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>)),</span>
<span id="cb17-49">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_text_minus_fig7_rms_dev_pct"</span>: rms(rdev) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rms(f7dev),</span>
<span id="cb17-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dev"</span>: dev, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rdev"</span>: rdev, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_inr"</span>: inr, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_pred"</span>: pred, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rpred"</span>: rpred,</span>
<span id="cb17-51">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_f7dev"</span>: f7dev, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_free"</span>: free,</span>
<span id="cb17-52">    }</span>
<span id="cb17-53">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_gain_flatters_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_gain_over_bestconst"</span>]</span>
<span id="cb17-54">                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_gain_over_bestconst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-55">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_gain_over_bestconst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_null_bestconst_rms_dev_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rms_dev_pct"</span>]</span>
<span id="cb17-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb17-57"></span>
<span id="cb17-58"></span>
<span id="cb17-59">C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_corr(BASE)</span>
<span id="cb17-60">SD22, SD23 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"friction_loss_standard_deviation_pct"</span>], KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"liquid_saturation_standard_deviation_pct"</span>]</span>
<span id="cb17-61">tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({</span>
<span id="cb17-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>: T3.run, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chi"</span>: T4.chi, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"param printed"</span>: T4.two_phase_parameter,</span>
<span id="cb17-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (22)"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_pred"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dev %"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dev"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb17-64">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_l printed %"</span>: T3.liquid_saturation_pct, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (23) %"</span>: np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rpred"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)})</span>
<span id="cb17-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(tab.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Eq. (22) against the eight printed parameters: worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_max_abs_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,"</span></span>
<span id="cb17-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" r.m.s. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_rms_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % (the paper, for the whole body: standard deviation"</span></span>
<span id="cb17-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SD22<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'friction_loss_within_20pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of points within 20 %)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   nulls in r.m.s. log units: no interaction </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_null_unity_rms_log_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb17-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" best single constant </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_null_bestconst_rms_log_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; Eq. (22)"</span></span>
<span id="cb17-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_rms_log_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, a gain of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_gain_over_bestconst'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   on the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_free'</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows where Eq. (22) is free (runs"</span></span>
<span id="cb17-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T3.run.values[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_free'</span>]])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are the chi limits):"</span></span>
<span id="cb17-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" r.m.s. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_free_rows_rms_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_free_rows_rms_log_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" log), null </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_free_rows_null_bestconst_rms_log_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, gain"</span></span>
<span id="cb17-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_free_rows_gain_over_bestconst'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x; the eight-row gain is"</span></span>
<span id="cb17-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_gain_flatters_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % larger</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Eq. (23) against the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_inr'</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows inside 0.05 &lt; chi &lt; 30: worst"</span></span>
<span id="cb17-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_max_abs_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, r.m.s. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_rms_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,"</span></span>
<span id="cb17-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_rows_outside_20pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> outside 20 % (the paper: standard deviation </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SD23<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,"</span></span>
<span id="cb17-81">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'saturation_within_20pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % within 20 %)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   null: best single constant </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_null_bestconst_rms_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % r.m.s.,"</span></span>
<span id="cb17-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" so Eq. (23) gains </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_gain_over_bestconst'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Eq. (23) with Figure 7's constant </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_c0_figure7'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: worst"</span></span>
<span id="cb17-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_fig7_max_abs_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, r.m.s. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_fig7_rms_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,"</span></span>
<span id="cb17-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_fig7_rows_outside_20pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> outside 20 %: better in r.m.s. by"</span></span>
<span id="cb17-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_text_minus_fig7_rms_dev_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points and worse on the 'within 20 %' count.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-88">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This is a goodness of fit: these rows are a printed sample of the data the correlations"</span></span>
<span id="cb17-89">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" were fitted to."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> run     chi  param printed  Eq. (22)  dev %  R_l printed %  Eq. (23) %
   5     inf          1.001    1.0000  -0.10          100.0         NaN
  23  3.2050          3.222    2.8266 -12.27           32.3       29.09
  28  1.0400          3.685    4.2107  14.27           15.0       17.18
  57 11.6400          1.899    1.7015 -10.40           47.0       45.90
  63  2.6070          2.882    3.1313   8.65           26.6       26.64
  86  0.2313          2.753    2.4473 -11.10            9.9        7.05
  90  0.0759          1.312    1.6470  25.53            4.8        3.17
 160  0.0000          1.009    1.0000  -0.89            0.0         NaN
Eq. (22) against the eight printed parameters: worst 25.53 %, r.m.s. 12.81 % (the paper, for the whole body: standard deviation 13 %, 87 % of points within 20 %)
   nulls in r.m.s. log units: no interaction 0.3666, best single constant 0.2151; Eq. (22) 0.0531, a gain of 4.05x
   on the 6 rows where Eq. (22) is free (runs 5, 160 are the chi limits): r.m.s. 14.79 % (0.0613 log), null 0.1520, gain 2.48x; the eight-row gain is 63 % larger
Eq. (23) against the 6 rows inside 0.05 &lt; chi &lt; 30: worst 33.90 %, r.m.s. 19.55 %, 2 outside 20 % (the paper: standard deviation 16 %, 80 % within 20 %)
   null: best single constant 117.9 % r.m.s., so Eq. (23) gains 6.03x
Eq. (23) with Figure 7's constant -0.744: worst 29.17 %, r.m.s. 18.33 %, 3 outside 20 %: better in r.m.s. by 1.2232 points and worse on the 'within 20 %' count.
This is a goodness of fit: these rows are a printed sample of the data the correlations were fitted to.</code></pre>
</div>
</div>
<p>Read together: Eq. (22) is 25.53 % worst and 12.81 % r.m.s. against all eight printed parameters, and beats the best single constant by 4.05 times in log units. On the six rows where it is free the gain is 2.48 times and the r.m.s. 14.79 %, so the eight-row headline is 63 % larger than the comparison that discriminates, and 14.79 % is the figure to set beside the paper’s 13 %. Eq. (23) is 33.90 % worst and 19.55 % r.m.s. over the six rows inside its declared range, two of them outside 20 %, against a best-constant null of 117.9 %. Figure 7’s constant term is worth 7.15 % in <img src="https://latex.codecogs.com/png.latex?R_l"> everywhere; on these six rows it is better in r.m.s. (18.33 % against 19.55 %) and worse on the “within 20 %” count (three rows against two), and six rows cannot separate a 7.15 % shift against a standard deviation the paper puts at 16 %. The page adopts neither reading.</p>
</section>
<section id="what-the-two-correlations-look-like-root-found" class="level3">
<h3 class="anchored" data-anchor-id="what-the-two-correlations-look-like-root-found">What the two correlations look like, root-found</h3>
<p>Neither extremum below is sampled off a grid.</p>
<p><strong>Eq. (22)</strong> is even in <img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D%5Cchi">, so its maximum sits at <img src="https://latex.codecogs.com/png.latex?%5Cchi%20=%201"> and equals <img src="https://latex.codecogs.com/png.latex?10%5E%7B0.416/0.666%7D">. The root-find only checks that the implementation has the printed constants in the right places.</p>
<p><strong>Eq. (23)</strong> is a downward parabola in <img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D%5Cchi">, so it has a ceiling. Its maximum is at <img src="https://latex.codecogs.com/png.latex?%5Cchi%20=%2010%5E%7B0.525/(2%5Ctimes%200.109)%7D">, root-found here and checked against that closed form, and the ceiling is a liquid saturation the equation can never exceed. The paper states two consistency checks the <em>data</em> must satisfy (book p.&nbsp;238): <img src="https://latex.codecogs.com/png.latex?R_l%20%5Cto%201"> as <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%20%5Cinfty"> and <img src="https://latex.codecogs.com/png.latex?R_l%20%5Cto%200"> as <img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%200">. It attributes both to “the data of Figure 7”, not to Eq. (23), and adds that Eq. (23) “is a power series fit which is only good within the limits given”. The numbers below quantify that caveat rather than contradict it: as printed, Eq. (23) has <strong>no real root at <img src="https://latex.codecogs.com/png.latex?R_l%20=%201"> at all</strong>, because the discriminant of <img src="https://latex.codecogs.com/png.latex?-0.774%20+%200.525t%20-%200.109t%5E2%20=%200"> is negative.</p>
<div id="7e7a48fc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.691340Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.691187Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:18.705241Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:18.704634Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _argmax(cfg, f, lo, hi):</span>
<span id="cb19-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Where f is largest on [lo, hi]: root-found on a centred difference, never sampled.</span></span>
<span id="cb19-3"></span>
<span id="cb19-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The scan has 400 points, so no scan point falls on chi = 1, where Eq. (22)'s</span></span>
<span id="cb19-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    difference is exactly zero; every maximum is then bracketed and found by</span></span>
<span id="cb19-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``brentq``. Raises when the difference has no sign change (no interior maximum).</span></span>
<span id="cb19-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb19-8">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(np.log10(lo), np.log10(hi), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb19-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> cfg.rootfind:                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break table's sampled variant</span></span>
<span id="cb19-10">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(f(g)))])</span>
<span id="cb19-11">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: f(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>))</span>
<span id="cb19-12">    dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([d(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> g])</span>
<span id="cb19-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>):</span>
<span id="cb19-14">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a scan point sits on a root: move the scan"</span>)</span>
<span id="cb19-15">    sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where((dv[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (dv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb19-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sgn) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb19-17">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no interior maximum on the bracket"</span>)</span>
<span id="cb19-18">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(sgn[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(f(g[sgn])))])</span>
<span id="cb19-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(d, g[i], g[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.root_xtol, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>))</span>
<span id="cb19-20"></span>
<span id="cb19-21"></span>
<span id="cb19-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_shape(cfg):</span>
<span id="cb19-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The extrema of Eqs. (22) and (23), root-found."""</span></span>
<span id="cb19-24">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.m</span>
<span id="cb19-25">    c0, c1, c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.eq23_c</span>
<span id="cb19-26">    amax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _argmax(cfg, m.f22, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>)</span>
<span id="cb19-27">    r_amax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _argmax(cfg, m.f23, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e6</span>)</span>
<span id="cb19-28">    m7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> replace(m, eq23_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c0_figure7"</span>], c1, c2))</span>
<span id="cb19-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb19-30">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_argmax_chi"</span>: amax,</span>
<span id="cb19-31">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_max_parameter"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.f22(amax)),</span>
<span id="cb19-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_argmax_chi"</span>: r_amax,</span>
<span id="cb19-33">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_argmax_root_vs_analytic_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r_amax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c2)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb19-34">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_ceiling_liquid_saturation"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.f23(r_amax)),</span>
<span id="cb19-35">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_at_chi_upper_limit"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.f23(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_max"</span>])),</span>
<span id="cb19-36">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_at_chi_lower_limit"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.f23(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_min"</span>])),</span>
<span id="cb19-37">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_discriminant_at_saturation_unity"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c0),</span>
<span id="cb19-38">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_ceiling_liquid_saturation"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m7.f23(r_amax)),</span>
<span id="cb19-39">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_discriminant"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c0_figure7"</span>]),</span>
<span id="cb19-40">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_constant_worth_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c0_figure7"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb19-41">    }</span>
<span id="cb19-42"></span>
<span id="cb19-43"></span>
<span id="cb19-44">S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_shape(BASE)</span>
<span id="cb19-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Eq. (22): maximum </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_max_parameter'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at chi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_argmax_chi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span></span>
<span id="cb19-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" closed form 10^(0.416/0.666) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_numerator'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_offset'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-47">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"          (log chi)^2 is even and &gt;= 0, so Eq. (22) never predicts a two-phase loss"</span></span>
<span id="cb19-48">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" below d_l + d_g.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Eq. (23): maximum at chi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_argmax_chi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (closed form"</span></span>
<span id="cb19-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_c1'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_c2'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, root-found to below 1e-8"</span></span>
<span id="cb19-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" relative (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_argmax_root_vs_analytic_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)), where R_l ="</span></span>
<span id="cb19-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_ceiling_liquid_saturation'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"          that is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_argmax_chi'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_chi_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the upper limit of"</span></span>
<span id="cb19-54">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 30 the equation is declared for, so inside its range it rises monotonically, from"</span></span>
<span id="cb19-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_at_chi_lower_limit'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at chi = 0.05 to"</span></span>
<span id="cb19-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_at_chi_upper_limit'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at chi = 30.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"          discriminant of 'Eq. (23) = 1': </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_discriminant_at_saturation_unity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-58">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" &lt; 0: no real chi gives a full column.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"          with Figure 7's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_c0_figure7'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the ceiling is"</span></span>
<span id="cb19-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_fig7_ceiling_liquid_saturation'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and the discriminant"</span></span>
<span id="cb19-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq23_fig7_discriminant'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, still negative, at the same chi."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Eq. (22): maximum 4.213322 at chi = 1.000000000; closed form 10^(0.416/0.666) = 4.213322.
          (log chi)^2 is even and &gt;= 0, so Eq. (22) never predicts a two-phase loss below d_l + d_g.
Eq. (23): maximum at chi = 256.009971 (closed form 256.009971, root-found to below 1e-8 relative (here 2.0e-09)), where R_l = 0.721386
          that is 8.5 times the upper limit of 30 the equation is declared for, so inside its range it rises monotonically, from 2.283 % at chi = 0.05 to 58.03 % at chi = 30.
          discriminant of 'Eq. (23) = 1': -0.061839 &lt; 0: no real chi gives a full column.
          with Figure 7's -0.744 the ceiling is 0.7730 and the discriminant -0.048759, still negative, at the same chi.</code></pre>
</div>
</div>
<p>Eq. (23)’s maximum is at <img src="https://latex.codecogs.com/png.latex?%5Cchi"> = 256.010, more than eight times the upper limit of 30 it is declared for, at a liquid saturation of 0.7214; the discriminant of “Eq. (23) = 1” is -0.0618. With Figure 7’s constant term the ceiling is 0.7730 and the discriminant -0.0488. Both readings put the ceiling below a full column, so this part does not depend on resolving the discrepancy. Inside its declared range Eq. (23) rises from 2.283 % at <img src="https://latex.codecogs.com/png.latex?%5Cchi"> = 0.05 to 58.03 % at <img src="https://latex.codecogs.com/png.latex?%5Cchi"> = 30.</p>
</section>
<section id="the-column-and-the-shortcut-the-design-procedure-rests-on" class="level3">
<h3 class="anchored" data-anchor-id="the-column-and-the-shortcut-the-design-procedure-rests-on">The column, and the shortcut the design procedure rests on</h3>
<p><strong>The claim.</strong> Book p.&nbsp;236: densities for Eqs. (17) and (20) may be evaluated at the arithmetic average of a section’s terminal pressures, and this “produces the correct average friction loss for a section”. The supporting reference is the thesis, which is not on disk.</p>
<p><strong>For one phase in horizontal flow the claim is exactly true, and the proof is two lines.</strong> In Eq. (17) the Reynolds number does not contain the density, so <em>both</em> Ergun terms carry <img src="https://latex.codecogs.com/png.latex?%5Crho%5E%7B-1%7D"> and</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdelta_g(P)%20%5C;=%5C;%20%5Cfrac%7BK%7D%7BP%7D%5Cquad%5Ctext%7Bexactly,%20for%20any%20%7D%20%5Calpha,%5C%20%5Cbeta."></p>
<p>With no gravity term Eq. (5) is <img src="https://latex.codecogs.com/png.latex?-%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dz%20=%20K/P">, so <img src="https://latex.codecogs.com/png.latex?P%5E2"> is <em>linear</em> in <img src="https://latex.codecogs.com/png.latex?z">: <img src="https://latex.codecogs.com/png.latex?P_0%5E2%20-%20P_L%5E2%20=%202KL">. Therefore</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdelta_g(%5Cbar%20P_%7B%5Ctext%7Barith%7D%7D)%20=%20%5Cfrac%7B2K%7D%7BP_0+P_L%7D%20=%20%5Cfrac%7BP_0-P_L%7D%7BL%7D%0A=%20%5Cfrac%7B1%7D%7BL%7D%5Cint_0%5EL%20%5Cdelta_g%5C,%5Cmathrm%7Bd%7Dz%20,"></p>
<p>the last equality being the balance itself. Not approximately: identically. The page confirms it at round-off (below 1e-11) and then shows what it is <em>about</em> by replacing the arithmetic mean with the geometric mean of the same two terminals, which is wrong at 1.12e-05.</p>
<p><strong>Add gravity and it stops being exact</strong>, but only just: at the column inlet the friction loss of air is about <strong>two orders</strong> above its static head.</p>
<p><strong>Add the second phase and it stops being small.</strong> <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"> is <img src="https://latex.codecogs.com/png.latex?f_%7B22%7D(%5Cchi)%5C,(%5Cdelta_l%20+%20%5Cdelta_g)"> with <img src="https://latex.codecogs.com/png.latex?%5Cchi%20=%20%5Csqrt%7B%5Cdelta_l%20P/K_g%7D">, and <img src="https://latex.codecogs.com/png.latex?%5Crho_m"> carries <img src="https://latex.codecogs.com/png.latex?R_l"> from Eq. (23): neither is <img src="https://latex.codecogs.com/png.latex?%5Cpropto%201/P">, so the algebra above has nothing to work with. The page solves</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7DP%7D%7B%5Cmathrm%7Bd%7Dz%7D%20=%20%5Cfrac%7B%5Crho_m(P)%7D%7B144%7D%20-%20%5Cdelta_%7Blg%7D(P)"></p>
<p>for the bed <strong>three independent ways</strong>: the paper’s own sectional march, pymrm finite volumes, and <img src="https://latex.codecogs.com/png.latex?z(P)"> by adaptive quadrature inverted by <code>brentq</code>. It then root-finds the bed length at which the one-section recipe is 1 % wrong (<code>threshold_length</code>). The error vanishes as the bed shortens (the recipe is second order), so the bracket starts at a short bed and is widened, through converged evaluations only and never to the choking length, until the error exceeds 1 %; the error is checked to rise monotonically on twelve points of that bracket (checked on twelve points) before <code>brentq</code> takes the root.</p>
<p>The demonstration column uses run 63’s own rates, temperature and liquid viscosity, with the inlet at the <strong>90 lb/sq.in. gauge the paper prints as its equipment limit</strong> (book p.&nbsp;234). It is a <em>design calculation in the paper’s own sense</em>, not a reproduction of a measurement: no run in Table 3 is a seven-foot bed.</p>
<p><strong>Run 63 is the extreme row, and the page says so rather than generalising from it.</strong> It carries the largest friction loss of the eight (the largest printed <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"> in Table 4), which is precisely the condition step 1 names (“if the bed is of great length <strong>or the friction loss is large</strong>”). The 1 % length is therefore a <strong>worst case</strong>, and the page prints the same root-find over <em>every</em> two-phase row of Table 3. <code>Cfg.demo_run</code> selects the row and a break row moves it.</p>
<div id="37b79e54" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:18.707568Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:18.707398Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:22.394899Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:22.394052Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">PIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equipment_pressure_limit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BASE.m.p_atm</span>
<span id="cb21-2">TWO_PHASE_RUNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T3.run[(T3.liquid_rate_lb_sqft_min <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb21-3">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T3.air_rate_lb_sqft_min <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)].values]</span>
<span id="cb21-4"></span>
<span id="cb21-5"></span>
<span id="cb21-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run_column(cfg, run):</span>
<span id="cb21-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The Column at Table 3's rates, temperature and liquid viscosity of ``run``."""</span></span>
<span id="cb21-8">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.t3[cfg.t3.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> run].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb21-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Column(cfg.m, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.liquid_rate_lb_sqft_min), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.air_rate_lb_sqft_min),</span>
<span id="cb21-10">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.column_temperature_F), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.liquid_viscosity_cP))</span>
<span id="cb21-11"></span>
<span id="cb21-12"></span>
<span id="cb21-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> gas_only_column(m, t3):</span>
<span id="cb21-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Run 160's air, with no liquid."""</span></span>
<span id="cb21-15">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3[t3.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb21-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Column(m, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.air_rate_lb_sqft_min), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.column_temperature_F),</span>
<span id="cb21-17">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.liquid_viscosity_cP))</span>
<span id="cb21-18"></span>
<span id="cb21-19"></span>
<span id="cb21-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fv_outlet(cfg, col, p_in, L, n, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb21-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""pymrm outlet pressure; raises unless newton converged."""</span></span>
<span id="cb21-22">    fv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, p_in, L, n, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>outlet <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> cfg.outlet)</span>
<span id="cb21-23">    P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv.solve(tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.newton_tol)</span>
<span id="cb21-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> fv.outlet_value(P, read <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> cfg.read)</span>
<span id="cb21-25"></span>
<span id="cb21-26"></span>
<span id="cb21-27"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_col(cfg):</span>
<span id="cb21-28">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The average-pressure claim, the 1 % length, sectioning, and the pymrm grid study."""</span></span>
<span id="cb21-29">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.m</span>
<span id="cb21-30">    Pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equipment_pressure_limit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m.p_atm</span>
<span id="cb21-31">    rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pr, Pe: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((Pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pe) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pe))</span>
<span id="cb21-32">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the theorem: one phase, no gravity</span></span>
<span id="cb21-33">    cg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gas_only_column(replace(m, gravity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, two_phase<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), cfg.t3)</span>
<span id="cb21-34">    err_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [rel(recipe_outlet(cg, Pin, L, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.recipe_tol),</span>
<span id="cb21-35">                 quad_outlet(cg, Pin, L)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)]</span>
<span id="cb21-36">    err_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [rel(recipe_outlet(cg, Pin, L, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"geometric"</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.recipe_tol),</span>
<span id="cb21-37">                 quad_outlet(cg, Pin, L)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)]</span>
<span id="cb21-38">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one phase, with gravity</span></span>
<span id="cb21-39">    cgd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gas_only_column(replace(m, two_phase<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), cfg.t3)</span>
<span id="cb21-40">    err_dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rel(recipe_outlet(cgd, Pin, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.recipe_tol),</span>
<span id="cb21-41">                 quad_outlet(cgd, Pin, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb21-42">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two phases</span></span>
<span id="cb21-43">    col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_column(cfg, cfg.demo_run)</span>
<span id="cb21-44">    Lch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> choking_length(col, Pin)</span>
<span id="cb21-45">    L4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span></span>
<span id="cb21-46">    Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quad_outlet(col, Pin, L4)</span>
<span id="cb21-47">    e4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rel(recipe_outlet(col, Pin, L4, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.recipe_tol), Pe4)</span>
<span id="cb21-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg.rootfind:</span>
<span id="cb21-49">        L1, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> threshold_length(col, Pin, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule)</span>
<span id="cb21-50">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break table's sampled variant</span></span>
<span id="cb21-51">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.arange(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.97</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Lch, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb21-52">        L1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(recipe_error(col, Pin, x, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb21-53">                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> g]))])</span>
<span id="cb21-54">    es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [rel(recipe_outlet(col, Pin, L4, N, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.recipe_tol), Pe4)</span>
<span id="cb21-55">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>)]</span>
<span id="cb21-56">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pymrm finite volumes against the quadrature</span></span>
<span id="cb21-57">    n1, n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cfg.n_fv</span>
<span id="cb21-58">    P1, P2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv_outlet(cfg, col, Pin, L4, n1), fv_outlet(cfg, col, Pin, L4, n2)</span>
<span id="cb21-59">    e1, e2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb21-60">    order_fv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e2))      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the pair is read as a doubling</span></span>
<span id="cb21-61">    ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb21-62">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Richardson remainders of the pairs (n1/2, n1), (n1, n2), (n2, 2 n2): O(h^2)</span></span>
<span id="cb21-63">    P0, P3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv_outlet(cfg, col, Pin, L4, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), fv_outlet(cfg, col, Pin, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n2)</span>
<span id="cb21-64">    rem <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Pb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pa) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Pa, Pb <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((P0, P1), (P1, P2), (P2, P3))]</span>
<span id="cb21-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb21-66">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_arith_mean_max_rel_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(err_a)),</span>
<span id="cb21-67">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_geom_mean_max_rel_error"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(err_g)),</span>
<span id="cb21-68">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_downflow_arith_mean_rel_error_2ft"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(err_dn),</span>
<span id="cb21-69">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_rel_error_4ft"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(e4),</span>
<span id="cb21-70">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_ft"</span>: L1,</span>
<span id="cb21-71">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sectioning_observed_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(es[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> es[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb21-72">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sectioning_finest_err_over_noise"</span>:</span>
<span id="cb21-73">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(es[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (cfg.recipe_tol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pe4))),</span>
<span id="cb21-74">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"choking_length_ft"</span>: Lch,</span>
<span id="cb21-75">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_observed_order"</span>: order_fv,</span>
<span id="cb21-76">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_rel_error_at_n_fine"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(e2),</span>
<span id="cb21-77">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_finest_err_over_noise"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(e2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (cfg.newton_tol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P2)),</span>
<span id="cb21-78">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_extrapolated_vs_quadrature_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ext),</span>
<span id="cb21-79">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_extrap_orders_below_recipe"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(e4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ext)),</span>
<span id="cb21-80">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_extrap_orders_below_nfine"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(e2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ext)),</span>
<span id="cb21-81">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_richardson_remainder_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(rem[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rem[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])),</span>
<span id="cb21-82">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_richardson_remainder_finest_over_noise"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rem[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (cfg.newton_tol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P3)),</span>
<span id="cb21-83">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_error_signed_n_fine"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb21-84">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_friction_over_static_head_at_inlet"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cgd.dg(Pin) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (m.rho_air(Pin, cgd.TF) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">144.0</span>)),</span>
<span id="cb21-85">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pe4"</span>: Pe4, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pin"</span>: Pin, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_col"</span>: col, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_L4"</span>: L4, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_es"</span>: es,</span>
<span id="cb21-86">    }</span>
<span id="cb21-87"></span>
<span id="cb21-88"></span>
<span id="cb21-89"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_spread(cfg):</span>
<span id="cb21-90">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The same 1 % root-find over every two-phase row in Table 3."""</span></span>
<span id="cb21-91">    Pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equipment_pressure_limit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cfg.m.p_atm</span>
<span id="cb21-92">    lens <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {r: threshold_length(run_column(cfg, r), Pin, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.mean_rule)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb21-93">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TWO_PHASE_RUNS}</span>
<span id="cb21-94">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(lens.values()))</span>
<span id="cb21-95">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb21-96">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_max_ft"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb21-97">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_min_ft"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()),</span>
<span id="cb21-98">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_experimental_column"</span>:</span>
<span id="cb21-99">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"experimental_column_length"</span>])),</span>
<span id="cb21-100">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_commercial_reactor"</span>:</span>
<span id="cb21-101">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"commercial_reactor_length"</span>])),</span>
<span id="cb21-102">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_lens"</span>: lens,</span>
<span id="cb21-103">    }</span>
<span id="cb21-104"></span>
<span id="cb21-105"></span>
<span id="cb21-106">COL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_col(BASE)</span>
<span id="cb21-107">SPR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_spread(BASE)</span>
<span id="cb21-108">col, L4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_col"</span>], COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_L4"</span>]</span>
<span id="cb21-109">DELTA_LG_ARGMAX_RUN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(T4.run.values[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(T4.delta_lg_psi_per_ft.values))])</span>
<span id="cb21-110"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> DELTA_LG_ARGMAX_RUN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> BASE.demo_run, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the demonstration column is not Table 4's largest delta_lg"</span></span>
<span id="cb21-111">spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(</span>
<span id="cb21-112">    {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_lens"</span>]),</span>
<span id="cb21-113">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg printed, psi/ft"</span>: [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T4.delta_lg_psi_per_ft[T3.run.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-114">                                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_lens"</span>]],</span>
<span id="cb21-115">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 % bed length, ft"</span>: [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_lens"</span>].values()]}</span>
<span id="cb21-116">).sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 % bed length, ft"</span>).reset_index(drop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb21-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"demonstration column: run </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>demo_run<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'s rates (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Gl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> lb/(sq.ft.min) water,"</span></span>
<span id="cb21-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Gg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> air) at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>TF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> F, inlet </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'equipment_pressure_limit'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> psig ="</span></span>
<span id="cb21-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> psia</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  delta_l = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> lb/sq.in./ft (pressure-independent); delta_g = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dg(PIN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at the inlet; the bed chokes (P -&gt; 0) at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'choking_length_ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ft</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-122">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ONE PHASE, HORIZONTAL, arithmetic mean of the terminals, worst over 0.5, 1 and 2 ft:"</span></span>
<span id="cb21-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below 1e-11, an identity (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gas_horizontal_arith_mean_max_rel_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the geometric mean of the same terminals: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gas_horizontal_geom_mean_max_rel_error'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"WITH GRAVITY, 2 ft: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gas_downflow_arith_mean_rel_error_2ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; at the inlet the"</span></span>
<span id="cb21-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" friction loss of air is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gas_friction_over_static_head_at_inlet'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times its"</span></span>
<span id="cb21-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" static head (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gas_friction_over_static_head_at_inlet'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> orders)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"TWO PHASES: one section over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ft is"</span></span>
<span id="cb21-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_rel_error_4ft'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % wrong in the pressure drop; the error"</span></span>
<span id="cb21-130">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reaches 1 % at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_length_ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ft (root-found)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-131">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  sectioning converges at order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sectioning_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the midpoint"</span></span>
<span id="cb21-132">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" rule), its finest error"</span></span>
<span id="cb21-133">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sectioning_finest_err_over_noise'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the fixed-point tolerance</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-134">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Run </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>demo_run<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prints Table 4's largest delta_lg,"</span></span>
<span id="cb21-135">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>delta_lg_psi_per_ft<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> lb/sq.in./ft. The same root-find over every"</span></span>
<span id="cb21-136">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" two-phase row, at the same inlet:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>spread<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_length_min_ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ft to"</span></span>
<span id="cb21-138">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_length_max_ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ft, a factor of"</span></span>
<span id="cb21-139">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_length_max_ft'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_length_min_ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span></span>
<span id="cb21-140">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_runs_inside_experimental_column'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of"</span></span>
<span id="cb21-141">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_lens'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inside the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'experimental_column_length'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-ft column"</span></span>
<span id="cb21-142">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (book p. 232), </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_1pct_runs_inside_commercial_reactor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inside"</span></span>
<span id="cb21-143">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'commercial_reactor_length'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-ft commercial reactor"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>demonstration column: run 63's rates (2731 lb/(sq.ft.min) water, 78.85 air) at 70 F, inlet 90 psig = 104.696 psia
  delta_l = 3.0483 lb/sq.in./ft (pressure-independent); delta_g = 0.2930 at the inlet; the bed chokes (P -&gt; 0) at 8.0627 ft
ONE PHASE, HORIZONTAL, arithmetic mean of the terminals, worst over 0.5, 1 and 2 ft: below 1e-11, an identity (here 1.2e-13)
  the geometric mean of the same terminals: 1.116e-05
WITH GRAVITY, 2 ft: 1.718e-07; at the inlet the friction loss of air is 129 times its static head (2.11 orders)
TWO PHASES: one section over 4 ft is 0.3323 % wrong in the pressure drop; the error reaches 1 % at 5.6012 ft (root-found)
  sectioning converges at order 1.9999 (the midpoint rule), its finest error 3.3e+07 times the fixed-point tolerance
Run 63 prints Table 4's largest delta_lg, 10.0570 lb/sq.in./ft. The same root-find over every two-phase row, at the same inlet:
 run  delta_lg printed, psi/ft  1 % bed length, ft
  63                   10.0570              5.6012
  28                    5.5700             12.1077
  57                    5.8600             15.7986
  23                    2.7880             36.4421
  90                    1.7610             76.2535
  86                    0.4095            466.9537
  5.6012 ft to 466.9537 ft, a factor of 83; 1 of 6 inside the 7-ft column (book p. 232), 4 inside the 40-ft commercial reactor</code></pre>
</div>
</div>
<p>For a single phase in horizontal flow the arithmetic-mean recipe is exact to round-off; the geometric mean of the same terminals is wrong at 1.12e-05, and with gravity the arithmetic mean is wrong at 1.72e-07 over 2 ft, where the friction loss of air at the inlet is 129 times its static head. With the two-phase correlation in the loop, one section over 4 ft is 0.332 % wrong and the error reaches 1 % at 5.6012 ft on run 63, inside the paper’s 7-ft column. Over the six two-phase rows the same length runs from 5.6012 ft to 466.9537 ft: 1 of the 6 is inside the 7-ft column and 4 inside the 40-ft commercial reactor. The bed chokes at 8.0627 ft. Sectioning converges at second order (observed 1.9999), the midpoint rule, so the number of sections a target accuracy needs follows from one number.</p>
<div id="59e9a945" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:22.397042Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:22.396865Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:22.851948Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:22.851034Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb23-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>):</span>
<span id="cb23-3">    Pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> recipe_outlet(col, PIN, L4, N)</span>
<span id="cb23-4">    rows.append((N, Pr, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((Pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pe4"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (PIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pe4"</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>))</span>
<span id="cb23-5">sec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sections"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_out psia"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"error in dP, %"</span>])</span>
<span id="cb23-6">sec[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.nan] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [np.log2(sec[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"error in dP, %"</span>][i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sec[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"error in dP, %"</span>][i])</span>
<span id="cb23-7">                           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sec))]</span>
<span id="cb23-8">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb23-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>):</span>
<span id="cb23-10">    Pn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv_outlet(BASE, col, PIN, L4, n)</span>
<span id="cb23-11">    rows.append((n, Pn, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Pn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pe4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb23-12">fv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_out psia"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel error"</span>])</span>
<span id="cb23-13">fv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.nan] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [np.log2(fv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel error"</span>][i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> fv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel error"</span>][i])</span>
<span id="cb23-14">                          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(fv))]</span>
<span id="cb23-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(sec.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>).to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"exact outlet pressure (quadrature): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_Pe4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> psia</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-17">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> fv.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm, outflow outlet: first order (observed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); the"</span></span>
<span id="cb23-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" error at 1600 cells is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_finest_err_over_noise'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the Newton tolerance."</span></span>
<span id="cb23-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the Richardson pair (800, 1600) lands on the quadrature to"</span></span>
<span id="cb23-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_extrapolated_vs_quadrature_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative,"</span></span>
<span id="cb23-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_extrap_orders_below_recipe'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> orders below the"</span></span>
<span id="cb23-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_phase_recipe_rel_error_4ft'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % recipe error it is used to measure"</span></span>
<span id="cb23-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_extrap_orders_below_nfine'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> orders below 1600 cells alone."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> sections  P_out psia  error in dP, %    order
        1   64.669054        0.332305      NaN
        2   64.570740        0.087501 1.925137
        4   64.544519        0.022210 1.978095
        8   64.537838        0.005575 1.994227
       16   64.536160        0.001395 1.998535
       32   64.535740        0.000349 1.999632
       64   64.535634        0.000087 1.999908
exact outlet pressure (quadrature): 64.53559940 psia

 cells  P_out psia  rel error    order
   100   64.496418   0.000607      NaN
   200   64.516039   0.000303 1.002245
   400   64.525827   0.000151 1.001121
   800   64.530715   0.000076 1.000560
  1600   64.533158   0.000038 1.000280
pymrm, outflow outlet: first order (observed 1.0003); the error at 1600 cells is 2.4e+07 times the Newton tolerance.
the Richardson pair (800, 1600) lands on the quadrature to 1.47e-08 relative, 5.4 orders below the 0.332 % recipe error it is used to measure and 3.4 orders below 1600 cells alone.</code></pre>
</div>
</div>
</section>
<section id="what-the-outlet-condition-does-measured" class="level3">
<h3 class="anchored" data-anchor-id="what-the-outlet-condition-does-measured">What the outlet condition does, measured</h3>
<p>The outlet of a first-order problem needs no condition, and pymrm’s <code>{"outflow": True}</code> imposes none. The cell below checks that on the page’s own assembly, against a scalar backward-Euler march written by hand (<code>backward_euler_march</code>, which shares no code with <code>ColumnFV</code>), and closes the discrete balance <img src="https://latex.codecogs.com/png.latex?P_%7Bout%7D%20-%20P_%7Bin%7D%20=%20%5Csum_i%20h%5C,%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dz(P_i)"> with the outlet value read on the face. The balance holds for any source term, so it checks the bookkeeping of the discretisation, not the physics.</p>
<p>It then measures the alternative, a zero-gradient outlet <img src="https://latex.codecogs.com/png.latex?%5C%7Ba:%201,%20b:%200,%20d:%200%5C%7D">, which imposes <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dz%20=%200"> at <img src="https://latex.codecogs.com/png.latex?z%20=%20L">. <code>construct_convflux_upwind</code> folds that condition into the flux operator: the outlet-face row of the operator is <img src="https://latex.codecogs.com/png.latex?%5B%5Cdots,%20-1/8,%20+9/8%5D">, so the flux leaving the domain is <img src="https://latex.codecogs.com/png.latex?(9P_N%20-%20P_%7BN-1%7D)/8">, which is what <code>compute_boundary_values</code> returns for that condition, and not <img src="https://latex.codecogs.com/png.latex?vP_N">. The last cell’s balance is then <img src="https://latex.codecogs.com/png.latex?(9P_N%20-%20P_%7BN-1%7D)/8%20-%20P_%7BN-1%7D%20=%20h%5C,S(P_N)">, i.e. <img src="https://latex.codecogs.com/png.latex?(P_N%20-%20P_%7BN-1%7D)/h%20=%20%5Ctfrac%7B8%7D%7B9%7DS(P_N)">: <strong>the zero-gradient condition shortens the last step from <img src="https://latex.codecogs.com/png.latex?h"> to <img src="https://latex.codecogs.com/png.latex?%5Ctfrac%7B8%7D%7B9%7Dh"></strong> and moves <img src="https://latex.codecogs.com/png.latex?P_N"> off the face by <img src="https://latex.codecogs.com/png.latex?h%5C,S/9">. Reading the face with <code>compute_boundary_values</code> adds the same <img src="https://latex.codecogs.com/png.latex?h%5C,S/9"> back and lands on the outflow solution to <img src="https://latex.codecogs.com/png.latex?O(h%5E2)">. The last-cell value happens to be closer to the exact outlet here, 3.84 times, because that shift points against the accumulated first-order march error: a cancellation of two <img src="https://latex.codecogs.com/png.latex?O(h)"> errors, not an accuracy, and a balance written on it fails to close by <img src="https://latex.codecogs.com/png.latex?O(h)"> (pitfall P8): by 1.2e-3 of the pressure drop at 100 cells and 7.7e-5 at 1600.</p>
<p>The same cancellation explains the Richardson remainders printed below. At 1600 cells the zero-gradient last-cell error is +9.85e-06 and the outflow error -3.78e-05: opposite signs, so the zero-gradient reads extrapolate to smaller remainders by cancellation, not by better accuracy. The outflow pair’s remainder is itself <img src="https://latex.codecogs.com/png.latex?O(h%5E2)"> (observed order 2.00 from the pairs (800, 1600) and (1600, 3200)), which is what a Richardson pair of a first-order scheme should leave.</p>
<div id="5175128e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:22.854680Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:22.854492Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:24.070002Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:24.069120Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> block_outlet(cfg):</span>
<span id="cb25-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The outflow solve against a hand march and its own balance; the zero-gradient outlet."""</span></span>
<span id="cb25-3">    Pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equipment_pressure_limit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cfg.m.p_atm</span>
<span id="cb25-4">    col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_column(cfg, cfg.demo_run)</span>
<span id="cb25-5">    L4, n_mech, (n_c, n_f) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, cfg.n_fv</span>
<span id="cb25-6">    Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quad_outlet(col, Pin, L4)</span>
<span id="cb25-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the outflow solve (the page's default) against the hand-written march</span></span>
<span id="cb25-8">    fv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, Pin, L4, n_mech, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.outlet)</span>
<span id="cb25-9">    P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv.solve(tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.newton_tol)</span>
<span id="cb25-10">    march <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> backward_euler_march(col, Pin, L4, n_mech)</span>
<span id="cb25-11">    out_main <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv.outlet_value(P, cfg.read)</span>
<span id="cb25-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the zero-gradient outlet, built and read both ways</span></span>
<span id="cb25-13">    zg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, Pin, L4, n_mech, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_gradient"</span>)</span>
<span id="cb25-14">    Pz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zg.solve(tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.newton_tol)</span>
<span id="cb25-15">    row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(zg.conv.todense())[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb25-16">    flux_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> Pz)</span>
<span id="cb25-17">    cbv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zg.outlet_value(Pz, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"face"</span>)</span>
<span id="cb25-18">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n_mech</span>
<span id="cb25-19">    S_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(col.dPdz(Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb25-20">    zg_read <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n, read: fv_outlet(cfg, col, Pin, L4, n, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_gradient"</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>read)</span>
<span id="cb25-21">    cbv_f, cbv_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zg_read(n_f, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"face"</span>), zg_read(n_c, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"face"</span>)</span>
<span id="cb25-22">    lc_f, lc_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zg_read(n_f, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>), zg_read(n_c, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>)</span>
<span id="cb25-23">    of_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv_outlet(cfg, col, Pin, L4, n_f)</span>
<span id="cb25-24">    zg_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, Pin, L4, n_f, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_gradient"</span>)</span>
<span id="cb25-25">    Pzf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zg_f.solve(tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cfg.newton_tol)</span>
<span id="cb25-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first cell of the outflow solve: distance to the exact value at its right</span></span>
<span id="cb25-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># face over the distance to the exact value at its centre</span></span>
<span id="cb25-28">    P1st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb25-29">    d_face <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P1st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> quad_outlet(col, Pin, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fv.x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb25-30">    d_centre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P1st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> quad_outlet(col, Pin, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fv.x_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])))</span>
<span id="cb25-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb25-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_n100"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(zg.balance_gap(Pz, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>))),</span>
<span id="cb25-33">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_nfine"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(zg_f.balance_gap(Pzf, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>))),</span>
<span id="cb25-34">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_first_cell_face_over_centre_distance"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d_face <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d_centre),</span>
<span id="cb25-35">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_error_signed_nfine"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(lc_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb25-36">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_outflow_vs_hand_march_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(out_main <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> march <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-37">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_balance_gap"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(fv.balance_gap(P, cfg.read))),</span>
<span id="cb25-38">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_row_last_weight"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb25-39">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_row_prev_weight"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb25-40">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_flux_vs_face_value"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(flux_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cbv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-41">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_last_step_over_h"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> S_N),</span>
<span id="cb25-42">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_correction_over_ninth"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((cbv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-43">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_vs_outflow_rel_n100"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cbv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> march <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-44">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_vs_outflow_rel_nfine"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cbv_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> of_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-45">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_over_zg_face_error_ratio"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(of_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cbv_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-46">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cbv_over_upwind_face_outlet_error_ratio"</span>:</span>
<span id="cb25-47">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cbv_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lc_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-48">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_extrapolated_vs_quadrature_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lc_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lc_c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-49">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_extrapolated_vs_quadrature_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cbv_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cbv_c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_P"</span>: Pz, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_row"</span>: row, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_flux_out"</span>: flux_out, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_cbv"</span>: cbv, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_march"</span>: march,</span>
<span id="cb25-51">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_h"</span>: h, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_S_N"</span>: S_N, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pe4"</span>: Pe4, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_col"</span>: col, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_Pin"</span>: Pin, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_errs"</span>:</span>
<span id="cb25-52">            (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(of_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cbv_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lc_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb25-53">    }</span>
<span id="cb25-54"></span>
<span id="cb25-55"></span>
<span id="cb25-56">OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> block_outlet(BASE)</span>
<span id="cb25-57">e_of, e_cbv, e_lc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_errs"</span>]</span>
<span id="cb25-58">x_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>).x_c</span>
<span id="cb25-59">x_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>).x_f</span>
<span id="cb25-60">first_face, first_centre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quad_outlet(col, PIN, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])), quad_outlet(col, PIN, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb25-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"OUTFLOW OUTLET, n = 100: the pymrm solve against the hand-written backward-Euler march"</span></span>
<span id="cb25-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below 1e-10 relative, an identity (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_outflow_vs_hand_march_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  balance P_out - P_in - sum h dP/dz on the face value: below 1e-10 of the"</span></span>
<span id="cb25-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pressure drop, an identity (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_balance_gap'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  first cell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ColumnFV(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>solve()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>first_face<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact at"</span></span>
<span id="cb25-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" its right face and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>first_centre<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at its centre: cell values are face values"</span></span>
<span id="cb25-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (distance ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_first_cell_face_over_centre_distance'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, bound 0.05)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ZERO-GRADIENT last-cell balance gap: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_lastcell_balance_gap_n100'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at n = 100,"</span></span>
<span id="cb25-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_lastcell_balance_gap_nfine'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at n = 1600; signed errors at n = 1600:"</span></span>
<span id="cb25-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" last cell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_lastcell_error_signed_nfine'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, outflow"</span></span>
<span id="cb25-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_error_signed_n_fine'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"outflow Richardson remainder order (pairs 800/1600 and 1600/3200):"</span></span>
<span id="cb25-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_richardson_remainder_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-74">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ZERO-GRADIENT OUTLET, n = 100:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  outlet-face row of the flux operator: [..., </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_outlet_row_prev_weight'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb25-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_outlet_row_last_weight'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]; flux out </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_flux_out'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against"</span></span>
<span id="cb25-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" compute_boundary_values </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_cbv'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_outlet_flux_vs_face_value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> apart);"</span></span>
<span id="cb25-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the last cell is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_P'</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  last step (P_N - P_(N-1))/h = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_last_step_over_h'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> S(P_N), i.e. 8/9;"</span></span>
<span id="cb25-81">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the face read adds h S/9 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_cbv'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_P'</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> lb/sq.in."</span></span>
<span id="cb25-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (h S/9 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_h'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_S_N'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; an eighth would be"</span></span>
<span id="cb25-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_h'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_S_N'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the face read against the outflow solve: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_face_vs_outflow_rel_n100'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at"</span></span>
<span id="cb25-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" n = 100, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_face_vs_outflow_rel_nfine'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at n = 1600: O(h^2)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"AT n = 1600, error against the quadrature: outflow </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_of<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, zero-gradient face"</span></span>
<span id="cb25-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_cbv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'outflow_over_zg_face_error_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), zero-gradient last cell"</span></span>
<span id="cb25-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_lc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the face read is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cbv_over_upwind_face_outlet_error_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times"</span></span>
<span id="cb25-89">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the last cell's)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Richardson pairs (800, 1600): zero-gradient last cell"</span></span>
<span id="cb25-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_lastcell_extrapolated_vs_quadrature_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, face"</span></span>
<span id="cb25-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zg_face_extrapolated_vs_quadrature_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, outflow"</span></span>
<span id="cb25-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fv_extrapolated_vs_quadrature_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>OUTFLOW OUTLET, n = 100: the pymrm solve against the hand-written backward-Euler march below 1e-10 relative, an identity (here 1.1e-15)
  balance P_out - P_in - sum h dP/dz on the face value: below 1e-10 of the pressure drop, an identity (here 1.4e-15)
  first cell 104.324109 against 104.324336 exact at its right face and 104.510225 at its centre: cell values are face values (distance ratio 1.22e-03, bound 0.05)
ZERO-GRADIENT last-cell balance gap: 1.23e-03 at n = 100, 7.66e-05 at n = 1600; signed errors at n = 1600: last cell +9.849e-06, outflow -3.783e-05
outflow Richardson remainder order (pairs 800/1600 and 1600/3200): 2.00
ZERO-GRADIENT OUTLET, n = 100:
  outlet-face row of the flux operator: [..., -0.1250, +1.1250]; flux out 64.4965491956 against compute_boundary_values 64.4965491956 (here 2.2e-16 apart); the last cell is 64.5457747097
  last step (P_N - P_(N-1))/h = 0.888889 S(P_N), i.e. 8/9; the face read adds h S/9 = -0.049226 lb/sq.in. (h S/9 = -0.049226; an eighth would be -0.055379)
  the face read against the outflow solve: 2.03e-06 at n = 100, 7.89e-09 at n = 1600: O(h^2)
AT n = 1600, error against the quadrature: outflow 3.7835e-05, zero-gradient face 3.7827e-05 (ratio 1.0002), zero-gradient last cell 9.8488e-06 (the face read is 3.841 times the last cell's)
  Richardson pairs (800, 1600): zero-gradient last cell 7.46e-10, face 1.11e-09, outflow 1.47e-08</code></pre>
</div>
</div>
<div id="e74b822d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:24.072280Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:24.072100Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:25.134696Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:25.133929Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>))</span>
<span id="cb27-2"></span>
<span id="cb27-3">cg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>)</span>
<span id="cb27-4">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(cg, BASE.m.f22(cg), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0-"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (22)"</span>)</span>
<span id="cb27-5">fin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.isfinite(T4.chi.values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T4.chi.values <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb27-6">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(T4.chi.values[fin], T4.two_phase_parameter.values[fin], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4"</span>)</span>
<span id="cb27-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb27-8">cin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(np.log10(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_min"</span>]), np.log10(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_max"</span>]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb27-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(cin, BASE.m.f23(cin), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3-"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (23), declared range"</span>)</span>
<span id="cb27-10">cout <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(np.log10(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_chi_max"</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb27-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(cout, BASE.m.f23(cout), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (23), extrapolated"</span>)</span>
<span id="cb27-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(T4.chi.values[fin], T3.liquid_saturation_pct.values[fin] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3s"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb27-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_ceiling_liquid_saturation"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb27-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>), ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_yscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb27-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">chi=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_l/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_g}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_{lg}/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_l</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_g</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   and   </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">R_l</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(a) Eqs. (22) and (23), and Table 4"</span>)</span>
<span id="cb27-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb27-19"></span>
<span id="cb27-20">w, x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.27</span>, np.arange(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T3))</span>
<span id="cb27-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> np.errstate(divide<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>, invalid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>):</span>
<span id="cb27-22">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].bar(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> w, np.where(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dl"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dl"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T4.delta_l_psi_per_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), w,</span>
<span id="cb27-23">              label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_l</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-24">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].bar(x, np.where(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dg"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dg"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T4.delta_g_psi_per_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), w,</span>
<span id="cb27-25">              label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_g</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].bar(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> w, R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_e_dlg_all"</span>], w, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta_{lg}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-27">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xticks(x), ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xticklabels(T3.run)</span>
<span id="cb27-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>), ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this page / Table 4 - 1,  %"</span>)</span>
<span id="cb27-29">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(b) Table 4 redone; run 5 is the outlier"</span>)</span>
<span id="cb27-30">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb27-31"></span>
<span id="cb27-32">fv800 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb27-33">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(fv800.x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], fv800.solve(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0-"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm, 800 cells (at right faces)"</span>)</span>
<span id="cb27-34">Ls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span>
<span id="cb27-35">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(Ls, [quad_outlet(col, PIN, L) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> L <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> Ls], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature"</span>)</span>
<span id="cb27-36">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, L4], [PIN, recipe_outlet(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3o-"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>,</span>
<span id="cb27-37">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one section, arithmetic mean"</span>)</span>
<span id="cb27-38">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"depth into the bed, ft"</span>)</span>
<span id="cb27-39">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pressure, lb/sq.in. absolute"</span>)</span>
<span id="cb27-40">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(c) run 63's rates from 90 psig"</span>)</span>
<span id="cb27-41">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb27-42">plt.tight_layout()</span>
<span id="cb27-43">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/G1.1-larkins-two-phase-packed-bed/index_files/figure-html/cell-16-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<section id="what-is-being-validated-ranked" class="level3">
<h3 class="anchored" data-anchor-id="what-is-being-validated-ranked">What is being validated, ranked</h3>
<ol type="1">
<li><strong>The worked example.</strong> Table 3 to Table 4 is the authors’ own arithmetic, printed in full. Reproducing it tests the transcription, the equations, the constants, the unit conversions and the manometer correction all at once, against numbers nobody on this page chose. This is where the page’s weight sits.</li>
<li><strong>Two asymptotic checks the paper states for its own data.</strong> Run 160 is gas alone (<img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%200">) and run 5 liquid alone (<img src="https://latex.codecogs.com/png.latex?%5Cchi%20%5Cto%20%5Cinfty">), and the paper says the two-phase parameter approaches unity at both ends. <strong>These are asymptotic statements about the Figure 7 cloud, not per-row requirements</strong>, and step 3 weighs both rows against the scatter the same paper prints for that cloud.</li>
<li><strong>A stated result in the text</strong>: the average-pressure claim of book p.&nbsp;236, checked algebraically for one phase and numerically for two, with three independent routes to the column and a discrete balance.</li>
<li><strong>Nothing from a figure.</strong> The correlation curves plotted above are the printed equations.</li>
</ol>
<p><strong>And what is NOT validation.</strong> The comparison of Eqs. (22)/(23) with Table 4 is a goodness of fit to data inside the fit. It is on the page because the size of the residuals is informative, and it is printed beside two nulls so that it cannot be read as more.</p>
</section>
<section id="every-number-registered" class="level3">
<h3 class="anchored" data-anchor-id="every-number-registered">Every number, registered</h3>
<p>Each number the page states is registered below with how it is checked (<code>gallery_utils.Claims</code>): a <strong>value</strong> held to a tolerance of its committed result, a <strong>bound</strong> checked whenever the page runs (identities, solver tolerances, convergence orders), or an <strong>exact</strong> count with its margin to the threshold that decided it.</p>
<div id="b94f16f3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:25.137019Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:25.136880Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:52:28.833688Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:52:28.832837Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run_blocks(cfg, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"self"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,</span>
<span id="cb28-2">                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span>)):</span>
<span id="cb28-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Every claimed number of the named blocks, recomputed under ``cfg``."""</span></span>
<span id="cb28-4">    blocks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>: block_repro, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>: block_recon, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>: block_run5,</span>
<span id="cb28-5">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"self"</span>: block_selfcheck, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>: block_corr, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>: block_shape,</span>
<span id="cb28-6">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>: block_col, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>: block_outlet, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span>: block_spread}</span>
<span id="cb28-7">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb28-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> which:</span>
<span id="cb28-9">        out.update({a: b <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> blocks[k](cfg).items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> a.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb28-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb28-11"></span>
<span id="cb28-12"></span>
<span id="cb28-13">ALL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_blocks(BASE)</span>
<span id="cb28-14">TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton tol 1e-10 psi on pressures near 100 psia"</span></span>
<span id="cb28-15">EXACT_ID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>)</span>
<span id="cb28-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ALL.items():</span>
<span id="cb28-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_two_unit_systems_max_rel_diff"</span>,):</span>
<span id="cb28-18">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID,</span>
<span id="cb28-19">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same Eq. (17) in two unit systems sharing every Cfg input"</span>)</span>
<span id="cb28-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_ergun_residual_is_parameter_gap"</span>:</span>
<span id="cb28-21">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_g = 0 on run 5"</span>)</span>
<span id="cb28-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_arith_mean_max_rel_error"</span>:</span>
<span id="cb28-23">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID,</span>
<span id="cb28-24">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_g = K/P makes P^2 linear in z; recipe and quadrature at round-off"</span>)</span>
<span id="cb28-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_argmax_chi"</span>:</span>
<span id="cb28-26">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID,</span>
<span id="cb28-27">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (22) is even in log10 chi; brentq xtol 1e-13"</span>)</span>
<span id="cb28-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_argmax_root_vs_analytic_rel"</span>:</span>
<span id="cb28-29">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb28-30">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root of a centred difference with relative step 1e-6"</span>)</span>
<span id="cb28-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_observed_order"</span>:</span>
<span id="cb28-32">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind"</span>)</span>
<span id="cb28-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sectioning_observed_order"</span>:</span>
<span id="cb28-34">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.95</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-35">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the arithmetic mean of the terminals is the midpoint rule"</span>)</span>
<span id="cb28-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_richardson_remainder_order"</span>:</span>
<span id="cb28-37">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-38">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the Richardson pair of a first-order scheme leaves an O(h^2) remainder"</span>)</span>
<span id="cb28-39">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_richardson_remainder_finest_over_noise"</span>:</span>
<span id="cb28-40">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-41">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"remainder of the (1600, 3200) pair over the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_first_cell_face_over_centre_distance"</span>:</span>
<span id="cb28-43">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-44">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler: O(h^2) from the right face, O(h) from the centre"</span>)</span>
<span id="cb28-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_finest_err_over_noise"</span>:</span>
<span id="cb28-46">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"error at 1600 cells over the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sectioning_finest_err_over_noise"</span>:</span>
<span id="cb28-48">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-49">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"error at 64 sections over the fixed-point tolerance 1e-14"</span>)</span>
<span id="cb28-50">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_outflow_vs_hand_march_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_balance_gap"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_flux_vs_face_value"</span>,</span>
<span id="cb28-51">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_correction_over_ninth"</span>):</span>
<span id="cb28-52">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"round-off; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_row_last_weight"</span>:</span>
<span id="cb28-54">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.125</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.125</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID,</span>
<span id="cb28-55">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero-gradient outlet folded into the flux: 9/8"</span>)</span>
<span id="cb28-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_row_prev_weight"</span>:</span>
<span id="cb28-57">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.125</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.125</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID,</span>
<span id="cb28-58">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero-gradient outlet folded into the flux: -1/8"</span>)</span>
<span id="cb28-59">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_last_step_over_h"</span>:</span>
<span id="cb28-60">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT_ID,</span>
<span id="cb28-61">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the last cell's balance with the folded outlet"</span>)</span>
<span id="cb28-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rows_outside_20pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_rows_outside_20pct"</span>):</span>
<span id="cb28-63">        dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rdev"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rows_outside_20pct"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_f7dev"</span>]</span>
<span id="cb28-64">        claims.count(name, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>)</span>
<span id="cb28-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_experimental_column"</span>:</span>
<span id="cb28-66">        claims.count(name, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_lens"</span>].values()), KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"experimental_column_length"</span>],</span>
<span id="cb28-67">                     above<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>)</span>
<span id="cb28-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_commercial_reactor"</span>:</span>
<span id="cb28-69">        claims.count(name, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(SPR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_lens"</span>].values()), KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"commercial_reactor_length"</span>],</span>
<span id="cb28-70">                     above<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>)</span>
<span id="cb28-71">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb28-72">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># deterministic arithmetic, root-finds and grid errors: spread below 1e-12</span></span>
<span id="cb28-73">        claims.value(name, x, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb28-74"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims registered"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>103 claims registered</code></pre>
</div>
</div>
</section>
<section id="the-break-table" class="level3">
<h3 class="anchored" data-anchor-id="the-break-table">The break table</h3>
<p>Every row below injects one defect, a transcribed constant read wrongly, a table cell read wrongly, a modelling choice or a numerical setting, <strong>re-runs the same block functions</strong> that produced the registered numbers, and hands each recomputed number to <code>claims.breaks</code>, which records whether that claim’s own check (its tolerance or its bound) catches it. Every claim must be caught by at least one row; the last cell raises otherwise. Rows that read a table cell wrongly are what reach the statistics of the printed tables (the nulls, the self-consistency checks, the run-5 arithmetic), which no constant touches.</p>
<div id="94316373" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:52:28.836113Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:52:28.835935Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:53:03.086209Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:53:03.085184Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cell(table, run, column, value):</span>
<span id="cb30-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A copy of ``table`` with one cell read differently."""</span></span>
<span id="cb30-3">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table.copy()</span>
<span id="cb30-4">    t.loc[t.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> run, column] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> value</span>
<span id="cb30-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> t</span>
<span id="cb30-6"></span>
<span id="cb30-7"></span>
<span id="cb30-8">ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb30-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha transcribed as Ergun's 150 (the paper prints 266)"</span>,</span>
<span id="cb30-10">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cylinder_alpha"</span>]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta transcribed as 1.75 (the paper prints 2.33)"</span>,</span>
<span id="cb30-12">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(beta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cylinder_beta"</span>]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"specific surface at 147.5, the bottom of what '148' rounds from"</span>,</span>
<span id="cb30-14">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(s_surf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">147.5</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"specific surface at 148.5, the top of the same interval"</span>,</span>
<span id="cb30-16">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(s_surf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">148.5</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the manometer correction of book p. 236 left out"</span>,</span>
<span id="cb30-18">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(manometer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>)),</span>
<span id="cb30-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_m taken as the liquid density instead of Eq. (21)'s mixture"</span>,</span>
<span id="cb30-20">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rho_m_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"liquid"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>)),</span>
<span id="cb30-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"air viscosity fixed at Table 2's 0.0192 cP instead of the recovered line"</span>,</span>
<span id="cb30-22">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(mu_air_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table2"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span>)),</span>
<span id="cb30-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 2's air viscosity 0.0192 read as 0.0129"</span>,</span>
<span id="cb30-24">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(mu_air_table2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0129</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>)),</span>
<span id="cb30-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_p taken as the nominal 3/8 in. instead of Eq. (19)'s 6(1-eps)/S"</span>,</span>
<span id="cb30-26">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(dp_override<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.375</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"g_c taken at the exact 32.174 instead of the printed 32.17"</span>,</span>
<span id="cb30-28">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(gc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">32.174049</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"standard atmosphere taken as 14.7 instead of 14.696"</span>,</span>
<span id="cb30-30">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(p_atm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">14.7</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-31">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 2's air density read as at 80 F instead of at 32 F"</span>,</span>
<span id="cb30-32">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t_air_ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">80.0</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 centipoise rounded to 6.72e-4 lb/(ft.sec)"</span>,</span>
<span id="cb30-34">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(cp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.72e-4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>)),</span>
<span id="cb30-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the ft-lb-second route given its own rounded centipoise"</span>,</span>
<span id="cb30-36">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(primitive_cp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.72e-4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>,)),</span>
<span id="cb30-37">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"porosity taken as the 3/8-in. sphere value 0.362"</span>,</span>
<span id="cb30-38">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sphere_bed_porosity"</span>]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span>)),</span>
<span id="cb30-39">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (22) read with natural logs instead of log10"</span>,</span>
<span id="cb30-40">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eq22_ln<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-41">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (22)'s two constants swapped"</span>,</span>
<span id="cb30-42">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eq22_a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_offset"</span>], eq22_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_numerator"</span>]), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>)),</span>
<span id="cb30-43">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (23)'s linear coefficient read as 0.252, a transposition of 0.525"</span>,</span>
<span id="cb30-44">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eq23_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c0"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.252</span>, KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c2"</span>])), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-45">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (23) taken with the constant term Figure 7 prints, -0.744"</span>,</span>
<span id="cb30-46">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eq23_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c0_figure7"</span>], KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c1"</span>], KV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_c2"</span>])),</span>
<span id="cb30-47">     (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span>)),</span>
<span id="cb30-48">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chi defined as sqrt(delta_g/delta_l), the reciprocal of the printed one"</span>,</span>
<span id="cb30-49">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(chi_inverted<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-50">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the gravity term of Eq. (5) dropped from the column"</span>,</span>
<span id="cb30-51">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(gravity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,)),</span>
<span id="cb30-52">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two-phase correlation switched off: delta_lg = delta_l + delta_g"</span>,</span>
<span id="cb30-53">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(two_phase<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,)),</span>
<span id="cb30-54">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the section evaluated at its inlet pressure, not the mean of its terminals"</span>,</span>
<span id="cb30-55">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(mean_rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span>)),</span>
<span id="cb30-56">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the geometric mean of the terminals instead of the arithmetic one"</span>,</span>
<span id="cb30-57">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(mean_rule<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"geometric"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,)),</span>
<span id="cb30-58">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrema and thresholds sampled on a grid instead of root-found"</span>,</span>
<span id="cb30-59">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rootfind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>)),</span>
<span id="cb30-60">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the root-finder's tolerance loosened to 1e-4"</span>,</span>
<span id="cb30-61">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(root_xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape"</span>,)),</span>
<span id="cb30-62">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the grid pair 1200 and 1600 cells read as a doubling"</span>,</span>
<span id="cb30-63">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_fv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,)),</span>
<span id="cb30-64">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the column solved on 50 and 100 cells instead of 800 and 1600"</span>,</span>
<span id="cb30-65">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_fv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>)),</span>
<span id="cb30-66">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Newton tolerance loosened to 1e-3"</span>,</span>
<span id="cb30-67">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(newton_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,)),</span>
<span id="cb30-68">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the recipe's fixed point stopped at 1e-6"</span>,</span>
<span id="cb30-69">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(recipe_tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>,)),</span>
<span id="cb30-70">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero-gradient outlet, read from the last cell (pitfall P8)"</span>,</span>
<span id="cb30-71">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_gradient"</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>)),</span>
<span id="cb30-72">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero-gradient outlet, read on the face"</span>,</span>
<span id="cb30-73">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero_gradient"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>)),</span>
<span id="cb30-74">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the demonstration column built on the mildest two-phase row (run 86)"</span>,</span>
<span id="cb30-75">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(demo_run<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">86</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"col"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet"</span>)),</span>
<span id="cb30-76">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 air Reynolds of run 63 read as 4515 (printed 4155)"</span>,</span>
<span id="cb30-77">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">63</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_air"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4515.0</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recon"</span>,)),</span>
<span id="cb30-78">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 two-phase parameter of run 28 read as 3.865 (printed 3.685)"</span>,</span>
<span id="cb30-79">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_parameter"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.865</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"self"</span>)),</span>
<span id="cb30-80">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 liquid saturation of run 57 read as 41.0 (printed 47.0)"</span>,</span>
<span id="cb30-81">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T3, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">57</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"liquid_saturation_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">41.0</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr"</span>,)),</span>
<span id="cb30-82">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 delta_lg of run 5 read as 2.496 (printed 2.469)"</span>,</span>
<span id="cb30-83">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg_psi_per_ft"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.496</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>,)),</span>
<span id="cb30-84">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 delta_g of run 5 read as 0.0226 (printed 0)"</span>,</span>
<span id="cb30-85">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_g_psi_per_ft"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0226</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>,)),</span>
<span id="cb30-86">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 delta_g of run 160 read as 1.983 (printed 1.938)"</span>,</span>
<span id="cb30-87">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_g_psi_per_ft"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.983</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>,)),</span>
<span id="cb30-88">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 two-phase parameter of run 160 read as 1.090 (printed 1.009)"</span>,</span>
<span id="cb30-89">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_parameter"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.090</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5"</span>,)),</span>
<span id="cb30-90">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 chi of run 23 read as 3.502 (printed 3.205)"</span>,</span>
<span id="cb30-91">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chi"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.502</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"self"</span>,)),</span>
<span id="cb30-92">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 liquid rate of run 86 read as 79.93 (printed 97.93)"</span>,</span>
<span id="cb30-93">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cell(T3, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">86</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"liquid_rate_lb_sqft_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">79.93</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"repro"</span>,)),</span>
<span id="cb30-94">]</span>
<span id="cb30-95"></span>
<span id="cb30-96">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb30-97"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, changes, which <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS:</span>
<span id="cb30-98">    got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_blocks(make(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>changes), which)</span>
<span id="cb30-99">    caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [n <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> claims.breaks(label, n, v)]</span>
<span id="cb30-100">    BREAK.append((label, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(got), caught))</span>
<span id="cb30-101"></span>
<span id="cb30-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the zero-gradient comparison's own claims: built with the outflow marker, the</span></span>
<span id="cb30-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># folded row, the shortened step and the face correction all disappear</span></span>
<span id="cb30-104">_zg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow"</span>)</span>
<span id="cb30-105">_Pz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _zg.solve()</span>
<span id="cb30-106">_row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(_zg.conv.todense())[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb30-107">_label <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the zero-gradient comparison built with the outflow marker instead"</span></span>
<span id="cb30-108">_caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [n <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> {</span>
<span id="cb30-109">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_row_last_weight"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_row[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb30-110">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_row_prev_weight"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_row[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb30-111">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_last_step_over_h"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((_Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (L4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> col.dPdz(_Pz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb30-112">}.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.breaks(_label, n, v)]</span>
<span id="cb30-113">BREAK.append((_label, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, _caught))</span>
<span id="cb30-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same last-cell balance with the outflow marker: it closes, as the face read does</span></span>
<span id="cb30-115">_rows2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb30-116"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _n, _name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_n100"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_nfine"</span>)):</span>
<span id="cb30-117">    _o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, PIN, L4, _n, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow"</span>)</span>
<span id="cb30-118">    _rows2[_name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_o.balance_gap(_o.solve(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>)))</span>
<span id="cb30-119">_l2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the last-cell balance taken with the outflow marker instead of the zero-gradient outlet"</span></span>
<span id="cb30-120">BREAK.append((_l2, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, [n <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _rows2.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.breaks(_l2, n, v)]))</span>
<span id="cb30-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the first cell read as a centre value: the distance ratio inverts</span></span>
<span id="cb30-122">_o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ColumnFV(col, PIN, L4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb30-123">_p1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_o.solve()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb30-124">_l3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell values located at cell centres instead of right faces"</span></span>
<span id="cb30-125">_inv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_p1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> quad_outlet(col, PIN, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_o.x_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_p1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> quad_outlet(col, PIN, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_o.x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb30-126">BREAK.append((_l3, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_first_cell_face_over_centre_distance"</span>]</span>
<span id="cb30-127">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.breaks(_l3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_first_cell_face_over_centre_distance"</span>, _inv) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> []))</span>
<span id="cb30-128"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the face value against the flux the operator transports, with the last cell read instead</span></span>
<span id="cb30-129">_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_P"</span>]</span>
<span id="cb30-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero-gradient flux compared with the last cell (pitfall P8)"</span>,</span>
<span id="cb30-131">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_flux_vs_face_value"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_flux_out"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _P[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))):</span>
<span id="cb30-132">    BREAK.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero-gradient flux compared with the last cell (pitfall P8)"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb30-133">                  [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_outlet_flux_vs_face_value"</span>]))</span>
<span id="cb30-134"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the face correction measured against h S/8 instead of h S/9</span></span>
<span id="cb30-135"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the face correction taken as h S/8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_correction_over_ninth"</span>,</span>
<span id="cb30-136">                 <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_cbv"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _P[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_S_N"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))):</span>
<span id="cb30-137">    BREAK.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the face correction taken as h S/8"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_face_correction_over_ninth"</span>]))</span>
<span id="cb30-138"></span>
<span id="cb30-139">caught_by <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb30-140"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, n, caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb30-141">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> caught:</span>
<span id="cb30-142">        caught_by.setdefault(c, []).append(label)</span>
<span id="cb30-143">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows; per row: claims recomputed, claims caught"</span>]</span>
<span id="cb30-144">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(c)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, n, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK]</span>
<span id="cb30-145">miss <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(claims.metrics) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(caught_by))</span>
<span id="cb30-146">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(caught_by)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims caught by at least one row;"</span></span>
<span id="cb30-147">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not caught: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>miss <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> miss <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb30-148"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(lines))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>47 rows; per row: claims recomputed, claims caught
   42  15  alpha transcribed as Ergun's 150 (the paper prints 266)
   42  16  beta transcribed as 1.75 (the paper prints 2.33)
   49  21  specific surface at 147.5, the bottom of what '148' rounds from
   49  21  specific surface at 148.5, the top of the same interval
   24   8  the manometer correction of book p. 236 left out
   24   4  rho_m taken as the liquid density instead of Eq. (21)'s mixture
   51   3  air viscosity fixed at Table 2's 0.0192 cP instead of the recovered line
   19   3  Table 2's air viscosity 0.0192 read as 0.0129
   49  25  D_p taken as the nominal 3/8 in. instead of Eq. (19)'s 6(1-eps)/S
   42   3  g_c taken at the exact 32.174 instead of the printed 32.17
   42   1  standard atmosphere taken as 14.7 instead of 14.696
   42  14  Table 2's air density read as at 80 F instead of at 32 F
   19   7  1 centipoise rounded to 6.72e-4 lb/(ft.sec)
   12   1  the ft-lb-second route given its own rounded centipoise
   35   9  porosity taken as the 3/8-in. sphere value 0.362
   49  17  Eq. (22) read with natural logs instead of log10
   31   8  Eq. (22)'s two constants swapped
   49  21  Eq. (23)'s linear coefficient read as 0.252, a transposition of 0.525
   53  15  Eq. (23) taken with the constant term Figure 7 prints, -0.744
   38  14  chi defined as sqrt(delta_g/delta_l), the reciprocal of the printed one
   18   8  the gravity term of Eq. (5) dropped from the column
   18   9  the two-phase correlation switched off: delta_lg = delta_l + delta_g
   22  10  the section evaluated at its inlet pressure, not the mean of its terminals
   18   5  the geometric mean of the terminals instead of the arithmetic one
   29   3  extrema and thresholds sampled on a grid instead of root-found
   11   2  the root-finder's tolerance loosened to 1e-4
   18   5  the grid pair 1200 and 1600 cells read as a doubling
   35  11  the column solved on 50 and 100 cells instead of 800 and 1600
   18   2  Newton tolerance loosened to 1e-3
   18   3  the recipe's fixed point stopped at 1e-6
   35  10  zero-gradient outlet, read from the last cell (pitfall P8)
   35   6  zero-gradient outlet, read on the face
   35  19  the demonstration column built on the mildest two-phase row (run 86)
    7   4  Table 4 air Reynolds of run 63 read as 4515 (printed 4155)
   22  11  Table 4 two-phase parameter of run 28 read as 3.865 (printed 3.685)
   20   5  Table 3 liquid saturation of run 57 read as 41.0 (printed 47.0)
   12   4  Table 4 delta_lg of run 5 read as 2.496 (printed 2.469)
   12   4  Table 4 delta_g of run 5 read as 0.0226 (printed 0)
   12   2  Table 4 delta_g of run 160 read as 1.983 (printed 1.938)
   12   1  Table 4 two-phase parameter of run 160 read as 1.090 (printed 1.009)
    2   1  Table 4 chi of run 23 read as 3.502 (printed 3.205)
   12   6  Table 3 liquid rate of run 86 read as 79.93 (printed 97.93)
    3   3  the zero-gradient comparison built with the outflow marker instead
    2   2  the last-cell balance taken with the outflow marker instead of the zero-gradient outlet
    1   1  cell values located at cell centres instead of right faces
    1   1  zero-gradient flux compared with the last cell (pitfall P8)
    1   1  the face correction taken as h S/8

103 of 103 claims caught by at least one row; not caught: none</code></pre>
</div>
</div>
</section>
<section id="printed-features-reported-and-not-repaired" class="level3">
<h3 class="anchored" data-anchor-id="printed-features-reported-and-not-repaired">Printed features, reported and not repaired</h3>
<p><strong>1. Table 3 and Table 4 disagree about run 5.</strong> Table 3’s run-5 pressure drop is <code>2.321</code>, Table 4’s run-5 <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7Blg%7D"> is <code>2.469</code>, and for a run with no gas Eq. (20) makes those the same number. Established from the paper’s own arithmetic above; <strong>not repaired</strong>, and this page does not say which cell is wrong.</p>
<p><strong>2. Eq. (23) is printed twice on book p.&nbsp;237 with two different constant terms.</strong> The typeset equation is</p>
<blockquote class="blockquote">
<p><code>log_10 R_l = - 0.774 + 0.525 (log_10 chi) - 0.109 (log_10 chi)^2</code></p>
</blockquote>
<p>and the annotation inside Figure 7, on the facing column of the same page, is</p>
<blockquote class="blockquote">
<p><code>log_10 R_l = -0.744 + 0.525 log_10 X - 0.109 (log_10 X)^2</code></p>
</blockquote>
<p>Every other coefficient agrees, and so does the whole of Eq. (22), which Figure 7 also prints in full. Both were read on 300 ppi crops enlarged to digit scale; the difference is a transposition. Figures 3, 5 and 6 carry the same curves but print only the labels “EQUATION (22)” and “EQUATION (23)” beside them, not the coefficients (each was cropped and read), so Figure 7 is the only second printing of either equation in the paper. <strong>Neither reading is adopted</strong>, and the paper’s own printed data cannot settle it (Results).</p>
<p><strong>3. The notation’s units make Eq. (17) inconsistent with the printed <img src="https://latex.codecogs.com/png.latex?g_c">.</strong> Verbatim: <code>mu = viscosity, (lb. mass/ft.-min.)</code> and <code>g_c = conversion factor, 32.17 pdl./lb.-mass in English units</code>. With <img src="https://latex.codecogs.com/png.latex?%5Cmu"> on those units Eq. (17) reproduces Table 4 only if the conversion factor carries <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bmin%7D%5E%7B-2%7D">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?32.17%20%5Ctimes%203600">; the factor the table requires is measured above at 3593.8. Separately, “pdl./lb.-mass” is an acceleration, <img src="https://latex.codecogs.com/png.latex?g_c"> being poundals per pound-<strong>force</strong>, but that is a reading of the words rather than of the arithmetic. <strong>Neither is repaired.</strong></p>
<p><strong>4. Not a defect.</strong> Eq. (23) cannot return a full column for any <img src="https://latex.codecogs.com/png.latex?%5Cchi">, and its maximum sits more than eight times beyond the upper limit it is declared for. The paper says on book p.&nbsp;238 that Eq. (23) “is a power series fit which is only good within the limits given”, and it attributes the <img src="https://latex.codecogs.com/png.latex?R_l%20%5Cto%201"> and <img src="https://latex.codecogs.com/png.latex?R_l%20%5Cto%200"> consistency checks to “the data of Figure 7” rather than to the equation. The numbers on this page quantify a caveat the authors print.</p>
<p><strong>Where the search for these went.</strong> All nine pages were rendered at their native 300 ppi and read; the numerals of Tables 2, 3, 4 and 5, of Eqs. (17) to (23), and of every equation annotated inside Figures 3, 5, 6 and 7 were re-read on enlarged crops at digit scale. The claim that no footnote attaches to Table 3 or Table 4 was checked by cropping the strip beneath each table. The claim that the tables are discussed nowhere else was checked by reading both sections that name them in full, plus the “PRESENTATION OF CORRELATED DATA” section that follows. Reference 4, the thesis, is not on disk, so nothing here rules out that it addresses run 5.</p>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Not the correlation, and not the worked example.</strong> Eqs. (17)-(23) are arithmetic. The reproduction of Table 4 above uses NumPy and nothing else.</p>
<p><strong>What pymrm buys is the question the 1961 procedure could only answer by judgement.</strong> The paper’s design calculation is a march with an assumed average pressure per section, iterated to consistency, and its own step 1 tells the reader to split the bed when it is long or the loss is large, without saying how long or how many sections. Written as a differential equation and solved on a grid, the same physics answers both questions:</p>
<ul>
<li>the one-section recipe is <strong>exact</strong> for a single phase in horizontal flow, proved algebraically above and confirmed at round-off, so the sectioning advice is not about compressibility as such;</li>
<li>with the two-phase correlation in the loop it reaches 1 % at a bed length root-found on the page: inside the paper’s own column for the largest-friction-loss row of Table 3, and far outside the 40-ft commercial reactor for the mildest;</li>
<li>sectioning converges at second order, so the number of sections needed for a target accuracy follows from one number instead of from judgement.</li>
</ul>
<p>The assembly is small: <code>construct_convflux_upwind</code> and <code>construct_div</code> at <img src="https://latex.codecogs.com/png.latex?v%20=%201">, an inlet dictionary and the <code>{"outflow": True}</code> outlet, <code>NumJac((n, 1))</code> for a pointwise source, <code>newton</code>, and <code>compute_boundary_values</code> for the outlet. What it is worth is not speed (a quadrature does this problem too, and is used here as the independent route) but that the same operators carry over the moment anything else is added to the column: a reaction, a species balance, a heat balance, or a second spatial dimension.</p>
<p><strong>An honest limit.</strong> Nothing in this section is validated against a measurement. The paper reports no axial pressure profile, only a per-foot gradient from a middle section. What is validated is the <em>arithmetic</em>: three independent routes to the same profile, a discrete balance, and an identity that can be proved.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>Change</th>
<th>Where</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>A different packing</td>
<td><code>alpha</code>, <code>beta</code>, <code>eps</code>, <code>s_surf</code> of <code>Larkins</code> (<code>Larkins.from_constants(KV, alpha=..., ...)</code>); book p.&nbsp;236 prints (118.2, 1.0) for 3/8-in. spheres and Ergun’s own (150, 1.75) for cylinders, <strong>neither of which any printed data on this page exercises</strong></td>
</tr>
<tr class="even">
<td>A different gas-liquid system</td>
<td><code>rho_w</code>, <code>rho_air_ref</code>, <code>t_air_ref</code> and the air viscosity (<code>mu_air_mode="table2"</code> with <code>mu_air_table2</code>, or your own <code>mu_air_line</code>); Table 2 carries eleven fluids</td>
</tr>
<tr class="odd">
<td>Horizontal flow</td>
<td><code>Larkins.from_constants(KV, gravity=False)</code> drops the static head</td>
</tr>
<tr class="even">
<td>Upflow</td>
<td>the static head opposes the flow: change the sign of the <img src="https://latex.codecogs.com/png.latex?%5Crho_m"> term in <code>Column.dPdz</code> (with <img src="https://latex.codecogs.com/png.latex?z"> along the flow)</td>
</tr>
<tr class="odd">
<td>A reaction in the bed</td>
<td>add species fields to <code>ColumnFV</code>: the shape becomes <code>(n, 1 + n_c)</code> and <code>NumJac((n, 1 + n_c))</code> couples the last axis in full. The <code>v = 1</code> of the pressure equation is only a device for marching it; species are convected with their own phase velocities, so they need their own convection operators</td>
</tr>
<tr class="even">
<td>Heat as well</td>
<td>a temperature field in the same state, with its own bc dictionaries; the <code>S3</code> pattern is unchanged</td>
</tr>
<tr class="odd">
<td>A hold-up closure instead of Eq. (23)</td>
<td>replace <code>Larkins.f23</code>; <code>G1.7</code> (Wammes) is the high-pressure alternative and <code>G1.8</code> the partial-wetting one</td>
</tr>
</tbody>
</table>
<p>The outlet of a convection-only column takes <code>{"outflow": True}</code>; a zero-gradient dictionary there imposes a condition the problem does not have (measured above).</p>
<p><strong>Related pages:</strong> <code>G1.7</code> Wammes-Westerterp high-pressure trickle-bed hydrodynamics, the same coupled hold-up/pressure-gradient structure at 7.5 MPa · <code>G1.8</code> trickle-bed partial wetting · <code>A1.1</code> Ergun, which is Eq. (17) with <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%20150">, <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%201.75"> · <code>F2.3</code> slurry bubble columns · <code>F1.4</code> Krishna-Ellenberger hold-up.</p>
<p><strong>Do not reuse the run-5 row as data.</strong> It is on this page as an unresolved discrepancy, not as a measurement, and the CSV’s sidecar says so.</p>
</section>
<section id="references" class="level2">
<h2 class="anchored" data-anchor-id="references">References</h2>
<p><strong>The source, read.</strong> Larkins, R. P., White, R. R. and Jeffrey, D. W. (1961). <em>Two-Phase Concurrent Flow in Packed Beds.</em> AIChE Journal <strong>7</strong>(2), 231-239. <a href="https://doi.org/10.1002/aic.690070213">doi:10.1002/aic.690070213</a>. Identity confirmed on the file’s own title page: the title, the by-line “R. P. LARKINS and R. R. WHITE / University of Michigan, Ann Arbor, Michigan” and “D. W. JEFFREY / Humble Oil and Refining Company, Baytown, Texas”, the abstract, and the present-address footnote. <strong>PDF page 1 opens with the NOMENCLATURE and “Manuscript received April 18, 1960” of the PRECEDING article</strong>, a film-theory/penetration-theory paper; Larkins et al.&nbsp;begin below the rule on the same page. Book page = PDF page + 230.</p>
<p><strong>Cited by the paper, not on disk, not read.</strong> Larkins, R. P. (1959). PhD thesis, University of Michigan, Ann Arbor: the paper’s reference 4, “the complete tabulation of properties, data and results”, offered on microfilm. It is also the support the paper gives for the average-pressure claim this page tests, so what is shown there, and under what assumptions, is unknown here.</p>
<p><strong>Named in the paper, not evaluated here.</strong> Ergun, S. (1952), <em>Chem. Eng. Progr.</em> <strong>48</strong>, 89 (reference 3, the origin of Eq. (17)’s form and of the (150, 1.75) pair). Brownell, L. E. and Katz, D. L. (1947), <em>Chem. Eng. Progr.</em> <strong>43</strong>, 537 (reference 2). Lockhart, R. W. and Martinelli, R. C. (1949), <em>Chem. Eng. Progr.</em> <strong>45</strong>, 39 (reference 6, whose <img src="https://latex.codecogs.com/png.latex?X"> this paper’s <img src="https://latex.codecogs.com/png.latex?%5Cchi"> mirrors). Piret, E. L., Mann, C. A. and Wall, T. Jr.&nbsp;(1940), <em>Ind. Eng. Chem.</em> <strong>32</strong>, 861 (reference 9). None of the four is on disk; each is cited, not used.</p>
<div id="e775061c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:53:03.088744Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:53:03.088544Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:53:03.097177Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:53:03.096392Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># prose numbers: the Markdown cells of this notebook (README.md tags its own)</span></span>
<span id="cb32-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb32-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Parameters and assumptions</span></span>
<span id="cb32-4">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.026"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_linear_fit_max_resid_pct"</span>),</span>
<span id="cb32-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Step 2 heading</span></span>
<span id="cb32-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.15"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_systematic_offset_pct"</span>),</span>
<span id="cb32-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Step 3 and run 5</span></span>
<span id="cb32-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-5.99"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_delta_lg_rel_error_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.639"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg_max_rel_error_pct"</span>),</span>
<span id="cb32-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+22.29"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_manometer_correction_worth_pct"</span>),</span>
<span id="cb32-10">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9408"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_two_phase_parameter_from_table3"</span>),</span>
<span id="cb32-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-5.92"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_parameter_gap_from_unity_pct"</span>),</span>
<span id="cb32-12">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.90"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_parameter_off_unity_pct"</span>),</span>
<span id="cb32-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.93"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_vs_ergun_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.081"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_vs_ergun_pct"</span>),</span>
<span id="cb32-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_closer_factor"</span>),</span>
<span id="cb32-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Results: correlations</span></span>
<span id="cb32-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"25.53"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_max_abs_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"12.81"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rms_dev_pct"</span>),</span>
<span id="cb32-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_gain_over_bestconst"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.48"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_gain_over_bestconst"</span>),</span>
<span id="cb32-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14.79"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_rms_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"63"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_gain_flatters_pct"</span>),</span>
<span id="cb32-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"33.90"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_max_abs_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"19.55"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rms_dev_pct"</span>),</span>
<span id="cb32-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"117.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_null_bestconst_rms_dev_pct"</span>),</span>
<span id="cb32-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.15"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_constant_worth_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18.33"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_rms_dev_pct"</span>),</span>
<span id="cb32-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"256.010"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_argmax_chi"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7214"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_ceiling_liquid_saturation"</span>),</span>
<span id="cb32-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.0618"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_discriminant_at_saturation_unity"</span>),</span>
<span id="cb32-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7730"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_ceiling_liquid_saturation"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.0488"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_discriminant"</span>),</span>
<span id="cb32-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.283 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_at_chi_lower_limit"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"58.03 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_at_chi_upper_limit"</span>),</span>
<span id="cb32-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Results: column</span></span>
<span id="cb32-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_arith_mean_max_rel_error"</span>),</span>
<span id="cb32-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.12e-05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_geom_mean_max_rel_error"</span>),</span>
<span id="cb32-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.72e-07"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_downflow_arith_mean_rel_error_2ft"</span>),</span>
<span id="cb32-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"129"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_friction_over_static_head_at_inlet"</span>),</span>
<span id="cb32-31">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.332 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_rel_error_4ft"</span>),</span>
<span id="cb32-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.6012"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_ft"</span>),</span>
<span id="cb32-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.6012"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_min_ft"</span>),</span>
<span id="cb32-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"466.9537"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_max_ft"</span>),</span>
<span id="cb32-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_experimental_column"</span>),</span>
<span id="cb32-36">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_commercial_reactor"</span>),</span>
<span id="cb32-37">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.0627"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"choking_length_ft"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.9999"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sectioning_observed_order"</span>),</span>
<span id="cb32-38">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.84"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cbv_over_upwind_face_outlet_error_ratio"</span>),</span>
<span id="cb32-39">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Printed features</span></span>
<span id="cb32-40">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3593.8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gc_minute_conversion_recovered"</span>),</span>
<span id="cb32-41">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the outlet condition</span></span>
<span id="cb32-42">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.2e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_n100"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.7e-5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_nfine"</span>),</span>
<span id="cb32-43">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+9.85e-06"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_error_signed_nfine"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-3.78e-05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_error_signed_n_fine"</span>),</span>
<span id="cb32-44">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_richardson_remainder_order"</span>),</span>
<span id="cb32-45">]:</span>
<span id="cb32-46">    claims.says(lit, name)</span>
<span id="cb32-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># meta.yaml (validation, adds, agreement) and the models.yaml entry</span></span>
<span id="cb32-48"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb32-49">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.174"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_liquid_max_rel_error_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.147"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_liquid_rms_rel_error_pct"</span>),</span>
<span id="cb32-50">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.218"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_max_rel_error_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.176"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_rms_rel_error_pct"</span>),</span>
<span id="cb32-51">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.416"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_g_max_rel_error_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.639"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg_max_rel_error_pct"</span>),</span>
<span id="cb32-52">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.260"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_lg_rms_rel_error_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-5.99"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_delta_lg_rel_error_pct"</span>),</span>
<span id="cb32-53">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9408"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_two_phase_parameter_from_table3"</span>),</span>
<span id="cb32-54">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-5.92"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_parameter_gap_from_unity_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.90"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_parameter_off_unity_pct"</span>),</span>
<span id="cb32-55">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.081"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_vs_ergun_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run5_closer_factor"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.93"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_vs_ergun_pct"</span>),</span>
<span id="cb32-56">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+22.29"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run160_manometer_correction_worth_pct"</span>),</span>
<span id="cb32-57">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0259"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_linear_fit_max_resid_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.819"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_at_80F_vs_table2_pct"</span>),</span>
<span id="cb32-58">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.672"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_air_at_80F_offset_corrected_vs_table2_pct"</span>),</span>
<span id="cb32-59">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"28"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_rate_range_fold"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.1454"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_systematic_offset_pct"</span>),</span>
<span id="cb32-60">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0515"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_offset_spread_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"148.22"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reynolds_offset_implied_specific_surface"</span>),</span>
<span id="cb32-61">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-13"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_l_two_unit_systems_max_rel_diff"</span>),</span>
<span id="cb32-62">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3593.8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gc_minute_conversion_recovered"</span>),</span>
<span id="cb32-63">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_arith_mean_max_rel_error"</span>),</span>
<span id="cb32-64">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.12e-05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_horizontal_geom_mean_max_rel_error"</span>),</span>
<span id="cb32-65">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.332 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_rel_error_4ft"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.6012"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_ft"</span>),</span>
<span id="cb32-66">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.6012"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_min_ft"</span>),</span>
<span id="cb32-67">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"466.9537"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_length_max_ft"</span>),</span>
<span id="cb32-68">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_experimental_column"</span>),</span>
<span id="cb32-69">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_phase_recipe_1pct_runs_inside_commercial_reactor"</span>),</span>
<span id="cb32-70">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.9999"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sectioning_observed_order"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.0003"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_observed_order"</span>),</span>
<span id="cb32-71">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.47e-08"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_extrapolated_vs_quadrature_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.35"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_extrap_orders_below_recipe"</span>),</span>
<span id="cb32-72">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_outflow_vs_hand_march_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_balance_gap"</span>),</span>
<span id="cb32-73">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.2e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zg_lastcell_balance_gap_n100"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fv_richardson_remainder_order"</span>),</span>
<span id="cb32-74">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.84"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cbv_over_upwind_face_outlet_error_ratio"</span>),</span>
<span id="cb32-75">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.15"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_constant_worth_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18.33"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_rms_dev_pct"</span>),</span>
<span id="cb32-76">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"19.55"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rms_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_rows_outside_20pct"</span>),</span>
<span id="cb32-77">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_rows_outside_20pct"</span>),</span>
<span id="cb32-78">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7730"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_fig7_ceiling_liquid_saturation"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7214"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_ceiling_liquid_saturation"</span>),</span>
<span id="cb32-79">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"256.010"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_argmax_chi"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.0618"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_discriminant_at_saturation_unity"</span>),</span>
<span id="cb32-80">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"25.53"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_max_abs_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"12.81"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rms_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"33.90"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23_max_abs_dev_pct"</span>),</span>
<span id="cb32-81">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_gain_over_bestconst"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.48"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_gain_over_bestconst"</span>),</span>
<span id="cb32-82">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14.79"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_free_rows_rms_dev_pct"</span>),</span>
<span id="cb32-83">]:</span>
<span id="cb32-84">    claims.says(lit, name)</span></code></pre></div></div>
</div>
<div id="1d01844d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T19:53:03.099055Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T19:53:03.098878Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T19:53:03.107372Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T19:53:03.106571Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb33-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb33-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb33-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for G1.1:
  re_liquid_max_rel_error_pct                           = 0.17406          value  rtol 0.001
  re_liquid_rms_rel_error_pct                           = 0.14652          value  rtol 0.001
  re_air_table2_viscosity_max_rel_error_pct             = 2.2116           value  rtol 0.001
  delta_l_max_rel_error_pct                             = 0.21769          value  rtol 0.001
  delta_l_rms_rel_error_pct                             = 0.17568          value  rtol 0.001
  delta_g_max_rel_error_pct                             = 0.41615          value  rtol 0.001
  delta_lg_max_rel_error_pct                            = 0.63899          value  rtol 0.001
  delta_lg_rms_rel_error_pct                            = 0.26001          value  rtol 0.001
  delta_l_two_unit_systems_max_rel_diff                 = (here 5.6e-16)   bound  bound &lt;= 1e-13 [identity]
  gc_minute_conversion_recovered                        = 3593.8           value  rtol 0.001
  mass_rate_range_fold                                  = 27.887           value  rtol 0.001
  dp_nominal_over_effective_pct                         = 60.59            value  rtol 0.001
  reynolds_systematic_offset_pct                        = 0.14538          value  rtol 0.001
  reynolds_offset_spread_pct                            = 0.051539         value  rtol 0.001
  reynolds_offset_implied_specific_surface              = 148.22           value  rtol 0.001
  mu_air_linear_fit_max_resid_pct                       = 0.025861         value  rtol 0.001
  mu_air_slope_cP_per_degF                              = 2.7649e-05       value  rtol 0.001
  mu_air_at_80F_vs_table2_pct                           = 0.81858          value  rtol 0.001
  mu_air_at_80F_offset_corrected_vs_table2_pct          = 0.67222          value  rtol 0.001
  run5_delta_lg_rel_error_pct                           = -5.9943          value  rtol 0.001
  run5_dpdl_implied_by_table4_psi_per_ft                = 2.469            value  rtol 0.001
  run5_two_phase_parameter_from_table3                  = 0.94082          value  rtol 0.001
  run5_parameter_gap_vs_printed                         = 0.060181         value  rtol 0.001
  run5_parameter_gap_from_unity_pct                     = -5.9181          value  rtol 0.001
  run160_delta_lg_rel_error_pct                         = 0.13392          value  rtol 0.001
  run160_manometer_correction_worth_pct                 = 22.288           value  rtol 0.001
  run5_vs_ergun_pct                                     = 0.08107          value  rtol 0.001
  run160_vs_ergun_pct                                   = 0.92879          value  rtol 0.001
  run5_closer_factor                                    = 11.457           value  rtol 0.001
  run160_parameter_off_unity_pct                        = 0.9              value  rtol 0.001
  run5_ergun_residual_is_parameter_gap                  = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  t4_chi_selfcheck_max_pct                              = 0.053021         value  rtol 0.001
  t4_parameter_selfcheck_max_pct                        = 0.065134         value  rtol 0.001
  eq22_max_abs_dev_pct                                  = 25.53            value  rtol 0.001
  eq22_rms_dev_pct                                      = 12.812           value  rtol 0.001
  eq22_rms_log_dev                                      = 0.053082         value  rtol 0.001
  eq22_null_unity_rms_log_dev                           = 0.36662          value  rtol 0.001
  eq22_null_bestconst_rms_log_dev                       = 0.21515          value  rtol 0.001
  eq22_gain_over_bestconst                              = 4.0531           value  rtol 0.001
  eq22_free_rows_rms_dev_pct                            = 14.789           value  rtol 0.001
  eq22_free_rows_rms_log_dev                            = 0.061273         value  rtol 0.001
  eq22_free_rows_null_bestconst_rms_log_dev             = 0.15205          value  rtol 0.001
  eq22_free_rows_gain_over_bestconst                    = 2.4815           value  rtol 0.001
  eq23_max_abs_dev_pct                                  = 33.898           value  rtol 0.001
  eq23_rms_dev_pct                                      = 19.551           value  rtol 0.001
  eq23_null_bestconst_rms_dev_pct                       = 117.94           value  rtol 0.001
  eq23_rows_outside_20pct                               = 2                exact  exact, margin 0.275
  eq23_fig7_rms_dev_pct                                 = 18.327           value  rtol 0.001
  eq23_fig7_max_abs_dev_pct                             = 29.17            value  rtol 0.001
  eq23_fig7_rows_outside_20pct                          = 3                exact  exact, margin 0.135
  eq23_text_minus_fig7_rms_dev_pct                      = 1.2232           value  rtol 0.001
  eq22_gain_flatters_pct                                = 63.332           value  rtol 0.001
  eq23_gain_over_bestconst                              = 6.0325           value  rtol 0.001
  eq22_argmax_chi                                       = (here 1.0e+00)   bound  bound [1, 1] [identity]
  eq22_max_parameter                                    = 4.2133           value  rtol 0.001
  eq23_argmax_chi                                       = 256.01           value  rtol 0.001
  eq23_argmax_root_vs_analytic_rel                      = (here 2.0e-09)   bound  bound &lt;= 1e-08 [tolerance]
  eq23_ceiling_liquid_saturation                        = 0.72139          value  rtol 0.001
  eq23_at_chi_upper_limit                               = 0.58031          value  rtol 0.001
  eq23_at_chi_lower_limit                               = 0.022827         value  rtol 0.001
  eq23_discriminant_at_saturation_unity                 = -0.061839        value  rtol 0.001
  eq23_fig7_ceiling_liquid_saturation                   = 0.77298          value  rtol 0.001
  eq23_fig7_discriminant                                = -0.048759        value  rtol 0.001
  eq23_fig7_constant_worth_pct                          = 7.1519           value  rtol 0.001
  gas_horizontal_arith_mean_max_rel_error               = (here 1.2e-13)   bound  bound &lt;= 1e-11 [identity]
  gas_horizontal_geom_mean_max_rel_error                = 1.116e-05        value  rtol 0.001
  gas_downflow_arith_mean_rel_error_2ft                 = 1.7183e-07       value  rtol 0.001
  two_phase_recipe_rel_error_4ft                        = 0.003323         value  rtol 0.001
  two_phase_recipe_1pct_length_ft                       = 5.6012           value  rtol 0.001
  sectioning_observed_order                             = (here 2.0e+00)   bound  bound [1.95, 2.05] [theory]
  sectioning_finest_err_over_noise                      = (here 3.3e+07)   bound  bound &gt;= 1000 [theory]
  choking_length_ft                                     = 8.0627           value  rtol 0.001
  fv_observed_order                                     = (here 1.0e+00)   bound  bound [0.95, 1.05] [theory]
  fv_rel_error_at_n_fine                                = 3.7835e-05       value  rtol 0.001
  fv_finest_err_over_noise                              = (here 2.4e+07)   bound  bound &gt;= 1000 [theory]
  fv_extrapolated_vs_quadrature_rel                     = 1.4677e-08       value  rtol 0.001
  fv_extrap_orders_below_recipe                         = 5.3549           value  rtol 0.001
  fv_extrap_orders_below_nfine                          = 3.4112           value  rtol 0.001
  fv_richardson_remainder_order                         = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  fv_richardson_remainder_finest_over_noise             = (here 2.4e+03)   bound  bound &gt;= 1000 [theory]
  fv_error_signed_n_fine                                = -3.7835e-05      value  rtol 0.001
  gas_friction_over_static_head_at_inlet                = 129              value  rtol 0.001
  zg_lastcell_balance_gap_n100                          = 0.001226         value  rtol 0.001
  zg_lastcell_balance_gap_nfine                         = 7.6613e-05       value  rtol 0.001
  zg_first_cell_face_over_centre_distance               = (here 1.2e-03)   bound  bound &lt;= 0.05 [theory]
  zg_lastcell_error_signed_nfine                        = 9.8488e-06       value  rtol 0.001
  fv_outflow_vs_hand_march_rel                          = (here 1.1e-15)   bound  bound &lt;= 1e-10 [identity]
  fv_balance_gap                                        = (here 1.4e-15)   bound  bound &lt;= 1e-10 [identity]
  zg_outlet_row_last_weight                             = (here 1.1e+00)   bound  bound [1.125, 1.125] [identity]
  zg_outlet_row_prev_weight                             = (here -1.3e-01)  bound  bound [-0.125, -0.125] [identity]
  zg_outlet_flux_vs_face_value                          = (here 2.2e-16)   bound  bound &lt;= 1e-10 [identity]
  zg_last_step_over_h                                   = (here 8.9e-01)   bound  bound [0.888889, 0.888889] [identity]
  zg_face_correction_over_ninth                         = (here 7.1e-14)   bound  bound &lt;= 1e-10 [identity]
  zg_face_vs_outflow_rel_n100                           = 2.0267e-06       value  rtol 0.001
  zg_face_vs_outflow_rel_nfine                          = 7.8903e-09       value  rtol 0.001
  outflow_over_zg_face_error_ratio                      = 1.0002           value  rtol 0.001
  cbv_over_upwind_face_outlet_error_ratio               = 3.8407           value  rtol 0.001
  zg_lastcell_extrapolated_vs_quadrature_rel            = 7.4635e-10       value  rtol 0.001
  zg_face_extrapolated_vs_quadrature_rel                = 1.1085e-09       value  rtol 0.001
  two_phase_recipe_1pct_length_max_ft                   = 466.95           value  rtol 0.001
  two_phase_recipe_1pct_length_min_ft                   = 5.6012           value  rtol 0.001
  two_phase_recipe_1pct_runs_inside_experimental_column = 1                exact  exact, margin 0.2
  two_phase_recipe_1pct_runs_inside_commercial_reactor  = 4                exact  exact, margin 0.0889</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:G</category>
  <category>struct:S3</category>
  <category>tier:T0</category>
  <category>data:tier2</category>
  <category>phase:gas-liquid-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/G1.1-larkins-two-phase-packed-bed/</guid>
  <pubDate>Fri, 14 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Andrews’ inhibition function: the two claims in his Summary, tested</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.2-andrews-substrate-inhibition/</link>
  <description><![CDATA[ 




<section id="andrews-inhibition-function-the-two-claims-in-his-summary-tested" class="level1">
<h1>Andrews’ inhibition function: the two claims in his Summary, tested</h1>
<p><strong>Catalog ID:</strong> <code>J4.2</code> · <strong>Structures:</strong> <code>S1</code> · <strong>Tier:</strong> T0</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>The source is on disk and was read in full, at its native resolution:</p>
<blockquote class="blockquote">
<p><strong>Andrews, J. F.</strong>, <em>A Mathematical Model for the Continuous Culture of Microorganisms Utilizing Inhibitory Substrates</em>, <strong>Biotechnology and Bioengineering 10</strong>(6), 707-723 (1968), doi:<code>10.1002/bit.260100602</code>.</p>
</blockquote>
<p>Identity confirmed from the document’s own first page - the masthead <em>“BIOTECHNOLOGY AND BIOENGINEERING / VOL. X, PAGES 707-723 (1968)”</em>, the title, the by-line <em>“JOHN F. ANDREWS, Environmental Systems Engineering, Clemson University, Clemson, South Carolina 29631”</em> and the Summary - read on a 300 ppi render. <code>pdfimages -list</code> reports every page of the file as CCITT-G4 bilevel at 300 ppi native, so 300 ppi is native and rendering higher would be interpolation. All seventeen pages were read at that resolution and every numeral quoted here was re-read on a crop enlarged to digit scale.</p>
<p><strong>The paper prints no table.</strong> A case-insensitive search of the extracted text layer for <code>table</code> returns exactly two hits and both are inside the word <em>“unstable”</em>. There is no ruled block, no column head and no <code>Table N</code> caption anywhere in the seventeen pages. What the paper does print is <strong>ten figures</strong>, and - this is why the page can exist at all - <strong>every parameter set is typeset inside a figure legend</strong>. Reading a typeset legend is transcription, not digitising.</p>
<p><strong>Nothing on this page is digitised.</strong> No curve was traced, no marker detected, no axis calibrated. The page therefore <strong>does not establish empirical adequacy against Andrews’ plotted results</strong>: where he prints a number in running text it is reproduced, and where a claim lives only in a plotted curve it is out of scope and is left there. That boundary is stated again in <em>Validation</em>.</p>
<p>Two things read <em>inside</em> figures are on the transcription side of that line, and both are named where they are used. Fig. 7 carries a typeset <strong>annotation</strong> - <code>S_i ADDED IN INCREMENTS OF 2.0 GM/L</code> - which is text, and it settles a sentence of Andrews’ running prose; it is in the CSV. And section 6 notes that both of Fig. 9’s <img src="https://latex.codecogs.com/png.latex?S_1"> curves <strong>start at the origin</strong>, which corroborates an initial condition Andrews never prints. The second is a reading of a curve, so it is declared: no axis was calibrated, no point was extracted, <strong>no number on this page comes from it</strong>, and the assumption it corroborates is one whose effect on the answer is reported anyway.</p>
<section id="the-one-sentence-this-page-is-about" class="level3">
<h3 class="anchored" data-anchor-id="the-one-sentence-this-page-is-about">The one sentence this page is about</h3>
<p>Andrews’ Summary, book p.&nbsp;707, in full for the part that matters:</p>
<blockquote class="blockquote">
<p><em>“Simulation studies show that the primary result of inhibition by substrate in a batch culture is an increase in the lag time whereas in continuous culture inhibition by substrate may result in process instability.”</em></p>
</blockquote>
<p>Two claims, one sentence, and they are not the same kind of claim. He restates them on book p.&nbsp;715 and adds the reason they differ:</p>
<blockquote class="blockquote">
<p><em>“The primary result of inhibition by substrate in a batch culture is an increase in the lag time. However, in the absence of organism death, the substrate will eventually be metabolized. Such is not the case in continuous cultures where high concentrations of inhibitory substrates may result in process instability with ‘washout’ of the organisms.”</em></p>
</blockquote>
<p><strong>The batch claim is testable and not tautological, because the model has no lag phase in it.</strong> Book p.&nbsp;711: <em>“the model has been kept as simple as possible by assuming that there is no lag phase, organism death, endogenous respiration, substrate used for maintenance energy, or inhibition by products.”</em> Whatever lag appears is produced by the kinetics, and can be measured against a no-inhibition control.</p>
<p><strong>The continuous claim is analytic and needs no figure at all.</strong> It is a statement about how many steady states the chemostat has and which of them are stable, and both are settled by root-finding and a 2x2 Jacobian.</p>
</section>
<section id="what-j4.1-left-here-deliberately" class="level3">
<h3 class="anchored" data-anchor-id="what-j4.1-left-here-deliberately">What J4.1 left here deliberately</h3>
<p><code>pages/J4.1-monod/</code> was published immediately before this page and <strong>left substrate inhibition to J4.2 on purpose</strong>. Its <code>data/printed-growth-laws.csv</code> carries two rows it transcribed and then refused to touch:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>key</th>
<th>as printed</th>
<th>its flag</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>froment_inhibition</code></td>
<td><code>r = r_m C_A / (K_S + C_A + C_A^2/K_i)</code></td>
<td><em>“OUT OF SCOPE - belongs to J4.2 (Andrews/Haldane); transcribed only so the scope boundary is checkable”</em></td>
</tr>
<tr class="even">
<td><code>rawlings_substrate_inhibition</code></td>
<td><code>mu = mu_m S / (K_s + S + K_1 S^2)</code></td>
<td><em>“OUT OF SCOPE - J4.2”</em></td>
</tr>
</tbody>
</table>
<p>This page <strong>loads that CSV</strong> rather than retyping either row, proves that both are the same function as Andrews’ eq. (1), and prints every number it shares with J4.1 beside J4.1’s own value. What J4.1 established about those rows, and whether it affects this page, is in <em>The data</em>.</p>
<p>One thing J4.1 could not do, this page’s source does for it. J4.1 recorded that Rawlings &amp; Ekerdt cite their five growth laws to two textbooks, so <em>“nothing on this page is attributed to Blackman, Tessier, Moser or Contois personally”</em>. Andrews’ reference list carries the primary citations for three of those four - Moser (Carnegie Inst. of Washington, 1958), <strong>Teissier</strong> (<em>Ann. Physiol. Physicochim. Biol.</em> <strong>12</strong>, 527, 1936; Rawlings spells the law “Tessier”, and neither spelling is repaired here) and Contois (<em>J. Gen.&nbsp;Microbiol.</em> <strong>21</strong>, 40, 1959). Those are transcribed into this page’s CSV as a service to J4.1 and to whoever builds those cases; <strong>none of them is on disk and none was consulted</strong>, and nothing on this page is attributed to any of them.</p>
</section>
<section id="what-is-not-claimed-here" class="level3">
<h3 class="anchored" data-anchor-id="what-is-not-claimed-here">What is <em>not</em> claimed here</h3>
<ul>
<li><strong>Andrews’ numbers are simulation output, not measurement.</strong> His own p.&nbsp;708: <em>“The solutions presented in this paper were obtained using PACTOLUS on the IBM 360 computer.”</em> Reproducing them is <strong>reproduction</strong>, not validation, and the two stated times he quotes were read off his own plotted curves - <em>“It can be seen that only 12.5 hr are required…”</em> - so they carry his reading precision, not his solver’s.</li>
<li><strong>The paper contains no experimental data at all.</strong> The only measurements it refers to are other people’s, in prose and without numbers. So this page fits nothing, and no number on it is a goodness of fit.</li>
<li><strong>Haldane (1930), Dixon &amp; Webb (1964), Monod (1942), Moser (1958), Teissier (1936), Contois (1959), Koga &amp; Humphrey (1967) and Brennan’s PACTOLUS report are cited by Andrews and are not on disk.</strong> None was consulted. Nothing is attributed to any of them beyond what Andrews prints.</li>
</ul>
<div id="901411db" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:38.697980Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:38.697822Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:39.112986Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:39.112234Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Colab: install pymrm if it is not already present.</span></span>
<span id="cb1-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-3">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: F401</span></span>
<span id="cb1-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pragma: no cover - only on a fresh Colab VM</span></span>
<span id="cb1-5">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm</span></code></pre></div></div>
</div>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Every equation below is transcribed from a 300 ppi render of the page that prints it, and every one is in <code>data/andrews1968-printed-model.csv</code> with its book page. The notebook reads the transcriptions out of that file; it does not retype them.</p>
<p><strong>The inhibition function</strong>, eq. (1), book p.&nbsp;708:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cfrac%7B%5Chat%5Cmu%7D%7B1%20+%20K_s/S%20+%20S/K_i%7D%20%5Ctag%7B1%7D"></p>
<p>and eq. (6), book p.&nbsp;711, which Andrews says he actually computed with - <em>“In developing the block diagram it was more convenient to use the inhibition function in the form”</em>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Chat%5Cmu%5Cleft%5B%5Cfrac%7BS%7D%7BS%5E2/K_i%20+%20S%20+%20K_s%7D%5Cright%5D%20%5Ctag%7B6%7D"></p>
<p>These are the same function. They are <strong>not</strong> the same numerically at <img src="https://latex.codecogs.com/png.latex?S%20=%200">, which is where every batch and every startup simulation in the paper begins, and eq. (6) is the one that is finite there.</p>
<p><strong>The maximum attainable rate and where it sits</strong>, eqs. (2) and (3), book p.&nbsp;709, obtained by Andrews <em>“by setting the first derivative of eq. (1) equal to zero”</em>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu_m%20=%20%5Cfrac%7B%5Chat%5Cmu%7D%7B1%20+%202(K_s/K_i)%5E%7B0.5%7D%7D%20%5Cqquad%20(2)%20%5Cqquad%5Cqquad%0A%20%20S_m%20=%20(K_s%20K_i)%5E%7B0.5%7D%20%5Cqquad%20(3)"></p>
<p><strong>Batch culture</strong>, eqs. (4) and (5), book p.&nbsp;711:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdX%7D%7Bdt%7D%20=%20%5Cmu(S)%5C,X%20%5Cqquad%20(4)%20%5Cqquad%5Cqquad%0A%20%20%5Cfrac%7BdS%7D%7Bdt%7D%20=%20-%5Cfrac%7B1%7D%7BY%7D%5C,%5Cmu(S)%5C,X%20%5Cqquad%20(5)"></p>
<p><strong>Continuous culture</strong>, eqs. (7) and (8), book p.&nbsp;711, for a <em>“complete mixing, continuous-flow reactor”</em>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdX_1%7D%7Bdt%7D%20=%20%5Cfrac%7BX_0%7D%7B%5Ctheta%7D%20-%20%5Cfrac%7BX_1%7D%7B%5Ctheta%7D%20+%20%5Cmu(S_1)%5C,X_1%0A%20%20%5Cqquad%20(7)"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdS_1%7D%7Bdt%7D%20=%20%5Cfrac%7BS_0%7D%7B%5Ctheta%7D%20-%20%5Cfrac%7BS_1%7D%7B%5Ctheta%7D%0A%20%20-%20%5Cfrac%7B1%7D%7BY%7D%5C,%5Cmu(S_1)%5C,X_1%20%5Cqquad%20(8)"></p>
<p><strong>Steady states</strong>, eqs. (9) and (10), book p.&nbsp;712:</p>
<p><img src="https://latex.codecogs.com/png.latex?S_1%20=%20%5Cfrac%7BK_i(%5Chat%5Cmu%5Ctheta%20-%201)%20+%20%5Cleft%5B(K_i)%5E2(%5Chat%5Cmu%5Ctheta%20-%201)%5E2%0A%20%20%20%20%20%20%20%20-%204K_sK_i%5Cright%5D%5E%7B0.5%7D%7D%7B2%7D%20%5Cqquad%20(9)%20%5Cqquad%5Cqquad%0A%20%20X_i%20=%20Y(S_0%20-%20S_1)%20%5Cqquad%20(10)"></p>
<p><strong>Washout residence time</strong>, eq. (11), book p.&nbsp;713:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctheta_w%20=%20%5Cfrac%7B1%7D%7B%5Chat%5Cmu%7D%5Cleft%5B1%20+%202(K_s/K_i)%5E%7B0.5%7D%5Cright%5D%20%5Cqquad%20(11)"></p>
<section id="three-things-about-those-printed-equations" class="level3">
<h3 class="anchored" data-anchor-id="three-things-about-those-printed-equations">Three things about those printed equations</h3>
<p><strong>eq. (9) is printed with a bare <code>+</code>, not <code>±</code>.</strong> Read at digit scale on a 300 ppi crop. The quadratic it solves has two roots and Andrews’ own running text one paragraph later says so - <em>“Two values of substrate and organism concentration are possible for each residence time since the substrate equation is a quadratic”</em>. The root eq. (9) as printed returns is therefore the <strong>higher</strong> one, which this same paper calls unstable. Reported, <strong>not repaired</strong>: this page computes both roots by an independent Brent root-find and checks eq. (9) against the upper one.</p>
<p><strong>eq. (10) is printed <code>X_i = Y(S_0 - S_1)</code>.</strong> The effluent organism concentration is <img src="https://latex.codecogs.com/png.latex?X_1"> in eq. (7), in the symbol list on the same page and in Fig. 8’s curve labels; <img src="https://latex.codecogs.com/png.latex?X_i"> is this paper’s symbol for the <strong>initial inoculum</strong> (p.&nbsp;713, <em>“The initial innoculum <img src="https://latex.codecogs.com/png.latex?(X_i)"> has been chosen as 0.005 g/l”</em>, and Fig. 9’s curve key). A subscript defect, read at digit scale. Reported, <strong>not repaired</strong>; the page writes <img src="https://latex.codecogs.com/png.latex?X_1%20=%20Y(S_0%20-%20S_1)"> and says why. The text layer of this scan turns <code>X_1</code> into <code>XI</code>, so the text layer could never have shown it.</p>
<p><strong>One nuance on that defect, because the symbol convention is not as firm as it looks.</strong> On book p.&nbsp;719 Andrews writes <em>“two different values of initial organism concentration <img src="https://latex.codecogs.com/png.latex?(X_1)">”</em> and then, three lines later, <em>“The process fails when <img src="https://latex.codecogs.com/png.latex?X_i%20=%200.10"> g/l”</em> - <strong>both symbols for the inoculum, on one page</strong>. Both lines were read at digit scale on a 300 ppi crop: the first subscript is an upright <code>1</code>, the second a dotted italic <code>i</code>. That does not weaken the eq. (10) finding - the quantity eq. (10) defines is the <em>effluent</em> concentration whatever he calls the inoculum - but it does mean the argument rests on the symbol list and eq. (7), not on a convention the paper keeps perfectly.</p>
<p><strong>eq. (11) is exactly <img src="https://latex.codecogs.com/png.latex?1/%5Chat%5Cmu_m">.</strong> Not stated in the paper. It is the residence time at which the discriminant of eq. (9) vanishes and the two steady states merge - a fold. The page checks the two agree to <code>0.0</code> in double precision, and then shows that a fold is only <strong>one</strong> of the two ways this chemostat washes out.</p>
</section>
<section id="what-k_s-and-k_i-actually-are" class="level3">
<h3 class="anchored" data-anchor-id="what-k_s-and-k_i-actually-are">What <img src="https://latex.codecogs.com/png.latex?K_s"> and <img src="https://latex.codecogs.com/png.latex?K_i"> actually are</h3>
<p>Andrews defines them on book p.&nbsp;709 as half-rate concentrations: <img src="https://latex.codecogs.com/png.latex?K_s"> <em>“numerically equals lowest concentration of substrate at which the specific growth rate is equal to one-half the maximum specific growth rate in the absence of inhibition”</em>, and <img src="https://latex.codecogs.com/png.latex?K_i"> <em>“the highest”</em> such concentration. Set eq. (1) equal to <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu/2"> and the two roots are</p>
<p><img src="https://latex.codecogs.com/png.latex?S_%5Cpm%20=%20%5Ctfrac12%20K_i%5Cleft(1%20%5Cpm%20%5Csqrt%7B1%20-%204K_s/K_i%7D%5Cright),"></p>
<p>so the definitions are exact only as <img src="https://latex.codecogs.com/png.latex?K_s/K_i%20%5Cto%200">, and they have <strong>no solution at all</strong> unless <img src="https://latex.codecogs.com/png.latex?K_i%20%5Cge%204K_s"> - which is exactly the condition under which his own eq. (2) gives <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu_m%20%5Cge%20%5Chat%5Cmu/2">. <strong>How far out they are depends on which of his three printed <img src="https://latex.codecogs.com/png.latex?K_i"> you take</strong>, and the cell below prints all three: at the <img src="https://latex.codecogs.com/png.latex?K_i%20=%202.0"> g/l of Figs. 6-10, which is this page’s case, they are out by +1.5468 % and -1.5232 %; at the <img src="https://latex.codecogs.com/png.latex?K_i%20=%201.0"> g/l of his Fig. 4 by +3.1947 % and -3.0958 %; and at the <img src="https://latex.codecogs.com/png.latex?K_i%20=%200.50"> g/l of his Fig. 1 by <strong>+6.8502 % and -6.4110 %</strong>. Quoting only the mildest of the three - the value this page happens to use - understates the approximation more than fourfold, so the table is printed in full. This is <strong>not</strong> filed as a printed defect: it is an approximation, not a misprint, and the nearest thing in the paper to a qualification is on the same page - <em>“even when <img src="https://latex.codecogs.com/png.latex?K_s"> and <img src="https://latex.codecogs.com/png.latex?K_i"> are well separated there is a considerable reduction in the maximum specific growth rate attainable”</em>. The page supplies the number and the exact condition and does <strong>not</strong> claim Andrews was unaware.</p>
<div id="f043f56c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:39.115773Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:39.115390Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:39.679059Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:39.678400Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> json</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_ivp</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb2-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> identity <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> speye</span>
<span id="cb2-12"></span>
<span id="cb2-13"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (NumJac, compute_boundary_values, construct_convflux_upwind,</span>
<span id="cb2-14">                   construct_div, newton)</span>
<span id="cb2-15"></span>
<span id="cb2-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gallery_utils: from the checkout when there is one, from raw GitHub on Colab</span></span>
<span id="cb2-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb2-18">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb2-19">    urllib.request.urlretrieve(</span>
<span id="cb2-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb2-21">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb2-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb2-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents):</span>
<span id="cb2-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb2-25">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))</span>
<span id="cb2-26">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb2-27"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> cite_data, load_data, load_meta, report_agreement</span>
<span id="cb2-28"></span>
<span id="cb2-29">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.2-andrews-substrate-inhibition"</span></span>
<span id="cb2-30">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb2-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, assigned in fixed order and never cycled</span></span>
<span id="cb2-32">C_BLUE, C_ORANGE, C_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span></span>
<span id="cb2-33">C_PURPLE, C_YELLOW, C_GREY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span></span>
<span id="cb2-34"></span>
<span id="cb2-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: nothing on this page is stochastic.  No sampling, no bootstrap,</span></span>
<span id="cb2-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># no random initial guess.  Two consecutive executions give identical content.</span></span>
<span id="cb2-37">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb2-38"></span>
<span id="cb2-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --------------------------------------------------------- the transcriptions</span></span>
<span id="cb2-40">PRN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"andrews1968-printed-model.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb2-41">PMETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"andrews1968-printed-model.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb2-42"></span>
<span id="cb2-43"></span>
<span id="cb2-44"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> printed(key, field<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>):</span>
<span id="cb2-45">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The verbatim transcription, looked up - never retyped in a cell."""</span></span>
<span id="cb2-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(PRN.loc[key, field])</span>
<span id="cb2-47"></span>
<span id="cb2-48"></span>
<span id="cb2-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(PMETA))</span>
<span id="cb2-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PRN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> transcribed rows, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(PRN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'flag'</span>].notna().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> flagged</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb2-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (1)  p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1"</span>)))</span>
<span id="cb2-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (6)  p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6"</span>)))</span>
<span id="cb2-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (2)  p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2"</span>)))</span>
<span id="cb2-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3)  p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3"</span>)))</span>
<span id="cb2-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (9)  p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq9"</span>)))</span>
<span id="cb2-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (10) p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq10"</span>)))</span>
<span id="cb2-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (11) p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> :  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PRN.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>], printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11"</span>)))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Andrews, J. F. (1968) — "A Mathematical Model for the Continuous Culture of Microorganisms Utilizing Inhibitory Substrates", Biotechnology and Bioengineering 10(6) 707-723 (1968), Environmental Systems Engineering, Clemson University
 — doi:10.1002/bit.260100602 — transcription
51 transcribed rows, 40 flagged

eq. (1)  p.708 :  mu = muhat / (1 + K_s/S + S/K_i)
eq. (6)  p.711 :  mu = muhat [ S / ( (S)^2/K_i + S + K_s ) ]
eq. (2)  p.709 :  muhat_m = muhat / (1 + 2 (K_s/K_i)^0.5)
eq. (3)  p.709 :  S_m = (K_s K_i)^0.5
eq. (9)  p.712 :  S_1 = { K_i(muhat theta - 1) + [ (K_i)^2 (muhat theta - 1)^2 - 4 K_s K_i ]^0.5 } / 2
eq. (10) p.712 :  X_i = Y(S_0 - S_1)
eq. (11) p.713 :  theta_w = (1/muhat)[ 1 + 2 (K_s/K_i)^0.5 ]</code></pre>
</div>
</div>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Every constant used on this page is printed by Andrews, in a typeset figure legend or in running text.</strong> Nothing is fitted, nothing is inferred, nothing is read off a curve. The legends were read at digit scale on 300 ppi crops; three of the pages carrying them (PDF 8, 12, 15 - Figs. 4, 7, 9) are landscape in the file and <code>pdftoppm</code> returns them rotated, so those crops were rotated back before reading.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>symbol</th>
<th>value</th>
<th>units as printed</th>
<th>where</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu"></td>
<td>1.0</td>
<td><code>HR^-1</code></td>
<td>every legend that carries it (Figs. 1, 4-10)</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?K_s"></td>
<td>0.03</td>
<td><code>GM/L</code></td>
<td>every legend that carries it</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?K_i"></td>
<td>2.0</td>
<td><code>GM/L</code></td>
<td>Figs. 6, 7, 8, 9, 10 legends</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?Y"></td>
<td>0.5</td>
<td><code>GM/GM</code> in Figs. 5, 6, 8, 9, 10; <strong><code>GM/L</code> in Figs. 4 and 7</strong></td>
<td>see below</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Ctheta"></td>
<td>3</td>
<td><code>HRS</code></td>
<td>Figs. 8, 9, 10 legends</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?S_0"></td>
<td>5</td>
<td><code>GM/L</code></td>
<td>Figs. 8, 9, 10 legends</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?S_i"></td>
<td>10.0</td>
<td><code>GM/L</code></td>
<td>Figs. 5, 6 legends; and the p.&nbsp;715 sentence</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?X_i"></td>
<td>0.005</td>
<td><code>GM/L</code></td>
<td>Figs. 5, 7 legends; and p.&nbsp;713</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?X_0"></td>
<td><strong>never given a value</strong></td>
<td>-</td>
<td>defined in eq. (7)’s symbol list only</td>
</tr>
</tbody>
</table>
<p><strong>The <code>GM/L</code> on the yield in two legends is a printed defect, reported and not repaired.</strong> <img src="https://latex.codecogs.com/png.latex?Y"> is defined on book p.&nbsp;711 as <em>“yield coefficient, mass organisms produced/mass substrate utilized”</em>, i.e.&nbsp;dimensionless, and eq. (5) requires it so - <img src="https://latex.codecogs.com/png.latex?dS/dt"> and <img src="https://latex.codecogs.com/png.latex?dX/dt"> have the same units, so <img src="https://latex.codecogs.com/png.latex?Y"> cannot carry any. The constraint that decides it is that printed definition together with the dimensions of eq. (5), not the five-to-two count across the legends. <strong>The numeral 0.5 is not in question, only the unit.</strong> Both offending legends are recorded in the CSV with the defect on the row.</p>
<p><strong><img src="https://latex.codecogs.com/png.latex?X_0%20=%200"> throughout, and that is this page’s assumption, not Andrews’.</strong> He defines <img src="https://latex.codecogs.com/png.latex?X_0"> in eq. (7) and never gives it a value: a full-text search of the extracted layer for <code>X0</code>, <code>X 0</code> and <code>influent</code>, plus a read of all seventeen 300 ppi renders, finds no numeral for it and no legend carrying it. Sterile feed is the only reading under which his Fig. 8-10 experiments make sense, because washout is impossible when <img src="https://latex.codecogs.com/png.latex?X_0%20%3E%200">. The page states this everywhere it matters, and then computes what a non-zero <img src="https://latex.codecogs.com/png.latex?X_0"> would do, clearly labelled as an extension.</p>
<p><strong>Two initial conditions are not printed either</strong>, and the page says which assumption it makes and how much the answer depends on it:</p>
<ul>
<li><strong>Fig. 9’s <img src="https://latex.codecogs.com/png.latex?S_1(0)">.</strong> Andrews says only that <em>“at time 0+ the reactor is abruptly converted from a batch reactor to a continuous-flow reactor”</em>. The page takes <img src="https://latex.codecogs.com/png.latex?S_1(0)%20=%200"> - a batch that has finished - and reports the threshold’s sensitivity across <img src="https://latex.codecogs.com/png.latex?S_1(0)%20%5Cin%20%5B0,%200.2%5D"> g/l.</li>
<li><strong>Fig. 10’s initial state.</strong> The page takes the stable steady state at <img src="https://latex.codecogs.com/png.latex?S_0%20=%205">, <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%203"> h, which is the only state from which <em>“during continuous-flow operation”</em> makes sense.</li>
</ul>
<p><strong>One sentence with three literal readings, settled by Andrews’ own figure.</strong> Book p.&nbsp;715 describes the acclimation procedure as <em>“a substrate concentration of 2.0 g/l with the substrate concentration being increased in 2.0 g/l steps after reduction in each case to 0.02 g/l”</em>. In isolation that supports three readings: <strong>reset</strong> the substrate to 2.0 each cycle, <strong>increment</strong> it by 2.0 from the 0.02 g/l left at the end of the previous cycle, or step the <em>initial</em> concentration up a <strong>ladder</strong> 2.0, 4.0, 6.0 g/l. They are not equivalent: the three give 12.366419 h, 12.371597 h and 13.794022 h, a raw spread of <strong>11.5442 %</strong> against Andrews’ printed 12.5 hr.</p>
<p><strong>Fig. 7 settles it, and it is not ambiguous once you read the figure.</strong> The typeset annotation inside Fig. 7 - the very figure the p.&nbsp;715 sentence is about - reads</p>
<blockquote class="blockquote">
<p><code>REPEATED ORGANISM SEPARATION &amp; DILUTION. S_i ADDED IN INCREMENTS OF 2.0 GM/L</code></p>
</blockquote>
<p>read at digit scale on a 300 ppi crop of the rotated landscape page and transcribed into <code>data/andrews1968-printed-model.csv</code> as <code>fig7_annotation</code>. <em>Added in increments of 2.0</em> is the increment reading: each cycle adds 2.0 g/l of substrate to what is left, so it starts at 2.02 g/l rather than at 2.0. The ladder reading would add 2.0, then 4.0, then 6.0 - not <em>increments of 2.0</em> - and is excluded. <strong>The increment reading is therefore the one reported</strong>, at 12.371597 h; the reset reading is kept and priced as the near neighbour it is (0.0419 % away), and the ladder reading is reported as the one the annotation rules out.</p>
<div id="0667f671" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:39.681750Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:39.681609Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:39.854843Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:39.854017Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------- Andrews' printed constants</span></span>
<span id="cb4-2">MU_HAT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># muhat, HR^-1        Figs. 1, 4-10 legends</span></span>
<span id="cb4-3">K_S    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># K_s,   GM/L         Figs. 1, 4-10 legends</span></span>
<span id="cb4-4">K_I    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># K_i,   GM/L         Figs. 6-10 legends</span></span>
<span id="cb4-5">YIELD  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Y,     GM/GM        Figs. 5, 6, 8, 9, 10 legends (see prose)</span></span>
<span id="cb4-6">THETA  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># theta, HRS          Figs. 8, 9, 10 legends</span></span>
<span id="cb4-7">S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># S_0,   GM/L         Figs. 8, 9, 10 legends</span></span>
<span id="cb4-8">S_INIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># S_i,   GM/L         Figs. 5, 6 legends</span></span>
<span id="cb4-9">X_INIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># X_i,   GM/L         Figs. 5, 7 legends</span></span>
<span id="cb4-10">X_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># X_0 - NEVER PRINTED.  Sterile feed is THIS PAGE's assumption.</span></span>
<span id="cb4-11"></span>
<span id="cb4-12"></span>
<span id="cb4-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mu(S, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT):</span>
<span id="cb4-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Andrews eq. (6): muhat S/(S^2/K_i + S + K_s).</span></span>
<span id="cb4-15"></span>
<span id="cb4-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Algebraically eq. (1), but finite at S = 0, which is where the batch and</span></span>
<span id="cb4-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    startup simulations start.  Andrews used this form too - p. 711.</span></span>
<span id="cb4-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb4-19">    S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(S, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb4-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Ks)</span>
<span id="cb4-21"></span>
<span id="cb4-22"></span>
<span id="cb4-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mu_eq1(S, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT):</span>
<span id="cb4-24">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Andrews eq. (1) as printed: muhat/(1 + K_s/S + S/K_i)."""</span></span>
<span id="cb4-25">    S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(S, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb4-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> np.errstate(divide<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>):</span>
<span id="cb4-27">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki)</span>
<span id="cb4-28"></span>
<span id="cb4-29"></span>
<span id="cb4-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mu_monod(S, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT):</span>
<span id="cb4-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The K_i -&gt; infinity limit.  J4.1's law, same two constants."""</span></span>
<span id="cb4-32">    S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(S, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb4-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)</span>
<span id="cb4-34"></span>
<span id="cb4-35"></span>
<span id="cb4-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (1) == eq. (6), symbolically</span></span>
<span id="cb4-37">_S, _Ks, _Ki, _mh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S K_s K_i muhat"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb4-38">EQ1_EQ6_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(_mh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki)</span>
<span id="cb4-39">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _mh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks))</span>
<span id="cb4-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  eq.(1) - eq.(6)  ="</span>, EQ1_EQ6_RESID)</span>
<span id="cb4-41"></span>
<span id="cb4-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eqs. (2) and (3) re-derived from eq. (1)</span></span>
<span id="cb4-43">_dmu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.diff(_mh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks), _S)</span>
<span id="cb4-44">_Sm_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [s <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sp.solve(sp.numer(sp.together(_dmu)), _S) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s.is_positive][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb4-45">EQ3_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(_Sm_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.sqrt(_Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_Ki))</span>
<span id="cb4-46">EQ2_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.simplify((_mh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks)).subs(_S, _Sm_sym))</span>
<span id="cb4-47">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _mh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.sqrt(_Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki)))</span>
<span id="cb4-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  eq.(3) residual  ="</span>, EQ3_RESID)</span>
<span id="cb4-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  eq.(2) residual  ="</span>, EQ2_RESID)</span>
<span id="cb4-50"></span>
<span id="cb4-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># numbers</span></span>
<span id="cb4-52">MU_HAT_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I))       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (2)</span></span>
<span id="cb4-53">S_M      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (3)</span></span>
<span id="cb4-54">THETA_W  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I))    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (11)</span></span>
<span id="cb4-55">EQ11_MINUS_INV_EQ2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> THETA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT_M</span>
<span id="cb4-56"></span>
<span id="cb4-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># root-find dmu/dS = 0 on the ANALYTIC derivative, so this is a Brent root at</span></span>
<span id="cb4-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># machine precision and not an optimiser's exit tolerance.</span></span>
<span id="cb4-59"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _dmu_dS(S, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT):</span>
<span id="cb4-60">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Ks</span>
<span id="cb4-61">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>d)</span>
<span id="cb4-62"></span>
<span id="cb4-63"></span>
<span id="cb4-64">S_M_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_dmu_dS, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-17</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb4-65">MU_HAT_M_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S_M_ROOT))</span>
<span id="cb4-66"></span>
<span id="cb4-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eq.(2)  muhat_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MU_HAT_M<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h   root-found max = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MU_HAT_M_ROOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq.(3)  S_m     = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_M<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l   root-found argmax = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_M_ROOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq.(11) theta_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h    1/muhat_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT_M<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span></span>
<span id="cb4-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   difference = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ11_MINUS_INV_EQ2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-71"></span>
<span id="cb4-72"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the half-rate definitions of K_s and K_i, tested against eq. (1) at ALL THREE</span></span>
<span id="cb4-73"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of the K_i values Andrews prints - the approximation is mildest at the one his</span></span>
<span id="cb4-74"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># continuous-culture figures use, so quoting only that one understates it 4x.</span></span>
<span id="cb4-75"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> half_rate_roots(Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S):</span>
<span id="cb4-76">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""exact roots of eq. (1) = muhat/2; they exist only for K_i &gt;= 4 K_s"""</span></span>
<span id="cb4-77">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki)</span>
<span id="cb4-78">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb4-79"></span>
<span id="cb4-80"></span>
<span id="cb4-81">HALF_LO, HALF_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_rate_roots(K_I)</span>
<span id="cb4-82">HALF_LO_BRENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, S_M,</span>
<span id="cb4-83">                       xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb4-84">HALF_HI_BRENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, S_M, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>,</span>
<span id="cb4-85">                       xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb4-86">KS_DEF_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (HALF_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_S</span>
<span id="cb4-87">KI_DEF_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (HALF_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I</span>
<span id="cb4-88">KI_MIN_FOR_DEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_S</span>
<span id="cb4-89">HALF_TABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb4-90"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _Ki, _where <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Figs. 6-10 (this page's case)"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 4"</span>),</span>
<span id="cb4-91">                    (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 1"</span>)):</span>
<span id="cb4-92">    _lo, _hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_rate_roots(_Ki)</span>
<span id="cb4-93">    HALF_TABLE.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(K_i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_Ki, low<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_lo, high<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_hi, ks_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_S,</span>
<span id="cb4-94">                           ki_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _Ki)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki, where<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_where))</span>
<span id="cb4-95">KS_DEF_ERR_FIG1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> HALF_TABLE[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ks_err"</span>]</span>
<span id="cb4-96">KI_DEF_ERR_FIG1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> HALF_TABLE[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ki_err"</span>]</span>
<span id="cb4-97"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">half-rate roots of eq.(1) at Andrews' THREE printed K_i:"</span>)</span>
<span id="cb4-98"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'K_i'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'low root'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'high root'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vs K_s'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vs K_i'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   where"</span>)</span>
<span id="cb4-100"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> HALF_TABLE:</span>
<span id="cb4-101">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'K_i'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'low'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'high'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb4-102">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ks_err'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+9.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ki_err'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+9.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'where'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-103"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; the approximation is MILDEST at K_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_I<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the value this page"</span></span>
<span id="cb4-104">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" uses: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KS_DEF_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI_DEF_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb4-105"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     and reaches </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KS_DEF_ERR_FIG1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI_DEF_ERR_FIG1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the"</span></span>
<span id="cb4-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" K_i = 0.50 g/l of his own Fig. 1."</span>)</span>
<span id="cb4-107"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the definitions have a solution only if K_i &gt;= 4 K_s = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI_MIN_FOR_DEF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l,"</span></span>
<span id="cb4-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  which is also eq.(2)'s condition for muhat_m &gt;= muhat/2"</span>)</span>
<span id="cb4-109"></span>
<span id="cb4-110"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (1) at S = 0 is the reason Andrews rewrote it as eq. (6)</span></span>
<span id="cb4-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eq.(1) at S=0 : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu_eq1(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      "</span></span>
<span id="cb4-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq.(6) at S=0 : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq.(1) vs eq.(6), max |rel| over S in [1e-6, 100]: "</span></span>
<span id="cb4-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mu_eq1(np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mu(np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>sympy  eq.(1) - eq.(6)  = 0
sympy  eq.(3) residual  = 0
sympy  eq.(2) residual  = 0

eq.(2)  muhat_m = 0.8032457720 1/h   root-found max = 0.8032457720
eq.(3)  S_m     = 0.2449489743 g/l   root-found argmax = 0.2449489743
eq.(11) theta_w = 1.2449489743 h    1/muhat_m = 1.2449489743 h   difference = np.float64(0.0)

half-rate roots of eq.(1) at Andrews' THREE printed K_i:
    K_i      low root    high root     vs K_s    vs K_i   where
   2.00      0.030464     1.969536   +1.5468%  -1.5232%   Figs. 6-10 (this page's case)
   1.00      0.030958     0.969042   +3.1947%  -3.0958%   Fig. 4
   0.50      0.032055     0.467945   +6.8502%  -6.4110%   Fig. 1
  -&gt; the approximation is MILDEST at K_i = 2, the value this page uses: +1.5468% / -1.5232%,
     and reaches +6.8502% / -6.4110% at the K_i = 0.50 g/l of his own Fig. 1.
  the definitions have a solution only if K_i &gt;= 4 K_s = 0.12 g/l,  which is also eq.(2)'s condition for muhat_m &gt;= muhat/2

eq.(1) at S=0 : 0.0      eq.(6) at S=0 : 0.0
eq.(1) vs eq.(6), max |rel| over S in [1e-6, 100]: 4.441e-16</code></pre>
</div>
</div>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p><strong>There are no data.</strong> Andrews reports no measurement of any kind; the only experimental work he refers to is other people’s, in prose and without numbers (Boon and Laudelout on <em>Nitrobacter winogradskyi</em>, p.&nbsp;708). So this page fits nothing and no number on it is a goodness of fit. What it has instead is <strong>Andrews’ own printed constants, his two stated numerical results and the six stated outcomes of his three continuous-culture experiments</strong>, and the question is whether those stated results follow from his stated model.</p>
<p><code>data/andrews1968-printed-model.csv</code> is the transcription: every equation, every figure-legend parameter set and every claim this page uses, verbatim, with the printed book page each came from and a flag on every row that carries a defect or an oddity. Its sidecar records the negative claims above and how each was checked.</p>
<section id="the-one-csv-borrowed-from-another-page-and-what-that-page-found-about-it" class="level3">
<h3 class="anchored" data-anchor-id="the-one-csv-borrowed-from-another-page-and-what-that-page-found-about-it">The one CSV borrowed from another page, and what that page found about it</h3>
<p>This page loads <code>printed-growth-laws.csv</code> from <code>pages/J4.1-monod/</code>. Per <code>AGENTS.md</code> that means reading J4.1’s findings about the rows used, and saying whether each affects this page:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>J4.1’s finding</th>
<th>affects this page?</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>froment_inhibition</code> and <code>rawlings_substrate_inhibition</code> are flagged <strong>“OUT OF SCOPE - belongs to J4.2”</strong>, transcribed only so the boundary is checkable, and are <em>“not fitted, evaluated or compared anywhere on this page”</em></td>
<td><strong>Yes, directly</strong> - they are the two rows this page picks up. This page evaluates them and proves both equal Andrews’ eq. (1).</td>
</tr>
<tr class="even">
<td>Froment’s clean born-digital text layer <strong>loses every operator in an equation</strong> to unmappable Private-Use-Area glyphs (<code>U+F02D</code>, <code>U+F03D</code>, <code>U+F02B</code>), so an extracted equation looks complete and has no operators at all</td>
<td><strong>No</strong> - Andrews is a bilevel scan, not born-digital, and everything here was read on a render anyway. But it is the reason <code>froment_inhibition</code> is trusted: J4.1 read it on a 300 ppi render, not off the text layer.</td>
</tr>
<tr class="odd">
<td><code>froment_rm_definition</code>: <em>“<img src="https://latex.codecogs.com/png.latex?r_m"> is the maximum specific rate of biomass growth, i.e., the rate when the substrate concentration is not limiting”</em></td>
<td><strong>Yes, and it is a trap.</strong> That definition belongs to Froment’s Monod eq. (1.5.2-1). Carried across to his inhibition eq. (1.5.2-4) it is <strong>false</strong>: the maximum of that function is <img src="https://latex.codecogs.com/png.latex?r_m/(1%20+%202%5Csqrt%7BK_S/K_i%7D)">, Andrews’ eq. (2). The page quantifies the gap.</td>
</tr>
<tr class="even">
<td><code>froment_asymptote</code>: <em>“In this case <img src="https://latex.codecogs.com/png.latex?r"> … exhibits a maximum, whereas with Monod-kinetics it tends to an asymptotic value”</em>, flagged <em>“the quantitative treatment is J4.2’s”</em></td>
<td><strong>Yes</strong> - Froment states the maximum exists and prints no formula for it. Andrews’ eq. (2) is that formula.</td>
</tr>
<tr class="odd">
<td>J4.1’s Levenspiel batch table has a flagged row 4 and a printed-cell defect</td>
<td><strong>No</strong> - this page uses none of Levenspiel’s rows and fits nothing.</td>
</tr>
<tr class="even">
<td>J4.1: <em>“Rawlings &amp; Ekerdt cite the five growth laws to two textbooks, not to their originators”</em></td>
<td><strong>No, but this page adds to it</strong> - Andrews’ reference list carries the primary citations for Moser, Teissier and Contois. Transcribed here, not consulted.</td>
</tr>
</tbody>
</table>
<p><strong>Nothing that is a row in either CSV is retyped in prose on this page.</strong> Where a number exists in both, both are printed and reconciled.</p>
<div id="48f2b173" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:39.856963Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:39.856772Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:39.902416Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:39.901681Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --------------------------------- the two rows J4.1 transcribed and left here</span></span>
<span id="cb6-2">J41 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed-growth-laws.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1-monod"</span>).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb6-3">J41META <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed-growth-laws.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1-monod"</span>)</span>
<span id="cb6-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"borrowed from pages/J4.1-monod/ :"</span>, J41META[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataset_id"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>,</span>
<span id="cb6-5">      J41META[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"title"</span>].strip().splitlines()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"..."</span>)</span>
<span id="cb6-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (its `source` is a THREE-KEYED mapping, one book per CSV row, so"</span></span>
<span id="cb6-7">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" cite_data's flat schema does not apply)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_inhibition"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_substrate_inhibition"</span>):</span>
<span id="cb6-9">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'source'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:28s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-10">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as printed : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-11">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> J4.1 flag  : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'flag'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-12"></span>
<span id="cb6-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE THREE PRINTED FORMS ARE ONE FUNCTION.  sympy, not assertion by eye.</span></span>
<span id="cb6-14">_rm, _K1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_m K_1"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb6-15">ANDREWS_1  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _mh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Andrews eq. (1)</span></span>
<span id="cb6-16">FROMENT_4  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki)                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Froment (1.5.2-4)</span></span>
<span id="cb6-17">RAWLINGS_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _K1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rawlings, p. 596</span></span>
<span id="cb6-18">FROMENT_RESID  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(ANDREWS_1.subs(_mh, _rm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FROMENT_4)</span>
<span id="cb6-19">RAWLINGS_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(ANDREWS_1.subs(_mh, _rm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RAWLINGS_S.subs(_K1, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki))</span>
<span id="cb6-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  Andrews eq.(1) - Froment eq.(1.5.2-4)          ="</span>, FROMENT_RESID)</span>
<span id="cb6-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  Andrews eq.(1) - Rawlings, with K_1 = 1/K_i    ="</span>, RAWLINGS_RESID)</span>
<span id="cb6-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"so Froment's r_m IS Andrews' muhat, and Rawlings' K_1 IS 1/K_i."</span>)</span>
<span id="cb6-23"></span>
<span id="cb6-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and Froment's OWN definition of r_m does not survive the crossing.</span></span>
<span id="cb6-25">FROMENT_RM_CLAIM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(J41.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_rm_definition"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>])</span>
<span id="cb6-26">RM_OVERSTATEMENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb6-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">J4.1 row froment_rm_definition, verbatim:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FROMENT_RM_CLAIM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span>
<span id="cb6-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  true maximum of the inhibition form (eq. 2) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MU_HAT_M<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h"</span>)</span>
<span id="cb6-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  r_m as printed                              = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MU_HAT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h"</span>)</span>
<span id="cb6-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; reading r_m as 'the maximum' overstates it by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RM_OVERSTATEMENT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb6-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at Andrews' constants"</span>)</span>
<span id="cb6-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  J4.1 row froment_asymptote says the max exists and prints no formula:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span></span>
<span id="cb6-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_asymptote"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>borrowed from pages/J4.1-monod/ : printed-growth-laws - Every equation and prose claim this page reads, transcribed verbatim from the three books, with the page and equation number each came from. ...
  (its `source` is a THREE-KEYED mapping, one book per CSV row, so cite_data's flat schema does not apply)

froment_inhibition               Froment-DeWilde-Bischoff-2011 p.27
                                 as printed : r = r_m C_A / (K_S + C_A + C_A^2/K_i)
                                 J4.1 flag  : OUT OF SCOPE - belongs to J4.2 (Andrews/Haldane); transcribed only so the scope boundary is checkable

rawlings_substrate_inhibition    Rawlings-Ekerdt-2025         p.596
                                 as printed : substrate inhibition: mu = mu_m S / (K_s + S + K_1 S^2)
                                 J4.1 flag  : OUT OF SCOPE - J4.2

sympy  Andrews eq.(1) - Froment eq.(1.5.2-4)          = 0
sympy  Andrews eq.(1) - Rawlings, with K_1 = 1/K_i    = 0
so Froment's r_m IS Andrews' muhat, and Rawlings' K_1 IS 1/K_i.

J4.1 row froment_rm_definition, verbatim:
  "r_m is the maximum specific rate of biomass growth, i.e., the rate when the substrate concentration is not limiting (C_A much larger than K_S)"
  true maximum of the inhibition form (eq. 2) = 0.8032457720 1/h
  r_m as printed                              = 1.0000000000 1/h
  -&gt; reading r_m as 'the maximum' overstates it by +24.4949% at Andrews' constants
  J4.1 row froment_asymptote says the max exists and prints no formula:
  "In this case r, when plotted versus the substrate concentration, exhibits a maximum, whereas with Monod-kinetics it tends to an asymptotic value."</code></pre>
</div>
</div>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>The physics here is 0-D in space and two fields wide, so the pymrm content is <code>NumJac</code> + <code>newton</code> on a <img src="https://latex.codecogs.com/png.latex?(1,%202)"> state and, for the plug-flow comparison, <code>construct_convflux_upwind</code> + <code>construct_div</code> + <code>compute_boundary_values</code> on an <img src="https://latex.codecogs.com/png.latex?(n,%202)"> one. Four routes are built, and <strong>they are used to check each other</strong>:</p>
<ol type="1">
<li><p><strong>A closed form for the batch time.</strong> Constant yield makes eqs. (4)-(5) a single autonomous ODE, so the time from <img src="https://latex.codecogs.com/png.latex?X_i"> to <img src="https://latex.codecogs.com/png.latex?X_f"> is a quadrature - and the integrand is a rational function, so the quadrature is elementary. Partial fractions give</p>
<p><img src="https://latex.codecogs.com/png.latex?t%20=%20%5Cfrac%7B1%7D%7B%5Chat%5Cmu%7D%5Cleft%5B%5Cfrac%7BS_f%20-%20S_i%7D%7BK_i%7D%0A%20%20%20%20%20+%20%5Cfrac%7BK_s%7D%7Ba%7D%5Cln%5Cfrac%7BS_i%7D%7BS_f%7D%0A%20%20%20%20%20+%20%5Cleft(1%20+%20%5Cfrac%7Ba%7D%7BK_i%7D%20+%20%5Cfrac%7BK_s%7D%7Ba%7D%5Cright)%5Cln%5Cfrac%7BX_f%7D%7BX_i%7D%5Cright%5D,%0A%20%20%5Cqquad%20a%20=%20S_i%20+%20%5Cfrac%7BX_i%7D%7BY%7D,%20%5Cquad%20S%20=%20a%20-%20%5Cfrac%7BX%7D%7BY%7D."></p>
<p>Derived below and verified in sympy: the partial-fraction residual and the antiderivative residual are both exactly <code>0</code>. <strong>This shares no code with any solver</strong>, which is what makes it a second route rather than a second run.</p></li>
<li><p><strong><code>solve_ivp</code> (LSODA)</strong> on eqs. (4)-(5) and on eqs. (7)-(8).</p></li>
<li><p><strong>A pymrm backward-Euler marcher</strong>, <code>NumJac((1, 2))</code> + <code>newton</code>, on eqs. (7)-(8). The dilution terms are linear, so the constant part of the operator is assembled <strong>once</strong> outside the step loop and only the growth term goes through <code>NumJac</code>; the shape is <code>(1, 2)</code>, never a bare <code>(2,)</code>, so the default stencil couples the two fields in full and nothing else.</p></li>
<li><p><strong>A pymrm plug-flow fermenter</strong>, <code>construct_convflux_upwind</code> + <code>construct_div</code> (<code>nu=0</code>, Cartesian) + <code>NumJac((n, 2))</code> + <code>newton</code>, whose outlet is read with <code>compute_boundary_values</code> and never off the last cell centre. It exists to answer a question Andrews raises and does not settle.</p></li>
</ol>
<p>Boundary conditions are on the <strong>outward normal</strong>, and the physical equation is written beside each one in the code.</p>
<div id="665c2b0b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:39.904879Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:39.904688Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:39.978468Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:39.977641Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------- 1. the batch closed form</span></span>
<span id="cb8-2">_a, _Y, _X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a Y X"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-3">_integrand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _S))</span>
<span id="cb8-4">_Bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_a</span>
<span id="cb8-5">_decomp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (_Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _Bc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _S)</span>
<span id="cb8-6">PF_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(_integrand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _decomp)</span>
<span id="cb8-7">_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (_Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(_S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _Bc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _S)</span>
<span id="cb8-8">ANTIDERIV_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(_F, _S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _integrand)</span>
<span id="cb8-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  partial-fraction residual ="</span>, PF_RESID)</span>
<span id="cb8-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy  antiderivative residual   ="</span>, ANTIDERIV_RESID)</span>
<span id="cb8-11"></span>
<span id="cb8-12"></span>
<span id="cb8-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> t_batch(Xi, Xf, Si, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD):</span>
<span id="cb8-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""CLOSED FORM.  Time for batch biomass to go from Xi to Xf.  No solver."""</span></span>
<span id="cb8-15">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Si <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Xi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv</span>
<span id="cb8-16">    Sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv</span>
<span id="cb8-17">    B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a</span>
<span id="cb8-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((Sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Si)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log(Si<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Sf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log(Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xi))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>muh</span>
<span id="cb8-19"></span>
<span id="cb8-20"></span>
<span id="cb8-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------- 2. the same thing by LSODA</span></span>
<span id="cb8-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> batch_ivp(Xi, Xf, Si, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>):</span>
<span id="cb8-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eqs. (4)-(5) marched until X reaches Xf.  Event, not a grid read."""</span></span>
<span id="cb8-24">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs(t, y):</span>
<span id="cb8-25">        S, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb8-26">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Ks)</span>
<span id="cb8-27">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X]</span>
<span id="cb8-28">    hit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xf            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb8-29">    hit.terminal, hit.direction <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb8-30">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>], [Si, Xi], events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hit, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,</span>
<span id="cb8-31">                  method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb8-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.t_events[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch never reached Xf"</span></span>
<span id="cb8-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.t_events[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-34"></span>
<span id="cb8-35"></span>
<span id="cb8-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------- 3. pymrm backward-Euler CSTR</span></span>
<span id="cb8-37"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> ChemostatMarch:</span>
<span id="cb8-38">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Backward Euler on Andrews eqs. (7)-(8) with pymrm's newton + NumJac.</span></span>
<span id="cb8-39"></span>
<span id="cb8-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Shape (1, 2): a completely mixed reactor is 0-D in space and 2 fields wide,</span></span>
<span id="cb8-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    and the growth term is pointwise in those 2 fields - which is exactly</span></span>
<span id="cb8-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    NumJac's default stencil.  NEVER a bare (2,): that would make space the last</span></span>
<span id="cb8-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    axis and build a dense Jacobian for no reason.</span></span>
<span id="cb8-44"></span>
<span id="cb8-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The dilution terms of eqs. (7)-(8) are LINEAR, so their operator is built</span></span>
<span id="cb8-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    once here and never inside the step loop; only the growth term goes through</span></span>
<span id="cb8-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    NumJac.</span></span>
<span id="cb8-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-49"></span>
<span id="cb8-50">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_FEED, X0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_FEED, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, nstep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>):</span>
<span id="cb8-51">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.S0, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.X0, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Ki, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.nstep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> theta, S0, X0, Ki, nstep</span>
<span id="cb8-52">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (cells, fields) = (S, X)</span></span>
<span id="cb8-53">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># last axis coupled in full</span></span>
<span id="cb8-54">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> speye(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># constant, assembled once</span></span>
<span id="cb8-55">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.inflow <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[S0, X0]])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># constant, assembled once</span></span>
<span id="cb8-56"></span>
<span id="cb8-57">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb8-58">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""growth only; the linear dilution is in the constant operator"""</span></span>
<span id="cb8-59">        S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb8-60">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-61">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.concatenate([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD, m], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-62"></span>
<span id="cb8-63">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> step(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c_old, h, S0_now):</span>
<span id="cb8-64">        inflow <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[S0_now, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.X0]])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta</span>
<span id="cb8-65"></span>
<span id="cb8-66">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(c):</span>
<span id="cb8-67">            s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb8-68">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_old.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h</span>
<span id="cb8-69">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta</span>
<span id="cb8-70">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> inflow.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-71">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js</span>
<span id="cb8-72">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(res, c_old, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb8-73">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> out.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chemostat step did not converge"</span></span>
<span id="cb8-74">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out.x.reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb8-75"></span>
<span id="cb8-76">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> march(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c0, T, S0_of_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb8-77">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(c0, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb8-78">        h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.nstep</span>
<span id="cb8-79">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.nstep):</span>
<span id="cb8-80">            t_new <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>h</span>
<span id="cb8-81">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.step(c, h, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.S0 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> S0_of_t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> S0_of_t(t_new))</span>
<span id="cb8-82">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> c</span>
<span id="cb8-83"></span>
<span id="cb8-84"></span>
<span id="cb8-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------- 4. pymrm plug-flow fermenter</span></span>
<span id="cb8-86"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> PlugFlowFermenter:</span>
<span id="cb8-87">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Steady 1-D plug flow with Andrews' kinetics.  Fields (S, X)."""</span></span>
<span id="cb8-88"></span>
<span id="cb8-89">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, Sf, Xf, tau, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I,</span>
<span id="cb8-90">                 inlet_bc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dirichlet"</span>, init<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>):</span>
<span id="cb8-91">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.v, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tau, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ncell, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), v, tau, Ki</span>
<span id="cb8-92">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>tau, ncell <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-93">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb8-94">        d0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[Sf, Xf]])</span>
<span id="cb8-95">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTWARD normal, so both dicts read  a dc/dn + b c = d.</span></span>
<span id="cb8-96">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = 0  inlet:  outward normal is -z  -&gt;  Dirichlet feed, a=0,b=1,d=(Sf,Xf)</span></span>
<span id="cb8-97">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = L  outlet: outward normal is +z  -&gt;  pure outflow,   a=1,b=0,d=0</span></span>
<span id="cb8-98">        left <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: d0} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inlet_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dirichlet"</span></span>
<span id="cb8-99">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>})     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break-row alternative</span></span>
<span id="cb8-100">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (left, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>})</span>
<span id="cb8-101">        conv, conv_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_convflux_upwind(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c,</span>
<span id="cb8-102">                                                  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-103">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nu=0 Cartesian</span></span>
<span id="cb8-104">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> conv, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> conv_bc</span>
<span id="cb8-105">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pointwise in the 2 fields</span></span>
<span id="cb8-106">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> init <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>:</span>
<span id="cb8-107">            <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.tile(d0, (ncell, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the refinement study uses this</span></span>
<span id="cb8-108">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb8-109">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISTIC per-tau initial guess, NOT a continuation chain:</span></span>
<span id="cb8-110">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the batch trajectory sampled at z/v.  Nothing carries over from a</span></span>
<span id="cb8-111">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># previous tau, so the answer cannot depend on the sweep order.</span></span>
<span id="cb8-112">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _rhs(t, y):</span>
<span id="cb8-113">                S, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb8-114">                m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_S)</span>
<span id="cb8-115">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X]</span>
<span id="cb8-116">            sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(_rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tau], [Sf, Xf], t_eval<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>v,</span>
<span id="cb8-117">                            rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb8-118">            <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.ascontiguousarray(sol.y.T)</span>
<span id="cb8-119"></span>
<span id="cb8-120">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb8-121">        S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb8-122">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-123">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.concatenate([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD, m], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-124"></span>
<span id="cb8-125">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb8-126">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(c):</span>
<span id="cb8-127">            s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb8-128">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb8-129">                    <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js)</span>
<span id="cb8-130">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(resid, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb8-131">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow solve did not converge"</span></span>
<span id="cb8-132">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.x.reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb8-133">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span></span>
<span id="cb8-134"></span>
<span id="cb8-135">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> outlet(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb8-136">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""from compute_boundary_values, NOT off the last cell centre"""</span></span>
<span id="cb8-137">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.asarray(compute_boundary_values(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c,</span>
<span id="cb8-138">                                                  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-139"></span>
<span id="cb8-140"></span>
<span id="cb8-141"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------------- steady states with a NON-STERILE feed</span></span>
<span id="cb8-142"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> n_steady_seeded(X0f, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_FEED, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40001</span>):</span>
<span id="cb8-143">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Steady states of eqs. (7)-(8) with X_0 &gt; 0.</span></span>
<span id="cb8-144"></span>
<span id="cb8-145"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Eliminating X_1 from eq. (7) gives X_1 = X_0/(1 - theta mu), which has a</span></span>
<span id="cb8-146"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    POLE wherever mu = 1/theta - exactly at the two roots of interest.  Clearing</span></span>
<span id="cb8-147"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the denominator instead leaves</span></span>
<span id="cb8-148"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        G(S) = (S_0 - S)(1 - theta mu(S)) - theta mu(S) X_0/Y</span></span>
<span id="cb8-149"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    which is pole-free, so a sign-change scan cannot invent roots at the pole.</span></span>
<span id="cb8-150"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-151">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> G(S):</span>
<span id="cb8-152">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu(S, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki)</span>
<span id="cb8-153">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X0f<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb8-154">    grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), ngrid)</span>
<span id="cb8-155">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(G(grid), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># vectorised: the scan is hot</span></span>
<span id="cb8-156">    idx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.flatnonzero(v[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-157">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(G(z)), grid[i], grid[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb8-158">                   xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> idx]</span>
<span id="cb8-159"></span>
<span id="cb8-160"></span>
<span id="cb8-161"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _fold_eq(S, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_FEED, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I):</span>
<span id="cb8-162">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The fold of G is a DOUBLE root: G = 0 and dG/dS = 0 together.</span></span>
<span id="cb8-163"></span>
<span id="cb8-164"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Eliminating X_0 between the two leaves one scalar equation with no counting</span></span>
<span id="cb8-165"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    and no grid in it:   mu (theta mu - 1) = mu' (S_0 - S).</span></span>
<span id="cb8-166"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb8-167">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_S</span>
<span id="cb8-168">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>d</span>
<span id="cb8-169">    dm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(K_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>d)</span>
<span id="cb8-170">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S)</span>
<span id="cb8-171"></span>
<span id="cb8-172"></span>
<span id="cb8-173"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ChemostatMarch     : NumJac((1,2)) + newton, backward Euler on eqs. (7)-(8)"</span>)</span>
<span id="cb8-174"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PlugFlowFermenter  : construct_convflux_upwind + construct_div(nu=0)"</span></span>
<span id="cb8-175">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" + NumJac((n,2)) + newton, outlet via compute_boundary_values"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>sympy  partial-fraction residual = 0
sympy  antiderivative residual   = 0

ChemostatMarch     : NumJac((1,2)) + newton, backward Euler on eqs. (7)-(8)
PlugFlowFermenter  : construct_convflux_upwind + construct_div(nu=0) + NumJac((n,2)) + newton, outlet via compute_boundary_values</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-batch-claim-it-is-a-lag-and-here-is-how-much-of-one" class="level3">
<h3 class="anchored" data-anchor-id="the-batch-claim-it-is-a-lag-and-here-is-how-much-of-one">1. The batch claim: it is a lag, and here is how much of one</h3>
<p>Andrews’ model has <strong>no lag phase in it</strong>. Any lag is produced by the kinetics, so the claim can be tested against a no-inhibition control run at the same <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu">, <img src="https://latex.codecogs.com/png.latex?K_s">, <img src="https://latex.codecogs.com/png.latex?Y">, <img src="https://latex.codecogs.com/png.latex?S_i"> and <img src="https://latex.codecogs.com/png.latex?X_i">.</p>
<p>The lag is defined the standard way and <strong>computed in closed form, not sampled</strong>: the specific growth rate along a batch run is <img src="https://latex.codecogs.com/png.latex?%5Cmu(S(t))">, its maximum over the run is <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu_m"> (eq. 2) reached where <img src="https://latex.codecogs.com/png.latex?S%20=%20S_m"> (eq. 3), and the lag is the intercept of the tangent to <img src="https://latex.codecogs.com/png.latex?%5Cln%20X"> at that point,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%20t(S_m)%20-%20%5Cfrac%7B1%7D%7B%5Chat%5Cmu_m%7D%5Cln%5Cfrac%7BX(S_m)%7D%7BX_i%7D,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?t(S_m)"> from the closed form above. Total time then splits exactly into <img src="https://latex.codecogs.com/png.latex?t_f%20=%20%5Clambda%20+%20%5Chat%5Cmu_m%5E%7B-1%7D%5Cln(X_f/X_i)%20+%20R">, where <img src="https://latex.codecogs.com/png.latex?R"> is the deceleration after the peak. Under Monod the trajectory starts at its steepest point, so <strong><img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%200"> identically</strong> - which is the content of Andrews’ claim: inhibition creates a lag where there was none.</p>
<p>Going from no inhibition to his <img src="https://latex.codecogs.com/png.latex?K_i%20=%202.0"> g/l at <img src="https://latex.codecogs.com/png.latex?S_i%20=%2010"> g/l, <img src="https://latex.codecogs.com/png.latex?X_i%20=%200.005"> g/l, the time to reach 5 g/l of biomass goes from 6.949160 h to 36.527476 h - a factor of <strong>5.26</strong>. Of that 29.578315 h increase, <strong>94.40 % is lag</strong>, 5.65 % is the slower exponential phase and <img src="https://latex.codecogs.com/png.latex?-0.05"> % is the tail. Andrews’ word “primary” is right, and the fraction is monotone in inhibition strength: 87.78 % at <img src="https://latex.codecogs.com/png.latex?K_i%20=%2010">, 91.25 % at <img src="https://latex.codecogs.com/png.latex?K_i%20=%205">, 94.40 % at <img src="https://latex.codecogs.com/png.latex?K_i%20=%202">.</p>
<p><strong>Two things about that split, both of which the numbers above invite a reader to get wrong.</strong></p>
<p><strong>First, the peak rate is not the culture’s rate.</strong> The peak specific growth rate falls only from 0.997009 to 0.803246 h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">, <strong>19.4 %</strong> - and that number says almost nothing about how fast the culture grows, because the run barely visits the peak. The maximum is attained at <img src="https://latex.codecogs.com/png.latex?t%20=%2036.492522"> h of a 36.527476 h run, <strong>99.90 % of the way through</strong>, and the trajectory is above half its peak rate for <strong>0.638869 h, 1.7490 % of its duration</strong>. The <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu_m%5E%7B-1%7D%5Cln(X_f/X_i)%0A=%208.599803"> h “exponential phase” is a back-extrapolated tangent, not a phase the culture passes through. What the culture actually realises is the mean <img src="https://latex.codecogs.com/png.latex?%5Cln(X_f/X_i)/t_f">, and <strong>that falls from 0.994042 to 0.189111 h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">, by 80.98 %</strong>. The 19.4 % is the drop in the best instantaneous rate the kinetics allow; it is not the effect of inhibition on growth. And during the 27.922318 h the split calls lag, biomass is not idle: it rises 114.67-fold, from 0.005 to 0.573354 g/l, which is what the middle figure panel’s log axis shows.</p>
<p><strong>Second, “94.40 % is lag” is a partition only near Andrews’ own target.</strong> <img src="https://latex.codecogs.com/png.latex?%5Clambda"> does not depend on <img src="https://latex.codecogs.com/png.latex?X_f"> but <img src="https://latex.codecogs.com/png.latex?%5CDelta%20t_f"> does, so the share is a function of the target biomass, and it exceeds 100 % below about 2 g/l: at <img src="https://latex.codecogs.com/png.latex?X_f%20=%201"> g/l the same decomposition gives <strong>109.4003 %</strong>, and at 0.5 g/l 123.8027 %. A share of 124 % is not a decomposition of anything. It is <img src="https://latex.codecogs.com/png.latex?%5Cle%0A100"> % here only because Andrews’ 5 g/l target sits hard against the 5.005 g/l asymptote of this batch. <strong>The 94.40 % is quoted at his target and is defined there</strong>; the table below prints the whole curve so the domain of validity is visible rather than assumed.</p>
<div id="759d555d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:39.980767Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:39.980601Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:39.996857Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:39.996084Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lag_split(Ki, Si<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_INIT, Xi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_INIT, Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD,</span>
<span id="cb10-2">              tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak"</span>):</span>
<span id="cb10-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Exact lag / exponential / tail split of the batch time.  Closed form.</span></span>
<span id="cb10-4"></span>
<span id="cb10-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `tangent="start"` forces S_m to S_i, i.e. takes the tangent at t = 0 rather</span></span>
<span id="cb10-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    than at the steepest point of the run.  That is the ALTERNATIVE DEFINITION</span></span>
<span id="cb10-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the break table injects; it is a parameter of this one function so that the</span></span>
<span id="cb10-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    break row RECOMPUTES the split rather than asserting what it comes to.</span></span>
<span id="cb10-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb10-10">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Si <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Xi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv</span>
<span id="cb10-11">    Sm, mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ki), muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki))</span>
<span id="cb10-12">    branch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"interior peak"</span></span>
<span id="cb10-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Sm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> Si <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> tangent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start"</span>:   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># steepest point taken at t = 0</span></span>
<span id="cb10-14">        branch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak beyond S_i"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Sm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> Si <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tangent at t = 0"</span></span>
<span id="cb10-15">        Sm, mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Si, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(Si, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh))</span>
<span id="cb10-16">    Xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Sm)</span>
<span id="cb10-17">    ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(Xi, Xs, Si, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Yv)</span>
<span id="cb10-18">    lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(Xs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xi)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mum</span>
<span id="cb10-19">    tf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(Xi, Xf, Si, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Yv)</span>
<span id="cb10-20">    expo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xi)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mum</span>
<span id="cb10-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, branch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>branch, mu_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mum, S_m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Sm, X_peak<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Xs, t_peak<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ts,</span>
<span id="cb10-22">                lag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lam, expo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>expo, tail<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> expo, t_f<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tf)</span>
<span id="cb10-23"></span>
<span id="cb10-24"></span>
<span id="cb10-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lag_share(Ki, Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD, base_Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>,</span>
<span id="cb10-26">              tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak"</span>):</span>
<span id="cb10-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""share of the EXTRA time to reach Xf that is lag, against a control"""</span></span>
<span id="cb10-28">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lag_split(Ki, Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Xf, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Yv, tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tangent)</span>
<span id="cb10-29">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lag_split(base_Ki, Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Xf, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Yv, tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tangent)</span>
<span id="cb10-30">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]</span>
<span id="cb10-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(dtf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d, lag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>d, expo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>d,</span>
<span id="cb10-32">                tail<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>d)</span>
<span id="cb10-33"></span>
<span id="cb10-34"></span>
<span id="cb10-35">KI_SWITCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_S          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># where S_m = S_i: the branch switch, exactly</span></span>
<span id="cb10-36">NO_INHIB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lag_split(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>)</span>
<span id="cb10-37">ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [lag_split(k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, KI_SWITCH, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)]</span>
<span id="cb10-38">tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(ROWS)</span>
<span id="cb10-39">tab.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no inhibition (K_i -&gt; inf)"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI_SWITCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (switch)"</span>,</span>
<span id="cb10-40">                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i = 10.0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i = 5.0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i = 2.0 (Andrews')"</span>])</span>
<span id="cb10-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(tab[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"branch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_m"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]]</span>
<span id="cb10-42">      .to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, float_format<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb10-43"></span>
<span id="cb10-44">BASE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NO_INHIB</span>
<span id="cb10-45">FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ki"</span>]: lag_share(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ki"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]}</span>
<span id="cb10-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">share of the EXTRA time to reach 5 g/l, against the no-inhibition control:"</span>)</span>
<span id="cb10-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FRAC.items():</span>
<span id="cb10-48">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  K_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  dt_f = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dtf'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   lag </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lag'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-49">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   exponential </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'expo'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   tail </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tail'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-50"></span>
<span id="cb10-51">LAG_FRAC_2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>]</span>
<span id="cb10-52">DT_F_2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dtf"</span>]</span>
<span id="cb10-53">T_F_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]</span>
<span id="cb10-54">MUMAX_DROP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Andrews' K_i = 2.0 :  t_f x</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_F_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,  peak mu </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MUMAX_DROP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb10-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  lag share </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAG_FRAC_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"BOTH BRANCHES EXERCISED: 'peak beyond S_i' at K_i &gt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI_SWITCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb10-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 'interior peak' below it; at the switch the lag is"</span></span>
<span id="cb10-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lag_split(KI_SWITCH)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lag'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h (zero to round-off) and the split is continuous."</span>)</span>
<span id="cb10-60"></span>
<span id="cb10-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- WHAT THE PEAK-RATE NUMBER DOES NOT SAY --------------------------------</span></span>
<span id="cb10-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The peak is a property of the kinetics; the run barely visits it.  Everything</span></span>
<span id="cb10-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># below is closed form or a Brent root - nothing is sampled off a trajectory.</span></span>
<span id="cb10-64">KI2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb10-65">T_PEAK_FRACTION <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_peak"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]</span>
<span id="cb10-66">MEAN_MU_KI2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_INIT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># realised, not peak</span></span>
<span id="cb10-67">MEAN_MU_NOINH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_INIT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]</span>
<span id="cb10-68">MEAN_MU_DROP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MEAN_MU_KI2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MEAN_MU_NOINH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># biomass at t = lambda: invert the closed form in X by Brent, not read off a</span></span>
<span id="cb10-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># trajectory</span></span>
<span id="cb10-71">X_AT_LAG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: t_batch(X_INIT, x, S_INIT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb10-72">                  X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb10-73">LAG_FOLD_RISE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X_AT_LAG<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_INIT</span>
<span id="cb10-74"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># how long the run spends above HALF the peak rate: the two S at which</span></span>
<span id="cb10-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mu = mu_max/2, root-found on eq. (6), then the closed form for the time between</span></span>
<span id="cb10-76">_S_half_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, S_M,</span>
<span id="cb10-77">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-17</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb10-78">_S_half_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, S_M, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>,</span>
<span id="cb10-79">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb10-80">_a_lag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_INIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb10-81">_X_enter, _X_leave <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(_a_lag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _S_half_hi), YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(_a_lag <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _S_half_lo)</span>
<span id="cb10-82">T_ABOVE_HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t_batch(X_INIT, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_X_leave, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>), S_INIT)</span>
<span id="cb10-83">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t_batch(X_INIT, _X_enter, S_INIT))</span>
<span id="cb10-84">FRAC_ABOVE_HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_ABOVE_HALF<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]</span>
<span id="cb10-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THE </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MUMAX_DROP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> PEAK-RATE DROP DOES NOT SAY:"</span>)</span>
<span id="cb10-86"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed to five or more decimals DELIBERATELY: these three are NOT metrics, so</span></span>
<span id="cb10-87"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># check_agreement never compares them, and at two or four decimals they also fell</span></span>
<span id="cb10-88"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># outside the &gt;=5-decimal sweep of the metadata files.  README.md and</span></span>
<span id="cb10-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># models_entry.yaml now quote these digits, which puts them inside that sweep.</span></span>
<span id="cb10-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the peak rate is reached at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t_peak'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h of a"</span></span>
<span id="cb10-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t_f'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h run - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_PEAK_FRACTION<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the way through"</span>)</span>
<span id="cb10-92"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the run is above HALF its peak rate for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_ABOVE_HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h,"</span></span>
<span id="cb10-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FRAC_ABOVE_HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of its duration"</span>)</span>
<span id="cb10-94"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the REALISED mean rate ln(X_f/X_i)/t_f falls </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_MU_NOINH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt;"</span></span>
<span id="cb10-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_MU_KI2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_MU_DROP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-96"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and during the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KI2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lag'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h the split calls lag, biomass rises"</span></span>
<span id="cb10-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_INIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_AT_LAG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l, a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAG_FOLD_RISE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-98"></span>
<span id="cb10-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the share is a partition only near Andrews' own target ----------------</span></span>
<span id="cb10-100">SHARE_VS_XF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {xf: lag_share(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xf) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> xf <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)}</span>
<span id="cb10-101">LAG_SHARE_AT_XF1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SHARE_VS_XF[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>]</span>
<span id="cb10-102"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE SHARE IS DEFINED AT A TARGET: lambda does not depend on X_f, dt_f does"</span>)</span>
<span id="cb10-103"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> xf, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHARE_VS_XF.items():</span>
<span id="cb10-104">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  X_f = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>xf<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l   dt_f </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dtf'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   lag </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lag'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-105">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   exponential </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'expo'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   tail </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tail'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-106"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; it exceeds 100 % below about 2 g/l, so it is a PARTITION only near"</span></span>
<span id="cb10-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Andrews' own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     5 g/l target, where it is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAG_FRAC_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb10-108"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> SHARE_VS_XF[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> LAG_FRAC_2</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>                     label          branch       mu_max          S_m          lag         expo         tail          t_f
no inhibition (K_i -&gt; inf) peak beyond S_i     0.997009    10.000000     0.000000     6.928479     0.020682     6.949160
  K_i = 3333.3333 (switch) peak beyond S_i     0.994036    10.000000    -0.000000     6.949202     0.017706     6.966907
                K_i = 10.0   interior peak     0.901271     0.547723     5.192698     7.664462     0.007663    12.864823
                 K_i = 5.0   interior peak     0.865861     0.387298    10.795933     7.977900     0.006653    18.780486
      K_i = 2.0 (Andrews')   interior peak     0.803246     0.244949    27.922318     8.599803     0.005354    36.527476

share of the EXTRA time to reach 5 g/l, against the no-inhibition control:
  K_i = 3333.3333   dt_f =  0.017747 h   lag -0.0000%   exponential +116.7706%   tail -16.7706%
  K_i = 10.0000     dt_f =  5.915663 h   lag +87.7788%   exponential +12.4413%   tail -0.2201%
  K_i = 5.0000      dt_f = 11.831326 h   lag +91.2487%   exponential +8.8699%   tail -0.1186%
  K_i = 2.0000      dt_f = 29.578315 h   lag +94.4013%   exponential +5.6505%   tail -0.0518%

Andrews' K_i = 2.0 :  t_f x5.2564,  peak mu -19.4344%,  lag share 94.4013%
BOTH BRANCHES EXERCISED: 'peak beyond S_i' at K_i &gt;= 3333.3333, 'interior peak' below it; at the switch the lag is -6.388e-23 h (zero to round-off) and the split is continuous.

WHAT THE -19.4344% PEAK-RATE DROP DOES NOT SAY:
  the peak rate is reached at t = 36.492522 h of a 36.527476 h run - 99.90431% of the way through
  the run is above HALF its peak rate for 0.638869 h, 1.7490088% of its duration
  the REALISED mean rate ln(X_f/X_i)/t_f falls 0.994042 -&gt; 0.189111 1/h, -80.9755%
  and during the 27.922318 h the split calls lag, biomass rises 0.005 -&gt; 0.573354 g/l, a factor 114.67072

THE SHARE IS DEFINED AT A TARGET: lambda does not depend on X_f, dt_f does
  X_f =  0.5 g/l   dt_f  22.55388 h   lag 123.8027%   exponential  4.9402%   tail -28.7430%
  X_f =  1.0 g/l   dt_f  25.52308 h   lag 109.4003%   exponential  5.0226%   tail -14.4229%
  X_f =  2.0 g/l   dt_f  27.99228 h   lag  99.7501%   exponential  5.1787%   tail  -4.9287%
  X_f =  3.0 g/l   dt_f  29.02163 h   lag  96.2121%   exponential  5.3330%   tail  -1.5451%
  X_f =  4.0 g/l   dt_f  29.46148 h   lag  94.7757%   exponential  5.4897%   tail  -0.2653%
  X_f =  5.0 g/l   dt_f  29.57832 h   lag  94.4013%   exponential  5.6505%   tail  -0.0518%
  -&gt; it exceeds 100 % below about 2 g/l, so it is a PARTITION only near Andrews' own
     5 g/l target, where it is 94.4013%.</code></pre>
</div>
</div>
</section>
<section id="both-of-andrews-stated-numerical-results-from-a-closed-form" class="level3">
<h3 class="anchored" data-anchor-id="both-of-andrews-stated-numerical-results-from-a-closed-form">2. Both of Andrews’ stated numerical results, from a closed form</h3>
<p>Book p.&nbsp;715:</p>
<blockquote class="blockquote">
<p><em>“It can be seen that only 12.5 hr are required to obtain an organism concentration of 5 g/l using this procedure as compared to the 36 hr required if the original innoculum was exposed to the full 10 g/l of substrate at the beginning.”</em></p>
</blockquote>
<p><em>“It can be seen”</em> means he read both off his own Fig. 7, so they carry his reading precision, and reproducing them is reproduction rather than validation.</p>
<p>The direct case is <img src="https://latex.codecogs.com/png.latex?X"> from 0.005 to 5 g/l at <img src="https://latex.codecogs.com/png.latex?S_i%20=%2010"> g/l, <img src="https://latex.codecogs.com/png.latex?K_i%20=%202.0"> g/l: the closed form gives <strong>36.527476 h against his 36</strong>, <img src="https://latex.codecogs.com/png.latex?+1.4652"> %.</p>
<p>The acclimation procedure - start at 2.0 g/l of substrate, run down to 0.02 g/l, add more, repeat - is the one whose sentence has three literal readings, and <strong>Fig. 7’s own annotation settles which</strong>: <em>“<img src="https://latex.codecogs.com/png.latex?S_i"> ADDED IN INCREMENTS OF 2.0 GM/L”</em> means each cycle adds 2.0 g/l to the 0.02 g/l left behind. That reading gives <strong>12.371597 h against his 12.5</strong>, <img src="https://latex.codecogs.com/png.latex?-1.0272"> %, in six cycles, and it is the number reported. The other two readings are priced rather than assumed away: resetting to 2.0 instead of adding 2.0 gives 12.366419 h (<img src="https://latex.codecogs.com/png.latex?-1.0686"> %), only 0.0419 % away, while the ladder reading the annotation excludes - initial substrate stepping 2.0, 4.0, 6.0 g/l - gives 13.794022 h, <img src="https://latex.codecogs.com/png.latex?+10.3522"> %, in three cycles. <strong>The raw textual spread the annotation closes is 11.5442 %, not 0.042 %</strong>, and the 0.042 % is the residue after it is closed.</p>
<p>The speed-up is a factor <strong>2.9525</strong>, and its cause is visible in the cycle times - the first cycle alone takes 9.770815 h and the remaining five together take 2.600783 h.</p>
<div id="725e2515" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:39.998980Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:39.998837Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:40.022065Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:40.021216Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">T_DIRECT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT)</span>
<span id="cb12-2">T_DIRECT_IVP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> batch_ivp(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT)</span>
<span id="cb12-3">T_DIRECT_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span></span>
<span id="cb12-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"direct exposure to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_INIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l, X </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_INIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; 5 g/l, K_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_I<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb12-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  closed form </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_DIRECT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   LSODA </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_DIRECT_IVP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span></span>
<span id="cb12-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T_DIRECT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_DIRECT_IVP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Andrews prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_DIRECT_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> hr  -&gt;"</span></span>
<span id="cb12-8">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(T_DIRECT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_DIRECT_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_DIRECT_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-9"></span>
<span id="cb12-10"></span>
<span id="cb12-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> acclimate(mode, target<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_add<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, S_stop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, X0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_INIT,</span>
<span id="cb12-12">              Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT):</span>
<span id="cb12-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Andrews' 'acclimated seed', p. 715.  Organisms retained, substrate topped</span></span>
<span id="cb12-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    up.  `mode` is one of the THREE literal readings of his sentence:</span></span>
<span id="cb12-15"></span>
<span id="cb12-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">      increment : add S_add to what is left  -&gt; each cycle starts at S_stop+S_add</span></span>
<span id="cb12-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">                  THIS IS THE READING FIG. 7's OWN ANNOTATION PRINTS</span></span>
<span id="cb12-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">      reset     : refill to S_add            -&gt; each cycle starts at S_add</span></span>
<span id="cb12-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">      ladder    : step the initial concentration 2.0, 4.0, 6.0, ...</span></span>
<span id="cb12-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb12-21">    X, t, S_start, times <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, S_add, []</span>
<span id="cb12-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>):</span>
<span id="cb12-23">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb12-24">        X_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_stop)</span>
<span id="cb12-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> X_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> target:</span>
<span id="cb12-26">            dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(X, target, S_start, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)</span>
<span id="cb12-27">            times.append(dt)</span>
<span id="cb12-28">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dt, k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, times</span>
<span id="cb12-29">        dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(X, X_end, S_start, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)</span>
<span id="cb12-30">        t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> dt</span>
<span id="cb12-31">        times.append(dt)</span>
<span id="cb12-32">        X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X_end</span>
<span id="cb12-33">        S_start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>: S_stop <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_add, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset"</span>: S_add,</span>
<span id="cb12-34">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder"</span>: S_start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_add}[mode]</span>
<span id="cb12-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RuntimeError</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"acclimation never reached the target"</span>)</span>
<span id="cb12-36"></span>
<span id="cb12-37"></span>
<span id="cb12-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fig. 7's typeset annotation, printed from the CSV - never retyped in this cell.</span></span>
<span id="cb12-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 7 annotation, p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_annotation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"page"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, verbatim:'</span>)</span>
<span id="cb12-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_annotation"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"'</span>)</span>
<span id="cb12-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  flag: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_annotation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flag"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb12-42"></span>
<span id="cb12-43">T_SEED_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span></span>
<span id="cb12-44">SEED_READINGS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m: acclimate(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder"</span>)}</span>
<span id="cb12-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE REPORTED READING is the one the annotation prints.</span></span>
<span id="cb12-46">T_SEED, N_CYCLES, CYCLE_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SEED_READINGS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>]</span>
<span id="cb12-47">T_SEED_RESET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SEED_READINGS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-48">T_SEED_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SEED_READINGS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-49">_st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEED_READINGS.values()]</span>
<span id="cb12-50">SEED_READINGS_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_st)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_st) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-51">SEED_RESET_VS_INC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_SEED_RESET<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-52">SPEEDUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_DIRECT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_SEED</span>
<span id="cb12-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">acclimated seed, the three literal readings of the p.715 sentence:"</span>)</span>
<span id="cb12-54"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m, (t, n, ct) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEED_READINGS.items():</span>
<span id="cb12-55">    mark <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  &lt;- Fig. 7's annotation"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb12-56">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cycles -&gt;"</span></span>
<span id="cb12-57">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_SEED_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_SEED_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the printed 12.5</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mark<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  RAW SPREAD across the three: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEED_READINGS_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - that is what"</span></span>
<span id="cb12-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the annotation closes."</span>)</span>
<span id="cb12-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  what is left once it is closed: reset is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEED_RESET_VS_INC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from"</span></span>
<span id="cb12-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the reported increment reading."</span>)</span>
<span id="cb12-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  reported: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_SEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CYCLES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cycles, cycle times (h)"</span></span>
<span id="cb12-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CYCLE_T]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  speed-up </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPEEDUP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x ; first cycle </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CYCLE_T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h,"</span></span>
<span id="cb12-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" remaining </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CYCLES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> together </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(CYCLE_T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb12-66"></span>
<span id="cb12-67">REL_36 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T_DIRECT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_DIRECT_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_DIRECT_PRINTED</span>
<span id="cb12-68">REL_12P5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T_SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_SEED_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_SEED_PRINTED</span>
<span id="cb12-69">REL_12P5_RESET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T_SEED_RESET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_SEED_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_SEED_PRINTED</span>
<span id="cb12-70">REL_12P5_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T_SEED_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_SEED_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_SEED_PRINTED</span>
<span id="cb12-71">CF_VS_IVP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T_DIRECT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_DIRECT_IVP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>direct exposure to 10.0 g/l, X 0.005 -&gt; 5 g/l, K_i = 2.0:
  closed form 36.52747558 h   LSODA 36.52747558 h   |rel| 6.682e-12
  Andrews prints 36 hr  -&gt; +1.4652%

Fig. 7 annotation, p.718, verbatim:
  "REPEATED ORGANISM SEPARATION &amp; DILUTION. S_i ADDED IN INCREMENTS OF 2.0 GM/L"
  flag: THIS SETTLES THE p.715 SENTENCE, and it is the reason this page reports the INCREMENT reading. 'S_i ADDED IN INCREMENTS OF 2.0 GM/L' means 2.0 g/l of substrate is ADDED each cycle to the 0.02 g/l left behind, so each cycle starts at 2.02 g/l - not reset to 2.0, and not a 2/4/6 ladder, which would not be increments OF 2.0. Read at digit scale on a 300 ppi crop of the rotated landscape page; the subscript is a dotted italic i, matching X_i and S_i elsewhere. Transcribing it closes a raw 11.54 % spread between the three literal readings of the prose down to 0.042 %

acclimated seed, the three literal readings of the p.715 sentence:
  increment 12.37159748 h in 6 cycles -&gt; -1.0272% of the printed 12.5  &lt;- Fig. 7's annotation
  reset     12.36641949 h in 6 cycles -&gt; -1.0686% of the printed 12.5
  ladder    13.79402245 h in 3 cycles -&gt; +10.3522% of the printed 12.5
  RAW SPREAD across the three: +11.5442% - that is what the annotation closes.
  what is left once it is closed: reset is -0.0419% from the reported increment reading.
  reported: 12.37159748 h, 6 cycles, cycle times (h) [np.float64(9.770815), np.float64(1.13018), np.float64(0.652298), np.float64(0.460301), np.float64(0.355981), np.float64(0.002023)]
  speed-up 2.9525x ; first cycle 9.770815 h, remaining 5 together 2.600783 h</code></pre>
</div>
</div>
</section>
<section id="the-continuous-claim-proved-rather-than-illustrated" class="level3">
<h3 class="anchored" data-anchor-id="the-continuous-claim-proved-rather-than-illustrated">3. The continuous claim, proved rather than illustrated</h3>
<p>At <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%203"> h and <img src="https://latex.codecogs.com/png.latex?S_0%20=%205"> g/l with Andrews’ constants there are <strong>three</strong> steady states, not two: the two roots of his quadratic, and washout.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th><img src="https://latex.codecogs.com/png.latex?S_1"> (g/l)</th>
<th><img src="https://latex.codecogs.com/png.latex?X_1"> (g/l)</th>
<th>eigenvalues (h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">)</th>
<th></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>lower</td>
<td>0.0150567</td>
<td>2.492472</td>
<td><img src="https://latex.codecogs.com/png.latex?-73.019142">, <img src="https://latex.codecogs.com/png.latex?-1/3"></td>
<td><strong>stable node</strong></td>
</tr>
<tr class="even">
<td>upper</td>
<td>3.984943</td>
<td>0.507528</td>
<td><img src="https://latex.codecogs.com/png.latex?+0.0561790">, <img src="https://latex.codecogs.com/png.latex?-1/3"></td>
<td><strong>saddle</strong> - this is eq. (9)’s root</td>
</tr>
<tr class="odd">
<td>washout</td>
<td>5</td>
<td>0</td>
<td><img src="https://latex.codecogs.com/png.latex?-0.0481080">, <img src="https://latex.codecogs.com/png.latex?-1/3"></td>
<td><strong>stable node</strong></td>
</tr>
</tbody>
</table>
<p>The sign of the saddle’s positive eigenvalue is not a numerical accident, and the page proves it. With <img src="https://latex.codecogs.com/png.latex?X_1%20%3E%200"> and <img src="https://latex.codecogs.com/png.latex?%5Cmu(S%5E*)%20=%201/%5Ctheta">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdet%20J%20=%20%5Cfrac%7B%5Cmu'(S%5E*)%5C,X_1%7D%7BY%5Ctheta%7D,%20%5Cqquad%0A%20%20%5Coperatorname%7Btr%7D%20J%20=%20-%5Cfrac%7B1%7D%7B%5Ctheta%7D%20-%20%5Cfrac%7B%5Cmu'(S%5E*)%5C,X_1%7D%7BY%7D,"></p>
<p>so <img src="https://latex.codecogs.com/png.latex?%5Cdet%20J"> has the sign of <img src="https://latex.codecogs.com/png.latex?%5Cmu'(S%5E*)"> <strong>exactly</strong>. The lower root sits on the rising limb, <img src="https://latex.codecogs.com/png.latex?%5Cmu'%20%3E%200">, so <img src="https://latex.codecogs.com/png.latex?%5Cdet%20%3E%200"> and <img src="https://latex.codecogs.com/png.latex?%5Coperatorname%7Btr%7D%20%3C%200">: stable. The upper root sits on the falling limb, <img src="https://latex.codecogs.com/png.latex?%5Cmu'%20%3C%200">, so <img src="https://latex.codecogs.com/png.latex?%5Cdet%20%3C%200">: a saddle, whatever the constants. That is Andrews’ <em>“the higher substrate concentration can represent an unstable situation in continuous culture”</em>, with “can” replaced by “must”.</p>
<p><strong>And washout is stable.</strong> Its eigenvalues are <img src="https://latex.codecogs.com/png.latex?%5Cmu(S_0)%20-%201/%5Ctheta"> and <img src="https://latex.codecogs.com/png.latex?-1/%5Ctheta">, and at <img src="https://latex.codecogs.com/png.latex?S_0%20=%205"> the first is <img src="https://latex.codecogs.com/png.latex?-0.0481080"> h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">. So the reactor is <strong>bistable</strong>: two attractors separated by the saddle. That is what <em>“may result in process instability”</em> means, and it is why the batch case recovers and the continuous case does not.</p>
</section>
<section id="the-exact-bistable-window-and-andrews-sits-inside-it" class="level3">
<h3 class="anchored" data-anchor-id="the-exact-bistable-window-and-andrews-sits-inside-it">4. The exact bistable window, and Andrews sits inside it</h3>
<p>This chemostat washes out in <strong>two different ways</strong>, and eq. (11) is only one of them.</p>
<ul>
<li><strong>The fold.</strong> For <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%3C%20%5Ctheta_w%20=%20%5Chat%5Cmu_m%5E%7B-1%7D%20=%201.244949"> h there is no nontrivial steady state at all: eq. (9)‘s discriminant is negative. This is Andrews’ eq. (11), and it contains no <img src="https://latex.codecogs.com/png.latex?S_0">.</li>
<li><strong>The transcritical crossing.</strong> Washout is stable exactly when <img src="https://latex.codecogs.com/png.latex?%5Cmu(S_0)%20%3C%201/%5Ctheta">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%3C%201/%5Cmu(S_0)%20=%203.506000"> h at <img src="https://latex.codecogs.com/png.latex?S_0%20=%205">. Above that the upper root exceeds <img src="https://latex.codecogs.com/png.latex?S_0">, is no longer reachable, and washout turns unstable. Andrews does not print this condition. It is the same equation <img src="https://latex.codecogs.com/png.latex?%5Cmu(S)%20=%201/%5Ctheta"> that gives eq. (9), evaluated at the feed instead of at the peak.</li>
</ul>
<p>So the bistable window at <img src="https://latex.codecogs.com/png.latex?S_0%20=%205"> g/l is</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctheta%20%5Cin%20(1.244949,%5C;%203.506000)%5C%20%5Ctext%7Bh%7D,"></p>
<p>both ends available in closed form <em>and</em> root-found, and <strong>Andrews’ operating point <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%203"> h is inside it</strong> - which is why every one of his Fig. 8-10 experiments has something to show.</p>
<p>Those two conditions unify Andrews with J4.1. Under Monod, <img src="https://latex.codecogs.com/png.latex?%5Cmu"> is monotone, so the fold never happens and only the transcritical condition survives - <img src="https://latex.codecogs.com/png.latex?D_c%20=%20%5Cmu(S_f)%20=%20%5Cmu_m%20S_f/(K_S%20+%20S_f)">, exactly the formula J4.1 loads from Rawlings &amp; Ekerdt. Under Haldane both exist and they are different numbers. <strong>One criterion, <img src="https://latex.codecogs.com/png.latex?D%20=%20%5Cmu(S)">, read at two different points.</strong></p>
<div id="91f6bc08" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:40.024004Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:40.023844Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:40.032896Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:40.032250Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> steady_states(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_FEED, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT):</span>
<span id="cb14-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Both nontrivial roots of mu(S) = 1/theta by Brent, plus washout.</span></span>
<span id="cb14-3"></span>
<span id="cb14-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ROOT-FOUND, not swept and not continued: the reported numbers must not</span></span>
<span id="cb14-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    depend on a warm start.</span></span>
<span id="cb14-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb14-7">    Sm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ki)</span>
<span id="cb14-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(Sm, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta:</span>
<span id="cb14-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> []                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># past the fold</span></span>
<span id="cb14-10">    lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, Sm,</span>
<span id="cb14-11">                xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-17</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb14-12">    hi_cap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S0, Sm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb14-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(hi_cap, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta:</span>
<span id="cb14-14">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [lo]                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># upper root is above the feed</span></span>
<span id="cb14-15">    hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta, Sm, hi_cap,</span>
<span id="cb14-16">                xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-17</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb14-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [lo, hi]</span>
<span id="cb14-18"></span>
<span id="cb14-19"></span>
<span id="cb14-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> jacobian(S, X, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD):</span>
<span id="cb14-21">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""analytic dmu/dS, so this shares nothing with the ODE solver"""</span></span>
<span id="cb14-22">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Ks</span>
<span id="cb14-23">    dmu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>d)</span>
<span id="cb14-24">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh))</span>
<span id="cb14-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m, dmu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X],</span>
<span id="cb14-26">                     [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dmu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv]])</span>
<span id="cb14-27"></span>
<span id="cb14-28"></span>
<span id="cb14-29">SS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> steady_states()</span>
<span id="cb14-30">S_LO, S_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SS</span>
<span id="cb14-31">X_LO, X_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_LO), YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_HI)</span>
<span id="cb14-32"></span>
<span id="cb14-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (9) AS PRINTED - the bare '+' - against the root-find</span></span>
<span id="cb14-34">S1_EQ9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb14-35">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb14-36">S1_EQ9_MINUS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb14-37">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb14-38">EQ9_VS_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S1_EQ9<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb14-39">EQ9_MINUS_VS_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S1_EQ9_MINUS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb14-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (9) as printed (bare '+') = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S1_EQ9<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l   root-found upper"</span></span>
<span id="cb14-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ9_VS_ROOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sign it does NOT print    = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S1_EQ9_MINUS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l   root-found lower"</span></span>
<span id="cb14-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ9_MINUS_VS_ROOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"-&gt; eq. (9) as printed returns the root Andrews himself calls unstable.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-45"></span>
<span id="cb14-46">EIG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb14-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, S, X <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower"</span>, S_LO, X_LO), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper"</span>, S_HI, X_HI),</span>
<span id="cb14-48">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout"</span>, S_FEED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)):</span>
<span id="cb14-49">    J <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> jacobian(S, X)</span>
<span id="cb14-50">    w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sort(np.linalg.eigvals(J).real)</span>
<span id="cb14-51">    EIG[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> w</span>
<span id="cb14-52">    kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"saddle"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb14-53">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stable node"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unstable node"</span>)</span>
<span id="cb14-54">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> S=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  X=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  eig = (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb14-55">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   det=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>linalg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>det(J)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  tr=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>trace(J)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kind<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-56"></span>
<span id="cb14-57">LAM_SADDLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(EIG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper"</span>]))</span>
<span id="cb14-58">LAM_WASHOUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(EIG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout"</span>]))</span>
<span id="cb14-59">LAM_LOWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(EIG[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower"</span>]))</span>
<span id="cb14-60"></span>
<span id="cb14-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two washout conditions</span></span>
<span id="cb14-62">THETA_TRANS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S_FEED))</span>
<span id="cb14-63">THETA_TRANS_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(</span>
<span id="cb14-64">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: (K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb14-65">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_FEED,</span>
<span id="cb14-66">    THETA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb14-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">fold          : theta_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   (eq. 11, no S_0 in it)"</span>)</span>
<span id="cb14-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"transcritical : 1/mu(S_0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_TRANS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span></span>
<span id="cb14-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   root-found where S_+ = S_0: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_TRANS_ROOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span></span>
<span id="cb14-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(THETA_TRANS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA_TRANS_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"BISTABLE WINDOW at S_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_FEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l :"</span></span>
<span id="cb14-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta in (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_TRANS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) h"</span></span>
<span id="cb14-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   -- Andrews operates at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, inside it"</span>)</span>
<span id="cb14-74">TRANS_VS_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(THETA_TRANS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA_TRANS_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (9) as printed (bare '+') = 3.984943324128 g/l   root-found upper = 3.984943324128   |rel| 1.110e-16
the sign it does NOT print    = 0.015056675872 g/l   root-found lower = 0.015056675872   |rel| 3.997e-15
-&gt; eq. (9) as printed returns the root Andrews himself calls unstable.

lower    S=0.0150566759  X=2.4924716621  eig = (-73.01914193, -0.33333333)   det=+24.33971398  tr=-73.35247526   stable node
upper    S=3.9849433241  X=0.5075283379  eig = (-0.33333333, +0.05617897)   det=-0.01872632  tr=-0.27715437   saddle
washout  S=5.0000000000  X=0.0000000000  eig = (-0.33333333, -0.04810801)   det=+0.01603600  tr=-0.38144134   stable node

fold          : theta_w = 1.2449489743 h   (eq. 11, no S_0 in it)
transcritical : 1/mu(S_0) = 3.5060000000 h   root-found where S_+ = S_0: 3.5060000000 h   |rel| 0.000e+00
BISTABLE WINDOW at S_0 = 5.0 g/l : theta in (1.244949, 3.506000) h   -- Andrews operates at 3.0 h, inside it</code></pre>
</div>
</div>
</section>
<section id="inhibition-barely-moves-the-steady-state-and-completely-changes-its-basin" class="level3">
<h3 class="anchored" data-anchor-id="inhibition-barely-moves-the-steady-state-and-completely-changes-its-basin">5. Inhibition barely moves the steady state and completely changes its basin</h3>
<p>Andrews says so himself, on book p.&nbsp;709: <em>“In the usual continuous culture, operated near steady state, substrate concentrations are low and the term <img src="https://latex.codecogs.com/png.latex?S/K_i"> is therefore much less than the term <img src="https://latex.codecogs.com/png.latex?K_s/S"> even for low values of <img src="https://latex.codecogs.com/png.latex?K_i">. Under these conditions the inhibition function reduces to the Monod function.”</em></p>
<p>He is right about the steady state and it understates the case. At the same <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu">, <img src="https://latex.codecogs.com/png.latex?K_s">, <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> and <img src="https://latex.codecogs.com/png.latex?S_0">, dropping the inhibition term moves the operating substrate concentration by <strong>0.3778 %</strong> and the operating biomass by <strong>0.0011 %</strong>. And it changes the washout eigenvalue from <img src="https://latex.codecogs.com/png.latex?-0.0481080"> h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"> to <img src="https://latex.codecogs.com/png.latex?+0.660702"> h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"> - from stable to unstable. Under Monod there is one nontrivial steady state and it attracts every initial condition with <img src="https://latex.codecogs.com/png.latex?X%20%3E%200">; under Haldane the same steady state, to four figures, has a <strong>basin with a boundary in it</strong>.</p>
<p>That is the whole of Andrews’ second claim, quantified: an effect invisible in the steady state and decisive in the dynamics.</p>
<div id="b7c2fb65" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:40.035116Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:40.034989Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:40.040323Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:40.039686Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Monod at the same constants.  J4.1's law, J4.1's formula, loaded not retyped.</span></span>
<span id="cb16-2">S_MONOD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>MU_HAT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># D K_s/(mu_m - D), Rawlings eq. (10.19)</span></span>
<span id="cb16-3">X_MONOD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_MONOD)</span>
<span id="cb16-4">S_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (S_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_MONOD)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_MONOD</span>
<span id="cb16-5">X_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (X_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_MONOD)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_MONOD</span>
<span id="cb16-6">LAM_WASHOUT_MONOD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu_monod(S_FEED)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA</span>
<span id="cb16-7"></span>
<span id="cb16-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1 rows, loaded from pages/J4.1-monod/printed-growth-laws.csv:"</span>)</span>
<span id="cb16-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  rawlings_steady_states : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_steady_states"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb16-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'  rawlings_Dc            : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_Dc"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_printed"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb16-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"operating point at theta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, S_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_FEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb16-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Haldane  S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   X = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Monod    S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_MONOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   X = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_MONOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  shift    S </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   X </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">washout eigenvalue mu(S_0) - 1/theta"</span>)</span>
<span id="cb16-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Haldane </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAM_WASHOUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h  -&gt; washout STABLE   (bistable)"</span>)</span>
<span id="cb16-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Monod   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAM_WASHOUT_MONOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h  -&gt; washout UNSTABLE (monostable)"</span>)</span>
<span id="cb16-18"></span>
<span id="cb16-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two washout criteria, side by side, evaluated with Andrews' constants</span></span>
<span id="cb16-20">D_C_MONOD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_FEED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(K_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_FEED)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># J4.1's borrowed formula, evaluated here</span></span>
<span id="cb16-21">THETA_C_MONOD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_C_MONOD</span>
<span id="cb16-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">washout criteria at Andrews' constants:"</span>)</span>
<span id="cb16-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Monod, from J4.1's rawlings_Dc row : D_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_C_MONOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h"</span></span>
<span id="cb16-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; theta_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_C_MONOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   (feed-dependent, no fold)"</span>)</span>
<span id="cb16-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Haldane fold, Andrews eq. (11)     : theta_w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span></span>
<span id="cb16-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (S_0-independent)"</span>)</span>
<span id="cb16-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Haldane transcritical, not printed : 1/mu(S_0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_TRANS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb16-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the Monod criterion IS the transcritical one with K_i -&gt; inf:"</span></span>
<span id="cb16-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(THETA_C_MONOD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu_monod(S_FEED))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-30">MONOD_CRIT_IDENTITY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(THETA_C_MONOD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu_monod(S_FEED)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>J4.1 rows, loaded from pages/J4.1-monod/printed-growth-laws.csv:
  rawlings_steady_states : X_s1 = 0, S_s1 = S_f ; X_s2 = y(S_f - S_s2), S_s2 = D K_s/(mu_m - D)
  rawlings_Dc            : D_c = mu_m S_f / (K_s + S_f)

operating point at theta = 3.0 h, S_0 = 5.0 g/l
  Haldane  S = 0.0150566759   X = 2.4924716621
  Monod    S = 0.0150000000   X = 2.4925000000
  shift    S +0.3778%   X -0.0011%

washout eigenvalue mu(S_0) - 1/theta
  Haldane -0.04810801 1/h  -&gt; washout STABLE   (bistable)
  Monod   +0.66070245 1/h  -&gt; washout UNSTABLE (monostable)

washout criteria at Andrews' constants:
  Monod, from J4.1's rawlings_Dc row : D_c = 0.9940357853 1/h  -&gt; theta_c = 1.0060000000 h   (feed-dependent, no fold)
  Haldane fold, Andrews eq. (11)     : theta_w = 1.2449489743 h   (S_0-independent)
  Haldane transcritical, not printed : 1/mu(S_0) = 3.5060000000 h
  the Monod criterion IS the transcritical one with K_i -&gt; inf: |rel| 0.000e+00</code></pre>
</div>
</div>
</section>
<section id="all-six-of-andrews-stated-continuous-culture-outcomes-and-the-thresholds-he-does-not-print" class="level3">
<h3 class="anchored" data-anchor-id="all-six-of-andrews-stated-continuous-culture-outcomes-and-the-thresholds-he-does-not-print">6. All six of Andrews’ stated continuous-culture outcomes, and the thresholds he does not print</h3>
<p>Three separate experiments, each with two stated outcomes - <strong>six outcomes</strong> - all on book p.&nbsp;719. Every threshold below is <strong>root-found</strong>, never swept, and the trajectory classifier is <strong>event-based</strong> - it terminates on reaching the operating state or on biomass falling through <img src="https://latex.codecogs.com/png.latex?10%5E%7B-9%7D"> g/l - so no number here is read off the end of a fixed integration window.</p>
<p><strong>Fig. 8, <img src="https://latex.codecogs.com/png.latex?S_0"> from the saddle.</strong> <em>“When <img src="https://latex.codecogs.com/png.latex?S_0"> is increased to 5.2 g/l organism washout occurs … When <img src="https://latex.codecogs.com/png.latex?S_0"> is decreased to 4.8 g/l the process recovers.”</em> Both reproduce. <strong>The threshold here is exactly <img src="https://latex.codecogs.com/png.latex?S_0%20=%205.0"> by construction</strong> and is not a measurement: the initial state <em>is</em> the steady state at <img src="https://latex.codecogs.com/png.latex?S_0%20=%205">, so what the <img src="https://latex.codecogs.com/png.latex?%5Cpm%200.2"> excursions test is the <strong>direction</strong>, and that is the part that could have come out wrong.</p>
<p><strong>Fig. 9, startup.</strong> <em>“The process fails when <img src="https://latex.codecogs.com/png.latex?X_i%20=%200.10"> g/l but recovers when <img src="https://latex.codecogs.com/png.latex?X_i%20=%200.50"> g/l.”</em> Both reproduce, and the threshold between them is <img src="https://latex.codecogs.com/png.latex?X_%7Bi,%5Ctext%7Bcrit%7D%7D%20=%200.1842466"> g/l - his 0.10 is 45.7 % below it and his 0.50 is 171.4 % above. <strong>This number is computed twice, by routes sharing nothing but the right-hand side</strong>: a bisection on the outcome of the initial-value problem, and a backward integration of the saddle’s stable manifold down to <img src="https://latex.codecogs.com/png.latex?S%20=%200">. They agree to <img src="https://latex.codecogs.com/png.latex?2.4%5Ctimes10%5E%7B-12%7D"> relative.</p>
<p><strong>How much does it depend on the <img src="https://latex.codecogs.com/png.latex?S_1(0)"> Andrews never prints?</strong> Over <img src="https://latex.codecogs.com/png.latex?S_1(0)%20%5Cin%20%5B0,%200.2%5D"> g/l the threshold runs 0.1840000 to 0.1935900 g/l, a <strong>5.2120 %</strong> spread, and that whole range is reported rather than a truncation of it: over the narrower <img src="https://latex.codecogs.com/png.latex?%5B0,%200.05%5D"> g/l the spread is only 0.4071 %, and quoting that would be choosing the flattering window. <strong>The assumption itself is corroborated by Andrews’ own Fig. 9</strong>: on a 300 ppi crop of the rotated landscape page, both of his <img src="https://latex.codecogs.com/png.latex?S_1"> curves - the one for <img src="https://latex.codecogs.com/png.latex?X_i%20=%200.10"> and the one for <img src="https://latex.codecogs.com/png.latex?X_i%20=%200.50"> - emanate from the origin, while the two <img src="https://latex.codecogs.com/png.latex?X_1"> curves start at 0.10 and 0.50 as labelled. So <img src="https://latex.codecogs.com/png.latex?S_1(0)%20=%200"> is not a guess this page makes, it is a reading of the figure the experiment is plotted in, and the 5.2 % is the price of the rest of the interval.</p>
<p><strong>Fig. 10, forcing.</strong> <em>“The effect of step forcing <img src="https://latex.codecogs.com/png.latex?S_0"> from 5 to 20 g/l … process failure … the ramp forcing of <img src="https://latex.codecogs.com/png.latex?S_0"> from 5 to 20 g/l in one hour … the process recovers.”</em> Both reproduce. The critical step is <img src="https://latex.codecogs.com/png.latex?S_0%20=%2017.28760"> g/l, so his 20 clears it by 15.7 %; the critical ramp duration is <img src="https://latex.codecogs.com/png.latex?0.8720668"> h, so <strong>his 1 hr ramp clears it by only 14.67 %</strong>. The critical step is also computed twice - by bisection on the outcome, and by asking on which side of the new system’s separatrix the old operating point lies - agreeing to <img src="https://latex.codecogs.com/png.latex?8.1%5Ctimes10%5E%7B-14%7D">.</p>
<div id="bdd777e7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:40.042800Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:40.042672Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:11:59.340709Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:11:59.339871Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fate(X0_, S0_ini, S0_feed, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, tend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>,</span>
<span id="cb18-2">         Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, event<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb18-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""+1 the culture reaches the operating state, -1 it washes out.</span></span>
<span id="cb18-4"></span>
<span id="cb18-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    EVENT-BASED: terminates on reaching the low-S steady state or on X falling</span></span>
<span id="cb18-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    through 1e-9, so nothing is read off a fixed end time.  `event=False` is the</span></span>
<span id="cb18-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    break-table alternative - classify on the state at a FIXED end time - and it</span></span>
<span id="cb18-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    is here only so that the difference can be measured rather than asserted.</span></span>
<span id="cb18-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb18-10">    ss <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> steady_states(theta, S0_feed <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">callable</span>(S0_feed) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> S0_feed(tend),</span>
<span id="cb18-11">                       Ki, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)</span>
<span id="cb18-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ss:</span>
<span id="cb18-13">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># past the fold: washout is the only state</span></span>
<span id="cb18-14">    s_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-15"></span>
<span id="cb18-16">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs(t, y):</span>
<span id="cb18-17">        X, S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb18-18">        S0t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S0_feed(t) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">callable</span>(S0_feed) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> S0_feed</span>
<span id="cb18-19">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh))</span>
<span id="cb18-20">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X, (S0t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Yv]</span>
<span id="cb18-21"></span>
<span id="cb18-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> event:</span>
<span id="cb18-23">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tend], [X0_, S0_ini], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb18-24">                      method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb18-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> s_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-26">    won <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.001</span>         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb18-27">    won.terminal, won.direction <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-28">    lost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb18-29">    lost.terminal, lost.direction <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-30">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tend], [X0_, S0_ini], events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[won, lost],</span>
<span id="cb18-31">                  rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb18-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.t_events[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]):</span>
<span id="cb18-33">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.t_events[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]):</span>
<span id="cb18-35">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> s_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-37"></span>
<span id="cb18-38"></span>
<span id="cb18-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> separatrix_X_at(S_query, S0_feed, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>):</span>
<span id="cb18-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The saddle's stable manifold, integrated BACKWARD to S = S_query.</span></span>
<span id="cb18-41"></span>
<span id="cb18-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Shares no code with `fate` beyond the right-hand side: no bisection, no</span></span>
<span id="cb18-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    outcome classifier, no event on X.</span></span>
<span id="cb18-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb18-45">    Sm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ki)</span>
<span id="cb18-46">    s_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta, Sm, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S0_feed, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>),</span>
<span id="cb18-47">                  xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-17</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb18-48">    x_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S0_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_hi)</span>
<span id="cb18-49">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_S</span>
<span id="cb18-50">    dmu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(K_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ki)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>d)</span>
<span id="cb18-51">    J <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, dmu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x_hi],</span>
<span id="cb18-52">                  [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s_hi, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dmu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD]])</span>
<span id="cb18-53">    w, v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.eig(J)</span>
<span id="cb18-54">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v[:, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(w.real))].real</span>
<span id="cb18-55">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.linalg.norm(e)</span>
<span id="cb18-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb18-57">        e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>e                                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># head DOWN in S</span></span>
<span id="cb18-58"></span>
<span id="cb18-59">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs_back(t, y):                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># time reversed</span></span>
<span id="cb18-60">        X, S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb18-61">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki))</span>
<span id="cb18-62">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>((S0_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD)]</span>
<span id="cb18-63"></span>
<span id="cb18-64">    hit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_query              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb18-65">    hit.terminal, hit.direction <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-66">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs_back, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>], np.array([x_hi, s_hi]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>e, events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[hit],</span>
<span id="cb18-67">                  rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-18</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb18-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.t_events[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"manifold did not reach the query line"</span></span>
<span id="cb18-69">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.y_events[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb18-70"></span>
<span id="cb18-71"></span>
<span id="cb18-72">S1_ZERO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NOT PRINTED - this page's assumption</span></span>
<span id="cb18-73">STEP_TO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span></span>
<span id="cb18-74"></span>
<span id="cb18-75"></span>
<span id="cb18-76"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> six_outcomes(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb18-77">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Andrews' SIX stated outcomes - three experiments, two outcomes each.</span></span>
<span id="cb18-78"></span>
<span id="cb18-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    One function, so a break row re-runs exactly what the page reports.  `kw`</span></span>
<span id="cb18-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    goes to `fate`, which is how the break table changes theta, the classifier</span></span>
<span id="cb18-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    or a constant underneath all six at once.</span></span>
<span id="cb18-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb18-83">    f8 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {S0: fate(X_HI, S_HI, S0, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> S0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.8</span>)}</span>
<span id="cb18-84">    f9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {Xi: fate(Xi, S1_ZERO, S_FEED, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Xi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>)}</span>
<span id="cb18-85">    f10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step"</span>: fate(X_LO, S_LO, STEP_TO, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw),</span>
<span id="cb18-86">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ramp"</span>: fate(X_LO, S_LO, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(t, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)}</span>
<span id="cb18-87">    ok8 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (f8[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (f8[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.8</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb18-88">    ok9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (f9[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (f9[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb18-89">    ok10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (f10[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (f10[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ramp"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb18-90">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(fig8<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f8, fig9<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f9, fig10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>f10, fig8_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ok8, fig9_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ok9,</span>
<span id="cb18-91">                fig10_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ok10, all_six_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ok8 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ok9 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ok10)</span>
<span id="cb18-92"></span>
<span id="cb18-93"></span>
<span id="cb18-94">OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> six_outcomes()</span>
<span id="cb18-95"></span>
<span id="cb18-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Fig. 8 : direction from the saddle -----------------------------------</span></span>
<span id="cb18-97">FIG8 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8"</span>]</span>
<span id="cb18-98"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 8, starting AT the saddle (S_1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.6f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">, X_1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.6f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">):"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (S_HI, X_HI))</span>
<span id="cb18-99"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> S0, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FIG8.items():</span>
<span id="cb18-100">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  S_0 -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RECOVERS'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'WASHOUT '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-101">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (Andrews: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recovers'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'washout'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb18-102">FIG8_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8_ok"</span>]</span>
<span id="cb18-103"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  both directions as printed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG8_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-104"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THE THRESHOLD IS EXACTLY S_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_FEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> BY CONSTRUCTION and is not a"</span></span>
<span id="cb18-105">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" measurement; what is tested is the direction."</span>)</span>
<span id="cb18-106"></span>
<span id="cb18-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Fig. 9 : startup inoculum --------------------------------------------</span></span>
<span id="cb18-108">FIG9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9"</span>]</span>
<span id="cb18-109"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 9, startup at theta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, S_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_FEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l, S_1(0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S1_ZERO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb18-110"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Xi, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FIG9.items():</span>
<span id="cb18-111">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  X_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Xi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RECOVERS'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'FAILS   '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-112">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (Andrews: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recovers'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Xi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fails'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb18-113">FIG9_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9_ok"</span>]</span>
<span id="cb18-114">X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, S1_ZERO, S_FEED), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.60</span>,</span>
<span id="cb18-115">                xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb18-116">X_CRIT_MANIFOLD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> separatrix_X_at(S1_ZERO, S_FEED)</span>
<span id="cb18-117">X_CRIT_TWO_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_CRIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT_MANIFOLD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb18-118"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  both outcomes as printed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG9_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-119"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  critical inoculum, route A (bisection on the IVP outcome) :"</span></span>
<span id="cb18-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb18-121"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  critical inoculum, route B (saddle stable manifold, backward) :"</span></span>
<span id="cb18-122">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT_MANIFOLD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb18-123"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  |rel| between the two routes: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-124"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Andrews' 0.10 is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of it, his 0.50 is"</span></span>
<span id="cb18-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-126">SENS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {s: brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, s, S_FEED), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.90</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>,</span>
<span id="cb18-127">                  rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)}</span>
<span id="cb18-128"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  sensitivity to the unprinted S_1(0):"</span>,</span>
<span id="cb18-129">      {k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SENS.items()})</span>
<span id="cb18-130"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE WHOLE SAMPLED RANGE, not a truncation of it: dropping the largest S_1(0)</span></span>
<span id="cb18-131"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># would report 0.41 % where the sampled interval gives 5.2 %.</span></span>
<span id="cb18-132">X_CRIT_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(SENS.values())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(SENS.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-133">X_CRIT_SPREAD_NARROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(SENS.values())[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>])</span>
<span id="cb18-134">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(SENS.values())[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb18-135"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  spread over the whole sampled S_1(0) in [0, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(SENS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] g/l:"</span></span>
<span id="cb18-136">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (over [0, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(SENS)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] alone it would be"</span></span>
<span id="cb18-138">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT_SPREAD_NARROW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb18-139"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  S_1(0) = 0 is corroborated by Fig. 9 itself: both S_1 curves start at"</span></span>
<span id="cb18-140">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the origin,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  read on a 300 ppi crop of the rotated landscape page - it"</span></span>
<span id="cb18-141">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is not this page's guess."</span>)</span>
<span id="cb18-142"></span>
<span id="cb18-143"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Fig. 10 : step and ramp ----------------------------------------------</span></span>
<span id="cb18-144">FIG10_STEP, FIG10_RAMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig10"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step"</span>], OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig10"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ramp"</span>]</span>
<span id="cb18-145"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 10, from the stable steady state (S_1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb18-146">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" X_1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">):"</span>)</span>
<span id="cb18-147"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  STEP S_0 5 -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STEP_TO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l       :"</span></span>
<span id="cb18-148">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RECOVERS'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> FIG10_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'FAILS'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (Andrews: fails)"</span>)</span>
<span id="cb18-149"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  RAMP S_0 5 -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STEP_TO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in 1 hr   :"</span></span>
<span id="cb18-150">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RECOVERS'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> FIG10_RAMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'FAILS'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (Andrews: recovers)"</span>)</span>
<span id="cb18-151">FIG10_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig10_ok"</span>]</span>
<span id="cb18-152">S0_STEP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: fate(X_LO, S_LO, z), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>,</span>
<span id="cb18-153">                      xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb18-154">S0_STEP_CRIT_SEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: separatrix_X_at(S_LO, z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>,</span>
<span id="cb18-155">                          xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb18-156">STEP_TWO_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S0_STEP_CRIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S0_STEP_CRIT_SEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb18-157">RAMP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: fate(X_LO, S_LO,</span>
<span id="cb18-158">                                  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(t, T)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T),</span>
<span id="cb18-159">                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb18-160"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  critical STEP, route A (bisection)   : S_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S0_STEP_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb18-161"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  critical STEP, route B (separatrix)  : S_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S0_STEP_CRIT_SEP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span></span>
<span id="cb18-162">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STEP_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-163"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Andrews' step to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STEP_TO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> clears it by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STEP_TO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S0_STEP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-164"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  critical RAMP duration               : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RAMP_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb18-165"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Andrews' 1 hr ramp clears it by only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RAMP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-166">STEP_MARGIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> STEP_TO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S0_STEP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-167">RAMP_MARGIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RAMP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-168">ALL_SIX_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all_six_ok"</span>]</span>
<span id="cb18-169"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ALL_SIX_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (FIG8_OK <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> FIG9_OK <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> FIG10_OK)</span>
<span id="cb18-170"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ALL SIX STATED OUTCOMES REPRODUCE: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALL_SIX_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-171">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (Fig. 8 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG8_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, Fig. 9 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG9_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, Fig. 10 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG10_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Fig. 8, starting AT the saddle (S_1 = 3.984943, X_1 = 0.507528):
  S_0 -&gt; 5.2 g/l : WASHOUT   (Andrews: washout)
  S_0 -&gt; 4.8 g/l : RECOVERS  (Andrews: recovers)
  both directions as printed: True
  THE THRESHOLD IS EXACTLY S_0 = 5 BY CONSTRUCTION and is not a measurement; what is tested is the direction.

Fig. 9, startup at theta = 3.0 h, S_0 = 5.0 g/l, S_1(0) = 0.0:
  X_i = 0.10 g/l : FAILS     (Andrews: fails)
  X_i = 0.50 g/l : RECOVERS  (Andrews: recovers)
  both outcomes as printed: True
  critical inoculum, route A (bisection on the IVP outcome) : 0.184246642137 g/l
  critical inoculum, route B (saddle stable manifold, backward) : 0.184246642136 g/l
  |rel| between the two routes: 2.351e-12
  Andrews' 0.10 is -45.7249% of it, his 0.50 is +171.3754%
  sensitivity to the unprinted S_1(0): {0.0: 0.1842466, 0.005: 0.1841017, 0.015: 0.184, 0.05: 0.184749, 0.2: 0.19359}
  spread over the whole sampled S_1(0) in [0, 0.2] g/l: +5.2120%   (over [0, 0.05] alone it would be +0.4071%)
  S_1(0) = 0 is corroborated by Fig. 9 itself: both S_1 curves start at the origin,
  read on a 300 ppi crop of the rotated landscape page - it is not this page's guess.

Fig. 10, from the stable steady state (S_1 = 0.0150567, X_1 = 2.4924717):
  STEP S_0 5 -&gt; 20 g/l       : FAILS   (Andrews: fails)
  RAMP S_0 5 -&gt; 20 in 1 hr   : RECOVERS   (Andrews: recovers)
  critical STEP, route A (bisection)   : S_0 = 17.2875978711 g/l
  critical STEP, route B (separatrix)  : S_0 = 17.2875978711 g/l   |rel| 8.060e-14
  Andrews' step to 20 clears it by +15.6899%
  critical RAMP duration               : 0.8720667988 h
  Andrews' 1 hr ramp clears it by only +14.6701%

ALL SIX STATED OUTCOMES REPRODUCE: True  (Fig. 8 True, Fig. 9 True, Fig. 10 True)</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p><strong>Ranking, per the builder brief.</strong> There is no worked example with printed intermediates and there are no measurements. The two highest available routes are used, and the fourth is refused:</p>
<ol type="1">
<li><strong>Internal identities the paper must satisfy</strong> - eqs. (2), (3), (6) and (11) re-derived from eq. (1) in sympy with residual exactly <code>0</code>, eq. (9) checked against an independent Brent root-find, and the stability of both roots established from the sign of <img src="https://latex.codecogs.com/png.latex?%5Cdet%20J"> rather than from a picture.</li>
<li><strong>Stated numerical results in the text</strong> - the 36 hr and 12.5 hr of book p.&nbsp;715, and the six stated outcomes of the three experiments on book p.&nbsp;719.</li>
<li><strong>A digitised figure - refused.</strong> Nothing on this page is traced. The consequence is stated plainly: <strong>this page does not establish empirical adequacy against Andrews’ plotted results.</strong> The shapes of Figs. 1, 4, 5, 6, 7, 8, 9 and 10 are not compared with anything computed here, and any claim that lives only in the shape of one of those curves is out of scope.</li>
</ol>
<p><strong>Reproduction, not validation.</strong> Everything in category 2 is Andrews’ own PACTOLUS output. Matching it says the equations were transcribed and integrated correctly; it says nothing about whether microorganisms behave this way.</p>
<section id="independent-second-computations" class="level3">
<h3 class="anchored" data-anchor-id="independent-second-computations">Independent second computations</h3>
<table class="caption-top table">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>quantity</th>
<th>route A</th>
<th>route B</th>
<th>agreement</th>
<th>what it can catch</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>batch time to 5 g/l</td>
<td>closed form (partial fractions, sympy-verified)</td>
<td>LSODA event</td>
<td><img src="https://latex.codecogs.com/png.latex?6.7%5Ctimes10%5E%7B-12%7D"> rel</td>
<td>an error in either route</td>
</tr>
<tr class="even">
<td>critical inoculum</td>
<td>bisection on the IVP outcome</td>
<td>saddle stable manifold, backward</td>
<td><img src="https://latex.codecogs.com/png.latex?2.4%5Ctimes10%5E%7B-12%7D"> rel</td>
<td>an error in either route</td>
</tr>
<tr class="odd">
<td>critical step</td>
<td>bisection on the IVP outcome</td>
<td>separatrix side test</td>
<td><img src="https://latex.codecogs.com/png.latex?8.1%5Ctimes10%5E%7B-14%7D"> rel</td>
<td>an error in either route</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?X_0"> that kills the fold</td>
<td>bisection on the root count, <strong>grid-limited</strong></td>
<td>double root, <img src="https://latex.codecogs.com/png.latex?G%20=%20G'%20=%200"></td>
<td><img src="https://latex.codecogs.com/png.latex?1.2%5Ctimes10%5E%7B-9%7D"> rel at the finest scan</td>
<td>an error in either route</td>
</tr>
<tr class="odd">
<td>upper steady state</td>
<td>eq. (9) <strong>as printed</strong></td>
<td>Brent on <img src="https://latex.codecogs.com/png.latex?%5Cmu(S)%20=%201/%5Ctheta"></td>
<td><img src="https://latex.codecogs.com/png.latex?1.1%5Ctimes10%5E%7B-16%7D"> rel</td>
<td><strong>only a mis-transcription</strong></td>
</tr>
<tr class="even">
<td>transcritical <img src="https://latex.codecogs.com/png.latex?%5Ctheta"></td>
<td><img src="https://latex.codecogs.com/png.latex?1/%5Cmu(S_0)">, closed form</td>
<td>Brent on <img src="https://latex.codecogs.com/png.latex?S_+(%5Ctheta)%20=%20S_0"></td>
<td><strong>exactly <code>0.0</code></strong></td>
<td><strong>only a mis-transcription</strong></td>
</tr>
<tr class="odd">
<td>chemostat transient</td>
<td>pymrm backward Euler + Richardson</td>
<td>LSODA</td>
<td>refinement study</td>
<td>discretisation error</td>
</tr>
<tr class="even">
<td>plug-flow outlet</td>
<td>pymrm steady solve</td>
<td>batch IVP at <img src="https://latex.codecogs.com/png.latex?t%20=%20%5Ctau"></td>
<td>refinement study</td>
<td>discretisation error</td>
</tr>
</tbody>
</table>
<p><strong>Four of those are second computations and two are transcription checks, and the page says which is which.</strong> The last two rows of the first group solve the same algebra twice - eq. (9) <em>is</em> the quadratic the Brent root solves, and <img src="https://latex.codecogs.com/png.latex?1/%5Cmu(S_0)"> <em>is</em> eq. (9) evaluated at <img src="https://latex.codecogs.com/png.latex?S_+%20=%20S_0"> - so they agree to <img src="https://latex.codecogs.com/png.latex?10%5E%7B-16%7D"> and to <code>0.0</code> by construction, and the only defect they can catch is a mis-transcribed equation. That is worth having on a page whose whole licence to exist is transcription, and the break table injects exactly that defect into each of them; it is not worth counting as independent evidence, so it is not.</p>
<p>The last two rows are the refinement studies. <strong>Both axes that carry error are refined</strong>: the time step of the marcher and the grid of the plug-flow solve, each with an observed order.</p>
<div id="fc31763c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:11:59.342912Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:11:59.342761Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:12:03.971551Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:12:03.970596Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- time-step refinement of the pymrm chemostat marcher -------------------</span></span>
<span id="cb20-2">T_MARCH, C0_MARCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.0</span>, [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>]      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># S_1(0) = 0, X_i = 0.50: Fig. 9's recovering case</span></span>
<span id="cb20-3"></span>
<span id="cb20-4"></span>
<span id="cb20-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> chemostat_ivp(c0, T, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_FEED, X0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_FEED, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>):</span>
<span id="cb20-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs(t, y):</span>
<span id="cb20-7">        S, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb20-8">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)))</span>
<span id="cb20-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD, (X0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X]</span>
<span id="cb20-10">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, T], c0, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb20-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s.y[:, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb20-12"></span>
<span id="cb20-13"></span>
<span id="cb20-14">REF_MARCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chemostat_ivp(C0_MARCH, T_MARCH)</span>
<span id="cb20-15">NSTEPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>)</span>
<span id="cb20-16">march_err, march_val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb20-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NSTEPS:</span>
<span id="cb20-18">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ChemostatMarch(nstep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n).march([C0_MARCH], T_MARCH)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb20-19">    march_val.append(c)</span>
<span id="cb20-20">    march_err.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_MARCH)))</span>
<span id="cb20-21">MARCH_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.log2(march_err[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>march_err[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(NSTEPS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb20-22">MARCH_RICH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>march_val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> march_val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first order -&gt; Richardson</span></span>
<span id="cb20-23">MARCH_RICH_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(MARCH_RICH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_MARCH))</span>
<span id="cb20-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm ChemostatMarch vs LSODA at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_MARCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   ref ="</span></span>
<span id="cb20-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (S </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF_MARCH[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, X </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF_MARCH[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb20-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(NSTEPS, march_err):</span>
<span id="cb20-27">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  nstep </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |err| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed orders: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(o, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ORDERS]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Richardson (2c_2n - c_n) |err| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MARCH_RICH_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb20-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>march_err[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MARCH_RICH_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x better than the finest step"</span>)</span>
<span id="cb20-31">MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(MARCH_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb20-32"></span>
<span id="cb20-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- grid refinement of the pymrm plug-flow solve --------------------------</span></span>
<span id="cb20-34">TAU_PFR, S_PFR, X_PFR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, S_FEED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span></span>
<span id="cb20-35"></span>
<span id="cb20-36"></span>
<span id="cb20-37"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> batch_state(S0i, X0i, tau, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>):</span>
<span id="cb20-38">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs(t, y):</span>
<span id="cb20-39">        S, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb20-40">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki))</span>
<span id="cb20-41">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X]</span>
<span id="cb20-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tau], [S0i, X0i], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>,</span>
<span id="cb20-43">                     method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>).y[:, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb20-44"></span>
<span id="cb20-45"></span>
<span id="cb20-46">REF_PFR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> batch_state(S_PFR, X_PFR, TAU_PFR)</span>
<span id="cb20-47">NCELLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb20-48"></span>
<span id="cb20-49"></span>
<span id="cb20-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pfr_refine(ncells<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NCELLS, ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb20-51">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the grid study, as a function, so a break row re-runs exactly this.</span></span>
<span id="cb20-52"></span>
<span id="cb20-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `read` selects the two ways of reading the outlet: through</span></span>
<span id="cb20-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    compute_boundary_values, or off the last cell centre.</span></span>
<span id="cb20-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb20-56">    ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REF_PFR <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ref <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ref</span>
<span id="cb20-57">    err, val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb20-58">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ncells:</span>
<span id="cb20-59">        p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugFlowFermenter(S_PFR, X_PFR, TAU_PFR, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw).solve()</span>
<span id="cb20-60">        o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p.outlet() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> read <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> p.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb20-61">        val.append(np.asarray(o, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb20-62">        err.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref)))</span>
<span id="cb20-63">    orders <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(err[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>err[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ncells) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb20-64">    rich <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb20-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>err, val<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>val, orders<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>orders, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>orders[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb20-66">                richardson<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rich, rich_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(rich <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref)),</span>
<span id="cb20-67">                outlet_X_finest<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb20-68"></span>
<span id="cb20-69"></span>
<span id="cb20-70">PFR_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_refine()</span>
<span id="cb20-71">pfr_err, pfr_val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>], PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"val"</span>]</span>
<span id="cb20-72">PFR_ORDERS, PFR_RICH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>], PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"richardson"</span>]</span>
<span id="cb20-73">PFR_RICH_ERR, PFR_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rich_err"</span>], PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>]</span>
<span id="cb20-74"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pymrm PlugFlowFermenter outlet vs the batch IVP at t = tau = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TAU_PFR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb20-75"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  batch reference (S </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF_PFR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, X </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF_PFR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb20-76"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(NCELLS, pfr_err):</span>
<span id="cb20-77">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ncell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |err| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-78"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed orders: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(o, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_ORDERS]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Richardson |err| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_RICH_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb20-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pfr_err[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_RICH_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x better than the finest grid"</span>)</span>
<span id="cb20-81"></span>
<span id="cb20-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the two ways of reading the outlet, BOTH refined ----------------------</span></span>
<span id="cb20-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The handoff's standing warning is that a last-cell read is O(h) against a</span></span>
<span id="cb20-84"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second-order boundary read.  With a ZERO-GRADIENT outflow condition that is not</span></span>
<span id="cb20-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what happens here, and this page reports what it measures rather than the</span></span>
<span id="cb20-86"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># general rule.</span></span>
<span id="cb20-87">PFR_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_refine(read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"centre"</span>)</span>
<span id="cb20-88">PFR_CENTRE_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>]</span>
<span id="cb20-89">PFR_BOUNDARY_OVER_CENTRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_err[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb20-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  BOTH READS REFINED, same grids, same reference:"</span>)</span>
<span id="cb20-91"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, eb, ec <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(NCELLS, pfr_err, PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>]):</span>
<span id="cb20-92">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    ncell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   boundary |err| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   last cell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ec<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-93">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ec<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-94"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    observed orders: boundary </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, last cell"</span></span>
<span id="cb20-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_CENTRE_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - BOTH FIRST ORDER"</span>)</span>
<span id="cb20-96"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    and the last-cell read is the CLOSER of the two at every grid, by"</span></span>
<span id="cb20-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_BOUNDARY_OVER_CENTRE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x at the finest."</span>)</span>
<span id="cb20-98"></span>
<span id="cb20-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the tau = 6 outlet, converged rather than taken off one grid ----------</span></span>
<span id="cb20-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The sweep below runs 200 cells per hour of residence time, so tau = 6 is</span></span>
<span id="cb20-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ncell = 1200; at first order that value is still 0.16 % from the converged</span></span>
<span id="cb20-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one, so what is REPORTED is the Richardson pair, with the grid value printed</span></span>
<span id="cb20-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># beside it.</span></span>
<span id="cb20-104">TAU6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span></span>
<span id="cb20-105">REF_TAU6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> batch_state(S_FEED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, TAU6)</span>
<span id="cb20-106">_o6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: PlugFlowFermenter(S_FEED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, TAU6, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, init<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>)</span>
<span id="cb20-107">       .solve().outlet() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>)}</span>
<span id="cb20-108">PFR_X_TAU6_GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_o6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb20-109">PFR_TAU6_RICH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_o6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _o6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>]</span>
<span id="cb20-110">PFR_X_TAU6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_TAU6_RICH[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb20-111">PFR_TAU6_GRID_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_X_TAU6_GRID<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(REF_TAU6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb20-112">PFR_TAU6_RICH_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_X_TAU6<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(REF_TAU6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb20-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  outlet X at tau = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TAU6<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, feed S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_FEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, X = 0.10 g/l:"</span>)</span>
<span id="cb20-114"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    ncell 1200 (the sweep's grid) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_X_TAU6_GRID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span></span>
<span id="cb20-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_TAU6_GRID_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the batch reference"</span>)</span>
<span id="cb20-116"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    ncell 2400                    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_o6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb20-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    Richardson of the two         </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_X_TAU6<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span></span>
<span id="cb20-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_TAU6_RICH_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - THIS is what is reported"</span>)</span>
<span id="cb20-119"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    batch reference (LSODA, rtol 1e-13) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(REF_TAU6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb20-120"></span>
<span id="cb20-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- conservation: S + X/Y is invariant in batch, by construction ----------</span></span>
<span id="cb20-122">_a_batch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_PFR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X_PFR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb20-123">PFR_BALANCE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((REF_PFR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> REF_PFR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_a_batch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb20-124">_pf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugFlowFermenter(S_PFR, X_PFR, TAU_PFR, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>).solve()</span>
<span id="cb20-125">PFR_BALANCE_CELLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb20-126">    (_pf.c[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _pf.c[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_a_batch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb20-127"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">S + X/Y invariance: batch IVP </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_BALANCE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb20-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" plug-flow cells </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_BALANCE_CELLS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -- STRUCTURAL, see the break table"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm ChemostatMarch vs LSODA at t = 16 h   ref = (S 0.0151457697, X 2.4827712151)
  nstep   150   |err| 9.415064e-04
  nstep   300   |err| 4.653431e-04
  nstep   600   |err| 2.313138e-04
  nstep  1200   |err| 1.153168e-04
  nstep  2400   |err| 5.757331e-05
  observed orders: [np.float64(1.0167), np.float64(1.0084), np.float64(1.0042), np.float64(1.0021)]
  Richardson (2c_2n - c_n) |err| 1.702080e-07, 338.3x better than the finest step

pymrm PlugFlowFermenter outlet vs the batch IVP at t = tau = 3 h
  batch reference (S 4.7224274718, X 0.2387862641)
  ncell   100   |err| 2.179575e-03
  ncell   200   |err| 1.086354e-03
  ncell   400   |err| 5.423235e-04
  ncell   800   |err| 2.709490e-04
  observed orders: [1.0046, 1.0023, 1.0011]
  Richardson |err| 4.254326e-07, 636.9x better than the finest grid

  BOTH READS REFINED, same grids, same reference:
    ncell   100   boundary |err| 2.179575e-03   last cell 1.649312e-03   ratio 1.3215
    ncell   200   boundary |err| 1.086354e-03   last cell 8.216611e-04   ratio 1.3221
    ncell   400   boundary |err| 5.423235e-04   last cell 4.100862e-04   ratio 1.3225
    ncell   800   boundary |err| 2.709490e-04   last cell 2.048576e-04   ratio 1.3226
    observed orders: boundary 1.0011, last cell 1.0013 - BOTH FIRST ORDER
    and the last-cell read is the CLOSER of the two at every grid, by 1.3226x at the finest.

  outlet X at tau = 6 h, feed S = 5, X = 0.10 g/l:
    ncell 1200 (the sweep's grid) 0.6086420099 g/l   +0.1637% from the batch reference
    ncell 2400                    0.6081441122 g/l
    Richardson of the two         0.6076462145 g/l   -1.702e-06 - THIS is what is reported
    batch reference (LSODA, rtol 1e-13) 0.6076472486 g/l

S + X/Y invariance: batch IVP 2.220e-16, plug-flow cells 6.661e-16  -- STRUCTURAL, see the break table</code></pre>
</div>
</div>
</section>
<section id="break-table" class="level3">
<h3 class="anchored" data-anchor-id="break-table">Break table</h3>
<p>Every metric in <code>agreement.json</code> needs something that moves it. The table below is built for <em>this</em> physics; nothing in it was inherited.</p>
<p><strong>The link between a break row and the metrics it covers is machine-checked, not prose.</strong> Each row returns a dictionary <strong>keyed by metric name</strong>, whose values are those metrics <em>recomputed under the defect</em>; the coverage map printed with <code>agreement.json</code> is then generated from the measured moves, and the notebook fails to execute if any metric is neither moved by a row nor named structural, <strong>or if any row moves nothing at all</strong>. An earlier version of this page carried the link as free text, and two of its entries were false - a row that moved a <em>related</em> quantity without ever recomputing the metric it claimed, and a row whose parenthetical said two routes “part company” when in fact they still agreed to <img src="https://latex.codecogs.com/png.latex?6%5Ctimes10%5E%7B-14%7D">. Generated coverage cannot say that.</p>
<p><strong>But generated coverage can still be faked, and this page faked it.</strong> A row that returns a <em>typed constant</em> for a metric records a relative move of exactly 1.0 <strong>whatever the reported value is</strong>, so its coverage links cannot fail - the free-text claim again, wearing the generator’s clothes. The lag row below used to return five literal <code>0.0</code>s and was the only cover of four metrics. It now recomputes the alternative split with <code>lag_split(..., tangent="start")</code>, the same function the reported split comes from; the values are unchanged and the link became falsifiable. To make the class unshippable rather than something a reviewer has to notice again, a <strong>static guard</strong> parses every row’s own source, plus one level of the notebook helpers it names, and rejects any <code>agreement.json</code> key bound to a numeric literal or to a local name only ever assigned one. Its teeth are <em>measured</em>: the offending row is kept verbatim as a negative control and the guard is asserted to catch all five of its literal metrics - and to leave its <code>_</code>-prefixed diagnostic alone. What the guard cannot do is say whether an expression is the <em>right</em> one; that is what the measured moves are for.</p>
<p>Four quantities <strong>cannot</strong> be moved and are labelled identities rather than reported as agreements. None of them is an <code>agreement.json</code> key; they are printed under the names below:</p>
<ul>
<li><strong>eq. (11) <img src="https://latex.codecogs.com/png.latex?-"> 1/eq. (2)</strong> is exactly <code>0.0</code> in double precision, because eq. (11) and <img src="https://latex.codecogs.com/png.latex?1/">eq. (2) are the same arithmetic expression. Its above-floor companion is <code>theta_washout_h</code>, which every constant change moves.</li>
<li><strong>the <img src="https://latex.codecogs.com/png.latex?S%20+%20X/Y"> balance across the plug-flow cells</strong> (<code>PFR_BALANCE_CELLS</code> in the code) is enforced cell by cell by the yield-coupled source whatever the grid or the kinetics. It is a tautology of the scheme, quoted as a bound. Its companion is <code>pfr_outlet_grid_order</code>.</li>
<li><strong>The Fig. 8 threshold, <img src="https://latex.codecogs.com/png.latex?S_0%20=%205.0"> g/l</strong>, is exact by construction, because the initial state is the steady state at that <img src="https://latex.codecogs.com/png.latex?S_0">. It is not reported as a metric at all; what is reported is <code>fig8_direction_ok</code>, which a change of residence time moves.</li>
<li><strong>The plug-flow outlet’s monotonicity in residence time</strong> follows from <img src="https://latex.codecogs.com/png.latex?dX/dt%20=%20%5Cmu%20X%20%3E%200">, a property of eq. (4) rather than a measurement. It is asserted (<code>PFR_MONOTONE</code>) and not reported.</li>
</ul>
<p>The sympy residuals (<code>eq1 - eq6</code>, eq. (2), eq. (3), the partial fraction, the antiderivative, the two J4.1 form identities) are all exactly zero and are <strong>printed but deliberately not reported</strong>: CI compares everything above <code>ABS_FLOOR = 1e-12</code> at 5 %, and a symbolic zero is a proof, not a measurement.</p>
<p><strong>Four rows are transcription errors rather than physics errors</strong>, and they exist because four of the reported residuals - eq. (2) and eq. (3) against their root-found values, eq. (9) against the Brent root, and the transcritical residence time by its two routes - are <em>algebraically guaranteed</em> to be zero when the transcription is right. They are not checks that the algebra is correct; they are checks that this page copied the paper’s equations correctly, and mis-transcribing the equation is the only thing that can move them. They are labelled that way, and each has a row that mis-transcribes exactly one term.</p>
<div id="e3e48e6d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:12:03.973768Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:12:03.973621Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:12:29.981569Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:12:29.980581Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1">BREAKS, BREAK_FNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb22-2">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative move that counts as coverage of a metric</span></span>
<span id="cb22-3"></span>
<span id="cb22-4"></span>
<span id="cb22-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(label, fn, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>):</span>
<span id="cb22-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Run one defect injection.</span></span>
<span id="cb22-7"></span>
<span id="cb22-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `fn` returns a dict whose keys are METRIC NAMES and whose values are those</span></span>
<span id="cb22-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    metrics RECOMPUTED under the defect.  The coverage map beside</span></span>
<span id="cb22-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `agreement.json` is generated from those measured moves - it is never a</span></span>
<span id="cb22-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    hand-written claim.  Keys beginning with `_` are diagnostics: printed, and</span></span>
<span id="cb22-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    deliberately not counted as coverage.</span></span>
<span id="cb22-13"></span>
<span id="cb22-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `fn` itself is kept, not just its output: the guard at the end of this cell</span></span>
<span id="cb22-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    reads every row's own source and rejects any metric returned as a typed</span></span>
<span id="cb22-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    constant rather than computed.</span></span>
<span id="cb22-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb22-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb22-19">        got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn()</span>
<span id="cb22-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> exc:                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a break that breaks</span></span>
<span id="cb22-21">        got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_raised"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span>(exc)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">__name__</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>exc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}</span>
<span id="cb22-22">    BREAKS.append((label, got, note))</span>
<span id="cb22-23">    BREAK_FNS.append((label, fn))</span>
<span id="cb22-24"></span>
<span id="cb22-25"></span>
<span id="cb22-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eig_pack(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>THETA, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_FEED, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_S, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YIELD):</span>
<span id="cb22-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""steady states, biomass and eigenvalues, recomputed from scratch"""</span></span>
<span id="cb22-28">    ss <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> steady_states(theta, S0, Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)</span>
<span id="cb22-29">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb22-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ss:</span>
<span id="cb22-31">        lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-32">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_S_lower_g_per_l"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lo</span>
<span id="cb22-33">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_X_lower_g_per_l"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo)</span>
<span id="cb22-34">        w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sort(np.linalg.eigvals(jacobian(lo, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo), theta, Ki,</span>
<span id="cb22-35">                                               Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Yv)).real)</span>
<span id="cb22-36">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower_node_fast_eigenvalue_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb22-37">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ss) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb22-38">        hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb22-39">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_S_upper_g_per_l"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hi</span>
<span id="cb22-40">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_X_upper_g_per_l"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi)</span>
<span id="cb22-41">        w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sort(np.linalg.eigvals(jacobian(hi, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi), theta, Ki,</span>
<span id="cb22-42">                                               Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Yv)).real)</span>
<span id="cb22-43">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"saddle_positive_eigenvalue_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb22-44">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout_eigenvalue_haldane_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (</span>
<span id="cb22-45">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S0, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta)</span>
<span id="cb22-46">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout_eigenvalue_monod_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (</span>
<span id="cb22-47">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu_monod(S0, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>theta)</span>
<span id="cb22-48">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S0, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ks, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>muh))</span>
<span id="cb22-49">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_theta_c_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S0)</span>
<span id="cb22-50">    s_monod <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>muh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-51">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ss:</span>
<span id="cb22-52">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_vs_haldane_S_shift_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_monod)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_monod</span>
<span id="cb22-53">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_vs_haldane_X_shift_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(S0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_monod) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-55"></span>
<span id="cb22-56"></span>
<span id="cb22-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 1. drop the inhibition term entirely (K_i -&gt; inf, i.e. Monod) ----------</span></span>
<span id="cb22-58"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _monod_limit():</span>
<span id="cb22-59">    KI_INF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span></span>
<span id="cb22-60">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_rate_roots(KI_INF)</span>
<span id="cb22-61">    mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KI_INF))</span>
<span id="cb22-62">    seeded <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m: acclimate(m, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KI_INF)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder"</span>)}</span>
<span id="cb22-63">    st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(seeded.values())</span>
<span id="cb22-64">    t_dir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KI_INF)</span>
<span id="cb22-65">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(_n_steady<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(steady_states(THETA, S_FEED, KI_INF)),</span>
<span id="cb22-66">               _lag_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lag_split(KI_INF)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb22-67">               mu_hat_m_eq2_per_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mum,</span>
<span id="cb22-68">               S_m_eq3_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KI_INF),</span>
<span id="cb22-69">               theta_washout_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KI_INF)),</span>
<span id="cb22-70">               rm_as_maximum_overstatement_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-71">               half_rate_low_root_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo, half_rate_high_root_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi,</span>
<span id="cb22-72">               Ks_definition_rel_error<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_S,</span>
<span id="cb22-73">               Ki_definition_rel_error<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KI_INF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KI_INF,</span>
<span id="cb22-74">               batch_time_direct_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_dir,</span>
<span id="cb22-75">               batch_time_direct_vs_printed36_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t_dir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>,</span>
<span id="cb22-76">               batch_time_ratio_vs_no_inhibition<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_dir<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>],</span>
<span id="cb22-77">               lag_hours_at_Ki2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lag_split(KI_INF)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb22-78">               peak_growth_rate_drop_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-79">               batch_realised_mean_growth_drop_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>t_dir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-80">               batch_time_seeded_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>seeded[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>],</span>
<span id="cb22-81">               batch_time_seeded_vs_printed12p5_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(seeded[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span>,</span>
<span id="cb22-82">               seed_readings_raw_spread_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(st)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(st) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-83">               seed_reset_vs_increment_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>seeded[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>seeded[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-84">               seed_speedup_factor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_dir<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>seeded[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>])</span>
<span id="cb22-85">    out.update(_eig_pack(Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KI_INF))</span>
<span id="cb22-86">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-87"></span>
<span id="cb22-88"></span>
<span id="cb22-89">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i -&gt; inf (Monod)"</span>, _monod_limit,</span>
<span id="cb22-90">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kills the saddle, the fold and the lag; t_direct falls 5.26x, the"</span></span>
<span id="cb22-91">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" acclimation speed-up collapses to ~1 and washout turns unstable"</span>)</span>
<span id="cb22-92"></span>
<span id="cb22-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 2. halve K_s ----------------------------------------------------------</span></span>
<span id="cb22-94"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _half_Ks():</span>
<span id="cb22-95">    KS2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span></span>
<span id="cb22-96">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_rate_roots(K_I, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KS2)</span>
<span id="cb22-97">    mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(KS2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I))</span>
<span id="cb22-98">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(mu_hat_m_eq2_per_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mum, S_m_eq3_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.sqrt(KS2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I),</span>
<span id="cb22-99">               theta_washout_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(KS2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I)),</span>
<span id="cb22-100">               rm_as_maximum_overstatement_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-101">               half_rate_low_root_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo, half_rate_high_root_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi,</span>
<span id="cb22-102">               Ks_definition_rel_error<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KS2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KS2,</span>
<span id="cb22-103">               Ki_definition_rel_error<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I,</span>
<span id="cb22-104">               Ki_min_for_half_rate_defs_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KS2,</span>
<span id="cb22-105">               branch_switch_Ki_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KS2,</span>
<span id="cb22-106">               peak_growth_rate_drop_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lag_split(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KS2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>]</span>
<span id="cb22-107">                                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lag_split(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KS2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-108">               feed_seed_fold_S_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(</span>
<span id="cb22-109">                   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m, dm: m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s))(</span>
<span id="cb22-110">                       <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s, Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KS2)),</span>
<span id="cb22-111">                       MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(KS2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb22-112">                   np.sqrt(KS2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>, S_FEED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb22-113">                   xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>))</span>
<span id="cb22-114">    out.update(_eig_pack(Ks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KS2))</span>
<span id="cb22-115">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-116"></span>
<span id="cb22-117"></span>
<span id="cb22-118">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_s 0.03 -&gt; 0.015"</span>, _half_Ks,</span>
<span id="cb22-119">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every constant of the inhibition function moves, and so do all three"</span></span>
<span id="cb22-120">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" steady states"</span>)</span>
<span id="cb22-121"></span>
<span id="cb22-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 3. wrong yield --------------------------------------------------------</span></span>
<span id="cb22-123"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _wrong_yield():</span>
<span id="cb22-124">    Y2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span></span>
<span id="cb22-125">    s_fold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_fold_eq, np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>, S_FEED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb22-126">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-127">    m_fold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s_fold))</span>
<span id="cb22-128">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(_X_reachable_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Y2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_INIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Y2),</span>
<span id="cb22-129">               _t_to_X3p5_Y0p5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>, S_INIT),</span>
<span id="cb22-130">               _t_to_X3p5_Y0p4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>, S_INIT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Y2),</span>
<span id="cb22-131">               critical_inoculum_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(</span>
<span id="cb22-132">                   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, S1_ZERO, S_FEED, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Y2), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>,</span>
<span id="cb22-133">                   xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb22-134">               feed_seed_removing_hysteresis_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(</span>
<span id="cb22-135">                   Y2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_fold)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m_fold)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m_fold)))</span>
<span id="cb22-136">    out.update(_eig_pack(Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Y2))</span>
<span id="cb22-137">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-138"></span>
<span id="cb22-139"></span>
<span id="cb22-140">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Y 0.5 -&gt; 0.4"</span>, _wrong_yield,</span>
<span id="cb22-141">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5 g/l of biomass is UNREACHABLE at Y = 0.4 (max 4.005), so the batch"</span></span>
<span id="cb22-142">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" comparison is made at 3.5 g/l; X_crit scales exactly with Y, because"</span></span>
<span id="cb22-143">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" u = X/Y turns the chemostat into a pair of equations with no Y in them at"</span></span>
<span id="cb22-144">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" all - and that substitution is only available BECAUSE THE FEED IS STERILE"</span></span>
<span id="cb22-145">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (X_FEED = 0) and the outcome test is on S, not on X.  So this row cannot"</span></span>
<span id="cb22-146">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" move X_crit's sensitivity to S_1(0) either: the whole basin boundary"</span></span>
<span id="cb22-147">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" scales with Y and the spread is invariant"</span>)</span>
<span id="cb22-148"></span>
<span id="cb22-149"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 4. use eq. (9) as printed (the '+' root) as the operating point --------</span></span>
<span id="cb22-150"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _operate_at_eq9():</span>
<span id="cb22-151">    X9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S1_EQ9)</span>
<span id="cb22-152">    w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sort(np.linalg.eigvals(jacobian(S1_EQ9, X9)).real)</span>
<span id="cb22-153">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(steady_S_lower_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S1_EQ9, steady_X_lower_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X9,</span>
<span id="cb22-154">                lower_node_fast_eigenvalue_per_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb22-155">                monod_vs_haldane_S_shift_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(S1_EQ9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_MONOD)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_MONOD,</span>
<span id="cb22-156">                _max_eig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb22-157"></span>
<span id="cb22-158"></span>
<span id="cb22-159">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"operate at eq.(9)'s printed root"</span>, _operate_at_eq9,</span>
<span id="cb22-160">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed root is the SADDLE: taking it as the operating point reports a"</span></span>
<span id="cb22-161">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" substrate 265x too high and a positive eigenvalue"</span>)</span>
<span id="cb22-162"></span>
<span id="cb22-163"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 5. flip the sign of the yield coupling in the batch closed form --------</span></span>
<span id="cb22-164">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dS/dt sign flipped"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb22-165">    batch_time_direct_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>YIELD),</span>
<span id="cb22-166">    batch_time_direct_vs_printed36_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>YIELD)</span>
<span id="cb22-167">                                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>,</span>
<span id="cb22-168">    _closedform_vs_lsoda_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>YIELD)</span>
<span id="cb22-169">                                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> batch_ivp(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT, Yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>YIELD) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb22-170">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a = S_i - X_i/Y and the closed form is no longer the same problem - but"</span></span>
<span id="cb22-171">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" BOTH ROUTES CARRY THE FLIP, so they still agree to ~1e-13 and"</span></span>
<span id="cb22-172">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" batch_closedform_vs_lsoda_rel does NOT move.  That metric needs the next"</span></span>
<span id="cb22-173">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" row, not this one"</span>)</span>
<span id="cb22-174"></span>
<span id="cb22-175"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 5b. drop one term from the closed form: the two routes DO part company -</span></span>
<span id="cb22-176"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _drop_term():</span>
<span id="cb22-177">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> t_bad(Xi, Xf, Si):</span>
<span id="cb22-178">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Si <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Xi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb22-179">        Sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb22-180">        B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a</span>
<span id="cb22-181">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log(Si<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Sf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log(Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xi))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (S_f-S_i)/K_i GONE</span></span>
<span id="cb22-182">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_bad(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT)</span>
<span id="cb22-183">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(batch_time_direct_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t,</span>
<span id="cb22-184">                batch_time_direct_vs_printed36_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>,</span>
<span id="cb22-185">                batch_closedform_vs_lsoda_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_DIRECT_IVP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb22-186"></span>
<span id="cb22-187"></span>
<span id="cb22-188">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form with the (S_f - S_i)/K_i term dropped"</span>, _drop_term,</span>
<span id="cb22-189">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the partial fraction's constant term is what the two routes disagree about"</span></span>
<span id="cb22-190">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" if it is lost: 41.52 h against LSODA's 36.53"</span>)</span>
<span id="cb22-191"></span>
<span id="cb22-192"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 6. theta outside the bistable window ----------------------------------</span></span>
<span id="cb22-193"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _theta_four():</span>
<span id="cb22-194">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> six_outcomes(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)</span>
<span id="cb22-195">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(all_six_stated_outcomes_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all_six_ok"</span>]),</span>
<span id="cb22-196">               fig8_direction_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8_ok"</span>]),</span>
<span id="cb22-197">               _fig9_at_0p10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig9"</span>][<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>],</span>
<span id="cb22-198">               _fold_eq_has_root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_fold_eq(np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>,</span>
<span id="cb22-199">                                                theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)</span>
<span id="cb22-200">                                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _fold_eq(S_FEED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb22-201">    out.update(_eig_pack(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>))</span>
<span id="cb22-202">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-203"></span>
<span id="cb22-204"></span>
<span id="cb22-205">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta 3 -&gt; 4 h (above 1/mu(S_0))"</span>, _theta_four,</span>
<span id="cb22-206">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout turns unstable, so every one of the six outcomes comes out"</span></span>
<span id="cb22-207">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 'recovers' and the critical inoculum and the X_0 fold cease to exist"</span>)</span>
<span id="cb22-208"></span>
<span id="cb22-209"></span>
<span id="cb22-210"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _theta_past_fold():</span>
<span id="cb22-211">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> six_outcomes(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>)</span>
<span id="cb22-212">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(all_six_stated_outcomes_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all_six_ok"</span>]),</span>
<span id="cb22-213">                fig8_direction_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8_ok"</span>]),</span>
<span id="cb22-214">                _n_steady<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(steady_states(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, S_FEED, K_I)))</span>
<span id="cb22-215"></span>
<span id="cb22-216"></span>
<span id="cb22-217">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta 3 -&gt; 1.2 h (below theta_w)"</span>, _theta_past_fold,</span>
<span id="cb22-218">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"past the fold: nothing survives and all six outcomes come out 'washout'"</span>)</span>
<span id="cb22-219"></span>
<span id="cb22-220"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 7. move the feed ------------------------------------------------------</span></span>
<span id="cb22-221"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _feed_seven():</span>
<span id="cb22-222">    S07 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.0</span></span>
<span id="cb22-223">    x_lo7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S07 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_LO)</span>
<span id="cb22-224">    step7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: fate(x_lo7, S_LO, z), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb22-225">    s_fold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_fold_eq, np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>, S07<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb22-226">                    args<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(S07,), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-227">    m_fold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(s_fold))</span>
<span id="cb22-228">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(critical_inoculum_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, S1_ZERO, S07),</span>
<span id="cb22-229">                                                <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb22-230">               critical_step_S0_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>step7,</span>
<span id="cb22-231">               andrews_step_margin_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STEP_TO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>step7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-232">               feed_seed_fold_S_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s_fold,</span>
<span id="cb22-233">               feed_seed_removing_hysteresis_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(</span>
<span id="cb22-234">                   YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S07 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_fold)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m_fold)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m_fold)))</span>
<span id="cb22-235">    out.update(_eig_pack(S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S07))</span>
<span id="cb22-236">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-237"></span>
<span id="cb22-238"></span>
<span id="cb22-239">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_0 5 -&gt; 7 g/l (still bistable)"</span>, _feed_seven,</span>
<span id="cb22-240">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the feed enters every threshold and the fold, but not the steady-state"</span></span>
<span id="cb22-241">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" SUBSTRATE concentrations, which depend on theta alone"</span>)</span>
<span id="cb22-242"></span>
<span id="cb22-243"></span>
<span id="cb22-244"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _feed_three():</span>
<span id="cb22-245">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(_theta_trans<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)),</span>
<span id="cb22-246">                _bistable<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(THETA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>))),</span>
<span id="cb22-247">                _fate_at_tiny_inoculum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>fate(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, S1_ZERO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>),</span>
<span id="cb22-248">                theta_transcritical_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)),</span>
<span id="cb22-249">                washout_eigenvalue_haldane_per_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA,</span>
<span id="cb22-250">                _fold_eq_has_root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_fold_eq(np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>, S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb22-251">                                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _fold_eq(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), S0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb22-252"></span>
<span id="cb22-253"></span>
<span id="cb22-254">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_0 5 -&gt; 3 g/l (below the bistable range)"</span>, _feed_three,</span>
<span id="cb22-255">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/mu(3) = 2.51 h &lt; theta = 3 h, so washout is unstable: the critical"</span></span>
<span id="cb22-256">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" inoculum, the critical step and the X_0 fold all cease to exist"</span>)</span>
<span id="cb22-257"></span>
<span id="cb22-258"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 8. mis-set muhat ------------------------------------------------------</span></span>
<span id="cb22-259"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _muhat_low():</span>
<span id="cb22-260">    MU9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span></span>
<span id="cb22-261">    t_dir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_batch(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, S_INIT, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9)</span>
<span id="cb22-262">    t_seed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> acclimate(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"increment"</span>, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-263">    s_lo9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> steady_states(muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-264">    x_lo9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_lo9)</span>
<span id="cb22-265">    step9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: fate(x_lo9, s_lo9, z, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb22-266">    ramp9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> T: fate(x_lo9, s_lo9,</span>
<span id="cb22-267">                                  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(t, T)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T, muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9),</span>
<span id="cb22-268">                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb22-269">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(critical_step_S0_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>step9,</span>
<span id="cb22-270">               andrews_step_margin_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STEP_TO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>step9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-271">               critical_ramp_duration_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ramp9,</span>
<span id="cb22-272">               andrews_ramp_margin_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ramp9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb22-273">               mu_hat_m_eq2_per_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I)),</span>
<span id="cb22-274">               theta_washout_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU9)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I)),</span>
<span id="cb22-275">               batch_time_direct_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_dir,</span>
<span id="cb22-276">               batch_time_direct_vs_printed36_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t_dir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.0</span>,</span>
<span id="cb22-277">               batch_time_seeded_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_seed,</span>
<span id="cb22-278">               batch_time_seeded_vs_printed12p5_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t_seed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span>,</span>
<span id="cb22-279">               seed_speedup_factor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_dir<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>t_seed)</span>
<span id="cb22-280">    out.update(_eig_pack(muh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU9))</span>
<span id="cb22-281">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb22-282"></span>
<span id="cb22-283"></span>
<span id="cb22-284">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"muhat 1.0 -&gt; 0.9"</span>, _muhat_low,</span>
<span id="cb22-285">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a pure time scaling of the BATCH problem - so the ratio t_direct/t_seed"</span></span>
<span id="cb22-286">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" barely moves - but not of the chemostat, where theta and the forcing"</span></span>
<span id="cb22-287">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" durations are fixed in hours: slower kinetics need a slower ramp, 1.6 h"</span></span>
<span id="cb22-288">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" against 0.87 h"</span>)</span>
<span id="cb22-289"></span>
<span id="cb22-290"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 9. the other two readings of the acclimation sentence -----------------</span></span>
<span id="cb22-291"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _reading(mode):</span>
<span id="cb22-292">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> acclimate(mode)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-293">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(batch_time_seeded_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t,</span>
<span id="cb22-294">                batch_time_seeded_vs_printed12p5_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.5</span>,</span>
<span id="cb22-295">                seed_speedup_factor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_DIRECT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>t)</span>
<span id="cb22-296"></span>
<span id="cb22-297"></span>
<span id="cb22-298">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"acclimation read as 'reset to 2.0'"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _reading(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset"</span>),</span>
<span id="cb22-299">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the near neighbour of the reported reading: 0.042 % away, which is what is"</span></span>
<span id="cb22-300">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" left of the ambiguity once Fig. 7's annotation has closed it"</span>)</span>
<span id="cb22-301">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"acclimation read as the 2/4/6 ladder"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _reading(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder"</span>),</span>
<span id="cb22-302">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reading Fig. 7's 'ADDED IN INCREMENTS OF 2.0 GM/L' excludes: three"</span></span>
<span id="cb22-303">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" cycles instead of six and +10.35 % against his printed 12.5 hr"</span>)</span>
<span id="cb22-304"></span>
<span id="cb22-305"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 10. the lag definition ------------------------------------------------</span></span>
<span id="cb22-306"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lag_alt():</span>
<span id="cb22-307">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""tangent taken at t = 0 instead of at the peak.</span></span>
<span id="cb22-308"></span>
<span id="cb22-309"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The split is RECOMPUTED under that definition - `lag_split(..., tangent=</span></span>
<span id="cb22-310"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    "start")`, the same function the reported split comes from - and not</span></span>
<span id="cb22-311"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    asserted to be zero.  An earlier version of this row returned five literal</span></span>
<span id="cb22-312"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    0.0s, which made its five coverage links unconditional: they recorded a</span></span>
<span id="cb22-313"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    move of exactly 1.0 whatever the reported values were.  The row is kept</span></span>
<span id="cb22-314"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    verbatim below as the negative control for the guard that now forbids it.</span></span>
<span id="cb22-315"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb22-316">    alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: lag_split(k, tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)}</span>
<span id="cb22-317">    sh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: lag_share(k, tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)}</span>
<span id="cb22-318">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(lag_hours_at_Ki2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alt[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb22-319">                lag_share_of_delay_Ki2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>],</span>
<span id="cb22-320">                lag_share_of_delay_Ki5<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>],</span>
<span id="cb22-321">                lag_share_of_delay_Ki10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>],</span>
<span id="cb22-322">                lag_share_of_delay_at_Xf1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lag_share(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, Xf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb22-323">                                                    tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb22-324">                _expo_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_INIT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S_INIT)),</span>
<span id="cb22-325">                _largest_recomputed_lag_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> alt.values()),</span>
<span id="cb22-326">                _branch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alt[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"branch"</span>])</span>
<span id="cb22-327"></span>
<span id="cb22-328"></span>
<span id="cb22-329">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag tangent at t=0, not at the peak"</span>, _lag_alt,</span>
<span id="cb22-330">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collapses the lag to zero by definition - which is why the peak tangent"</span></span>
<span id="cb22-331">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" is the one that can distinguish a lag from a slow phase.  The zero is"</span></span>
<span id="cb22-332">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" COMPUTED, not asserted: the largest lag the alternative definition"</span></span>
<span id="cb22-333">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" returns over K_i = 2, 5, 10 is printed above"</span>)</span>
<span id="cb22-334"></span>
<span id="cb22-335"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 10b. marcher with the linear dilution dropped from the operator -------</span></span>
<span id="cb22-336"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _march_no_dilution():</span>
<span id="cb22-337">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Bad(ChemostatMarch):</span>
<span id="cb22-338">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> step(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c_old, h, S0_now):</span>
<span id="cb22-339">            inflow <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[S0_now, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.X0]])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta</span>
<span id="cb22-340"></span>
<span id="cb22-341">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(c):</span>
<span id="cb22-342">                sc, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb22-343">                r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_old.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h</span>
<span id="cb22-344">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> inflow.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sc.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -c/theta GONE</span></span>
<span id="cb22-345">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js</span>
<span id="cb22-346">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(res, c_old, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb22-347">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> out.success</span>
<span id="cb22-348">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out.x.reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb22-349"></span>
<span id="cb22-350">    errs, vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb22-351">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NSTEPS:</span>
<span id="cb22-352">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bad(nstep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n).march([C0_MARCH], T_MARCH)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-353">        vals.append(c)</span>
<span id="cb22-354">        errs.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_MARCH)))</span>
<span id="cb22-355">    orders <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(errs[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>errs[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(NSTEPS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb22-356">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pymrm_march_time_step_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>orders[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb22-357">                pymrm_march_richardson_abs_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb22-358">                    np.linalg.norm(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_MARCH)),</span>
<span id="cb22-359">                _finest_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb22-360"></span>
<span id="cb22-361"></span>
<span id="cb22-362">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"marcher: -c/theta dropped from the constant operator"</span>, _march_no_dilution,</span>
<span id="cb22-363">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the marcher now solves a different equation, so refining the step no longer"</span></span>
<span id="cb22-364">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" converges on the reference and the observed order collapses"</span>)</span>
<span id="cb22-365"></span>
<span id="cb22-366"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 11. wrong geometry in construct_div -----------------------------------</span></span>
<span id="cb22-367"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _nu_one():</span>
<span id="cb22-368">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_refine(nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-369">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_refine(nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"centre"</span>)</span>
<span id="cb22-370">    o6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: PlugFlowFermenter(S_FEED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, TAU6, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, init<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>)</span>
<span id="cb22-371">          .solve().outlet() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>)}</span>
<span id="cb22-372">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pfr_outlet_grid_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>],</span>
<span id="cb22-373">                pfr_richardson_abs_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rich_err"</span>],</span>
<span id="cb22-374">                pfr_outlet_X_at_tau3_ncell800_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet_X_finest"</span>],</span>
<span id="cb22-375">                pfr_last_cell_read_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>],</span>
<span id="cb22-376">                pfr_boundary_over_last_cell_err_ratio_ncell800<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb22-377">                pfr_outlet_X_at_tau6_richardson_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb22-378">                    (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>o6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> o6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb22-379"></span>
<span id="cb22-380"></span>
<span id="cb22-381">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"construct_div nu=1 (cylindrical)"</span>, _nu_one,</span>
<span id="cb22-382">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the divergence now carries a 1/r area profile the reactor does not have:"</span></span>
<span id="cb22-383">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the solve still converges, on the wrong answer, and the grid study is what"</span></span>
<span id="cb22-384">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" catches it"</span>)</span>
<span id="cb22-385"></span>
<span id="cb22-386"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 12. outlet read off the last cell centre ------------------------------</span></span>
<span id="cb22-387"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _outlet_last_cell():</span>
<span id="cb22-388">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugFlowFermenter(S_PFR, X_PFR, TAU_PFR, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>).solve()</span>
<span id="cb22-389">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(_last_cell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].tolist(), _boundary_values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p.outlet().tolist(),</span>
<span id="cb22-390">                _err_last_cell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(p.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_PFR)),</span>
<span id="cb22-391">                _err_boundary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.linalg.norm(p.outlet() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_PFR)),</span>
<span id="cb22-392">                pfr_outlet_X_at_tau3_ncell800_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet_X_finest"</span>],</span>
<span id="cb22-393">                pfr_outlet_grid_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>],</span>
<span id="cb22-394">                pfr_richardson_abs_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rich_err"</span>])</span>
<span id="cb22-395"></span>
<span id="cb22-396"></span>
<span id="cb22-397">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet off the last cell centre"</span>, _outlet_last_cell,</span>
<span id="cb22-398">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MEASURED, not assumed: both reads are FIRST ORDER here (1.0011 boundary,"</span></span>
<span id="cb22-399">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1.0013 last cell) and the last-cell read is the closer of the two at every"</span></span>
<span id="cb22-400">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" grid, by a ratio that hardly moves under refinement (1.3215 at n = 100,"</span></span>
<span id="cb22-401">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1.3226 at n = 800).  The boundary read is used because it is the value the"</span></span>
<span id="cb22-402">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" flux operator transports, not because it is more accurate"</span>)</span>
<span id="cb22-403"></span>
<span id="cb22-404"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 13. wrong inlet boundary condition ------------------------------------</span></span>
<span id="cb22-405"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _neumann_inlet():</span>
<span id="cb22-406">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_refine(inlet_bc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"neumann"</span>)</span>
<span id="cb22-407">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pfr_refine(inlet_bc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"neumann"</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"centre"</span>)</span>
<span id="cb22-408">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pfr_outlet_grid_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>],</span>
<span id="cb22-409">                pfr_richardson_abs_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rich_err"</span>],</span>
<span id="cb22-410">                pfr_outlet_X_at_tau3_ncell800_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet_X_finest"</span>],</span>
<span id="cb22-411">                pfr_last_cell_read_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>],</span>
<span id="cb22-412">                pfr_boundary_over_last_cell_err_ratio_ncell800<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb22-413"></span>
<span id="cb22-414"></span>
<span id="cb22-415">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet bc zero-gradient not Dirichlet"</span>, _neumann_inlet, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the feed never enters"</span>)</span>
<span id="cb22-416"></span>
<span id="cb22-417"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 14. the X_0 fold found by COUNTING roots on the coarsest scan ----------</span></span>
<span id="cb22-418"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _fold_by_counting():</span>
<span id="cb22-419">    coarse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(n_steady_seeded(z, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1501</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb22-420">                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-421">    fine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(n_steady_seeded(z, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96001</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb22-422">                  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-423">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(feed_seed_removing_hysteresis_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>coarse,</span>
<span id="cb22-424">                feed_seed_fold_two_routes_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(coarse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>fine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb22-425"></span>
<span id="cb22-426"></span>
<span id="cb22-427">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the X_0 fold reported from the root COUNT at ngrid 1501"</span>, _fold_by_counting,</span>
<span id="cb22-428">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this is the grid-limited route the page refuses to report: it sees the two"</span></span>
<span id="cb22-429">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" merging roots only while they are more than one scan cell apart, so it"</span></span>
<span id="cb22-430">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" puts the fold 0.49 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% e</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">arly"</span>)</span>
<span id="cb22-431"></span>
<span id="cb22-432"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 15. transcription: eq. (9) with 4 K_s K_i written as 4 K_s ------------</span></span>
<span id="cb22-433"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eq9_mistranscribed():</span>
<span id="cb22-434">    disc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_S</span>
<span id="cb22-435">    s9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(disc))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb22-436">    root <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(</span>
<span id="cb22-437">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: (K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-438">                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(K_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_FEED,</span>
<span id="cb22-439">        THETA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-440">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eq9_printed_vs_rootfound_upper_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s9<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-441">                theta_transcritical_two_routes_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(THETA_TRANS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>root <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb22-442"></span>
<span id="cb22-443"></span>
<span id="cb22-444">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (9) transcribed with 4 K_s K_i as 4 K_s"</span>, _eq9_mistranscribed,</span>
<span id="cb22-445">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the ONLY thing that can move these two residuals, which are otherwise zero"</span></span>
<span id="cb22-446">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" by algebra: they check the transcription, not the arithmetic"</span>)</span>
<span id="cb22-447"></span>
<span id="cb22-448"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 16. transcription: eq. (2) without the 2, eq. (3) without the root -----</span></span>
<span id="cb22-449"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eq23_mistranscribed():</span>
<span id="cb22-450">    mum_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_I))          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the factor 2 dropped</span></span>
<span id="cb22-451">    sm_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the square root dropped</span></span>
<span id="cb22-452">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(mu_hat_m_eq2_per_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mum_bad,</span>
<span id="cb22-453">                eq2_vs_rootfound_max_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mum_bad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT_M_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-454">                S_m_eq3_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sm_bad,</span>
<span id="cb22-455">                eq3_vs_rootfound_argmax_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sm_bad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_M_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-456">                rm_as_maximum_overstatement_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MU_HAT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mum_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-457"></span>
<span id="cb22-458"></span>
<span id="cb22-459">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (2) transcribed without the 2, eq. (3) without the square root"</span>,</span>
<span id="cb22-460">    _eq23_mistranscribed,</span>
<span id="cb22-461">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same class as the row above: the residuals against the root-found maximum"</span></span>
<span id="cb22-462">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" exist to catch exactly this"</span>)</span>
<span id="cb22-463"></span>
<span id="cb22-464"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 17. classify the outcome at a FIXED end time instead of on an event ----</span></span>
<span id="cb22-465"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _fixed_window():</span>
<span id="cb22-466">    kw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(tend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, event<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb22-467">    xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, S1_ZERO, S_FEED, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.60</span>,</span>
<span id="cb22-468">                xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-469">    sens <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {s: brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, s, S_FEED, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.90</span>,</span>
<span id="cb22-470">                      xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb22-471">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)}</span>
<span id="cb22-472">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(critical_inoculum_g_per_l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xc,</span>
<span id="cb22-473">                critical_inoculum_two_routes_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(xc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT_MANIFOLD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-474">                critical_inoculum_S1_init_sensitivity_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sens.values())</span>
<span id="cb22-475">                                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(sens.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb22-476"></span>
<span id="cb22-477"></span>
<span id="cb22-478">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcome classified at t = 50 h instead of on an event"</span>, _fixed_window,</span>
<span id="cb22-479">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"trajectories near the separatrix linger by the saddle for far longer than"</span></span>
<span id="cb22-480">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 50 h, so a fixed window calls them washout and biases the threshold 3.8 %"</span></span>
<span id="cb22-481">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" high - this is why every threshold on the page is event-terminated"</span>)</span>
<span id="cb22-482"></span>
<span id="cb22-483"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 18. the separatrix side test queried at the wrong substrate -----------</span></span>
<span id="cb22-484"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _wrong_query():</span>
<span id="cb22-485">    xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> separatrix_X_at(S_LO, S_FEED)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># queried at S_LO, not at S_1(0)</span></span>
<span id="cb22-486">    step <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: separatrix_X_at(S1_ZERO, z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>,</span>
<span id="cb22-487">                  xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># queried at 0, not at S_LO</span></span>
<span id="cb22-488">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(critical_inoculum_two_routes_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_CRIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-489">                critical_step_two_routes_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S0_STEP_CRIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>step <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb22-490"></span>
<span id="cb22-491"></span>
<span id="cb22-492">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"separatrix route B queried at the wrong substrate"</span>, _wrong_query,</span>
<span id="cb22-493">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route B is only a second route if it asks the same question: querying the"</span></span>
<span id="cb22-494">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" manifold at S_LO rather than at S_1(0), and at S_1(0) rather than at the"</span></span>
<span id="cb22-495">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" operating substrate, moves both agreements from ~1e-12 to ~1e-3 - nine"</span></span>
<span id="cb22-496">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" orders of magnitude, on a change no eye would catch in the code"</span>)</span>
<span id="cb22-497"></span>
<span id="cb22-498"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 19. the S_1(0) sensitivity quoted over a TRUNCATED sample -------------</span></span>
<span id="cb22-499"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _truncated_sens():</span>
<span id="cb22-500">    kept <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the largest sampled S_1(0) dropped</span></span>
<span id="cb22-501">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {s: brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: fate(x, s, S_FEED), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.90</span>,</span>
<span id="cb22-502">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kept}</span>
<span id="cb22-503">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(critical_inoculum_S1_init_sensitivity_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(xs.values())</span>
<span id="cb22-504">                                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(xs.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-505">                _largest_S1_kept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(kept), _n_kept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(kept))</span>
<span id="cb22-506"></span>
<span id="cb22-507"></span>
<span id="cb22-508">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_1(0) sensitivity over a truncated sample"</span>, _truncated_sens,</span>
<span id="cb22-509">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reported spread is a property of the SAMPLE as much as of the model:"</span></span>
<span id="cb22-510">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" dropping the largest sampled S_1(0) and re-root-finding the rest reports"</span></span>
<span id="cb22-511">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 0.41 % where the whole sampled interval gives 5.21 %.  This is the row"</span></span>
<span id="cb22-512">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" that moves that metric far enough for CI, which compares at 5 %, to see"</span></span>
<span id="cb22-513">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" a regression in it"</span>)</span>
<span id="cb22-514"></span>
<span id="cb22-515"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, got, note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb22-516">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-517">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>got<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-518">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> note:</span>
<span id="cb22-519">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>note<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>* K_i -&gt; inf (Monod)
    {'_n_steady': 1, '_lag_h': np.float64(6.388496104322403e-20), 'mu_hat_m_eq2_per_h': np.float64(0.9999996535899586), 'S_m_eq3_g_per_l': np.float64(173205.08075688774), 'theta_washout_h': np.float64(1.0000003464101614), 'rm_as_maximum_overstatement_rel': np.float64(3.4641016144476566e-07), 'half_rate_low_root_g_per_l': np.float64(0.030031532816110484), 'half_rate_high_root_g_per_l': np.float64(999999999999.97), 'Ks_definition_rel_error': np.float64(0.0010510938703495176), 'Ki_definition_rel_error': np.float64(-3.0029296875e-14), 'batch_time_direct_h': np.float64(6.949160405588639), 'batch_time_direct_vs_printed36_rel': np.float64(-0.8069677665114267), 'batch_time_ratio_vs_no_inhibition': np.float64(1.0), 'lag_hours_at_Ki2': np.float64(6.388496104322403e-20), 'peak_growth_rate_drop_rel': np.float64(0.0029996525607283164), 'batch_realised_mean_growth_drop_rel': np.float64(0.0), 'batch_time_seeded_h': np.float64(7.153170596661518), 'batch_time_seeded_vs_printed12p5_rel': np.float64(-0.4277463522670786), 'seed_readings_raw_spread_rel': np.float64(0.008750867532464346), 'seed_reset_vs_increment_rel': np.float64(7.03285358132355e-05), 'seed_speedup_factor': np.float64(0.9714797531645487), 'steady_S_lower_g_per_l': 0.015000000000000109, 'steady_X_lower_g_per_l': 2.4925, 'lower_node_fast_eigenvalue_per_h': -73.85185185185021, 'washout_eigenvalue_haldane_per_h': 0.6607024519499967, 'washout_eigenvalue_monod_per_h': 0.6607024519549369, 'theta_transcritical_h': 1.006000000005, 'monod_theta_c_h': 1.006, 'monod_vs_haldane_S_shift_rel': 7.28583859910259e-15, 'monod_vs_haldane_X_shift_rel': 0.0}
    -&gt; kills the saddle, the fold and the lag; t_direct falls 5.26x, the acclimation speed-up collapses to ~1 and washout turns unstable
* K_s 0.03 -&gt; 0.015
    {'mu_hat_m_eq2_per_h': np.float64(0.8523658961269199), 'S_m_eq3_g_per_l': np.float64(0.17320508075688773), 'theta_washout_h': np.float64(1.1732050807568877), 'rm_as_maximum_overstatement_rel': np.float64(0.17320508075688767), 'half_rate_low_root_g_per_l': np.float64(0.015114219820389518), 'half_rate_high_root_g_per_l': np.float64(1.9848857801796105), 'Ks_definition_rel_error': np.float64(0.007614654692634597), 'Ki_definition_rel_error': np.float64(-0.007557109910194759), 'Ki_min_for_half_rate_defs_g_per_l': 0.06, 'branch_switch_Ki_g_per_l': 6666.666666666667, 'peak_growth_rate_drop_rel': np.float64(-0.146355555020366), 'feed_seed_fold_S_g_per_l': 4.4962901820401795, 'steady_S_lower_g_per_l': 0.007514115482872486, 'steady_X_lower_g_per_l': 2.4962429422585637, 'lower_node_fast_eigenvalue_per_h': -147.09290469865098, 'steady_S_upper_g_per_l': 3.992485884517128, 'steady_X_upper_g_per_l': 0.5037570577414361, 'saddle_positive_eigenvalue_per_h': 0.05586766161393081, 'washout_eigenvalue_haldane_per_h': -0.04786373584546577, 'washout_eigenvalue_monod_per_h': 0.6636756397474244, 'theta_transcritical_h': 3.503, 'monod_theta_c_h': 1.003, 'monod_vs_haldane_S_shift_rel': 0.0018820643829981637, 'monod_vs_haldane_X_shift_rel': -2.8273375808351986e-06}
    -&gt; every constant of the inhibition function moves, and so do all three steady states
* Y 0.5 -&gt; 0.4
    {'_X_reachable_max': 4.005, '_t_to_X3p5_Y0p5': np.float64(35.86746935603937), '_t_to_X3p5_Y0p4': np.float64(35.00450569020724), 'critical_inoculum_g_per_l': 0.14739731370958903, 'feed_seed_removing_hysteresis_g_per_l': 0.01711478119263852, 'steady_S_lower_g_per_l': 0.015056675872079211, 'steady_X_lower_g_per_l': 1.9939773296511683, 'lower_node_fast_eigenvalue_per_h': -73.01914192931764, 'steady_S_upper_g_per_l': 3.9849433241279213, 'steady_X_upper_g_per_l': 0.4060226703488315, 'saddle_positive_eigenvalue_per_h': 0.056178966354689996, 'washout_eigenvalue_haldane_per_h': -0.048108005324206116, 'washout_eigenvalue_monod_per_h': 0.6607024519549369, 'theta_transcritical_h': 3.5060000000000002, 'monod_theta_c_h': 1.006, 'monod_vs_haldane_S_shift_rel': 0.00377839147194745, 'monod_vs_haldane_X_shift_rel': -1.1369282262752023e-05}
    -&gt; 5 g/l of biomass is UNREACHABLE at Y = 0.4 (max 4.005), so the batch comparison is made at 3.5 g/l; X_crit scales exactly with Y, because u = X/Y turns the chemostat into a pair of equations with no Y in them at all - and that substitution is only available BECAUSE THE FEED IS STERILE (X_FEED = 0) and the outcome test is on S, not on X.  So this row cannot move X_crit's sensitivity to S_1(0) either: the whole basin boundary scales with Y and the spread is invariant
* operate at eq.(9)'s printed root
    {'steady_S_lower_g_per_l': np.float64(3.984943324127921), 'steady_X_lower_g_per_l': np.float64(0.5075283379360396), 'lower_node_fast_eigenvalue_per_h': -0.3333333333333333, 'monod_vs_haldane_S_shift_rel': np.float64(264.66288827519475), '_max_eig': 0.05617896635469011}
    -&gt; the printed root is the SADDLE: taking it as the operating point reports a substrate 265x too high and a positive eigenvalue
* dS/dt sign flipped
    {'batch_time_direct_h': np.float64(46.425656886156965), 'batch_time_direct_vs_printed36_rel': np.float64(0.2896015801710268), '_closedform_vs_lsoda_rel': np.float64(5.906386491005833e-14)}
    -&gt; a = S_i - X_i/Y and the closed form is no longer the same problem - but BOTH ROUTES CARRY THE FLIP, so they still agree to ~1e-13 and batch_closedform_vs_lsoda_rel does NOT move.  That metric needs the next row, not this one
* closed form with the (S_f - S_i)/K_i term dropped
    {'batch_time_direct_h': np.float64(41.52247557683508), 'batch_time_direct_vs_printed36_rel': np.float64(0.15340209935652993), 'batch_closedform_vs_lsoda_rel': np.float64(0.13674637848352078)}
    -&gt; the partial fraction's constant term is what the two routes disagree about if it is lost: 41.52 h against LSODA's 36.53
* theta 3 -&gt; 4 h (above 1/mu(S_0))
    {'all_six_stated_outcomes_ok': 0.0, 'fig8_direction_ok': 0.0, '_fig9_at_0p10': 1, '_fold_eq_has_root': 0.0, 'steady_S_lower_g_per_l': 0.010016722454789379, 'steady_X_lower_g_per_l': 2.494991638772605, 'lower_node_fast_eigenvalue_per_h': -93.09411475679737, 'washout_eigenvalue_haldane_per_h': 0.0352253280091272, 'washout_eigenvalue_monod_per_h': 0.7440357852882703, 'theta_transcritical_h': 3.5060000000000002, 'monod_theta_c_h': 1.006, 'monod_vs_haldane_S_shift_rel': 0.0016722454789378297, 'monod_vs_haldane_X_shift_rel': -3.3511933446028763e-06}
    -&gt; washout turns unstable, so every one of the six outcomes comes out 'recovers' and the critical inoculum and the X_0 fold cease to exist
* theta 3 -&gt; 1.2 h (below theta_w)
    {'all_six_stated_outcomes_ok': 0.0, 'fig8_direction_ok': 0.0, '_n_steady': 0}
    -&gt; past the fold: nothing survives and all six outcomes come out 'washout'
* S_0 5 -&gt; 7 g/l (still bistable)
    {'critical_inoculum_g_per_l': 0.5514276870368098, 'critical_step_S0_g_per_l': 22.478873417190286, 'andrews_step_margin_rel': -0.11027569625863076, 'feed_seed_fold_S_g_per_l': 5.493040248514688, 'feed_seed_removing_hysteresis_g_per_l': 0.18886766265968505, 'steady_S_lower_g_per_l': 0.015056675872079211, 'steady_X_lower_g_per_l': 3.49247166206396, 'lower_node_fast_eigenvalue_per_h': -102.31501840433927, 'steady_S_upper_g_per_l': 3.9849433241279213, 'steady_X_upper_g_per_l': 1.5075283379360394, 'saddle_positive_eigenvalue_per_h': 0.1668702561911402, 'washout_eigenvalue_haldane_per_h': -0.11132254995242624, 'washout_eigenvalue_monod_per_h': 0.6623992413466098, 'theta_transcritical_h': 4.5042857142857144, 'monod_theta_c_h': 1.0042857142857142, 'monod_vs_haldane_S_shift_rel': 0.00377839147194745, 'monod_vs_haldane_X_shift_rel': -8.113940168974487e-06}
    -&gt; the feed enters every threshold and the fold, but not the steady-state SUBSTRATE concentrations, which depend on theta alone
* S_0 5 -&gt; 3 g/l (below the bistable range)
    {'_theta_trans': 2.5100000000000002, '_bistable': 0.0, '_fate_at_tiny_inoculum': 1, 'theta_transcritical_h': 2.5100000000000002, 'washout_eigenvalue_haldane_per_h': 0.0650730411686587, '_fold_eq_has_root': 0.0}
    -&gt; 1/mu(3) = 2.51 h &lt; theta = 3 h, so washout is unstable: the critical inoculum, the critical step and the X_0 fold all cease to exist
* muhat 1.0 -&gt; 0.9
    {'critical_step_S0_g_per_l': 15.30217421301802, 'andrews_step_margin_rel': 0.3070038101504162, 'critical_ramp_duration_h': 1.6569177748336072, 'andrews_ramp_margin_rel': -0.3964697493208901, 'mu_hat_m_eq2_per_h': np.float64(0.7229211948399086), 'theta_washout_h': np.float64(1.3832766380870198), 'batch_time_direct_h': np.float64(40.5860839742612), 'batch_time_direct_vs_printed36_rel': np.float64(0.12739122150725557), 'batch_time_seeded_h': np.float64(13.746219425326863), 'batch_time_seeded_vs_printed12p5_rel': np.float64(0.09969755402614908), 'seed_speedup_factor': np.float64(2.9525269980401267), 'steady_S_lower_g_per_l': 0.017739615873927795, 'steady_X_lower_g_per_l': 2.491130192063036, 'lower_node_fast_eigenvalue_per_h': -58.329789386880776, 'steady_S_upper_g_per_l': 3.3822603841260737, 'steady_X_upper_g_per_l': 0.8088698079369632, 'saddle_positive_eigenvalue_per_h': 0.09933671198364047, 'washout_eigenvalue_haldane_per_h': -0.07663053812511883, 'washout_eigenvalue_monod_per_h': 0.56129887342611, 'theta_transcritical_h': 3.8955555555555557, 'monod_theta_c_h': 1.1177777777777778, 'monod_vs_haldane_S_shift_rel': 0.005244899522575259, 'monod_vs_haldane_X_shift_rel': -1.857697587681617e-05}
    -&gt; a pure time scaling of the BATCH problem - so the ratio t_direct/t_seed barely moves - but not of the chemostat, where theta and the forcing durations are fixed in hours: slower kinetics need a slower ramp, 1.6 h against 0.87 h
* acclimation read as 'reset to 2.0'
    {'batch_time_seeded_h': np.float64(12.366419490751275), 'batch_time_seeded_vs_printed12p5_rel': np.float64(-0.010686440739898018), 'seed_speedup_factor': np.float64(2.953763262208081)}
    -&gt; the near neighbour of the reported reading: 0.042 % away, which is what is left of the ambiguity once Fig. 7's annotation has closed it
* acclimation read as the 2/4/6 ladder
    {'batch_time_seeded_h': np.float64(13.794022451989592), 'batch_time_seeded_vs_printed12p5_rel': np.float64(0.1035217961591674), 'seed_speedup_factor': np.float64(2.6480655446204895)}
    -&gt; the reading Fig. 7's 'ADDED IN INCREMENTS OF 2.0 GM/L' excludes: three cycles instead of six and +10.35 % against his printed 12.5 hr
* lag tangent at t=0, not at the peak
    {'lag_hours_at_Ki2': np.float64(-1.0651752540277074e-16), 'lag_share_of_delay_Ki2': np.float64(-3.603363130954243e-18), 'lag_share_of_delay_Ki5': np.float64(-3.6033631309525196e-18), 'lag_share_of_delay_Ki10': np.float64(-3.603363130952135e-18), 'lag_share_of_delay_at_Xf1': np.float64(-4.1758838260784746e-18), '_expo_h': np.float64(41.46725493972977), '_largest_recomputed_lag_h': np.float64(1.0651752540277074e-16), '_branch': 'tangent at t = 0'}
    -&gt; collapses the lag to zero by definition - which is why the peak tangent is the one that can distinguish a lag from a slow phase.  The zero is COMPUTED, not asserted: the largest lag the alternative definition returns over K_i = 2, 5, 10 is printed above
* marcher: -c/theta dropped from the constant operator
    {'pymrm_march_time_step_order': -4.138506700284428e-12, 'pymrm_march_richardson_abs_err': 11.349608075523806, '_finest_err': 11.349608075491247}
    -&gt; the marcher now solves a different equation, so refining the step no longer converges on the reference and the observed order collapses
* construct_div nu=1 (cylindrical)
    {'pfr_outlet_grid_order': 0.0, 'pfr_richardson_abs_err': 4.728460648719498, 'pfr_outlet_X_at_tau3_ncell800_g_per_l': -9.244463733058731e-33, 'pfr_last_cell_read_order': 0.0, 'pfr_boundary_over_last_cell_err_ratio_ncell800': 1.0, 'pfr_outlet_X_at_tau6_richardson_g_per_l': 3.275929798204913e-29}
    -&gt; the divergence now carries a 1/r area profile the reactor does not have: the solve still converges, on the wrong answer, and the grid study is what catches it
* outlet off the last cell centre
    {'_last_cell': [4.7216925557939895, 0.23915372210300495], '_boundary_values': [4.721455807430411, 0.23927209628479396], '_err_last_cell': 0.0008216610923752152, '_err_boundary': 0.001086353809636646, 'pfr_outlet_X_at_tau3_ncell800_g_per_l': 0.23887787919165546, 'pfr_outlet_grid_order': 1.001305959559354, 'pfr_richardson_abs_err': 3.7105119031845305e-07}
    -&gt; MEASURED, not assumed: both reads are FIRST ORDER here (1.0011 boundary, 1.0013 last cell) and the last-cell read is the closer of the two at every grid, by a ratio that hardly moves under refinement (1.3215 at n = 100, 1.3226 at n = 800).  The boundary read is used because it is the value the flux operator transports, not because it is more accurate
* inlet bc zero-gradient not Dirichlet
    {'pfr_outlet_grid_order': 8.009973975159465e-08, 'pfr_richardson_abs_err': 4.72846037471016, 'pfr_outlet_X_at_tau3_ncell800_g_per_l': -6.89412491536861e-09, 'pfr_last_cell_read_order': 8.009973975159465e-08, 'pfr_boundary_over_last_cell_err_ratio_ncell800': 1.0}
    -&gt; the feed never enters
* the X_0 fold reported from the root COUNT at ngrid 1501
    {'feed_seed_removing_hysteresis_g_per_l': 0.021288334009414028, 'feed_seed_fold_two_routes_rel': 0.004914697068422735}
    -&gt; this is the grid-limited route the page refuses to report: it sees the two merging roots only while they are more than one scan cell apart, so it puts the fold 0.49 % early
* eq. (9) transcribed with 4 K_s K_i as 4 K_s
    {'eq9_printed_vs_rootfound_upper_rel': np.float64(0.0018927647837643224), 'theta_transcritical_two_routes_rel': 0.0008564087924638475}
    -&gt; the ONLY thing that can move these two residuals, which are otherwise zero by algebra: they check the transcription, not the arithmetic
* eq. (2) transcribed without the 2, eq. (3) without the square root
    {'mu_hat_m_eq2_per_h': np.float64(0.890888845544001), 'eq2_vs_rootfound_max_rel': np.float64(0.10911115445599884), 'S_m_eq3_g_per_l': 0.06, 'eq3_vs_rootfound_argmax_rel': 0.7550510257216821, 'rm_as_maximum_overstatement_rel': np.float64(0.12247448713915898)}
    -&gt; same class as the row above: the residuals against the root-found maximum exist to catch exactly this
* outcome classified at t = 50 h instead of on an event
    {'critical_inoculum_g_per_l': 0.1913358741787527, 'critical_inoculum_two_routes_rel': 0.03847685884666352, 'critical_inoculum_S1_init_sensitivity_rel': 0.05223934803817043}
    -&gt; trajectories near the separatrix linger by the saddle for far longer than 50 h, so a fixed window calls them washout and biases the threshold 3.8 % high - this is why every threshold on the page is event-terminated
* separatrix route B queried at the wrong substrate
    {'critical_inoculum_two_routes_rel': 0.001340622742707076, 'critical_step_two_routes_rel': 0.00032010224349710015}
    -&gt; route B is only a second route if it asks the same question: querying the manifold at S_LO rather than at S_1(0), and at S_1(0) rather than at the operating substrate, moves both agreements from ~1e-12 to ~1e-3 - nine orders of magnitude, on a change no eye would catch in the code
* S_1(0) sensitivity over a truncated sample
    {'critical_inoculum_S1_init_sensitivity_rel': 0.004070917803202123, '_largest_S1_kept': 0.05, '_n_kept': 4}
    -&gt; the reported spread is a property of the SAMPLE as much as of the model: dropping the largest sampled S_1(0) and re-root-finding the rest reports 0.41 % where the whole sampled interval gives 5.21 %.  This is the row that moves that metric far enough for CI, which compares at 5 %, to see a regression in it</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Honestly: not much to the 0-D physics, and something real to the question Andrews leaves open.</strong></p>
<p>The batch and chemostat balances are two ODEs. pymrm’s <code>NumJac</code> + <code>newton</code> solves them, at first order in the step, and gets the same answer as LSODA; that is a demonstration that the pymrm route is correct, not an improvement on Andrews. The genuinely useful piece is the closed form derived above, which owes nothing to pymrm either.</p>
<p>What pymrm does add is the <strong>spatial</strong> comparison, and it answers something Andrews states as future work. His Discussion, book p.&nbsp;723: <em>“Operational changes currently being investigated are (1) organism separation and recycle, (2) multistage operation with separate substrate supply to each reactor, and (3) recycle without organism separation in a fixed-film reactor. The general effect of these modifications should be to increase process stability.”</em></p>
<p>The infinite-stage limit of (2) is plug flow, and <code>construct_convflux_upwind</code> + <code>construct_div</code> + <code>NumJac</code> + <code>newton</code> solve it directly. <strong>A plug-flow fermenter with the same Haldane kinetics has no bistability at all</strong>, at any residence time and any seed: it is the batch problem in space, so its outlet biomass is a strictly increasing function of <img src="https://latex.codecogs.com/png.latex?%5Ctau"> for every <img src="https://latex.codecogs.com/png.latex?X_%7B%5Ctext%7Bfeed%7D%7D%20%3E%200">, and the closed form proves it (the batch time is strictly increasing in <img src="https://latex.codecogs.com/png.latex?X_f"> on <img src="https://latex.codecogs.com/png.latex?(X_i,%5C,%20Y%20a)">, so its inverse exists and is increasing). The reactor that washes out below 0.1842466 g/l of inoculum and the reactor that cannot wash out at all differ only in their mixing.</p>
<p>Two caveats, because that statement is easy to over-read:</p>
<ul>
<li><strong>It is the limit of Andrews’ item (2), not item (2).</strong> A finite cascade with separate substrate supply is not solved here, and no claim is made about how many stages it takes.</li>
<li><strong>It confirms his prediction only in that limit.</strong> His items (1) and (3) are recycle problems and are untouched.</li>
</ul>
<p>The second extension is cheaper still, and is also this page’s rather than Andrews’. He defines <img src="https://latex.codecogs.com/png.latex?X_0"> in eq. (7) and never gives it a value. Seed the feed and washout stops being a steady state at all, so the fold that creates the bistability must disappear at some finite <img src="https://latex.codecogs.com/png.latex?X_0"> - and it does, at <strong>0.0213935 g/l</strong>, which is <strong>0.8583 %</strong> of the operating biomass. That number is found twice. Bisecting on <em>how many</em> steady states there are is <strong>grid-limited</strong>: it counts sign changes on a scan, so it can only see the two merging roots while they are more than one grid cell apart, and it therefore reports the fold too early. Solving for the <strong>double root</strong> directly - <img src="https://latex.codecogs.com/png.latex?G%20=%20G'%20=%200">, which eliminates <img src="https://latex.codecogs.com/png.latex?X_0"> and leaves the single scalar equation <img src="https://latex.codecogs.com/png.latex?%5Cmu(%5Ctheta%5Cmu%20-%201)%20=%20%5Cmu'(S_0%20-%20S)"> with no grid in it at all - does not. <strong>The double-root value is the one reported.</strong> Refining the counting route’s scan drives it onto the double-root value across <strong>six orders of magnitude in three scans</strong>, <img src="https://latex.codecogs.com/png.latex?4.9%5Ctimes10%5E%7B-3%7D%20%5Cto%205.3%5Ctimes10%5E%7B-6%7D%20%5Cto%201.2%5Ctimes10%5E%7B-9%7D">, which is what a grid-limited number looks like when it is caught instead of published.</p>
<section id="why-compute_boundary_values-measured-rather-than-assumed" class="level3">
<h3 class="anchored" data-anchor-id="why-compute_boundary_values-measured-rather-than-assumed">Why <code>compute_boundary_values</code>, measured rather than assumed</h3>
<p>The standing warning in this repository’s handoff is that an outlet read off the last cell centre is <img src="https://latex.codecogs.com/png.latex?O(h)"> against a second-order boundary read. <strong>On this problem that is not what happens, and the page reports what it measured.</strong> Both reads were refined on the same four grids against the same batch reference: the boundary read converges at order 1.0011 and the last-cell read at 1.0013 - <strong>both first order</strong> - and the last-cell read is the <em>closer</em> of the two at every grid, by a ratio that barely moves with refinement: 1.3215 at <img src="https://latex.codecogs.com/png.latex?n%20=%20100">, 1.3226 at <img src="https://latex.codecogs.com/png.latex?n%20=%20800">. That near-constant ratio is the signature of two reads inheriting the same <img src="https://latex.codecogs.com/png.latex?O(h)"> upwind error with different constants, which is exactly what a <strong>zero-gradient outflow condition</strong> produces: with <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20c/%5Cpartial%20n%20=%200"> at the outlet, <code>compute_boundary_values</code> reconstructs the boundary value from an interior solution that is itself only first-order accurate, so the reconstruction cannot buy an order it does not have. <code>J4.1</code> measured the same pair on its own Monod plug-flow problem and found both reads first order there too, with the last-cell read closer by a different constant - so this is a property of the outflow condition, not of these kinetics.</p>
<p><strong>The call is kept, and the reason is consistency rather than accuracy.</strong> <code>compute_boundary_values</code> returns the value the flux operator actually transports, so a mass balance written on it closes and one written on <img src="https://latex.codecogs.com/png.latex?v%5C,C_N"> does not; and it stays right when the outflow condition is <em>not</em> zero-gradient, which is where the extra order would appear. The first of those is this repository’s A3.7 lesson and is not re-measured here; what <strong>is</strong> measured, and is in the break table with its numbers, is the pair of orders and the ratio above. Neither reason is “it is more accurate”.</p>
<div id="30621951" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:12:29.984071Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:12:29.983871Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:12:30.386678Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:12:30.385958Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the plug-flow reactor has no washout: monotone in tau, for any seed</span></span>
<span id="cb24-2">TAUS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">24.0</span>])</span>
<span id="cb24-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 200 cells per hour of residence time: at fixed ncell the front at large tau is</span></span>
<span id="cb24-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># under-resolved and newton stops short, which is a grid failure, not physics.</span></span>
<span id="cb24-5">PFR_SWEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([PlugFlowFermenter(S_FEED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t),</span>
<span id="cb24-6">                                        ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t)),</span>
<span id="cb24-7">                                        init<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>).solve().outlet()</span>
<span id="cb24-8">                      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TAUS])</span>
<span id="cb24-9">PFR_X_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>)</span>
<span id="cb24-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># STRUCTURAL, and trivially so: eq. (4) is dX/dt = mu(S) X with mu &gt; 0 and X &gt; 0,</span></span>
<span id="cb24-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so X is strictly increasing along a batch trajectory, and plug flow IS the</span></span>
<span id="cb24-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># batch trajectory in space.  Asserted, not reported as an agreement.</span></span>
<span id="cb24-13">PFR_UNSAT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_SWEEP[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> PFR_X_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb24-14">PFR_MONOTONE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(PFR_SWEEP[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(</span>
<span id="cb24-15">    np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(PFR_SWEEP[PFR_UNSAT, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb24-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the tau = 6 entry of this sweep is a GRID value; the converged one is in the</span></span>
<span id="cb24-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># refinement study above (Richardson of ncell 1200 and 2400)</span></span>
<span id="cb24-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_SWEEP[TAUS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_X_TAU6_GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span></span>
<span id="cb24-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug flow, feed S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.1f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l, X = 0.10 g/l, Haldane kinetics:"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> S_FEED)</span>
<span id="cb24-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t, o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(TAUS, PFR_SWEEP):</span>
<span id="cb24-21">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  tau </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h   outlet S </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   X </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  outlet X non-decreasing in tau, strictly so before saturation:"</span></span>
<span id="cb24-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_MONOTONE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   asymptote Y S_f + X_f = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_X_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb24-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the CSTR at the SAME theta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h and the same seed:"</span></span>
<span id="cb24-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'recovers'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> fate(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, S_FEED) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'WASHES OUT'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-26"></span>
<span id="cb24-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what a non-sterile feed does - this page's extension, not Andrews'</span></span>
<span id="cb24-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">non-sterile feed (THIS PAGE's extension; Andrews never gives X_0 a value):"</span>)</span>
<span id="cb24-29">SEEDED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb24-30"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> X0f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>):</span>
<span id="cb24-31">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (steady_states() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [S_FEED]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> X0f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> n_steady_seeded(X0f)</span>
<span id="cb24-32">    SEEDED[X0f] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r</span>
<span id="cb24-33">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  X_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(r)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> steady state(s):"</span></span>
<span id="cb24-34">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-35">X0_FOLD_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEEDED.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb24-36">X0_FOLD_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEEDED.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route A: bisect on how many roots there are</span></span>
<span id="cb24-38">X0_FOLD_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(n_steady_seeded(z, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6001</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb24-39">                      X0_FOLD_LO, X0_FOLD_HI, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb24-40"></span>
<span id="cb24-41"></span>
<span id="cb24-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route B: the fold as a DOUBLE root of G (see `_fold_eq` above): no counting</span></span>
<span id="cb24-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and no grid in it at all.</span></span>
<span id="cb24-44">_S_fold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_fold_eq, np.sqrt(K_S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>, S_FEED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb24-45">                 xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb24-46">_m_fold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(_S_fold))</span>
<span id="cb24-47">X0_FOLD_CRIT_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _S_fold)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_m_fold)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(THETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_m_fold)</span>
<span id="cb24-48">X0_FOLD_TWO_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X0_FOLD_CRIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X0_FOLD_CRIT_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROUTE A IS GRID-LIMITED and is NOT the reported value: it bisects on an</span></span>
<span id="cb24-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># integer root COUNT, so it can only resolve the fold to the scan's spacing.</span></span>
<span id="cb24-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Refining that scan drives it onto route B, which has no grid in it at all.</span></span>
<span id="cb24-52">FOLD_A_REFINE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(n_steady_seeded(z, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb24-53">                           X0_FOLD_LO, X0_FOLD_HI, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb24-54">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1501</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6001</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96001</span>)}</span>
<span id="cb24-55">FOLD_A_FINEST_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FOLD_A_REFINE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96001</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X0_FOLD_CRIT_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the hysteresis disappears between X_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0_FOLD_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0_FOLD_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb24-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  route A (bisection on the root count) : X_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0_FOLD_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l"</span>)</span>
<span id="cb24-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  route B (double root, G = G' = 0)     : X_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0_FOLD_CRIT_DOUBLE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" g/l   at S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_S_fold<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |rel| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0_FOLD_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  route A is GRID-LIMITED - it bisects an integer root COUNT, so it can"</span></span>
<span id="cb24-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" only see the two roots while they are further apart than one grid"</span></span>
<span id="cb24-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  cell - and is therefore NOT the reported value.  Refining its scan"</span></span>
<span id="cb24-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" drives it onto route B across SIX ORDERS OF MAGNITUDE in three scans:"</span>)</span>
<span id="cb24-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FOLD_A_REFINE.items():</span>
<span id="cb24-66">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    ngrid </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |rel| to route B"</span></span>
<span id="cb24-67">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X0_FOLD_CRIT_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; seeding the feed at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X0_FOLD_CRIT_DOUBLE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the operating"</span></span>
<span id="cb24-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" biomass removes the instability Andrews' paper is about"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>plug flow, feed S = 5.0 g/l, X = 0.10 g/l, Haldane kinetics:
  tau   0.5 h   outlet S   4.96926697   X 0.11536652
  tau   1.0 h   outlet S   4.93361647   X 0.13319176
  tau   2.0 h   outlet S   4.84398134   X 0.17800933
  tau   3.0 h   outlet S   4.72210426   X 0.23894787
  tau   6.0 h   outlet S   3.98271598   X 0.60864201
  tau  12.0 h   outlet S  -0.00000000   X 2.60000000
  tau  24.0 h   outlet S  -0.00000000   X 2.60000000
  outlet X non-decreasing in tau, strictly so before saturation: True   asymptote Y S_f + X_f = 2.6000 g/l
  the CSTR at the SAME theta = 3.0 h and the same seed: WASHES OUT

non-sterile feed (THIS PAGE's extension; Andrews never gives X_0 a value):
  X_0 = 0.0e+00  -&gt; 3 steady state(s): [0.0150567, 3.9849433, 5.0]
  X_0 = 1.0e-03  -&gt; 3 steady state(s): [0.0150476, 3.9969521, 4.9880004]
  X_0 = 1.0e-02  -&gt; 3 steady state(s): [0.0149659, 4.1221406, 4.8628935]
  X_0 = 2.0e-02  -&gt; 3 steady state(s): [0.0148763, 4.3630347, 4.622089]
  X_0 = 3.0e-02  -&gt; 1 steady state(s): [0.0147877]
  X_0 = 5.0e-02  -&gt; 1 steady state(s): [0.0146137]
  X_0 = 1.0e-01  -&gt; 1 steady state(s): [0.0141962]
  the hysteresis disappears between X_0 = 2.0e-02 and 3.0e-02 g/l
  route A (bisection on the root count) : X_0 = 0.021393362699 g/l
  route B (double root, G = G' = 0)     : X_0 = 0.021393476491 g/l   at S = 4.4925680646   |rel| 5.319e-06
  route A is GRID-LIMITED - it bisects an integer root COUNT, so it can only see the two roots while they are further apart than one grid
  cell - and is therefore NOT the reported value.  Refining its scan drives it onto route B across SIX ORDERS OF MAGNITUDE in three scans:
    ngrid   1501 -&gt; 0.021288334009   |rel| to route B 4.915e-03
    ngrid   6001 -&gt; 0.021393362699   |rel| to route B 5.319e-06
    ngrid  96001 -&gt; 0.021393476465   |rel| to route B 1.183e-09
  -&gt; seeding the feed at 0.8583% of the operating biomass removes the instability Andrews' paper is about</code></pre>
</div>
</div>
<div id="c4db3f63" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:12:30.389096Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:12:30.388908Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:12:33.377493Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:12:33.376841Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------------------- figures</span></span>
<span id="cb26-2">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>))</span>
<span id="cb26-3"></span>
<span id="cb26-4">Sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>)</span>
<span id="cb26-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Ki, c, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, C_GREY, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no inhibition"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, C_GREEN, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$K_i=10$"</span>),</span>
<span id="cb26-6">                   (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, C_PURPLE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$K_i=5$"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, C_BLUE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$K_i=2$ (Andrews')"</span>)):</span>
<span id="cb26-7">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(Sg, mu(Sg, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab)</span>
<span id="cb26-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot([S_M], [MU_HAT_M], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb26-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (2), (3)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">hat</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_m=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MU_HAT_M<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$S_m=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_M<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>,</span>
<span id="cb26-10">               (S_M, MU_HAT_M), xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>), textcoords<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"offset points"</span>,</span>
<span id="cb26-11">               fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE,</span>
<span id="cb26-12">               arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(arrowstyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-&gt;"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb26-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot([S_LO, S_HI], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>)</span>
<span id="cb26-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].text(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.055</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>, <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE)</span>
<span id="cb26-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb26-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"substrate $S$, g/l"</span>)</span>
<span id="cb26-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"specific growth rate </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">u</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, h</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-19">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (1): two roots for each rate"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb26-20">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb26-21"></span>
<span id="cb26-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Ki, c, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, C_GREY, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no inhibition"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, C_GREEN, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$K_i=10$"</span>),</span>
<span id="cb26-23">                   (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, C_PURPLE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$K_i=5$"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, C_BLUE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$K_i=2$"</span>)):</span>
<span id="cb26-24">    Xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(X_INIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb26-25">    ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([t_batch(X_INIT, x, S_INIT, Ki<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ki) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> Xs])</span>
<span id="cb26-26">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ts, Xs, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab)</span>
<span id="cb26-27">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lag_split(Ki)</span>
<span id="cb26-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>:</span>
<span id="cb26-29">        tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>], r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>]])</span>
<span id="cb26-30">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(tt, X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>])), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c,</span>
<span id="cb26-31">                   ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb26-32">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot([r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>]], [X_INIT], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb26-33">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_yscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb26-34">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>)</span>
<span id="cb26-35">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylim(X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb26-36">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time, h"</span>)</span>
<span id="cb26-37">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"biomass $X$, g/l"</span>)</span>
<span id="cb26-38">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"batch: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAG_FRAC_2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the delay is lag"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb26-39">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)</span>
<span id="cb26-40"></span>
<span id="cb26-41">th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(THETA_W<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0000001</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>)</span>
<span id="cb26-42">lo_b, hi_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb26-43"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> th:</span>
<span id="cb26-44">    ss <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> steady_states(t, S_FEED, K_I)</span>
<span id="cb26-45">    lo_b.append(ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ss <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb26-46">    hi_b.append(ss[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ss) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb26-47">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(th, lo_b, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stable branch"</span>)</span>
<span id="cb26-48">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(th, hi_b, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"saddle (eq. 9's root)"</span>)</span>
<span id="cb26-49">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(th, np.full_like(th, S_FEED), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>,</span>
<span id="cb26-50">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout $S_1=S_0$"</span>)</span>
<span id="cb26-51">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].axvspan(THETA_W, THETA_TRANS, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_YELLOW, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.18</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb26-52">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].axvline(THETA, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREEN, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>)</span>
<span id="cb26-53">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].text(THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.06</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Andrews'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">theta=3$ h"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREEN)</span>
<span id="cb26-54">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].text((THETA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> THETA_TRANS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bistable</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.4f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.4f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span></span>
<span id="cb26-55">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (THETA_W, THETA_TRANS), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"center"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.25"</span>)</span>
<span id="cb26-56">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"residence time </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, h"</span>)</span>
<span id="cb26-57">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady-state $S_1$, g/l"</span>)</span>
<span id="cb26-58">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_ylim(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.6</span>)</span>
<span id="cb26-59">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"three steady states, one window"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb26-60">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb26-61"></span>
<span id="cb26-62">fig.tight_layout()</span>
<span id="cb26-63">plt.show()</span>
<span id="cb26-64"></span>
<span id="cb26-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># phase plane: the separatrix and Andrews' two startup inocula</span></span>
<span id="cb26-66">fig2, ax2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6</span>))</span>
<span id="cb26-67">Sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>)</span>
<span id="cb26-68">Xq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>)</span>
<span id="cb26-69">SS_, XX_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.meshgrid(Sq, Xq)</span>
<span id="cb26-70">M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu(SS_)</span>
<span id="cb26-71">U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (S_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SS_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>XX_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD</span>
<span id="cb26-72">V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>XX_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>XX_</span>
<span id="cb26-73">ax2.streamplot(Sq, Xq, U, V, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.82"</span>, density<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>,</span>
<span id="cb26-74">               arrowsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)</span>
<span id="cb26-75">sepS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, S_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">220</span>)</span>
<span id="cb26-76">sepX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([separatrix_X_at(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s), S_FEED) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sepS])</span>
<span id="cb26-77">ax2.plot(sepS, sepX, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"separatrix"</span>)</span>
<span id="cb26-78">ax2.plot([S_LO], [X_LO], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stable"</span>)</span>
<span id="cb26-79">ax2.plot([S_HI], [X_HI], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"saddle"</span>)</span>
<span id="cb26-80">ax2.plot([S_FEED], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout (stable)"</span>)</span>
<span id="cb26-81">ax2.plot([S1_ZERO, S1_ZERO], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>)</span>
<span id="cb26-82">ax2.plot([S1_ZERO], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_PURPLE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb26-83">ax2.plot([S1_ZERO], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREEN, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb26-84">ax2.annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$X_i=0.10$ fails</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$X_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">i,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rm crit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$X_i=0.50$ recovers"</span>,</span>
<span id="cb26-85">             (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.62</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98</span>), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.25"</span>,</span>
<span id="cb26-86">             arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(arrowstyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-&gt;"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>),</span>
<span id="cb26-87">             xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.62</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.35</span>))</span>
<span id="cb26-88">ax2.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$S_1$, g/l"</span>)</span>
<span id="cb26-89">ax2.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$X_1$, g/l"</span>)</span>
<span id="cb26-90">ax2.set_xlim(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.4</span>)</span>
<span id="cb26-91">ax2.set_ylim(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9</span>)</span>
<span id="cb26-92">ax2.set_title(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta=3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S_0=5</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/l: two attractors"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb26-93">ax2.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper right"</span>)</span>
<span id="cb26-94">fig2.tight_layout()</span>
<span id="cb26-95">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.2-andrews-substrate-inhibition/index_files/figure-html/cell-15-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.2-andrews-substrate-inhibition/index_files/figure-html/cell-15-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="6e1c0c6a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:12:33.379885Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:12:33.379683Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:12:33.473774Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:12:33.473182Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --------------------------------------------------------------- agreement.json</span></span>
<span id="cb27-2">METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb27-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the inhibition function, eqs. (1)-(3), (6), (11)</span></span>
<span id="cb27-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_hat_m_eq2_per_h"</span>: MU_HAT_M,</span>
<span id="cb27-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_m_eq3_g_per_l"</span>: S_M,</span>
<span id="cb27-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_vs_rootfound_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(MU_HAT_M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MU_HAT_M_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb27-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_vs_rootfound_argmax_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S_M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_M_ROOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb27-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_washout_h"</span>: THETA_W,</span>
<span id="cb27-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half_rate_low_root_g_per_l"</span>: HALF_LO,</span>
<span id="cb27-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half_rate_high_root_g_per_l"</span>: HALF_HI,</span>
<span id="cb27-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ks_definition_rel_error"</span>: KS_DEF_ERR,</span>
<span id="cb27-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ki_definition_rel_error"</span>: KI_DEF_ERR,</span>
<span id="cb27-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ki_min_for_half_rate_defs_g_per_l"</span>: KI_MIN_FOR_DEF,</span>
<span id="cb27-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rm_as_maximum_overstatement_rel"</span>: RM_OVERSTATEMENT,</span>
<span id="cb27-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- batch: the closed form and Andrews' two stated times</span></span>
<span id="cb27-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_time_direct_h"</span>: T_DIRECT,</span>
<span id="cb27-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_time_direct_vs_printed36_rel"</span>: REL_36,</span>
<span id="cb27-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_closedform_vs_lsoda_rel"</span>: CF_VS_IVP,</span>
<span id="cb27-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_time_seeded_h"</span>: T_SEED,</span>
<span id="cb27-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_time_seeded_vs_printed12p5_rel"</span>: REL_12P5,</span>
<span id="cb27-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"seed_readings_raw_spread_rel"</span>: SEED_READINGS_SPREAD,</span>
<span id="cb27-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"seed_reset_vs_increment_rel"</span>: SEED_RESET_VS_INC,</span>
<span id="cb27-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"seed_speedup_factor"</span>: SPEEDUP,</span>
<span id="cb27-24">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the batch claim</span></span>
<span id="cb27-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_hours_at_Ki2"</span>: ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb27-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki2"</span>: LAG_FRAC_2,</span>
<span id="cb27-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki5"</span>: FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb27-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki10"</span>: FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],</span>
<span id="cb27-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_at_Xf1"</span>: LAG_SHARE_AT_XF1,</span>
<span id="cb27-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak_growth_rate_drop_rel"</span>: MUMAX_DROP,</span>
<span id="cb27-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_realised_mean_growth_drop_rel"</span>: MEAN_MU_DROP,</span>
<span id="cb27-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_time_ratio_vs_no_inhibition"</span>: T_F_RATIO,</span>
<span id="cb27-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"branch_switch_Ki_g_per_l"</span>: KI_SWITCH,</span>
<span id="cb27-34">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the continuous claim</span></span>
<span id="cb27-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_S_lower_g_per_l"</span>: S_LO,</span>
<span id="cb27-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_S_upper_g_per_l"</span>: S_HI,</span>
<span id="cb27-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_X_lower_g_per_l"</span>: X_LO,</span>
<span id="cb27-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_X_upper_g_per_l"</span>: X_HI,</span>
<span id="cb27-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq9_printed_vs_rootfound_upper_rel"</span>: EQ9_VS_ROOT,</span>
<span id="cb27-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"saddle_positive_eigenvalue_per_h"</span>: LAM_SADDLE,</span>
<span id="cb27-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout_eigenvalue_haldane_per_h"</span>: LAM_WASHOUT,</span>
<span id="cb27-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout_eigenvalue_monod_per_h"</span>: LAM_WASHOUT_MONOD,</span>
<span id="cb27-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower_node_fast_eigenvalue_per_h"</span>: LAM_LOWER,</span>
<span id="cb27-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical_h"</span>: THETA_TRANS,</span>
<span id="cb27-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical_two_routes_rel"</span>: TRANS_VS_ROOT,</span>
<span id="cb27-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_vs_haldane_S_shift_rel"</span>: S_SHIFT,</span>
<span id="cb27-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_vs_haldane_X_shift_rel"</span>: X_SHIFT,</span>
<span id="cb27-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_theta_c_h"</span>: THETA_C_MONOD,</span>
<span id="cb27-49">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Andrews' six stated outcomes and the thresholds he omits</span></span>
<span id="cb27-50">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all_six_stated_outcomes_ok"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ALL_SIX_OK),</span>
<span id="cb27-51">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig8_direction_ok"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG8_OK),</span>
<span id="cb27-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_inoculum_g_per_l"</span>: X_CRIT,</span>
<span id="cb27-53">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_inoculum_two_routes_rel"</span>: X_CRIT_TWO_ROUTES,</span>
<span id="cb27-54">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_inoculum_S1_init_sensitivity_rel"</span>: X_CRIT_SPREAD,</span>
<span id="cb27-55">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_step_S0_g_per_l"</span>: S0_STEP_CRIT,</span>
<span id="cb27-56">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_step_two_routes_rel"</span>: STEP_TWO_ROUTES,</span>
<span id="cb27-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_ramp_duration_h"</span>: RAMP_CRIT,</span>
<span id="cb27-58">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"andrews_step_margin_rel"</span>: STEP_MARGIN,</span>
<span id="cb27-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"andrews_ramp_margin_rel"</span>: RAMP_MARGIN,</span>
<span id="cb27-60">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- pymrm</span></span>
<span id="cb27-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_march_time_step_order"</span>: MARCH_ORDER,</span>
<span id="cb27-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_march_richardson_abs_err"</span>: MARCH_RICH_ERR,</span>
<span id="cb27-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_outlet_grid_order"</span>: PFR_ORDER,</span>
<span id="cb27-64">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_last_cell_read_order"</span>: PFR_CENTRE_ORDER,</span>
<span id="cb27-65">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_boundary_over_last_cell_err_ratio_ncell800"</span>: PFR_BOUNDARY_OVER_CENTRE,</span>
<span id="cb27-66">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_richardson_abs_err"</span>: PFR_RICH_ERR,</span>
<span id="cb27-67">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_outlet_X_at_tau3_ncell800_g_per_l"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pfr_val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb27-68">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_outlet_X_at_tau6_richardson_g_per_l"</span>: PFR_X_TAU6,</span>
<span id="cb27-69">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_seed_removing_hysteresis_g_per_l"</span>: X0_FOLD_CRIT_DOUBLE,</span>
<span id="cb27-70">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_seed_fold_two_routes_rel"</span>: FOLD_A_FINEST_REL,</span>
<span id="cb27-71">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_seed_fold_S_g_per_l"</span>: _S_fold,</span>
<span id="cb27-72">}</span>
<span id="cb27-73"></span>
<span id="cb27-74"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- coverage: GENERATED from the break table's measured moves -------------</span></span>
<span id="cb27-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Each break row returned a dict keyed BY METRIC NAME whose values are those</span></span>
<span id="cb27-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metrics recomputed under the defect.  Nothing below is a hand-written claim:</span></span>
<span id="cb27-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a row covers a metric if, and only if, its recomputed value differs from the</span></span>
<span id="cb27-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reported one by more than MOVE_TOL.</span></span>
<span id="cb27-79">COVERAGE, UNKNOWN_KEYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, []</span>
<span id="cb27-80"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _label, _got, _note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb27-81">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(_got, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>):</span>
<span id="cb27-82">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb27-83">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _got.items():</span>
<span id="cb27-84">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>):</span>
<span id="cb27-85">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a diagnostic, not a coverage claim</span></span>
<span id="cb27-86">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb27-87">            UNKNOWN_KEYS.append((_label, _k))</span>
<span id="cb27-88">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb27-89">        _base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> METRICS[_k]</span>
<span id="cb27-90">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># symmetric, so that a metric whose reported value is exactly 0.0 - the</span></span>
<span id="cb27-91">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># transcritical transcription check - still gets a finite move</span></span>
<span id="cb27-92">        _rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _base)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_base), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_v)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb27-93">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL:</span>
<span id="cb27-94">            COVERAGE.setdefault(_k, []).append((_label, _rel))</span>
<span id="cb27-95"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> UNKNOWN_KEYS, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break rows recompute names that are not metrics: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UNKNOWN_KEYS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-96"></span>
<span id="cb27-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- and the rows must COMPUTE what they return ---------------------------</span></span>
<span id="cb27-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A row that returns a TYPED CONSTANT for a metric records a relative move of</span></span>
<span id="cb27-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exactly 1.0 whatever the reported value is, so its coverage links cannot fail:</span></span>
<span id="cb27-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a hand-written coverage claim wearing the generator's clothes.  This page</span></span>
<span id="cb27-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># shipped that defect - five literal 0.0s in the lag row, the sole cover of four</span></span>
<span id="cb27-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metrics - and the guard below is what makes it unshippable rather than a thing</span></span>
<span id="cb27-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># each reviewer has to notice again.  It is static and mechanical: it parses each</span></span>
<span id="cb27-104"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># row's OWN SOURCE, plus one level of the notebook-defined helpers that row</span></span>
<span id="cb27-105"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># names, and rejects any `agreement.json` key bound to a numeric literal, or to a</span></span>
<span id="cb27-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># local name that is only ever assigned one, in a dict literal, a `dict(...)`</span></span>
<span id="cb27-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># call or a `d["key"] = ...` assignment.  What it cannot do is say whether the</span></span>
<span id="cb27-108"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># expression is the RIGHT one - that is what the measured moves above are for.</span></span>
<span id="cb27-109"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> ast</span>
<span id="cb27-110"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> inspect</span>
<span id="cb27-111"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> textwrap</span>
<span id="cb27-112"></span>
<span id="cb27-113"></span>
<span id="cb27-114"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _is_number(node):</span>
<span id="cb27-115">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.Constant):</span>
<span id="cb27-116">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.value, (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>)</span>
<span id="cb27-117">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node, ast.UnaryOp) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(node.op, (ast.UAdd, ast.USub))</span>
<span id="cb27-118">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _is_number(node.operand))</span>
<span id="cb27-119"></span>
<span id="cb27-120"></span>
<span id="cb27-121"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _key_bindings(src):</span>
<span id="cb27-122">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""every ("key", value-expression) pair bound anywhere in `src`"""</span></span>
<span id="cb27-123">    tree, out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ast.parse(textwrap.dedent(src)), []</span>
<span id="cb27-124">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(tree):</span>
<span id="cb27-125">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Dict):</span>
<span id="cb27-126">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(k.value, v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(n.keys, n.values)</span>
<span id="cb27-127">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(k, ast.Constant) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(k.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)]</span>
<span id="cb27-128">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Call) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(n.func, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dict"</span>:</span>
<span id="cb27-129">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(kw.arg, kw.value) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.keywords <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kw.arg]</span>
<span id="cb27-130">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Assign):</span>
<span id="cb27-131">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.targets:</span>
<span id="cb27-132">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Subscript) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>, ast.Constant)</span>
<span id="cb27-133">                        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>.value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)):</span>
<span id="cb27-134">                    out.append((t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">slice</span>.value, n.value))</span>
<span id="cb27-135">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb27-136"></span>
<span id="cb27-137"></span>
<span id="cb27-138"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sources(fn):</span>
<span id="cb27-139">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the row's source, plus that of the notebook functions it names"""</span></span>
<span id="cb27-140">    src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> textwrap.dedent(inspect.getsource(fn))</span>
<span id="cb27-141">    seen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [src]</span>
<span id="cb27-142">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(ast.parse(src)):</span>
<span id="cb27-143">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Name):</span>
<span id="cb27-144">            obj <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">globals</span>().get(n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span>)</span>
<span id="cb27-145">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (inspect.isfunction(obj) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(obj, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__module__"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"__main__"</span></span>
<span id="cb27-146">                    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> obj <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> fn):</span>
<span id="cb27-147">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb27-148">                    seen.append(textwrap.dedent(inspect.getsource(obj)))</span>
<span id="cb27-149">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> (<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">OSError</span>, <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">TypeError</span>):            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># not recoverable: say so</span></span>
<span id="cb27-150">                    seen.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"# UNREADABLE SOURCE: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-151">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> seen</span>
<span id="cb27-152"></span>
<span id="cb27-153"></span>
<span id="cb27-154"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> literal_metrics(fn):</span>
<span id="cb27-155">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""metrics this row returns as a CONSTANT instead of computing"""</span></span>
<span id="cb27-156">    bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb27-157">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> src <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _sources(fn):</span>
<span id="cb27-158">        frozen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ast.walk(ast.parse(src)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(n, ast.Assign)</span>
<span id="cb27-159">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n.targets <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(t, ast.Name) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _is_number(n.value)}</span>
<span id="cb27-160">        bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _key_bindings(src) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS</span>
<span id="cb27-161">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (_is_number(v) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(v, ast.Name) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> v.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">id</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> frozen))]</span>
<span id="cb27-162">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(bad))</span>
<span id="cb27-163"></span>
<span id="cb27-164"></span>
<span id="cb27-165"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lag_alt_v0():</span>
<span id="cb27-166">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""THE NEGATIVE CONTROL: the lag row exactly as this page used to ship it -</span></span>
<span id="cb27-167"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    five literals, nothing recomputed, and the only cover of four metrics."""</span></span>
<span id="cb27-168">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_hours_at_Ki2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb27-169">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki5"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki10"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb27-170">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_at_Xf1"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb27-171">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_expo_h"</span>: np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_INIT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mu(S_INIT))}</span>
<span id="cb27-172"></span>
<span id="cb27-173"></span>
<span id="cb27-174">CAUGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> literal_metrics(_lag_alt_v0)</span>
<span id="cb27-175">LITERAL_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl: bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> bad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [literal_metrics(fn)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bad}</span>
<span id="cb27-176"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ROWS MUST COMPUTE WHAT THEY RETURN, and it is parsed rather than trusted:"</span></span>
<span id="cb27-177">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows read; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(LITERAL_ROWS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> return a metric as a typed"</span></span>
<span id="cb27-178">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" constant."</span>)</span>
<span id="cb27-179"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the guard's teeth, MEASURED on the row this page used to ship:"</span></span>
<span id="cb27-180">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CAUGHT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of its</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  keys are literal metrics - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAUGHT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (its `_expo_h` is a diagnostic and is correctly not among them)."</span>)</span>
<span id="cb27-182"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(CAUGHT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_hours_at_Ki2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki2"</span>,</span>
<span id="cb27-183">                       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_Ki10"</span>,</span>
<span id="cb27-184">                       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag_share_of_delay_at_Xf1"</span>}, (</span>
<span id="cb27-185">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the literal guard no longer catches the row it was written for"</span>)</span>
<span id="cb27-186"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> LITERAL_ROWS, (</span>
<span id="cb27-187">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break rows returning a metric as a typed constant, so their coverage links"</span></span>
<span id="cb27-188">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" cannot fail: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LITERAL_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-189"></span>
<span id="cb27-190"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A metric that no row moves must be named here, individually, with the reason.</span></span>
<span id="cb27-191">STRUCTURAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb27-192">uncovered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(STRUCTURAL))</span>
<span id="cb27-193"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"COVERAGE MAP, GENERATED FROM </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> DEFECT INJECTIONS"</span></span>
<span id="cb27-194">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics, move threshold </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOVE_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative):"</span>)</span>
<span id="cb27-195"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(METRICS):</span>
<span id="cb27-196">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE:</span>
<span id="cb27-197">        _rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(COVERAGE[_k], key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb27-198">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_rows)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> row(s); strongest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-199">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  &lt;- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-200">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL:</span>
<span id="cb27-201">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> STRUCTURAL - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STRUCTURAL[_k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-202">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb27-203">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> UNCOVERED"</span>)</span>
<span id="cb27-204"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> uncovered, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics no break row moves and none named structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>uncovered<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-205">_moving_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(got, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>)</span>
<span id="cb27-206">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE[k])</span>
<span id="cb27-207">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got)}</span>
<span id="cb27-208">N_BREAK_ROWS, N_MOVING_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_moving_rows)</span>
<span id="cb27-209">N_COVERAGE_LINKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values())</span>
<span id="cb27-210"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">every one of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics is moved by at least one row;"</span></span>
<span id="cb27-211">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MOVING_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BREAK_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows move a reported metric and"</span></span>
<span id="cb27-212">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the map holds </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_COVERAGE_LINKS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> measured row-metric links."</span>)</span>
<span id="cb27-213"></span>
<span id="cb27-214"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># COVERED IS NOT THE SAME AS COVERED FAR ENOUGH TO MATTER.  check_agreement.py</span></span>
<span id="cb27-215"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># compares at 5 %, so a metric whose strongest mover shifts it by less than that</span></span>
<span id="cb27-216"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is one no defect on this page could surface as a regression.  One metric was in</span></span>
<span id="cb27-217"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exactly that position (the S_1(0) sensitivity, moved 0.23 % by its only cover),</span></span>
<span id="cb27-218"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which is why the truncated-sample row exists.  The weakest cover is reported</span></span>
<span id="cb27-219"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># here and required to clear CI's comparison tolerance.</span></span>
<span id="cb27-220">CI_REL_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb27-221">WEAKEST_COVER, WEAKEST_METRIC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v), k)</span>
<span id="cb27-222">                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items())</span>
<span id="cb27-223"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"weakest cover on the page: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_COVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_METRIC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-224">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - above the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at which</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">check_agreement compares, so every"</span></span>
<span id="cb27-225">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" metric here is one a defect could surface as a regression."</span>)</span>
<span id="cb27-226"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> WEAKEST_COVER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> CI_REL_TOL, (</span>
<span id="cb27-227">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_METRIC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is moved only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_COVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by its strongest row,"</span></span>
<span id="cb27-228">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below CI's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> comparison tolerance"</span>)</span>
<span id="cb27-229"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> N_MOVING_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_BREAK_ROWS, (</span>
<span id="cb27-230">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a break row moves no metric: "</span></span>
<span id="cb27-231">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, _, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS} <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _moving_rows)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-232"></span>
<span id="cb27-233"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># quantities PROVED exactly zero: printed, deliberately NOT reported.</span></span>
<span id="cb27-234">EXACT_ZEROS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb27-235">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy eq.(1) - eq.(6)"</span>: EQ1_EQ6_RESID,</span>
<span id="cb27-236">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy eq.(2) residual"</span>: EQ2_RESID,</span>
<span id="cb27-237">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy eq.(3) residual"</span>: EQ3_RESID,</span>
<span id="cb27-238">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy partial-fraction residual"</span>: PF_RESID,</span>
<span id="cb27-239">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy antiderivative residual"</span>: ANTIDERIV_RESID,</span>
<span id="cb27-240">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy Andrews eq.(1) - Froment eq.(1.5.2-4)"</span>: FROMENT_RESID,</span>
<span id="cb27-241">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy Andrews eq.(1) - Rawlings (K_1 = 1/K_i)"</span>: RAWLINGS_RESID,</span>
<span id="cb27-242">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq.(11) - 1/eq.(2)"</span>: EQ11_MINUS_INV_EQ2,</span>
<span id="cb27-243">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod theta_c mu(S_f) - 1"</span>: MONOD_CRIT_IDENTITY,</span>
<span id="cb27-244">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S + X/Y balance, plug-flow cells"</span>: PFR_BALANCE_CELLS,</span>
<span id="cb27-245">}</span>
<span id="cb27-246"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">PROVED EXACTLY ZERO - printed, NOT reported (CI compares above 1e-12 at 5 %,"</span></span>
<span id="cb27-247">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">and a symbolic zero is a proof, not a measurement):"</span>)</span>
<span id="cb27-248"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXACT_ZEROS.items():</span>
<span id="cb27-249">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-250"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(EXACT_ZEROS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an exact zero leaked into METRICS"</span></span>
<span id="cb27-251"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EQ11_MINUS_INV_EQ2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb27-252"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> PFR_BALANCE_CELLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span></span>
<span id="cb27-253"></span>
<span id="cb27-254"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Four reported residuals are TRANSCRIPTION CHECKS, not independent</span></span>
<span id="cb27-255"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># computations: they are zero by algebra whenever the equations are copied</span></span>
<span id="cb27-256"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># correctly, so the only thing that can move them is a mis-transcription - and</span></span>
<span id="cb27-257"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break table mis-transcribes each one to show it does.</span></span>
<span id="cb27-258">TRANSCRIPTION_CHECKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb27-259">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_vs_rootfound_max_rel"</span>:</span>
<span id="cb27-260">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (2) against the root-found maximum of eq. (6): the same extremum by"</span></span>
<span id="cb27-261">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" two expressions, equal by algebra"</span>,</span>
<span id="cb27-262">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_vs_rootfound_argmax_rel"</span>:</span>
<span id="cb27-263">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3) against the Brent root of the analytic dmu/dS: equal by algebra"</span>,</span>
<span id="cb27-264">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq9_printed_vs_rootfound_upper_rel"</span>:</span>
<span id="cb27-265">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (9) as printed against the Brent root of mu(S) = 1/theta: the same"</span></span>
<span id="cb27-266">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" quadratic solved two ways"</span>,</span>
<span id="cb27-267">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical_two_routes_rel"</span>:</span>
<span id="cb27-268">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/mu(S_0) against a Brent root of eq. (9) at S_+ = S_0: the same"</span></span>
<span id="cb27-269">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" equation rearranged, so it agrees to 0.0 exactly"</span>,</span>
<span id="cb27-270">}</span>
<span id="cb27-271"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(TRANSCRIPTION_CHECKS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS)</span>
<span id="cb27-272"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TRANSCRIPTION_CHECKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics are"</span></span>
<span id="cb27-273">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" TRANSCRIPTION CHECKS rather than second computations -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">zero by algebra"</span></span>
<span id="cb27-274">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" when the copying is right, and each has a break row that mis-transcribes"</span></span>
<span id="cb27-275">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">exactly one term of the equation it checks:"</span>)</span>
<span id="cb27-276"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, why <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TRANSCRIPTION_CHECKS.items():</span>
<span id="cb27-277">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>METRICS[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>why<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-278"></span>
<span id="cb27-279"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Metrics that sit below CI's ABS_FLOOR are OUTSIDE the regression suite while</span></span>
<span id="cb27-280"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># both sides stay under it.  Each one is named here with an ABOVE-FLOOR</span></span>
<span id="cb27-281"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># COMPANION that carries the same physics and is compared.</span></span>
<span id="cb27-282">ABS_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span></span>
<span id="cb27-283">BELOW_FLOOR_COMPANION <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb27-284">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_vs_rootfound_max_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_hat_m_eq2_per_h"</span>,</span>
<span id="cb27-285">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_vs_rootfound_argmax_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_m_eq3_g_per_l"</span>,</span>
<span id="cb27-286">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq9_printed_vs_rootfound_upper_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steady_S_upper_g_per_l"</span>,</span>
<span id="cb27-287">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical_two_routes_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical_h"</span>,</span>
<span id="cb27-288">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_step_two_routes_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_step_S0_g_per_l"</span>,</span>
<span id="cb27-289">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_inoculum_two_routes_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical_inoculum_g_per_l"</span>,</span>
<span id="cb27-290">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_seed_fold_two_routes_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_seed_removing_hysteresis_g_per_l"</span>,</span>
<span id="cb27-291">}</span>
<span id="cb27-292">below <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ABS_FLOOR}</span>
<span id="cb27-293">unnamed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(below) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(BELOW_FLOOR_COMPANION)</span>
<span id="cb27-294"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> unnamed, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics below ABS_FLOOR with no companion named: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>unnamed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-295"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(BELOW_FLOOR_COMPANION) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS)</span>
<span id="cb27-296"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, comp <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BELOW_FLOOR_COMPANION.items():</span>
<span id="cb27-297">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(METRICS[comp]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ABS_FLOOR, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"companion </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>comp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is itself below floor"</span></span>
<span id="cb27-298">N_BELOW_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(below)</span>
<span id="cb27-299"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">below CI's ABS_FLOOR = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ABS_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so outside the regression suite"</span></span>
<span id="cb27-300">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BELOW_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">):"</span>)</span>
<span id="cb27-301"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BELOW_FLOOR_COMPANION:</span>
<span id="cb27-302">    mark <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BELOW"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> below <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"above"</span></span>
<span id="cb27-303">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mark<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>METRICS[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-304">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   companion </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BELOW_FLOOR_COMPANION[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-305">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>METRICS[BELOW_FLOOR_COMPANION[k]]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-306"></span>
<span id="cb27-307"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the second computations, counted and ranged by the code ---------------</span></span>
<span id="cb27-308">SECOND_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb27-309">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch time to 5 g/l, closed form vs LSODA"</span>: CF_VS_IVP,</span>
<span id="cb27-310">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper steady state, eq. (9) vs Brent [transcription]"</span>: EQ9_VS_ROOT,</span>
<span id="cb27-311">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"transcritical theta, 1/mu(S_0) vs Brent [transcription]"</span>: TRANS_VS_ROOT,</span>
<span id="cb27-312">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical inoculum, bisection vs stable manifold"</span>: X_CRIT_TWO_ROUTES,</span>
<span id="cb27-313">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical step, bisection vs separatrix side test"</span>: STEP_TWO_ROUTES,</span>
<span id="cb27-314">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_0 fold, root count vs double root"</span>: FOLD_A_FINEST_REL,</span>
<span id="cb27-315">}</span>
<span id="cb27-316">N_SECOND_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES)</span>
<span id="cb27-317">N_INDEPENDENT_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_SECOND_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(</span>
<span id="cb27-318">    [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SECOND_ROUTES <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"transcription"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> k])</span>
<span id="cb27-319">SECOND_ROUTE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(SECOND_ROUTES.values())</span>
<span id="cb27-320">SECOND_ROUTE_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(SECOND_ROUTES.values())</span>
<span id="cb27-321"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SECOND_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> quantities are computed twice"</span></span>
<span id="cb27-322">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_INDEPENDENT_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by genuinely independent routes, the other"</span></span>
<span id="cb27-323">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SECOND_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_INDEPENDENT_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by a second transcription of"</span></span>
<span id="cb27-324">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the same algebra), agreeing between </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and"</span></span>
<span id="cb27-325">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb27-326"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SECOND_ROUTES.items():</span>
<span id="cb27-327">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-328"></span>
<span id="cb27-329"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb27-330">report_agreement(PAGE, METRICS)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>ROWS MUST COMPUTE WHAT THEY RETURN, and it is parsed rather than trusted:
  24 rows read; 0 return a metric as a typed constant.
  the guard's teeth, MEASURED on the row this page used to ship: 5 of its
  keys are literal metrics - ['lag_hours_at_Ki2', 'lag_share_of_delay_Ki10', 'lag_share_of_delay_Ki2', 'lag_share_of_delay_Ki5', 'lag_share_of_delay_at_Xf1']
  (its `_expo_h` is a diagnostic and is correctly not among them).
COVERAGE MAP, GENERATED FROM 24 DEFECT INJECTIONS (63 metrics, move threshold 1e-06 relative):
  Ki_definition_rel_error                      2 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  Ki_min_for_half_rate_defs_g_per_l            1 row(s); strongest 5.000e-01  &lt;- K_s 0.03 -&gt; 0.015
  Ks_definition_rel_error                      2 row(s); strongest 9.320e-01  &lt;- K_i -&gt; inf (Monod)
  S_m_eq3_g_per_l                              3 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  all_six_stated_outcomes_ok                   2 row(s); strongest 1.000e+00  &lt;- theta 3 -&gt; 4 h (above 1/mu(S_0))
  andrews_ramp_margin_rel                      1 row(s); strongest 1.370e+00  &lt;- muhat 1.0 -&gt; 0.9
  andrews_step_margin_rel                      2 row(s); strongest 1.703e+00  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  batch_closedform_vs_lsoda_rel                1 row(s); strongest 1.000e+00  &lt;- closed form with the (S_f - S_i)/K_i term dropped
  batch_realised_mean_growth_drop_rel          1 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  batch_time_direct_h                          4 row(s); strongest 8.098e-01  &lt;- K_i -&gt; inf (Monod)
  batch_time_direct_vs_printed36_rel           4 row(s); strongest 1.018e+00  &lt;- K_i -&gt; inf (Monod)
  batch_time_ratio_vs_no_inhibition            1 row(s); strongest 8.098e-01  &lt;- K_i -&gt; inf (Monod)
  batch_time_seeded_h                          4 row(s); strongest 4.218e-01  &lt;- K_i -&gt; inf (Monod)
  batch_time_seeded_vs_printed12p5_rel         4 row(s); strongest 1.103e+00  &lt;- muhat 1.0 -&gt; 0.9
  branch_switch_Ki_g_per_l                     1 row(s); strongest 5.000e-01  &lt;- K_s 0.03 -&gt; 0.015
  critical_inoculum_S1_init_sensitivity_rel    2 row(s); strongest 9.219e-01  &lt;- S_1(0) sensitivity over a truncated sample
  critical_inoculum_g_per_l                    3 row(s); strongest 6.659e-01  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  critical_inoculum_two_routes_rel             2 row(s); strongest 1.000e+00  &lt;- outcome classified at t = 50 h instead of on an event
  critical_ramp_duration_h                     1 row(s); strongest 4.737e-01  &lt;- muhat 1.0 -&gt; 0.9
  critical_step_S0_g_per_l                     2 row(s); strongest 2.309e-01  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  critical_step_two_routes_rel                 1 row(s); strongest 1.000e+00  &lt;- separatrix route B queried at the wrong substrate
  eq2_vs_rootfound_max_rel                     1 row(s); strongest 1.000e+00  &lt;- eq. (2) transcribed without the 2, eq. (3) without the square root
  eq3_vs_rootfound_argmax_rel                  1 row(s); strongest 1.000e+00  &lt;- eq. (2) transcribed without the 2, eq. (3) without the square root
  eq9_printed_vs_rootfound_upper_rel           1 row(s); strongest 1.000e+00  &lt;- eq. (9) transcribed with 4 K_s K_i as 4 K_s
  feed_seed_fold_S_g_per_l                     2 row(s); strongest 1.821e-01  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  feed_seed_fold_two_routes_rel                1 row(s); strongest 1.000e+00  &lt;- the X_0 fold reported from the root COUNT at ngrid 1501
  feed_seed_removing_hysteresis_g_per_l        3 row(s); strongest 8.867e-01  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  fig8_direction_ok                            2 row(s); strongest 1.000e+00  &lt;- theta 3 -&gt; 4 h (above 1/mu(S_0))
  half_rate_high_root_g_per_l                  2 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  half_rate_low_root_g_per_l                   2 row(s); strongest 5.039e-01  &lt;- K_s 0.03 -&gt; 0.015
  lag_hours_at_Ki2                             2 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  lag_share_of_delay_Ki10                      1 row(s); strongest 1.000e+00  &lt;- lag tangent at t=0, not at the peak
  lag_share_of_delay_Ki2                       1 row(s); strongest 1.000e+00  &lt;- lag tangent at t=0, not at the peak
  lag_share_of_delay_Ki5                       1 row(s); strongest 1.000e+00  &lt;- lag tangent at t=0, not at the peak
  lag_share_of_delay_at_Xf1                    1 row(s); strongest 1.000e+00  &lt;- lag tangent at t=0, not at the peak
  lower_node_fast_eigenvalue_per_h             6 row(s); strongest 9.954e-01  &lt;- operate at eq.(9)'s printed root
  monod_theta_c_h                              3 row(s); strongest 1.000e-01  &lt;- muhat 1.0 -&gt; 0.9
  monod_vs_haldane_S_shift_rel                 5 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  monod_vs_haldane_X_shift_rel                 5 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  mu_hat_m_eq2_per_h                           4 row(s); strongest 1.968e-01  &lt;- K_i -&gt; inf (Monod)
  peak_growth_rate_drop_rel                    2 row(s); strongest 1.015e+00  &lt;- K_i -&gt; inf (Monod)
  pfr_boundary_over_last_cell_err_ratio_ncell800 2 row(s); strongest 2.439e-01  &lt;- construct_div nu=1 (cylindrical)
  pfr_last_cell_read_order                     2 row(s); strongest 1.000e+00  &lt;- construct_div nu=1 (cylindrical)
  pfr_outlet_X_at_tau3_ncell800_g_per_l        3 row(s); strongest 1.000e+00  &lt;- inlet bc zero-gradient not Dirichlet
  pfr_outlet_X_at_tau6_richardson_g_per_l      1 row(s); strongest 1.000e+00  &lt;- construct_div nu=1 (cylindrical)
  pfr_outlet_grid_order                        3 row(s); strongest 1.000e+00  &lt;- construct_div nu=1 (cylindrical)
  pfr_richardson_abs_err                       3 row(s); strongest 1.000e+00  &lt;- construct_div nu=1 (cylindrical)
  pymrm_march_richardson_abs_err               1 row(s); strongest 1.000e+00  &lt;- marcher: -c/theta dropped from the constant operator
  pymrm_march_time_step_order                  1 row(s); strongest 1.000e+00  &lt;- marcher: -c/theta dropped from the constant operator
  rm_as_maximum_overstatement_rel              3 row(s); strongest 1.000e+00  &lt;- K_i -&gt; inf (Monod)
  saddle_positive_eigenvalue_per_h             3 row(s); strongest 6.633e-01  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  seed_readings_raw_spread_rel                 1 row(s); strongest 9.242e-01  &lt;- K_i -&gt; inf (Monod)
  seed_reset_vs_increment_rel                  1 row(s); strongest 1.168e+00  &lt;- K_i -&gt; inf (Monod)
  seed_speedup_factor                          3 row(s); strongest 6.710e-01  &lt;- K_i -&gt; inf (Monod)
  steady_S_lower_g_per_l                       5 row(s); strongest 9.962e-01  &lt;- operate at eq.(9)'s printed root
  steady_S_upper_g_per_l                       2 row(s); strongest 1.512e-01  &lt;- muhat 1.0 -&gt; 0.9
  steady_X_lower_g_per_l                       7 row(s); strongest 7.964e-01  &lt;- operate at eq.(9)'s printed root
  steady_X_upper_g_per_l                       4 row(s); strongest 6.633e-01  &lt;- S_0 5 -&gt; 7 g/l (still bistable)
  theta_transcritical_h                        5 row(s); strongest 7.131e-01  &lt;- K_i -&gt; inf (Monod)
  theta_transcritical_two_routes_rel           1 row(s); strongest 1.000e+00  &lt;- eq. (9) transcribed with 4 K_s K_i as 4 K_s
  theta_washout_h                              3 row(s); strongest 1.968e-01  &lt;- K_i -&gt; inf (Monod)
  washout_eigenvalue_haldane_per_h             6 row(s); strongest 1.739e+00  &lt;- S_0 5 -&gt; 3 g/l (below the bistable range)
  washout_eigenvalue_monod_per_h               4 row(s); strongest 1.505e-01  &lt;- muhat 1.0 -&gt; 0.9

every one of the 63 metrics is moved by at least one row; 24 of the
24 rows move a reported metric and the map holds 154 measured row-metric links.
weakest cover on the page: 10.0000% on monod_theta_c_h - above the 5% at which
check_agreement compares, so every metric here is one a defect could surface as a regression.

PROVED EXACTLY ZERO - printed, NOT reported (CI compares above 1e-12 at 5 %,
and a symbolic zero is a proof, not a measurement):
  sympy eq.(1) - eq.(6)                                = 0
  sympy eq.(2) residual                                = 0
  sympy eq.(3) residual                                = 0
  sympy partial-fraction residual                      = 0
  sympy antiderivative residual                        = 0
  sympy Andrews eq.(1) - Froment eq.(1.5.2-4)          = 0
  sympy Andrews eq.(1) - Rawlings (K_1 = 1/K_i)        = 0
  eq.(11) - 1/eq.(2)                                   = 0.0
  Monod theta_c mu(S_f) - 1                            = 1.1102230246251565e-16
  S + X/Y balance, plug-flow cells                     = 6.661338147750939e-16

4 of the 63 metrics are TRANSCRIPTION CHECKS rather than second computations -
zero by algebra when the copying is right, and each has a break row that mis-transcribes
exactly one term of the equation it checks:
  eq2_vs_rootfound_max_rel               = 2.220e-16   eq. (2) against the root-found maximum of eq. (6): the same extremum by two expressions, equal by algebra
  eq3_vs_rootfound_argmax_rel            = 2.220e-16   eq. (3) against the Brent root of the analytic dmu/dS: equal by algebra
  eq9_printed_vs_rootfound_upper_rel     = 1.110e-16   eq. (9) as printed against the Brent root of mu(S) = 1/theta: the same quadratic solved two ways
  theta_transcritical_two_routes_rel     = 0.000e+00   1/mu(S_0) against a Brent root of eq. (9) at S_+ = S_0: the same equation rearranged, so it agrees to 0.0 exactly

below CI's ABS_FLOOR = 1e-12, so outside the regression suite (5 of 63):
  BELOW  eq2_vs_rootfound_max_rel               = 2.220e-16   companion mu_hat_m_eq2_per_h = 0.803246
  BELOW  eq3_vs_rootfound_argmax_rel            = 2.220e-16   companion S_m_eq3_g_per_l = 0.244949
  BELOW  eq9_printed_vs_rootfound_upper_rel     = 1.110e-16   companion steady_S_upper_g_per_l = 3.98494
  BELOW  theta_transcritical_two_routes_rel     = 0.000e+00   companion theta_transcritical_h = 3.506
  BELOW  critical_step_two_routes_rel           = 8.060e-14   companion critical_step_S0_g_per_l = 17.2876
  above  critical_inoculum_two_routes_rel       = 2.351e-12   companion critical_inoculum_g_per_l = 0.184247
  above  feed_seed_fold_two_routes_rel          = 1.183e-09   companion feed_seed_removing_hysteresis_g_per_l = 0.0213935

6 quantities are computed twice (4 by genuinely independent routes, the other 2
by a second transcription of the same algebra), agreeing between 0.0e+00 and 1.2e-09:
  6.682e-12   batch time to 5 g/l, closed form vs LSODA
  1.110e-16   upper steady state, eq. (9) vs Brent [transcription]
  0.000e+00   transcritical theta, 1/mu(S_0) vs Brent [transcription]
  2.351e-12   critical inoculum, bisection vs stable manifold
  8.060e-14   critical step, bisection vs separatrix side test
  1.183e-09   X_0 fold, root count vs double root

Agreement metrics for J4.2-andrews-substrate-inhibition:
  mu_hat_m_eq2_per_h                             = 0.80325
  S_m_eq3_g_per_l                                = 0.24495
  eq2_vs_rootfound_max_rel                       = 2.2204e-16
  eq3_vs_rootfound_argmax_rel                    = 2.2204e-16
  theta_washout_h                                = 1.2449
  half_rate_low_root_g_per_l                     = 0.030464
  half_rate_high_root_g_per_l                    = 1.9695
  Ks_definition_rel_error                        = 0.015468
  Ki_definition_rel_error                        = -0.015232
  Ki_min_for_half_rate_defs_g_per_l              = 0.12
  rm_as_maximum_overstatement_rel                = 0.24495
  batch_time_direct_h                            = 36.527
  batch_time_direct_vs_printed36_rel             = 0.014652
  batch_closedform_vs_lsoda_rel                  = 6.682e-12
  batch_time_seeded_h                            = 12.372
  batch_time_seeded_vs_printed12p5_rel           = -0.010272
  seed_readings_raw_spread_rel                   = 0.11544
  seed_reset_vs_increment_rel                    = -0.00041854
  seed_speedup_factor                            = 2.9525
  lag_hours_at_Ki2                               = 27.922
  lag_share_of_delay_Ki2                         = 0.94401
  lag_share_of_delay_Ki5                         = 0.91249
  lag_share_of_delay_Ki10                        = 0.87779
  lag_share_of_delay_at_Xf1                      = 1.094
  peak_growth_rate_drop_rel                      = -0.19434
  batch_realised_mean_growth_drop_rel            = -0.80976
  batch_time_ratio_vs_no_inhibition              = 5.2564
  branch_switch_Ki_g_per_l                       = 3333.3
  steady_S_lower_g_per_l                         = 0.015057
  steady_S_upper_g_per_l                         = 3.9849
  steady_X_lower_g_per_l                         = 2.4925
  steady_X_upper_g_per_l                         = 0.50753
  eq9_printed_vs_rootfound_upper_rel             = 1.1102e-16
  saddle_positive_eigenvalue_per_h               = 0.056179
  washout_eigenvalue_haldane_per_h               = -0.048108
  washout_eigenvalue_monod_per_h                 = 0.6607
  lower_node_fast_eigenvalue_per_h               = -73.019
  theta_transcritical_h                          = 3.506
  theta_transcritical_two_routes_rel             = 0
  monod_vs_haldane_S_shift_rel                   = 0.0037784
  monod_vs_haldane_X_shift_rel                   = -1.1369e-05
  monod_theta_c_h                                = 1.006
  all_six_stated_outcomes_ok                     = 1
  fig8_direction_ok                              = 1
  critical_inoculum_g_per_l                      = 0.18425
  critical_inoculum_two_routes_rel               = 2.3506e-12
  critical_inoculum_S1_init_sensitivity_rel      = 0.05212
  critical_step_S0_g_per_l                       = 17.288
  critical_step_two_routes_rel                   = 8.0602e-14
  critical_ramp_duration_h                       = 0.87207
  andrews_step_margin_rel                        = 0.1569
  andrews_ramp_margin_rel                        = 0.1467
  pymrm_march_time_step_order                    = 1.0021
  pymrm_march_richardson_abs_err                 = 1.7021e-07
  pfr_outlet_grid_order                          = 1.0011
  pfr_last_cell_read_order                       = 1.0013
  pfr_boundary_over_last_cell_err_ratio_ncell800 = 1.3226
  pfr_richardson_abs_err                         = 4.2543e-07
  pfr_outlet_X_at_tau3_ncell800_g_per_l          = 0.23891
  pfr_outlet_X_at_tau6_richardson_g_per_l        = 0.60765
  feed_seed_removing_hysteresis_g_per_l          = 0.021393
  feed_seed_fold_two_routes_rel                  = 1.1833e-09
  feed_seed_fold_S_g_per_l                       = 4.4926</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="15">
<pre><code>{'page': 'J4.2-andrews-substrate-inhibition',
 'metrics': {'mu_hat_m_eq2_per_h': 0.8032457720443428,
  'S_m_eq3_g_per_l': 0.2449489742783178,
  'eq2_vs_rootfound_max_rel': 2.220446049250313e-16,
  'eq3_vs_rootfound_argmax_rel': 2.220446049250313e-16,
  'theta_washout_h': 1.2449489742783177,
  'half_rate_low_root_g_per_l': 0.030464028516734243,
  'half_rate_high_root_g_per_l': 1.9695359714832659,
  'Ks_definition_rel_error': 0.0154676172244748,
  'Ki_definition_rel_error': -0.015232014258367066,
  'Ki_min_for_half_rate_defs_g_per_l': 0.12,
  'rm_as_maximum_overstatement_rel': 0.24494897427831774,
  'batch_time_direct_h': 36.52747557683508,
  'batch_time_direct_vs_printed36_rel': 0.014652099356530002,
  'batch_closedform_vs_lsoda_rel': 6.681988296008967e-12,
  'batch_time_seeded_h': 12.371597482794177,
  'batch_time_seeded_vs_printed12p5_rel': -0.010272201376465801,
  'seed_readings_raw_spread_rel': 0.11544189992147746,
  'seed_reset_vs_increment_rel': -0.0004185386770062527,
  'seed_speedup_factor': 2.9525269980401267,
  'lag_hours_at_Ki2': 27.922318494599278,
  'lag_share_of_delay_Ki2': 0.9440131506118717,
  'lag_share_of_delay_Ki5': 0.9124871582573425,
  'lag_share_of_delay_Ki10': 0.8777879980628407,
  'lag_share_of_delay_at_Xf1': 1.0940027701847395,
  'peak_growth_rate_drop_rel': -0.19434449063149173,
  'batch_realised_mean_growth_drop_rel': -0.8097552514689615,
  'batch_time_ratio_vs_no_inhibition': 5.256386879119819,
  'branch_switch_Ki_g_per_l': 3333.3333333333335,
  'steady_S_lower_g_per_l': 0.015056675872079211,
  'steady_S_upper_g_per_l': 3.9849433241279213,
  'steady_X_lower_g_per_l': 2.49247166206396,
  'steady_X_upper_g_per_l': 0.5075283379360394,
  'eq9_printed_vs_rootfound_upper_rel': 1.1102230246251565e-16,
  'saddle_positive_eigenvalue_per_h': 0.056178966354689996,
  'washout_eigenvalue_haldane_per_h': -0.048108005324206116,
  'washout_eigenvalue_monod_per_h': 0.6607024519549369,
  'lower_node_fast_eigenvalue_per_h': -73.01914192931764,
  'theta_transcritical_h': 3.5060000000000002,
  'theta_transcritical_two_routes_rel': 0.0,
  'monod_vs_haldane_S_shift_rel': 0.00377839147194745,
  'monod_vs_haldane_X_shift_rel': -1.1369282262771176e-05,
  'monod_theta_c_h': 1.006,
  'all_six_stated_outcomes_ok': 1.0,
  'fig8_direction_ok': 1.0,
  'critical_inoculum_g_per_l': 0.18424664213673553,
  'critical_inoculum_two_routes_rel': 2.3505641877363814e-12,
  'critical_inoculum_S1_init_sensitivity_rel': 0.05211954741897018,
  'critical_step_S0_g_per_l': 17.287597871124817,
  'critical_step_two_routes_rel': 8.060219158778636e-14,
  'critical_ramp_duration_h': 0.8720667988003954,
  'andrews_step_margin_rel': 0.15689872873579858,
  'andrews_ramp_margin_rel': 0.14670114878308405,
  'pymrm_march_time_step_order': 1.0021309950485744,
  'pymrm_march_richardson_abs_err': 1.702079659661626e-07,
  'pfr_outlet_grid_order': 1.0011321846858463,
  'pfr_last_cell_read_order': 1.001305959559354,
  'pfr_boundary_over_last_cell_err_ratio_ncell800': 1.322621457072709,
  'pfr_richardson_abs_err': 4.254326150925653e-07,
  'pfr_outlet_X_at_tau3_ncell800_g_per_l': 0.23890743618872498,
  'pfr_outlet_X_at_tau6_richardson_g_per_l': 0.6076462145033377,
  'feed_seed_removing_hysteresis_g_per_l': 0.021393476490798143,
  'feed_seed_fold_two_routes_rel': 1.1833438673392038e-09,
  'feed_seed_fold_S_g_per_l': 4.492568064568628}}</code></pre>
</div>
</div>
<div id="8bdab857" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T05:12:33.476099Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T05:12:33.475965Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T05:12:33.539710Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T05:12:33.538942Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------------------- prose sweep</span></span>
<span id="cb30-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number written in the markdown of this notebook, in meta.yaml, in</span></span>
<span id="cb30-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># README.md and in models_entry.yaml is checked here against the live</span></span>
<span id="cb30-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># computation.  The notebook FAILS TO EXECUTE if any of them drifts.</span></span>
<span id="cb30-5">CLAIMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb30-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_hat_m"</span>,                  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.803246</span>,      MU_HAT_M,            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_m"</span>,                       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.244949</span>,      S_M,                 <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_w"</span>,                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.244949</span>,      THETA_W,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_transcritical"</span>,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.506000</span>,     THETA_TRANS,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-10">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half-rate low root"</span>,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0304640</span>,     HALF_LO,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half-rate high root"</span>,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.969536</span>,      HALF_HI,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-12">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_s definition error"</span>,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015468</span>,      KS_DEF_ERR,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i definition error"</span>,     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015232</span>,      KI_DEF_ERR,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i &gt;= 4 K_s"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.12</span>,          KI_MIN_FOR_DEF,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb30-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_direct"</span>,                  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.527476</span>,     T_DIRECT,            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_direct vs printed 36"</span>,    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.014652</span>,      REL_36,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_seed increment (reported)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.371597</span>,   T_SEED,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_seed vs printed 12.5"</span>,   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.010272</span>,      REL_12P5,            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_seed reset"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.366419</span>,     T_SEED_RESET,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_seed reset vs 12.5"</span>,     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.010686</span>,      REL_12P5_RESET,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_seed ladder"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.794022</span>,     T_SEED_LADDER,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_seed ladder vs 12.5"</span>,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.103522</span>,      REL_12P5_LADDER,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"raw spread of the three readings"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.115442</span>, SEED_READINGS_SPREAD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reset vs increment"</span>,       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.000419</span>,      SEED_RESET_VS_INC,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"speedup"</span>,                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9525</span>,        SPEEDUP,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cycles"</span>,                    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>,             N_CYCLES,            <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb30-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first cycle"</span>,               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.770815</span>,      CYCLE_T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remaining cycles"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.600783</span>,      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(CYCLE_T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]),    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f no inhibition"</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.949160</span>,      NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>],     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f at K_i=2"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.527476</span>,     ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>],     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-31">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f ratio"</span>,                 <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.256387</span>,      T_F_RATIO,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta t_f at K_i=2"</span>,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">29.578315</span>,     DT_F_2,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag hours at K_i=2"</span>,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">27.922318</span>,     ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag share K_i=2"</span>,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.944013</span>,      LAG_FRAC_2,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo share K_i=2"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.056505</span>,      FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo"</span>],   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-36">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail share K_i=2"</span>,         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.000518</span>,      FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail"</span>],   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-37">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag share K_i=5"</span>,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.912487</span>,      FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-38">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag share K_i=10"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.877788</span>,      FRAC[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>],   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-39">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag share at X_f = 1 g/l"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.094003</span>,      LAG_SHARE_AT_XF1,    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-40">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag share at X_f = 0.5 g/l"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.238027</span>,     SHARE_VS_XF[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-41">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch asymptote Y a"</span>,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.005</span>,         YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_INIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb30-42">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak mu no inhibition"</span>,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.997009</span>,      NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>],  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-43">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak mu at K_i=2"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.803246</span>,      ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>],  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-44">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"peak mu drop"</span>,             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.194344</span>,      MUMAX_DROP,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-45">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_peak at K_i=2"</span>,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.492522</span>,     ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_peak"</span>],  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-46">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_peak as a fraction of t_f"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999043</span>,    T_PEAK_FRACTION,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-47">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo term at K_i=2"</span>,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.599803</span>,      ROWS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo"</span>],    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-48">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time above half the peak rate"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.638869</span>,  T_ABOVE_HALF,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-49">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fraction above half the peak"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.017490</span>,   FRAC_ABOVE_HALF,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-50">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"realised mean mu, no inhibition"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.994042</span>, MEAN_MU_NOINH,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-51">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"realised mean mu at K_i=2"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.189111</span>,      MEAN_MU_KI2,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-52">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"realised mean mu drop"</span>,    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.809755</span>,      MEAN_MU_DROP,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-53">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X at t = lag"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.573354</span>,      X_AT_LAG,            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-54">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fold rise during the lag"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">114.6707</span>,      LAG_FOLD_RISE,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-55">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half-rate low root, K_i=1.0"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.030958</span>,   HALF_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"low"</span>],  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-56">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half-rate high root, K_i=1.0"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.969042</span>,   HALF_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"high"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-57">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_s definition error, K_i=1.0"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.031947</span>,  HALF_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ks_err"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-58">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i definition error, K_i=1.0"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.030958</span>, HALF_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ki_err"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-59">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half-rate low root, K_i=0.5"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.032055</span>,   HALF_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"low"</span>],  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-60">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half-rate high root, K_i=0.5"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.467945</span>,   HALF_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"high"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-61">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_s definition error, K_i=0.5"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.068502</span>,  KS_DEF_ERR_FIG1,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-62">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_i definition error, K_i=0.5"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.064110</span>, KI_DEF_ERR_FIG1,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-63">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S lower"</span>,                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0150567</span>,     S_LO,                <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-64">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S upper"</span>,                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.984943</span>,      S_HI,                <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-65">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X lower"</span>,                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.492472</span>,      X_LO,                <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-66">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X upper"</span>,                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.507528</span>,      X_HI,                <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-67">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq.(9) root over the lower root"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">264.66</span>,  S1_EQ9<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_LO,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb30-68">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"saddle eigenvalue"</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0561790</span>,     LAM_SADDLE,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-69">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout eig Haldane"</span>,      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0481080</span>,     LAM_WASHOUT,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-70">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout eig Monod"</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.660702</span>,      LAM_WASHOUT_MONOD,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-71">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower node fast eig"</span>,     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">73.019142</span>,      LAM_LOWER,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-72">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S shift Monod-&gt;Haldane"</span>,    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.003778</span>,      S_SHIFT,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb30-73">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X shift Monod-&gt;Haldane"</span>,   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.000011369</span>,   X_SHIFT,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-9</span>),</span>
<span id="cb30-74">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_m overstatement"</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.244949</span>,      RM_OVERSTATEMENT,    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-75">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit"</span>,                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1842466</span>,     X_CRIT,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-76">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit two routes"</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,           X_CRIT_TWO_ROUTES,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-11</span>),</span>
<span id="cb30-77">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit lowest over S_1(0)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1840000</span>,     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(SENS.values()),  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-78">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit highest over S_1(0)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1935900</span>,    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(SENS.values()),  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-79">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit spread, [0, 0.2]"</span>,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.052120</span>,      X_CRIT_SPREAD,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb30-80">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit spread, [0, 0.05]"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.004071</span>,      X_CRIT_SPREAD_NARROW, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb30-81">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_i=0.10 below crit"</span>,      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.457</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb30-82">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_i=0.50 above crit"</span>,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.714</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb30-83">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical step"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">17.28760</span>,      S0_STEP_CRIT,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb30-84">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical step two routes"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,           STEP_TWO_ROUTES,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-12</span>),</span>
<span id="cb30-85">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step margin"</span>,               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.157</span>,         STEP_MARGIN,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb30-86">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical ramp"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8720668</span>,     RAMP_CRIT,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-87">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ramp margin"</span>,               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1467</span>,        RAMP_MARGIN,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-88">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod theta_c"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.006</span>,         THETA_C_MONOD,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb30-89">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_0 killing the fold"</span>,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0213935</span>,     X0_FOLD_CRIT_DOUBLE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-90">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_0 fold as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% o</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">f X_1"</span>,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.008583</span>,      X0_FOLD_CRIT_DOUBLE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-91">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fold route A, ngrid 1501"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0049</span>,        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FOLD_A_REFINE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1501</span>]</span>
<span id="cb30-92">                                                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X0_FOLD_CRIT_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-93">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fold route A, ngrid 6001"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0000053</span>,     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FOLD_A_REFINE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6001</span>]</span>
<span id="cb30-94">                                                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X0_FOLD_CRIT_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-95">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fold route A, ngrid 96001"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0000000012</span>,  FOLD_A_FINEST_REL,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-11</span>),</span>
<span id="cb30-96">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_crit two routes (table)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,           X_CRIT_TWO_ROUTES,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5e-12</span>),</span>
<span id="cb30-97">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step two routes (table)"</span>,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,           STEP_TWO_ROUTES,     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.2e-14</span>),</span>
<span id="cb30-98">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form vs LSODA"</span>,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,           CF_VS_IVP,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>),</span>
<span id="cb30-99">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA batch time"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">36.527476</span>,     T_DIRECT_IVP,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb30-100">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow boundary read order"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0011</span>,    PFR_ORDER,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-101">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow last-cell read order"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0013</span>,   PFR_CENTRE_ORDER,    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-102">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary over last-cell error"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3226</span>,    PFR_BOUNDARY_OVER_CENTRE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-103">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary over last-cell, ncell 100"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3215</span>, PFR_B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-104">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"marcher time-step order"</span>,   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0021</span>,        MARCH_ORDER,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb30-105">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PFR outlet X at tau 3, ncell 800"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2389074</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pfr_val[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-106">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PFR outlet X at tau 6, Richardson"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6076462</span>, PFR_X_TAU6,      <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-107">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PFR outlet X at tau 6, ncell 1200"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6086420</span>, PFR_X_TAU6_GRID, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb30-108">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PFR tau 6 grid value vs converged"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001637</span>, PFR_TAU6_GRID_ERR, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb30-109">]</span>
<span id="cb30-110">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(n, w, g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLAIMS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> t]</span>
<span id="cb30-111"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> bad, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PROSE DRIFT:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(</span>
<span id="cb30-112">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: page says </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, live value </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> bad)</span>
<span id="cb30-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLAIMS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose/metadata values checked against the live"</span></span>
<span id="cb30-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" computation: all agree."</span>)</span>
<span id="cb30-115"></span>
<span id="cb30-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- mechanical sweep of the metadata FILES ------------------------------</span></span>
<span id="cb30-117"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number written with FIVE OR MORE DECIMAL PLACES in meta.yaml,</span></span>
<span id="cb30-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># README.md, models_entry.yaml and the data sidecar must match some live value</span></span>
<span id="cb30-119"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to HALF AN ULP OF ITS OWN PRINTED DIGITS.  Five decimals rather than four is</span></span>
<span id="cb30-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># deliberate: it excludes the DOI (10.1002/...) without an exception list.</span></span>
<span id="cb30-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The sweep then MEASURES ITS OWN TEETH by corrupting the last printed digit of</span></span>
<span id="cb30-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every token it found and reporting how many of those corruptions it rejects.</span></span>
<span id="cb30-123"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb30-124"></span>
<span id="cb30-125">LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>()</span>
<span id="cb30-126"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.values():</span>
<span id="cb30-127">    LIVE.add(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_v))</span>
<span id="cb30-128"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(FRAC.values())):</span>
<span id="cb30-129">    LIVE.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _v.values())</span>
<span id="cb30-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS:</span>
<span id="cb30-131">    LIVE.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_r[k]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_max"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_m"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_peak"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expo"</span>,</span>
<span id="cb30-132">                                       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_f"</span>))</span>
<span id="cb30-133">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CYCLE_T])</span>
<span id="cb30-134">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(CYCLE_T[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]), T_SEED_RESET, REL_12P5_RESET, T_SEED_LADDER,</span>
<span id="cb30-135">             REL_12P5_LADDER, SEED_READINGS_SPREAD, SEED_RESET_VS_INC,</span>
<span id="cb30-136">             X0_FOLD_CRIT, X0_FOLD_CRIT_DOUBLE, X0_FOLD_CRIT_DOUBLE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_LO,</span>
<span id="cb30-137">             _S_fold, S1_EQ9, S1_EQ9_MINUS, S_MONOD, X_MONOD, D_C_MONOD,</span>
<span id="cb30-138">             KI_SWITCH, MU_HAT_M_ROOT, S_M_ROOT, HALF_LO_BRENT, HALF_HI_BRENT,</span>
<span id="cb30-139">             THETA_TRANS_ROOT, X_CRIT_MANIFOLD, S0_STEP_CRIT_SEP, PFR_X_MAX,</span>
<span id="cb30-140">             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, T_DIRECT_IVP,</span>
<span id="cb30-141">             T_PEAK_FRACTION, MEAN_MU_KI2, MEAN_MU_NOINH, MEAN_MU_DROP,</span>
<span id="cb30-142">             X_AT_LAG, LAG_FOLD_RISE, T_ABOVE_HALF, FRAC_ABOVE_HALF,</span>
<span id="cb30-143">             X_CRIT_SPREAD_NARROW, PFR_X_TAU6_GRID, PFR_TAU6_GRID_ERR,</span>
<span id="cb30-144">             PFR_TAU6_RICH_ERR, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(REF_TAU6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), PFR_CENTRE_ORDER,</span>
<span id="cb30-145">             PFR_BOUNDARY_OVER_CENTRE, YIELD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(S_INIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> X_INIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>YIELD)])</span>
<span id="cb30-146"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHARE_VS_XF.values():</span>
<span id="cb30-147">    LIVE.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _v.values())</span>
<span id="cb30-148"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> HALF_TABLE:</span>
<span id="cb30-149">    LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_r[k]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"low"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"high"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ks_err"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ki_err"</span>)])</span>
<span id="cb30-150">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]])</span>
<span id="cb30-151">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FOLD_A_REFINE.values()])</span>
<span id="cb30-152">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SENS.values()])</span>
<span id="cb30-153">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> march_err] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pfr_err])</span>
<span id="cb30-154">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ORDERS] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_ORDERS])</span>
<span id="cb30-155">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_SWEEP.ravel()])</span>
<span id="cb30-156">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> REF_MARCH] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> REF_PFR])</span>
<span id="cb30-157">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EIG.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> w])</span>
<span id="cb30-158">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(LIVE)])          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># signs are written as words</span></span>
<span id="cb30-159">LIVE.update([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(LIVE)])         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># percentages</span></span>
<span id="cb30-160">LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(x)}</span>
<span id="cb30-161"></span>
<span id="cb30-162">TOKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\.</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{5,}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-163">FILES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"meta.yaml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"README.md"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/andrews1968-printed-model.meta.yaml"</span>,</span>
<span id="cb30-164">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../models_entry.yaml"</span>]</span>
<span id="cb30-165"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE TOKEN COUNT DEPENDS ON THE SHAPE THE PAGE IS IN, so both counts are pinned</span></span>
<span id="cb30-166"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># here and whichever shape is executing is asserted.  `integrate_case.py` copies</span></span>
<span id="cb30-167"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `page/` only and splices `models_entry.yaml` into the repository's</span></span>
<span id="cb30-168"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `models.yaml`, so the fourth file is swept HERE, in the queue tree, before the</span></span>
<span id="cb30-169"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># splice, and is absent - and counted as absent - in the published page.  On</span></span>
<span id="cb30-170"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Colab none of the files is present.  Quoting one count in the metadata while</span></span>
<span id="cb30-171"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the shipped page printed the other is exactly the drift this sweep exists to</span></span>
<span id="cb30-172"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># catch, so the numbers in `README.md` and `meta.yaml` name both shapes.</span></span>
<span id="cb30-173">SWEEP_TOKENS_BY_SHAPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">93</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>}</span>
<span id="cb30-174"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># live values that are worth naming when a corruption lands on one: the metrics,</span></span>
<span id="cb30-175"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plus the second routes and references that sit close to a reported value.</span></span>
<span id="cb30-176">NAMED_LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(METRICS)</span>
<span id="cb30-177">NAMED_LIVE.update({</span>
<span id="cb30-178">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the LSODA batch reference for the tau = 6 h outlet"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(REF_TAU6[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb30-179">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the tau = 6 h outlet on the ncell 1200 grid"</span>: PFR_X_TAU6_GRID,</span>
<span id="cb30-180">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the batch time to 5 g/l by LSODA"</span>: T_DIRECT_IVP,</span>
<span id="cb30-181">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the critical inoculum by the stable manifold"</span>: X_CRIT_MANIFOLD,</span>
<span id="cb30-182">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the critical step by the separatrix side test"</span>: S0_STEP_CRIT_SEP,</span>
<span id="cb30-183">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the X_0 fold by the root count"</span>: X0_FOLD_CRIT,</span>
<span id="cb30-184">})</span>
<span id="cb30-185"></span>
<span id="cb30-186"></span>
<span id="cb30-187"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _half_ulp(tok):</span>
<span id="cb30-188">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tok.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb30-189"></span>
<span id="cb30-190"></span>
<span id="cb30-191"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _matches(tok):</span>
<span id="cb30-192">    v, half_ulp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tok), _half_ulp(tok)</span>
<span id="cb30-193">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> half_ulp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE)</span>
<span id="cb30-194"></span>
<span id="cb30-195"></span>
<span id="cb30-196"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _lands_on(tok):</span>
<span id="cb30-197">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the NAMED live value a token matches, when there is one"""</span></span>
<span id="cb30-198">    v, half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tok), _half_ulp(tok)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb30-199">    hits <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v), n) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NAMED_LIVE.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> half)</span>
<span id="cb30-200">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> hits[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> hits <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an unnamed live value"</span></span>
<span id="cb30-201"></span>
<span id="cb30-202"></span>
<span id="cb30-203">tokens, unmatched, rejected, corrupted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb30-204"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES:</span>
<span id="cb30-205">    fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path(fn)</span>
<span id="cb30-206">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> fp.is_file():</span>
<span id="cb30-207">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (skipped, not present next to the notebook: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb30-208">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb30-209">    text <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fp.read_text(encoding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utf-8"</span>)</span>
<span id="cb30-210">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TOKEN.findall(text):</span>
<span id="cb30-211">        tokens.append((fn, t))</span>
<span id="cb30-212">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matches(t):</span>
<span id="cb30-213">            unmatched.append((fn, t))</span>
<span id="cb30-214">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># teeth: corrupt the last printed digit and require rejection</span></span>
<span id="cb30-215">        last <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb30-216">        bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>((last <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb30-217">        corrupted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb30-218">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matches(bad):</span>
<span id="cb30-219">            rejected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb30-220">found <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tokens)</span>
<span id="cb30-221">n_files <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>([f <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Path(f).is_file()])</span>
<span id="cb30-222"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> unmatched, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metadata numbers with no live counterpart: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>unmatched<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-223"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> SWEEP_TOKENS_BY_SHAPE.get(n_files, found) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> found, (</span>
<span id="cb30-224">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sweep found </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tokens in the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape, not the"</span></span>
<span id="cb30-225">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(n_files)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pinned for it"</span>)</span>
<span id="cb30-226"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mechanical sweep of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FILES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metadata files:"</span></span>
<span id="cb30-227">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> numbers written to 5+ decimals, all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> match a live"</span></span>
<span id="cb30-228">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" value to half an ulp of their own printed digits."</span>)</span>
<span id="cb30-229"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the count is shape-dependent and BOTH shapes are pinned:"</span></span>
<span id="cb30-230">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FILES)]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tokens across the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FILES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> files"</span></span>
<span id="cb30-231">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" in the queue tree, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FILES) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the"</span></span>
<span id="cb30-232">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" published page,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  where ../models_entry.yaml has been spliced into"</span></span>
<span id="cb30-233">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" models.yaml; the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape is the one executing here and it"</span></span>
<span id="cb30-234">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is the count asserted."</span>)</span>
<span id="cb30-235"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  sweep teeth, measured not claimed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rejected<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>corrupted<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-236">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(corrupted, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) of last-digit corruptions rejected."</span>)</span>
<span id="cb30-237"></span>
<span id="cb30-238"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The claim above is about the LAST digit.  Hardened, on the spot: corrupt EVERY</span></span>
<span id="cb30-239"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># digit position of every token, by +1 and by +5, and report what survives -</span></span>
<span id="cb30-240"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># because "100 % of last-digit corruptions rejected" is a weaker statement than</span></span>
<span id="cb30-241"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it sounds, and the survivors are worth naming rather than rounding away.</span></span>
<span id="cb30-242">hard, survivors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, []</span>
<span id="cb30-243"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> tokens:</span>
<span id="cb30-244">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, ch <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(t):</span>
<span id="cb30-245">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ch.isdigit():</span>
<span id="cb30-246">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb30-247">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> step <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>):</span>
<span id="cb30-248">            bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[:i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(ch) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> step) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]</span>
<span id="cb30-249">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bad) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t):</span>
<span id="cb30-250">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb30-251">            hard <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb30-252">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _matches(bad):</span>
<span id="cb30-253">                survivors.append((fn, t, bad))</span>
<span id="cb30-254">survivors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(survivors))</span>
<span id="cb30-255"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  HARDENED, every digit position by +1 and by +5:"</span></span>
<span id="cb30-256">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hard <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(survivors)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hard<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-257">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(hard <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(survivors))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(hard, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) rejected,"</span></span>
<span id="cb30-258">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(survivors)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> survivor(s):"</span>)</span>
<span id="cb30-259"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn, t, bad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> survivors:</span>
<span id="cb30-260">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which lands on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_lands_on(bad)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-261">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bad) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> away)"</span>)</span>
<span id="cb30-262"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># counted as UNORDERED pairs: naming the near neighbour in README.md and</span></span>
<span id="cb30-263"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># meta.yaml puts both halves of the substitution in the swept text, and each</span></span>
<span id="cb30-264"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># then corrupts into the other.  It is one blind spot, not two.</span></span>
<span id="cb30-265">SURVIVOR_PAIRS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>((t, bad))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, t, bad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> survivors})</span>
<span id="cb30-266"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SURVIVOR_PAIRS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> distinct substitution(s) the sweep cannot"</span></span>
<span id="cb30-267">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" see: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SURVIVOR_PAIRS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-268"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SURVIVOR_PAIRS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, (</span>
<span id="cb30-269">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sweep now has more than one blind substitution: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SURVIVOR_PAIRS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-270"></span>
<span id="cb30-271"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># structural claims, asserted rather than asserted-by-eye</span></span>
<span id="cb30-272"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ALL_SIX_OK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one of Andrews' six stated outcomes did not reproduce"</span></span>
<span id="cb30-273"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> LAM_SADDLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> LAM_WASHOUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> LAM_WASHOUT_MONOD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb30-274"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> THETA_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> THETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> THETA_TRANS, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Andrews' theta is outside the window"</span></span>
<span id="cb30-275"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(steady_states()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(steady_states(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, S_FEED, K_I)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb30-276"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> PFR_MONOTONE</span>
<span id="cb30-277"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(NO_INHIB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lag"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod lag is not identically zero"</span></span>
<span id="cb30-278"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Andrews' two inocula do not bracket the threshold"</span></span>
<span id="cb30-279"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> S0_STEP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> RAMP_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb30-280"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> PFR_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span></span>
<span id="cb30-281"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural assertions: all pass."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>101 prose/metadata values checked against the live computation: all agree.
  (skipped, not present next to the notebook: ../models_entry.yaml)
mechanical sweep of 3 of the 4 metadata files: 60 numbers written to 5+ decimals, all 60 match a live value to half an ulp of their own printed digits.
  the count is shape-dependent and BOTH shapes are pinned: 93 tokens across the 4 files in the queue tree, 60 in the published page,
  where ../models_entry.yaml has been spliced into models.yaml; the 3-file shape is the one executing here and it is the count asserted.
  sweep teeth, measured not claimed: 60/60 (100.0%) of last-digit corruptions rejected.
  HARDENED, every digit position by +1 and by +5: 934/936 (99.79%) rejected, 2 survivor(s):
    README.md    0.6076462 -&gt; 0.6076472, which lands on the LSODA batch reference for the tau = 6 h outlet (1.0e-06 away)
    meta.yaml    0.6076462 -&gt; 0.6076472, which lands on the LSODA batch reference for the tau = 6 h outlet (1.0e-06 away)
    -&gt; 1 distinct substitution(s) the sweep cannot see: [('0.6076462', '0.6076472')]
structural assertions: all pass.</code></pre>
</div>
</div>
</section>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>Read <img src="https://latex.codecogs.com/png.latex?K_s"> and <img src="https://latex.codecogs.com/png.latex?K_i"> as the constants of eq. (1), not as the half-rate concentrations they are named for.</strong> They coincide only as <img src="https://latex.codecogs.com/png.latex?K_s/K_i%20%5Cto%200">, and how far out they are depends on the constants: +1.5468 % and -1.5232 % at the <img src="https://latex.codecogs.com/png.latex?K_i%20=%202.0"> g/l of Andrews’ chemostat figures, but <strong>+6.8502 % and -6.4110 % at the <img src="https://latex.codecogs.com/png.latex?K_i%20=%200.50"> g/l of his own Fig. 1</strong>. Quote the error at <em>your</em> <img src="https://latex.codecogs.com/png.latex?K_i">, not at the mildest one. The naming has no meaning at all unless <img src="https://latex.codecogs.com/png.latex?K_i%20%5Cge%204K_s">. If you are fitting the function, fit <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu">, <img src="https://latex.codecogs.com/png.latex?K_s">, <img src="https://latex.codecogs.com/png.latex?K_i">; if you are reporting it, report <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu_m"> and <img src="https://latex.codecogs.com/png.latex?S_m"> from eqs. (2)-(3) as well, because <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu"> alone is not a rate anything ever achieves.</p>
<p><strong>Do not carry a Monod textbook’s definition of <img src="https://latex.codecogs.com/png.latex?r_m"> across to the inhibition form.</strong> Froment defines <img src="https://latex.codecogs.com/png.latex?r_m"> as <em>“the maximum specific rate of biomass growth”</em> for eq. (1.5.2-1) and then reuses the symbol in eq. (1.5.2-4), where the maximum is <img src="https://latex.codecogs.com/png.latex?r_m/(1%20+%202%5Csqrt%7BK_S/K_i%7D)"> - 24.5 % lower at Andrews’ constants.</p>
<p><strong>Use eq. (6)’s form, <img src="https://latex.codecogs.com/png.latex?%5Chat%5Cmu%20S/(S%5E2/K_i%20+%20S%20+%20K_s)">, not eq. (1)’s.</strong> They are the same function, but eq. (1) is <img src="https://latex.codecogs.com/png.latex?0/0">-shaped at <img src="https://latex.codecogs.com/png.latex?S%20=%200"> and every batch and startup calculation goes there. Andrews rewrote it for exactly this reason.</p>
<p><strong>A chemostat on an inhibitory substrate has two washout conditions, and the printed one is not the one that usually bites.</strong> Andrews’ eq. (11), <img src="https://latex.codecogs.com/png.latex?%5Ctheta_w%20=%20%5Chat%5Cmu_m%5E%7B-1%7D">, is the fold, and it has no <img src="https://latex.codecogs.com/png.latex?S_0"> in it. The other - washout is stable whenever <img src="https://latex.codecogs.com/png.latex?%5Cmu(S_0)%20%3C%201/%5Ctheta"> - depends on the feed, and it is the one that produces bistability. Check both. Under Monod only the second survives, and it is exactly the <img src="https://latex.codecogs.com/png.latex?D_c%20=%20%5Cmu_m%20S_f/(K_S%20+%20S_f)"> that J4.1 loads from Rawlings &amp; Ekerdt.</p>
<p><strong>A steady state that barely moves can still change character completely.</strong> Inhibition shifts this operating point by 0.38 % in substrate and 0.0011 % in biomass, and turns a globally attracting state into one with a basin boundary at 0.1842466 g/l of inoculum. Never conclude from <em>“the inhibition term is negligible at the operating point”</em> that it is negligible.</p>
<p><strong>Root-find the thresholds; do not sweep for them.</strong> Every threshold on this page is a Brent root on an event-terminated integration, and two of them are computed a second time from the saddle’s stable manifold. A swept crossing would have given the same first three digits and hidden the fact that Andrews’ 1 hr ramp clears the critical ramp by only 14.67 %.</p>
<p><strong>Seed the feed if you can.</strong> A feed biomass of <strong>0.0213935 g/l</strong> - <strong>0.8583 %</strong> of the operating biomass - removes the hysteresis entirely, because washout stops being a steady state at all. This is this page’s extension, not Andrews’, and it is cheaper than any of the three stabilising modifications his Discussion lists.</p>
<p><strong>Plug flow has none of this.</strong> The same kinetics in a plug-flow fermenter give an outlet biomass that increases strictly with residence time for any positive seed: no fold, no saddle, no washout. That is the infinite-stage limit of Andrews’ <em>“multistage operation with separate substrate supply to each reactor”</em>, and it confirms his prediction in that limit only.</p>
<p><strong>And the batch lesson, which is the cheap one.</strong> Inhibition on a batch culture shows up as lag, not as a slower exponential phase - 94.40 % lag at Andrews’ constants and at his own 5 g/l target. If you are diagnosing a slow fermentation, measure the tangent slope at its steepest point before you conclude the organism is slow: here that slope falls only 19.4344 % while the run takes 5.2564 times as long.</p>
<p><strong>But do not report the peak slope as the growth rate.</strong> On this trajectory the peak is touched at 99.90 % of the elapsed time and the culture is above half of it for 1.7490 % of the run; the rate a fermenter actually realises, <img src="https://latex.codecogs.com/png.latex?%5Cln(X_f/X_i)/t_f">, falls <strong>80.98 %</strong>, four times the drop in the peak. The same caution applies to the lag share itself: <img src="https://latex.codecogs.com/png.latex?%5Clambda"> is independent of the target and <img src="https://latex.codecogs.com/png.latex?%5CDelta%20t_f"> is not, so “94 % of the delay is lag” is a statement about a target biomass, and at 1 g/l rather than 5 g/l the same arithmetic returns 109.4003 %. Quote the target with the share, or do not quote the share.</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier1</category>
  <category>phase:liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.2-andrews-substrate-inhibition/</guid>
  <pubDate>Fri, 14 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Luedeking-Piret: refitting alpha and beta from the one run whose raw data are printed</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.4-luedeking-piret/</link>
  <description><![CDATA[ 




<section id="luedeking-piret-refitting-alpha-and-beta-from-the-one-run-whose-raw-data-are-printed" class="level1">
<h1>Luedeking-Piret: refitting <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> from the one run whose raw data are printed</h1>
<p><strong>Catalog ID:</strong> <code>J4.4</code> · <strong>Structures:</strong> <code>S1</code> · <strong>Tier:</strong> T0</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>The source is on disk and all twenty pages were read at the file’s native resolution:</p>
<blockquote class="blockquote">
<p><strong>Luedeking, R.</strong> and <strong>Piret, E. L.</strong>, <em>A Kinetic Study of the Lactic Acid Fermentation. Batch Process at Controlled pH</em>, <strong>Journal of Biochemical and Microbiological Technology and Engineering 1</strong>(4), 393-412 (1959), doi:<code>10.1002/jbmte.390010406</code>.</p>
</blockquote>
<p>Identity confirmed from the document’s own first page, on a 300 ppi render: the masthead <em>“Journal of Biochemical and Microbiological Technology and Engineering / VOL. I, NO. 4. PAGES 393-412 (1959)”</em>, the title, the by-line <em>“ROBERT LUEDEKING and EDGAR L. PIRET / Department of Chemical Engineering, University of Minnesota / Minneapolis 14, Minnesota”</em>, and the Summary, which prints the relation this case is about. <code>pdfimages -list</code> reports every text page as CCITT-G4 bilevel at 300x300 ppi, so 300 ppi is native and rendering higher would be interpolation. Three byte-identical copies of the file arrived (md5 <code>601827724b39cac54e549e8aebb1227e</code>, 885270 bytes each); two are parked in <code>~/papers/pymrm-gallery/duplicates/</code> and are not parts.</p>
<section id="two-things-about-the-source-that-decide-how-this-page-is-built" class="level3">
<h3 class="anchored" data-anchor-id="two-things-about-the-source-that-decide-how-this-page-is-built">Two things about the source that decide how this page is built</h3>
<p><strong>Every decimal point in this paper is a British mid-dot.</strong> <code>2.2</code> prints as a <code>2</code> followed by a <em>raised</em> dot, and the Summary’s pH range prints as <em>“between 4·5 and 6·0”</em>. The text layer of this scan relocates and drops them: it renders book p.&nbsp;406’s <code>pH 5.4</code> as <code>pH 3.4</code> and, one line later, as <code>pH 3 4</code>; it renders the U.O.D. definition <code>N = 0.125r</code> as <code>N = 0.12%</code>. <strong>No number on this page came off the text layer.</strong> The text layer was used to find things - that is what the negative-claim searches below run on - and every numeral was then read on a crop of the 300 ppi bilevel image enlarged to digit scale. (Book page = PDF page + 392 throughout, confirmed on the printed running heads: PDF 8 reads <code>400</code>, PDF 14 reads <code>406 ROBERT LUEDEKING AND EDGAR L. PIRET</code>, PDF 15 reads <code>407</code>, PDF 17 reads <code>409</code>. Those were read on crops too, because the digit is exactly what this text layer is not to be trusted with.)</p>
<p><strong>The paper’s symbols are <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">.</strong> The catalogue entry for this case, and this repository’s own case yaml, both write the relation with <em>a</em> and <em>b</em>. The Summary, eq. (2), eq. (3), Table III, Fig. 10 and the Nomenclature all print Greek <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta">. This page uses the paper’s symbols throughout and records the discrepancy here rather than renaming anything silently.</p>
</section>
<section id="what-the-paper-prints-and-what-it-does-not" class="level3">
<h3 class="anchored" data-anchor-id="what-the-paper-prints-and-what-it-does-not">What the paper prints, and what it does not</h3>
<p><strong>Three tables, and only one fermentation is tabulated.</strong></p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>where</th>
<th>what</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Table I</td>
<td>book p.&nbsp;401 (PDF 9)</td>
<td><em>“Bacterial density during batch fermentation”</em> - 45 (time, <img src="https://latex.codecogs.com/png.latex?N">) pairs</td>
</tr>
<tr class="even">
<td>Table II</td>
<td>book p.&nbsp;402 (PDF 10)</td>
<td><em>“Growth and lactic acid synthesis during batch fermentation”</em> - 27 rows of <img src="https://latex.codecogs.com/png.latex?N">, <img src="https://latex.codecogs.com/png.latex?P">, <img src="https://latex.codecogs.com/png.latex?dN/dt">, <img src="https://latex.codecogs.com/png.latex?dP/dt">, <img src="https://latex.codecogs.com/png.latex?k">, <img src="https://latex.codecogs.com/png.latex?(1/N)(dP/dt)"></td>
</tr>
<tr class="odd">
<td>Table III</td>
<td>book p.&nbsp;410 (PDF 18)</td>
<td><em>“Experimental constants <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> of equations 3 and 2 for each pH level”</em> - six (pH, <img src="https://latex.codecogs.com/png.latex?%5Calpha">, <img src="https://latex.codecogs.com/png.latex?%5Cbeta">) triples</td>
</tr>
</tbody>
</table>
<p>Tables I and II both carry the footnote <em>“At 45°C, pH controlled at 6·0, on a 5 per cent glucose medium fortified with 3 per cent yeast extract and added mineral salts, <em>L. delbrueckii</em>”</em>, and the running text on book p.&nbsp;401 says so directly: <em>“As an example, the rate information for the fermentation at pH 6·0 is tabulated in Tables I and II”</em>.</p>
<p><strong>So five of Table III’s six rows have no printed raw data anywhere in this paper, and that half of the case is out of scope.</strong> The claim is checkable and here is the check, stated so that it reproduces exactly. <code>pdftotext -layout</code> over all twenty pages, then</p>
<pre><code>grep -c  "Table" all.txt   -&gt;  5      grep -ci "table" all.txt   -&gt;  6</code></pre>
<p>The <strong>five</strong> case-sensitive hits are every mention of a table in the paper: the three captions (the text layer renders the last two as <code>Table 11</code> and <code>Table 111</code>), the running-text sentence on book p.&nbsp;401 this page quotes twice - <em>“the rate information for the fermentation at pH 6·0 is tabulated in Tables I and 11”</em> - and the cross-reference on book p.&nbsp;409, <em>“can be seen from Table I11 and from Fig. 10”</em>. The sixth case-insensitive hit is not a table at all: it is the word <em>“unsuitable”</em> in running text on book p.&nbsp;398. All twenty rendered pages were then looked at for ruled blocks; the only three are on PDF pages 9, 10 and 18. The other five fermentations appear as <strong>plotted curves</strong> in Figs. 4-11 and as <strong>fitted constants</strong> in Table III. <strong>No curve on any figure is digitised on this page.</strong> What that costs is stated in <em>Validation</em>.</p>
</section>
<section id="what-this-page-therefore-does" class="level3">
<h3 class="anchored" data-anchor-id="what-this-page-therefore-does">What this page therefore does</h3>
<p>The paper’s Summary states the relation and says the constants depend on pH:</p>
<blockquote class="blockquote">
<p><em>“It was found that the instantaneous rate of acid formation d<img src="https://latex.codecogs.com/png.latex?P">/d<img src="https://latex.codecogs.com/png.latex?t">, could be related to the instantaneous rate of bacterial growth d<img src="https://latex.codecogs.com/png.latex?N">/d<img src="https://latex.codecogs.com/png.latex?t">, and to the bacterial density <img src="https://latex.codecogs.com/png.latex?N">, throughout a fermentation at a given pH, by the expression</em> <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt%20=%20%5Calpha%5C,%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt%20+%0A%5Cbeta%20N"> <em>where the constants <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> are determined by the pH of the fermentation.”</em></p>
</blockquote>
<ol type="1">
<li><strong>Refit <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> from Tables I and II</strong> and compare against Table III’s printed pH 6.0 pair. Three routes, one of which touches no differentiated column at all.</li>
<li><strong>Test the two-term <em>form</em> against the two one-term nulls</strong> - and both nulls are models this paper itself puts up and knocks down, so the comparison is the paper’s own argument made quantitative.</li>
<li><strong>Report the pH trends of the six printed pairs</strong> without refitting five of them, and say plainly what six numbers can and cannot establish.</li>
<li><strong>Put the relation into pymrm</strong> as a source term in a batch and in a plug-flow fermenter, checked against a closed form the model happens to have exactly.</li>
</ol>
</section>
<section id="the-one-thing-this-page-must-not-be-read-as-claiming" class="level3">
<h3 class="anchored" data-anchor-id="the-one-thing-this-page-must-not-be-read-as-claiming">The one thing this page must not be read as claiming</h3>
<p><strong>The refit is a consistency check on the authors’ own fit, not a validation of their model.</strong> Book p.&nbsp;409: <em>“The constants <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> are determined from the plots of Fig. 11”</em>, and Fig. 11 plots <img src="https://latex.codecogs.com/png.latex?(1/N)(%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt)"> against <img src="https://latex.codecogs.com/png.latex?k"> - which are Table II’s last two columns. <strong>The data on both sides of the comparison are the same measurements.</strong> Recovering 2.2 and 0.55 from them says the authors’ straight-edge and least squares agree; it says nothing about whether the relation would hold on a fermentation they did not run. That sentence is repeated in <em>Validation</em> and in <code>meta.yaml</code>, and every number below is labelled <strong>fit</strong> or <strong>test</strong> accordingly.</p>
<div id="f55ab110" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:40.518943Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:40.518770Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:40.937085Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:40.936218Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Colab: install pymrm if it is not already present.</span></span>
<span id="cb2-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb2-3">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: F401</span></span>
<span id="cb2-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pragma: no cover - only on a fresh Colab VM</span></span>
<span id="cb2-5">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm</span></code></pre></div></div>
</div>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Book p.&nbsp;408, in the paper’s own words - <em>“A reasonably close correlation can be obtained if it be assumed that the rate of acid synthesis is related <strong>both</strong> to the rate of growth and to the quantity of bacteria present, using the simplest possible relationship”</em>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7DP%7D%7B%5Cmathrm%7Bd%7Dt%7D%20=%20%5Calpha%5C,%5Cfrac%7B%5Cmathrm%7Bd%7DN%7D%7B%5Cmathrm%7Bd%7Dt%7D%0A%20%20%20+%20%5Cbeta%20N%20%5Ctag%7B2%7D"></p>
<p><em>“where <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> are constants of proportionality”</em>. And then, same page - <em>“It is easier to verify this assumed relationship and to evaluate the constants if the equation be modified by dividing by <img src="https://latex.codecogs.com/png.latex?N">”</em>, and <em>“since, by definition, <img src="https://latex.codecogs.com/png.latex?k%20=%20(1/N)(%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt)">, the equation finally simplifies to”</em>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7BN%7D%5Cfrac%7B%5Cmathrm%7Bd%7DP%7D%7B%5Cmathrm%7Bd%7Dt%7D%20=%20%5Calpha%20k%20+%20%5Cbeta%20%5Ctag%7B3%7D"></p>
<p><strong>Eq. (3) is eq. (2) divided by <img src="https://latex.codecogs.com/png.latex?N"> and nothing else.</strong> They are the same model. They are <em>not</em> the same fit: least squares on eq. (3) weights each row equally, least squares on eq. (2) weights it by <img src="https://latex.codecogs.com/png.latex?N%5E2">, and <img src="https://latex.codecogs.com/png.latex?N"> spans a factor of 78 down this table. The page reports both and says which is which.</p>
<p><strong>Two of Table II’s columns are the two axes of eq. (3).</strong> That is why the refit is possible at all, and it is also exactly why the refit is a consistency check: book p.&nbsp;409, <em>“When the experimental values of <img src="https://latex.codecogs.com/png.latex?(1/N)(%5Cmathrm%7Bd%7DP/%0A%5Cmathrm%7Bd%7Dt)"> are plotted against <img src="https://latex.codecogs.com/png.latex?k"> in Fig. 11, the points fall close to a straight line, thus tending to confirm the validity of equations 3 and 2”</em>, and p.&nbsp;410, <em>“The constants <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> are determined from the plots of Fig. 11.”</em></p>
<section id="the-two-nulls-and-that-they-are-the-papers-own" class="level3">
<h3 class="anchored" data-anchor-id="the-two-nulls-and-that-they-are-the-papers-own">The two nulls, and that they are the paper’s own</h3>
<p>Eq. (2) has two one-term degenerate cases, and the paper puts both of them up by name before rejecting them. Book p.&nbsp;410:</p>
<blockquote class="blockquote">
<p><em>“during the phase of logarithmic growth the two common assumptions mentioned above for relating rate of acid production to growth are both valid. This is true because <img src="https://latex.codecogs.com/png.latex?(%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt)%20=%20kN">, and during the logarithmic phase <img src="https://latex.codecogs.com/png.latex?k"> is a constant, <img src="https://latex.codecogs.com/png.latex?k_c">. Thus one can state with equal validity that during the logarithmic phase the rate of acid production is proportional to the growth rate of the bacteria, or that during this phase the rate of acid production is proportional to the quantity of bacteria present. <strong>Neither statement was found to hold true outside of the period of logarithmic growth</strong>, while equation 3, of course, was found to apply throughout the entire fermentation cycle.”</em></p>
</blockquote>
<p>So the null baselines this page computes beside the headline are <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200"> (<em>“proportional to the growth rate”</em>) and <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%200"> (<em>“proportional to the quantity of bacteria present”</em>), and they are not straw men chosen here - they are the two alternatives the authors themselves name.</p>
</section>
<section id="what-the-constants-mean-and-the-crossover-the-paper-describes-in-words" class="level3">
<h3 class="anchored" data-anchor-id="what-the-constants-mean-and-the-crossover-the-paper-describes-in-words">What the constants mean, and the crossover the paper describes in words</h3>
<p>Book p.&nbsp;410: <em>“The rate of acid production per cell for the first process is represented by <img src="https://latex.codecogs.com/png.latex?%5Calpha%20k"> and is therefore proportional to the specific growth rate. For the second process the rate of acid production per cell is a constant at a given pH level. In the early phases of a normal fermentation when the specific growth rate is high, the first term of equation 3 is the important one, while towards the end of the fermentation the second term becomes more important. For ‘resting’ cells where there is supposedly no growth occurring, the first term should be zero and all acid is produced in accordance with the second term of the equation, the constant <img src="https://latex.codecogs.com/png.latex?%5Cbeta">.”</em></p>
<p>That prose contains a number the paper never writes down. The two terms of eq. (3) are equal at</p>
<p><img src="https://latex.codecogs.com/png.latex?k%5E%7B*%7D%20=%20%5Cbeta/%5Calpha,"></p>
<p>which has units of <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bh%7D%5E%7B-1%7D"> and is the specific growth rate at which the fermentation stops being growth-dominated. It is computed below for all six pH levels, and the <em>time</em> at which the pH 6.0 run crosses it is root-found on Table II - by two routes that share no column.</p>
</section>
<section id="units-and-where-they-are-printed" class="level3">
<h3 class="anchored" data-anchor-id="units-and-where-they-are-printed">Units, and where they are printed</h3>
<p>Table III’s footnotes are the <strong>only</strong> place in the paper that gives <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> units: <em>“<img src="https://latex.codecogs.com/png.latex?%5Calpha"> has the units mg lactic/U.O.D.”</em> and <em>“<img src="https://latex.codecogs.com/png.latex?%5Cbeta"> has the units mg lactic/U.O.D./h”</em>. The Nomenclature on book p.&nbsp;411 lists <em>“<img src="https://latex.codecogs.com/png.latex?%5Calpha">, <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> Constants”</em> with no units at all. Reported, not repaired.</p>
<p><img src="https://latex.codecogs.com/png.latex?N"> is not a cell count. Book p.&nbsp;400 defines it: a sample diluted <img src="https://latex.codecogs.com/png.latex?r">-fold to 75 % transmission has <img src="https://latex.codecogs.com/png.latex?N%20=%200%7B%5Ccdot%7D125r"> U.O.D./ml, and <em>“for the <em>L. delbrueckii</em> used in this study, one unit of optical density corresponded to between 150,000,000 and 450,000,000 cells as determined by plate counts”</em> - a factor of three of slack, so U.O.D. is an optical surrogate for biomass and the constants inherit that.</p>
<div id="b5b5d6e7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:40.939736Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:40.939540Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.357114Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.356242Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> json</span>
<span id="cb3-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys</span>
<span id="cb3-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb3-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb3-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb3-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.interpolate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> PchipInterpolator</span>
<span id="cb3-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb3-10"></span>
<span id="cb3-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (NumJac, compute_boundary_values, construct_convflux_upwind,</span>
<span id="cb3-12">                   construct_div, newton)</span>
<span id="cb3-13"></span>
<span id="cb3-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gallery_utils: from the checkout when there is one, from raw GitHub on Colab</span></span>
<span id="cb3-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb3-16">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb3-17">    urllib.request.urlretrieve(</span>
<span id="cb3-18">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb3-19">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb3-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb3-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents):</span>
<span id="cb3-22">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb3-23">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))</span>
<span id="cb3-24">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb3-25"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> cite_data, load_data, load_meta, report_agreement</span>
<span id="cb3-26"></span>
<span id="cb3-27">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.4-luedeking-piret"</span></span>
<span id="cb3-28">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb3-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, assigned in fixed order and never cycled</span></span>
<span id="cb3-30">C_BLUE, C_ORANGE, C_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span></span>
<span id="cb3-31">C_PURPLE, C_YELLOW, C_GREY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span></span>
<span id="cb3-32"></span>
<span id="cb3-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: nothing on this page is stochastic.  No sampling, no bootstrap,</span></span>
<span id="cb3-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># no random initial guess, no continuation chain.  Two consecutive executions</span></span>
<span id="cb3-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># give identical content, figures and agreement.json.</span></span>
<span id="cb3-36">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb3-37"></span>
<span id="cb3-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------------ the three tables</span></span>
<span id="cb3-39">T1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking1959-table1-bacterial-density.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-40">T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking1959-table2-growth-acid.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-41">T3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking1959-table3-alpha-beta-vs-ph.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-42">M1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking1959-table1-bacterial-density.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-43">M2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking1959-table2-growth-acid.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-44">M3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking1959-table3-alpha-beta-vs-ph.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-45"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (M1, M2, M3):</span>
<span id="cb3-46">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(m))</span>
<span id="cb3-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table I  : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>time_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>time_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb3-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table II : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>time_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>time_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h,"</span></span>
<span id="cb3-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>notna()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> filled cells of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table III: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, pH </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-51"></span>
<span id="cb3-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE PRINTED pH 6.0 PAIR - looked up in the CSV, never retyped in a cell.</span></span>
<span id="cb3-53">_r60 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3.loc[T3.pH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb3-54">ALPHA_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_r60.alpha_mg_lactic_per_UOD)</span>
<span id="cb3-55">BETA_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_r60.beta_mg_lactic_per_UOD_h)</span>
<span id="cb3-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table III, pH 6.0:  alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  mg lactic/U.O.D."</span></span>
<span id="cb3-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  mg lactic/U.O.D./h"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Luedeking, R.; Piret, E. L. (1959) — "A Kinetic Study of the Lactic Acid Fermentation. Batch Process at Controlled pH", Journal of Biochemical and Microbiological Technology and Engineering 1(4) 393-412 (1959), Department of Chemical Engineering, University of Minnesota, Minneapolis 14, Minnesota
 — doi:10.1002/jbmte.390010406 — transcription
Luedeking, R.; Piret, E. L. (1959) — "A Kinetic Study of the Lactic Acid Fermentation. Batch Process at Controlled pH", Journal of Biochemical and Microbiological Technology and Engineering 1(4) 393-412 (1959), Department of Chemical Engineering, University of Minnesota, Minneapolis 14, Minnesota
 — doi:10.1002/jbmte.390010406 — transcription
Luedeking, R.; Piret, E. L. (1959) — "A Kinetic Study of the Lactic Acid Fermentation. Batch Process at Controlled pH", Journal of Biochemical and Microbiological Technology and Engineering 1(4) 393-412 (1959), Department of Chemical Engineering, University of Minnesota, Minneapolis 14, Minnesota
 — doi:10.1002/jbmte.390010406 — transcription

Table I  : 45 rows, 0.10-13.60 h
Table II : 27 rows, 1.00-14.00 h, 171 filled cells of 189
Table III: 6 rows, pH 4.5-6.0

Table III, pH 6.0:  alpha = 2.2  mg lactic/U.O.D.     beta = 0.55  mg lactic/U.O.D./h</code></pre>
</div>
</div>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Nothing on this page is a chosen parameter.</strong> There is no rate constant to pick, no initial guess that matters, and no tuning: the inputs are three printed tables and the outputs are least-squares fits to them plus two solver discretisations. What <em>is</em> an assumption is listed here.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>value</th>
<th>where it comes from</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>temperature</td>
<td>45 °C</td>
<td>Tables I and II footnotes, book pp.&nbsp;401-402</td>
</tr>
<tr class="even">
<td>pH</td>
<td>6·0, controlled</td>
<td>same footnotes; the only tabulated run</td>
</tr>
<tr class="odd">
<td>medium</td>
<td>5 % glucose + 3 % yeast extract + mineral salts</td>
<td>same footnotes</td>
</tr>
<tr class="even">
<td>organism</td>
<td><em>L. delbrueckii</em> NRRL-B445</td>
<td>book p.&nbsp;401</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?N"> unit</td>
<td>U.O.D./ml, <img src="https://latex.codecogs.com/png.latex?N%20=%200%7B%5Ccdot%7D125%5C,r"></td>
<td>book p.&nbsp;400</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Calpha">, <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> units</td>
<td>mg lactic/U.O.D., mg lactic/U.O.D./h</td>
<td>Table III footnotes ONLY</td>
</tr>
</tbody>
</table>
<p><strong>Assumption 1 - the fits are unweighted least squares.</strong> The authors fitted by drawing a straight line through Fig. 11, which is an unstated weighting. This page uses ordinary least squares in eq. (3)’s variables as the primary route because those are the variables they plotted, and reports the eq. (2) fit (which is the same problem weighted by <img src="https://latex.codecogs.com/png.latex?N%5E2">) beside it rather than choosing between them. The spread between the routes is a reported number, not a footnote.</p>
<p><strong>Assumption 2 - <img src="https://latex.codecogs.com/png.latex?k(t)"> and <img src="https://latex.codecogs.com/png.latex?N(t)"> between the printed rows are monotone cubic (PCHIP) interpolants of the printed columns.</strong> They are used only where an interpolant is unavoidable: the <img src="https://latex.codecogs.com/png.latex?%5Cint%20N%5C,%5Cmathrm%7Bd%7Dt"> of the integral form, the root-find for the crossover time, and the prescribed <img src="https://latex.codecogs.com/png.latex?k(z)"> of the plug-flow model. A linear interpolant is carried as a break row so the choice is priced rather than assumed.</p>
<p><strong>Assumption 3 - the one-significant-figure row at <img src="https://latex.codecogs.com/png.latex?t%20=%202%7B%5Ccdot%7D50"> h is used at face value.</strong> Table II prints <code>0.8</code>, <code>0.4</code> and <code>1.8</code> there, against two and three figures everywhere else. It is kept, and a break row drops it.</p>
<p><strong>What is NOT assumed: a growth law.</strong> Luedeking &amp; Piret do not propose one, and this page does not import one. Where a closed system is needed - the pymrm batch and plug-flow models - <img src="https://latex.codecogs.com/png.latex?k"> is <strong>prescribed from the paper’s own printed <img src="https://latex.codecogs.com/png.latex?k"> column</strong>. That keeps the product-formation model, which is what this case is about, separated from a growth model, which is J4.1’s and J4.2’s.</p>
<div id="2cda4701" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.359483Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.359223Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.412782Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.411945Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------- Table II checks itself, measured</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Book p. 400: "Instantaneous rates of growth and of acid formation were</span></span>
<span id="cb5-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># determined by graphical differentiation of curves ... The specific rate of</span></span>
<span id="cb5-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># growth and the specific rate of acid formation were determined by dividing the</span></span>
<span id="cb5-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># instantaneous rates by N."  So k and (1/N)(dP/dt) are QUOTIENTS of the other</span></span>
<span id="cb5-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed columns BY DEFINITION, and that is an arithmetic check on the</span></span>
<span id="cb5-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># transcription - the only one any of the three tables offers.</span></span>
<span id="cb5-8">_k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>])</span>
<span id="cb5-9">K_IDENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_k.dNdt_UOD_per_ml_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_k.N_UOD_per_ml<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_k.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).to_numpy()</span>
<span id="cb5-10">K_IDENT_MAX, K_IDENT_MEAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_IDENT.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_IDENT.mean())</span>
<span id="cb5-11">K_IDENT_AT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_k.time_h.to_numpy()[K_IDENT.argmax()])</span>
<span id="cb5-12">_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invN_dPdt_mg_per_UOD_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>])</span>
<span id="cb5-13">Q_IDENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_q.dPdt_mg_per_ml_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_q.N_UOD_per_ml<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_q.invN_dPdt_mg_per_UOD_h</span>
<span id="cb5-14">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).to_numpy()</span>
<span id="cb5-15">Q_IDENT_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Q_IDENT.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb5-16">Q_IDENT_AT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_q.time_h.to_numpy()[Q_IDENT.argmax()])</span>
<span id="cb5-17">N_SPAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2.N_UOD_per_ml.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T2.N_UOD_per_ml.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb5-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed N spans a factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SPAN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> down this table, which is why"</span></span>
<span id="cb5-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" eq. (2) and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eq. (3) are two different least-squares problems and both"</span></span>
<span id="cb5-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" are reported.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"k = (1/N)(dN/dt) over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_k)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows: max </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_IDENT_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_IDENT_AT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_IDENT_MEAN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(1/N)(dP/dt) over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_q)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows:     max </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_IDENT_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_IDENT_AT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb5-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  -&gt; the columns are rounded independently AFTER the division, so they are"</span></span>
<span id="cb5-26">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     self-consistent only to a few per cent.  That band is the resolution"</span></span>
<span id="cb5-27">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">     of the arithmetic check, and it is measured next rather than assumed."</span>)</span>
<span id="cb5-28"></span>
<span id="cb5-29"></span>
<span id="cb5-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> digit_detection(tol):</span>
<span id="cb5-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""How many single-digit substitutions the k identity would catch."""</span></span>
<span id="cb5-32">    cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>]</span>
<span id="cb5-33">    total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb5-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _k.iterrows():</span>
<span id="cb5-35">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> cols:</span>
<span id="cb5-36">            s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[c]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-37">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, ch <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(s):</span>
<span id="cb5-38">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ch.isdigit():</span>
<span id="cb5-39">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb5-40">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0123456789"</span>:</span>
<span id="cb5-41">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> ch:</span>
<span id="cb5-42">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb5-43">                    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s[:j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s[j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb5-44">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb5-45">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb5-46">                    trip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>: r.N_UOD_per_ml,</span>
<span id="cb5-47">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>: r.dNdt_UOD_per_ml_h,</span>
<span id="cb5-48">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>: r.k_per_h}</span>
<span id="cb5-49">                    trip[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb5-50">                    total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb5-51">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(trip[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>trip[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>]</span>
<span id="cb5-52">                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> trip[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> tol:</span>
<span id="cb5-53">                        caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb5-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> caught, total</span>
<span id="cb5-55"></span>
<span id="cb5-56"></span>
<span id="cb5-57">DIGIT_CAUGHT, DIGIT_TOTAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> digit_detection(K_IDENT_MAX)</span>
<span id="cb5-58">DIGIT_FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DIGIT_CAUGHT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>DIGIT_TOTAL</span>
<span id="cb5-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">TRANSCRIPTION CHECK, TEETH MEASURED NOT CLAIMED: of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DIGIT_TOTAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" single-digit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">substitutions available in the (N, dN/dt, k) triple,"</span></span>
<span id="cb5-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DIGIT_CAUGHT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DIGIT_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) break the identity by"</span></span>
<span id="cb5-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">more than the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_IDENT_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the true table already shows."</span></span>
<span id="cb5-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DIGIT_TOTAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DIGIT_CAUGHT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> it cannot see are</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">almost all"</span></span>
<span id="cb5-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" last-digit +-1 and +-2 changes, which the round-off band swallows."</span>)</span>
<span id="cb5-65"></span>
<span id="cb5-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------- Table I against Table II's "Interpolated"</span></span>
<span id="cb5-67">NT1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(T1.time_h.to_numpy(), T1.N_UOD_per_ml.to_numpy())</span>
<span id="cb5-68">_n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>])</span>
<span id="cb5-69">_n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _n2[(_n2.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> T1.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (_n2.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> T1.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())]</span>
<span id="cb5-70">_rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(NT1(_n2.time_h.to_numpy())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_n2.N_UOD_per_ml.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb5-71">X_TABLE_MAX, X_TABLE_RMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt((_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb5-72">X_TABLE_AT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_n2.time_h.to_numpy()[_rel.argmax()])</span>
<span id="cb5-73">_lin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.interp(_n2.time_h.to_numpy(), T1.time_h.to_numpy(),</span>
<span id="cb5-74">                 T1.N_UOD_per_ml.to_numpy())</span>
<span id="cb5-75">_rl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_lin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_n2.N_UOD_per_ml.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb5-76">X_TABLE_LIN_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_rl.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb5-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table II's N is footnoted </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">* Interpolated</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  Interpolating Table I onto"</span></span>
<span id="cb5-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" its</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_n2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> overlapping times reproduces it to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_TABLE_RMS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rms and"</span></span>
<span id="cb5-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_TABLE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at worst</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_TABLE_AT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h); a linear interpolant"</span></span>
<span id="cb5-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_TABLE_LIN_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the same row.  The residual is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the authors'"</span></span>
<span id="cb5-81">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" own smoothing - Table II's N is read off a drawn curve, not off Table I."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>printed N spans a factor of 78.3333 down this table, which is why eq. (2) and
eq. (3) are two different least-squares problems and both are reported.

k = (1/N)(dN/dt) over 25 rows: max 0.027356 at t = 3.50 h, mean 0.008089
(1/N)(dP/dt) over 22 rows:     max 0.018410 at t = 12.00 h
  -&gt; the columns are rounded independently AFTER the division, so they are
     self-consistent only to a few per cent.  That band is the resolution
     of the arithmetic check, and it is measured next rather than assumed.

TRANSCRIPTION CHECK, TEETH MEASURED NOT CLAIMED: of the 2019 single-digit
substitutions available in the (N, dN/dt, k) triple, 1764 (87.37%) break the identity by
more than the 0.0274 the true table already shows.  The 255 it cannot see are
almost all last-digit +-1 and +-2 changes, which the round-off band swallows.

Table II's N is footnoted "* Interpolated".  Interpolating Table I onto its
26 overlapping times reproduces it to 0.012495 rms and 0.033774 at worst
(t = 5.00 h); a linear interpolant gives 0.033333 at the same row.  The residual is
the authors' own smoothing - Table II's N is read off a drawn curve, not off Table I.</code></pre>
</div>
</div>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Three CSVs, one per printed table, each transcribed cell by cell from 300 ppi crops enlarged to digit scale. The sidecars carry the crop procedure, the footnotes verbatim, and the defect notes.</p>
<ul>
<li><code>luedeking1959-table1-bacterial-density.csv</code> - 45 rows, book p.&nbsp;401.</li>
<li><code>luedeking1959-table2-growth-acid.csv</code> - 27 rows, book p.&nbsp;402. This is the file the constants are refitted from. Blank cells are left blank: the paper prints no <img src="https://latex.codecogs.com/png.latex?P"> at 1·00, 1·50 and 3·00 h, no <img src="https://latex.codecogs.com/png.latex?k"> at 1·50 h, and only <img src="https://latex.codecogs.com/png.latex?P"> at the final 14·00 h row.</li>
<li><code>luedeking1959-table3-alpha-beta-vs-ph.csv</code> - 6 rows, book p.&nbsp;410.</li>
</ul>
<section id="table-iii-cell-by-cell" class="level3">
<h3 class="anchored" data-anchor-id="table-iii-cell-by-cell">Table III, cell by cell</h3>
<p>Read at 3x on a 300 ppi crop and the <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> column again at 7x:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>pH</th>
<th><img src="https://latex.codecogs.com/png.latex?%5Calpha"> (mg lactic/U.O.D.)</th>
<th><img src="https://latex.codecogs.com/png.latex?%5Cbeta"> (mg lactic/U.O.D./h)</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>6·0</td>
<td>2·2</td>
<td>0·55</td>
</tr>
<tr class="even">
<td>5·6</td>
<td>2·2</td>
<td>0·49 &nbsp;<em>(stray mark - see below)</em></td>
</tr>
<tr class="odd">
<td>5·4</td>
<td>2·2</td>
<td>0·32</td>
</tr>
<tr class="even">
<td>5·2</td>
<td>2·45</td>
<td>0·26</td>
</tr>
<tr class="odd">
<td>4·8</td>
<td>3·0</td>
<td>0·14</td>
</tr>
<tr class="even">
<td>4·5</td>
<td>3·55</td>
<td>0·11</td>
</tr>
</tbody>
</table>
<p><strong>One of the three columns has a printed cross-check outside the table.</strong> Book p.&nbsp;400, running text: the six fermentations were <em>“each of which was continuously controlled at a different pH level (6·0, 5·6, 5·4, 5·2, 4·8 and 4·5)”</em>. That is Table III’s whole pH column, printed a second time ten pages earlier, and the cell below asserts the CSV against it rather than saying it in prose. The <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> columns have no such second printing.</p>
</section>
<section id="the-stray-mark-in-the-ph-56-beta-cell---reported-not-repaired" class="level3">
<h3 class="anchored" data-anchor-id="the-stray-mark-in-the-ph-56-beta-cell---reported-not-repaired">The stray mark in the pH 5·6 <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> cell - reported, not repaired</h3>
<p>At 150 ppi that cell renders as <code>-0-49</code>, which is why it was flagged before dispatch. <strong>The value is 0·49, and it is settled three ways.</strong> The standing rule is that an ambiguous glyph is settled by <em>arithmetic</em> wherever arithmetic exists, and by pixel shape only where it does not; two arithmetic settlements exist here, so they lead and the pixels corroborate.</p>
<p><strong>1. The minus reading breaks a relation this notebook asserts.</strong> <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> falls monotonically as the pH falls, over all six levels, and cell <em>The six pH levels</em> below executes <code>assert BETA_MONOTONE</code>. Read the mark as a sign and the descending-pH sequence becomes 0·55, <strong>−0·49</strong>, 0·32, … - not monotone, and the notebook refuses to execute. The same cell prints that failure explicitly rather than leaving it to be imagined, and a break row prices the violation: it moves <code>beta_monotone_margin</code> by 2800 %. This is a <em>pattern</em> in six printed numbers rather than a derived identity, and it is labelled as one - but a sign error is exactly the size of error it catches.</p>
<p><strong>2. The paper plots this very column on a zero-based axis.</strong> Fig. 10, book p.&nbsp;407 (PDF 15), plots <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> against pH with the axis labelled 0, 0·2, 0·4, 0·6 and <strong>six open circles all standing clearly above the zero line</strong>; the caption prints eq. (3) itself, <em>“The effect of pH on the coefficients <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> in the equation <img src="https://latex.codecogs.com/png.latex?(1/N)(%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt)%20=%20%5Calpha%20k%20+%0A%5Cbeta">”</em>. Calibrated on the panel’s own gridlines the pH 5·6 marker sits at <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20%5Capprox%200%7B%5Ccdot%7D50">, and all six markers land within <strong>about</strong> 0·02 of the printed column - “about”, because the gridline centres themselves are ambiguous by a pixel or two and the largest deviation moves with them. <strong>That reading corroborates a sign; it is not a data source.</strong> No number off Fig. 10 enters a CSV, a fit or a metric, this page still digitises no curve, and the figure could not carry the <em>value</em> anyway - only the printed table can, which is why an approximate bound is quoted as a check and not as a measurement. What the reading has to separate is <img src="https://latex.codecogs.com/png.latex?+0%7B%5Ccdot%7D49"> from <img src="https://latex.codecogs.com/png.latex?-0%7B%5Ccdot%7D49">, so a tolerance of a few hundredths either way decides nothing.</p>
<p><strong>3. And only then, the pixels.</strong> The mark is a single connected component of <strong>8 pixels, 4 wide by 3 high</strong>, at (x 1023-1026, y 545-547) of the 300 ppi page, sitting <strong>3 px to the left</strong> of a leading zero that is itself complete and undamaged - its two strokes span x 1030-1044, exactly the span of every other zero in that column.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>width</th>
<th>height</th>
<th>area</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>the mark</td>
<td>4 px</td>
<td>3 px</td>
<td>8</td>
</tr>
<tr class="even">
<td>the five genuine mid-dots in the same <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> column</td>
<td>3-4 px</td>
<td>3-4 px</td>
<td>8-11</td>
</tr>
<tr class="odd">
<td>the page’s one true hyphen (<code>Rouy-Photrometer</code>, same page)</td>
<td><strong>11 px</strong></td>
<td>4 px</td>
<td><strong>38</strong></td>
</tr>
</tbody>
</table>
<p>A connected-component census of the whole page returns <strong>zero</strong> components of area 4-20 with no other ink within 12 px of them - the scan produces no free-floating specks of this size anywhere on the page. (An earlier, looser census - <em>“round blob with no ink within 14 px to its left”</em> - was quoted on this page as 38 hits with 37 in the Wiley watermark. <strong>That count does not reproduce</strong>: it swings between 43 and 407 depending on how “round blob” is pinned, so it has been withdrawn in favour of the criterion above, which reproduces exactly.)</p>
<p>What the mark <em>is</em> - broken type, an ink speck on the original, or dirt on the platen - <strong>cannot be settled from one copy and is not guessed at here.</strong> What is settled is the value: two arithmetic checks and the digits <code>0·49</code>, intact and unambiguous at 7x. <strong>The CSV carries 0·49 and the sidecar carries the mark.</strong> A break row prices the alternative reading, so the cost of being wrong is on the page rather than in a footnote.</p>
</section>
<section id="what-table-iii-can-and-cannot-check-about-itself" class="level3">
<h3 class="anchored" data-anchor-id="what-table-iii-can-and-cannot-check-about-itself">What Table III can and cannot check about itself</h3>
<p><strong>Table III has no <em>internal</em> identity.</strong> Six rows, three independent columns, no derived quantity, no total, no ratio printed beside them - so unlike Table II nothing <em>inside</em> this table constrains anything else inside it, and each cell rests on its own crop read. What the table is not short of is arithmetic <em>around</em> it: the pH column is printed again on book p.&nbsp;400, <img src="https://latex.codecogs.com/png.latex?%5Cbeta(%5Cmathrm%7BpH%7D)"> is plotted on a zero-based axis in Fig. 10, the monotonicity of <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> is asserted by this notebook, and the pH 6·0 row alone can be refitted from Tables I and II. The earlier version of this page said the table <em>“offers no arithmetic at all”</em> and rested the pH 5·6 reading on component geometry; that was wrong about the source, and it is corrected above rather than quietly dropped.</p>
<p>Table II, by contrast, does check itself - <img src="https://latex.codecogs.com/png.latex?k"> and <img src="https://latex.codecogs.com/png.latex?(1/N)(%5Cmathrm%7Bd%7DP/%0A%5Cmathrm%7Bd%7Dt)"> are quotients of its other columns <em>by the paper’s own definition</em> (book p.&nbsp;400) - and the cell above measures how far that goes.</p>
</section>
<section id="related-pages-and-what-is-borrowed" class="level3">
<h3 class="anchored" data-anchor-id="related-pages-and-what-is-borrowed">Related pages, and what is borrowed</h3>
<p><code>pages/J4.1-monod/</code> and <code>pages/J4.2-andrews-substrate-inhibition/</code> were published immediately before this one and both carry growth-kinetics material, including J4.1’s <code>data/printed-growth-laws.csv</code>, which J4.2 loads.</p>
<p><strong>This page loads none of it, and the reason is a finding rather than an omission.</strong> That CSV holds printed growth laws transcribed from Froment/De Wilde/Bischoff, Rawlings &amp; Ekerdt and Levenspiel; a search of its <code>key</code>, <code>as_printed</code> and <code>flag</code> columns for <code>luedeking</code>, <code>piret</code>, <code>lactic</code>, <code>product</code>, <code>alpha</code> and <code>beta</code> returns <strong>no hit</strong>. <strong>Its row count is not stated here</strong>: it is a number in a dataset this page loads, so the cell below prints it from the file. (An earlier version of this page typed <em>“29 rows”</em> two lines above a cell that printed 30 - which is the whole reason <code>AGENTS.md</code> rule 2 exists.) Its subject is the <em>growth</em> law <img src="https://latex.codecogs.com/png.latex?%5Cmu(S)"> - Monod, Blackman, Tessier, Moser, Contois and the substrate-inhibition form - and Luedeking &amp; Piret propose no growth law at all. <strong>There is no number in it that this page could restate, so there is nothing to reconcile,</strong> and the cell below prints that search rather than asserting it.</p>
<p>What <em>does</em> travel across is the scope boundary, and it runs the other way:</p>
<ul>
<li><strong>J4.1 and J4.2 model growth; this page models product formation given growth.</strong> Eq. (2) is a closure for <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt"> and contains no substrate concentration. It composes with either of their <img src="https://latex.codecogs.com/png.latex?%5Cmu(S)"> laws and is orthogonal to both.</li>
<li><strong>J4.2’s finding that matters here is a methodological one, and it is adopted:</strong> it measured that under a zero-gradient outflow condition a plug-flow outlet read with <code>compute_boundary_values</code> is first order and <em>not</em> more accurate than the last-cell read, and kept the call for flux consistency rather than accuracy. This page’s plug-flow model makes the same choice for the same reason and re-measures it on its own physics rather than inheriting the number.</li>
<li><strong>J4.1’s warning about identifiability bites differently here.</strong> Its problem was distinguishing rival <em>nonlinear</em> laws from one dataset. Eq. (3) is linear in both constants, so there is no <em>structural</em> identifiability question - the fit has a unique optimum and no local minima. <strong>Conditioning is another matter, and it is this page’s headline:</strong> <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> come out correlated at <img src="https://latex.codecogs.com/png.latex?-0.89">, so the pair is far better determined than either constant, which is section 2 below. Linearity buys uniqueness, not conditioning. What is left is a weighting question, which is why both weightings are reported.</li>
</ul>
<div id="fa8ca421" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.415451Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.415244Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.430350Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.429408Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------ the cross-page search, printed rather than asserted -----------------</span></span>
<span id="cb7-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb7-3">    J41 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed-growth-laws.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1-monod"</span>)</span>
<span id="cb7-4">    _hay <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> J41.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">apply</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: s.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.lower())</span>
<span id="cb7-5">    _terms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"luedeking"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"piret"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lactic"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"product"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta"</span>]</span>
<span id="cb7-6">    _hits <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(_hay.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">apply</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> c: c.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.contains(t, regex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb7-7">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _terms}</span>
<span id="cb7-8">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pages/J4.1-monod/data/printed-growth-laws.csv: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(J41)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows,"</span></span>
<span id="cb7-9">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" columns </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(J41.columns)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb7-10">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  search over every cell for the terms this page would have to"</span></span>
<span id="cb7-11">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" reconcile:"</span>)</span>
<span id="cb7-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _hits.items():</span>
<span id="cb7-13">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> hit(s)"</span>)</span>
<span id="cb7-14">    J41_TOTAL_HITS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(_hits.values())</span>
<span id="cb7-15">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>J41_TOTAL_HITS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> hits in total.  The file is about mu(S); this page"</span></span>
<span id="cb7-16">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is about dP/dt given</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     dN/dt and N.  NOTHING IS BORROWED AND THERE"</span></span>
<span id="cb7-17">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" IS NOTHING TO RECONCILE."</span>)</span>
<span id="cb7-18">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the five growth laws it catalogues:"</span></span>
<span id="cb7-19">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> J41[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'key'</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rawlings_'</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> k.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'monod'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'blackman'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tessier'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'moser'</span>,<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'contois'</span>)]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb7-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">FileNotFoundError</span>:                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pragma: no cover - Colab only</span></span>
<span id="cb7-21">    J41_TOTAL_HITS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb7-22">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1's CSV is not reachable from here; the search is recorded in"</span></span>
<span id="cb7-23">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" README.md."</span>)</span>
<span id="cb7-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> J41_TOTAL_HITS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, (</span>
<span id="cb7-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1's printed-growth-laws.csv now carries a row this page must reconcile"</span></span>
<span id="cb7-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" against - read that page's findings before using it"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pages/J4.1-monod/data/printed-growth-laws.csv: 30 rows, columns ['key', 'source', 'page', 'equation_number', 'as_printed', 'flag']
  search over every cell for the terms this page would have to reconcile:
    luedeking    0 hit(s)
    piret        0 hit(s)
    lactic       0 hit(s)
    product      0 hit(s)
    alpha        0 hit(s)
    beta         0 hit(s)
  -&gt; 0 hits in total.  The file is about mu(S); this page is about dP/dt given
     dN/dt and N.  NOTHING IS BORROWED AND THERE IS NOTHING TO RECONCILE.
  the five growth laws it catalogues: ['rawlings_monod', 'rawlings_blackman', 'rawlings_tessier', 'rawlings_moser', 'rawlings_contois']</code></pre>
</div>
</div>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Eq. (2) is a <strong>source term</strong>, not a transport problem: it says how fast <img src="https://latex.codecogs.com/png.latex?P"> appears given <img src="https://latex.codecogs.com/png.latex?N"> and <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt">. So the pymrm content is what happens when that source is carried by a reactor model, and there are two, both closed by the paper’s own printed <img src="https://latex.codecogs.com/png.latex?k"> column rather than by an imported growth law.</p>
<p><strong>1. Batch fermenter.</strong> State <img src="https://latex.codecogs.com/png.latex?(N,%20P)">, marched by backward Euler with pymrm’s <code>newton</code> and a <code>NumJac((1, 2))</code> - a 1-cell shape whose <em>last</em> axis is the field index, which is the stencil that couples the two fields in full and nothing else:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7DN%7D%7B%5Cmathrm%7Bd%7Dt%7D%20=%20k(t)%5C,N,%20%5Cqquad%0A%20%20%5Cfrac%7B%5Cmathrm%7Bd%7DP%7D%7B%5Cmathrm%7Bd%7Dt%7D%20=%20%5Calpha%5C,k(t)%5C,N%20+%20%5Cbeta%20N%20."></p>
<p><strong>2. Plug-flow fermenter.</strong> The same source in a steady tubular fermenter, assembled with <code>construct_convflux_upwind</code> + <code>construct_div</code> (<code>nu=0</code>, Cartesian), solved with <code>newton</code> + <code>NumJac((n, 2))</code>, outlet read with <code>compute_boundary_values</code>. The boundary conditions use the <strong>outward</strong> normal, so the two dicts read <img src="https://latex.codecogs.com/png.latex?a%5C,%5Cpartial%20c/%5Cpartial%20n%20+%20b%5C,c%20=%20d"> with <img src="https://latex.codecogs.com/png.latex?n"> pointing out of the domain: at the inlet that is a Dirichlet feed <img src="https://latex.codecogs.com/png.latex?%5C%7Ba=0,%20b=1,%20d=(N_0,%20P_0)%5C%7D">, and at the outlet a pure outflow <img src="https://latex.codecogs.com/png.latex?%5C%7Ba=1,%20b=0,%20d=0%5C%7D">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5Cpartial%20c/%5Cpartial%20z%20=%200"> there.</p>
<p>This is the paper’s own stated motivation, from the Summary: <em>“Kinetic data are needed to develop basic understanding of fermentation processes and to permit rational design of continuous fermentation processes.”</em> It is <strong>not</strong> something Luedeking &amp; Piret did, and <strong>no measurement in this paper tests it</strong> - the plug-flow model is checked against a closed form, not against data, and that is said again in <em>Validation</em>.</p>
<p><strong>The closed form.</strong> With <img src="https://latex.codecogs.com/png.latex?k(t)"> prescribed, both models integrate exactly:</p>
<p><img src="https://latex.codecogs.com/png.latex?N(t)%20=%20N_0%5Cexp%5C!%5Cint_%7Bt_0%7D%5E%7Bt%7D%5C!%20k%5C,%5Cmathrm%7Bd%7Dt',%20%5Cqquad%0A%20%20P(t)%20=%20P_0%20+%20%5Calpha%5C,%5BN(t)%20-%20N_0%5D%20+%20%5Cbeta%5C!%5Cint_%7Bt_0%7D%5E%7Bt%7D%5C!%20N%5C,%5Cmathrm%7Bd%7Dt'%20."></p>
<p>The second is eq. (2) integrated and it is the reference both solvers are checked against. It is also the third fitting route below - fit <img src="https://latex.codecogs.com/png.latex?P"> itself and <strong>no differentiated column enters at all</strong>.</p>
<div id="e43b4a9e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.432085Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.431944Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.463875Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.462962Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------- prescribed k(t) and N(t)</span></span>
<span id="cb9-2">_kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>])</span>
<span id="cb9-3">KT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_kk.time_h.to_numpy(), _kk.k_per_h.to_numpy())</span>
<span id="cb9-4">KANTI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KT.antiderivative()</span>
<span id="cb9-5">T_LO, T_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_kk.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_kk.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb9-6">N_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2.loc[T2.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_LO, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb9-7">P_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the closed form is affine in P_0; it cancels below</span></span>
<span id="cb9-8"></span>
<span id="cb9-9">_nn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>])</span>
<span id="cb9-10">NT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_nn.time_h.to_numpy(), _nn.N_UOD_per_ml.to_numpy())</span>
<span id="cb9-11">NT2_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NT2.antiderivative()</span>
<span id="cb9-12"></span>
<span id="cb9-13"></span>
<span id="cb9-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> N_closed(t):</span>
<span id="cb9-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""N from integrating the PRINTED k column - no growth law imported."""</span></span>
<span id="cb9-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> N_LO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(KANTI(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KANTI(T_LO))</span>
<span id="cb9-17"></span>
<span id="cb9-18"></span>
<span id="cb9-19">_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(T_LO, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160001</span>)</span>
<span id="cb9-20">N_CLOSED_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_g, N_closed(_g)).antiderivative()</span>
<span id="cb9-21"></span>
<span id="cb9-22"></span>
<span id="cb9-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> P_closed(t, a, b):</span>
<span id="cb9-24">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eq. (2) integrated, with N from the printed k column."""</span></span>
<span id="cb9-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> P_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(N_closed(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_LO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(N_CLOSED_INT(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_CLOSED_INT(T_LO))</span>
<span id="cb9-26"></span>
<span id="cb9-27"></span>
<span id="cb9-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------- 1. pymrm batch marcher</span></span>
<span id="cb9-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> batch_march(nt, a, b, t_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, t_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb9-30">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Backward Euler on (N, P) with pymrm newton + NumJac.</span></span>
<span id="cb9-31"></span>
<span id="cb9-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    NumJac((1, 2)): the LAST axis is the field index, so the default stencil</span></span>
<span id="cb9-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    couples the two fields in full and nothing else - the right shape for a</span></span>
<span id="cb9-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    pointwise source.  A bare (2,) shape would make the last axis "space" and</span></span>
<span id="cb9-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    build a dense Jacobian; here that is 2x2 either way, but the shape is</span></span>
<span id="cb9-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    written correctly because it is the one that generalises.</span></span>
<span id="cb9-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb9-38">    t_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_LO <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t_lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> t_lo</span>
<span id="cb9-39">    t_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_HI <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t_hi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> t_hi</span>
<span id="cb9-40">    dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t_lo)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>nt</span>
<span id="cb9-41">    jac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb9-42">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[N_closed(t_lo), P_closed(t_lo, a, b)]])</span>
<span id="cb9-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(nt):</span>
<span id="cb9-44">        kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(KT(np.clip(t_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dt, T_LO, T_HI)))</span>
<span id="cb9-45">        y_old <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y.copy()</span>
<span id="cb9-46"></span>
<span id="cb9-47">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> src(c):                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dy/dt = src(y), pointwise in the fields</span></span>
<span id="cb9-48">            N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-49">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.concatenate([kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N, a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb9-50"></span>
<span id="cb9-51">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(c):</span>
<span id="cb9-52">            s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> jac(src, c.reshape((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb9-53">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (c.reshape((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y_old)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s</span>
<span id="cb9-54">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)), np.eye(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js.toarray()</span>
<span id="cb9-55"></span>
<span id="cb9-56">        sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(resid, y.reshape((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb9-57">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sol.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch marcher did not converge"</span></span>
<span id="cb9-58">        y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sol.x.reshape((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb9-59">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb9-60"></span>
<span id="cb9-61"></span>
<span id="cb9-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------ 2. pymrm plug-flow fermenter</span></span>
<span id="cb9-63"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> PlugFlowFermenter:</span>
<span id="cb9-64">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Steady 1-D plug flow carrying (N, P) with the Luedeking-Piret source."""</span></span>
<span id="cb9-65"></span>
<span id="cb9-66">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, ncell, a, b, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, tau<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb9-67">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_LO) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tau <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> tau</span>
<span id="cb9-68">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.v, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.a, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ncell, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), v, a, b</span>
<span id="cb9-69">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tau, ncell <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb9-70">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb9-71">        d0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[N_closed(T_LO), P_closed(T_LO, a, b)]])</span>
<span id="cb9-72">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTWARD normal, so both dicts read  a dc/dn + b c = d.</span></span>
<span id="cb9-73">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = 0  inlet : outward normal is -z -&gt; Dirichlet feed, a=0, b=1</span></span>
<span id="cb9-74">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = L  outlet: outward normal is +z -&gt; pure outflow, dc/dz = 0</span></span>
<span id="cb9-75">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: d0},</span>
<span id="cb9-76">                   {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>})</span>
<span id="cb9-77">        conv, conv_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_convflux_upwind(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c,</span>
<span id="cb9-78">                                                  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb9-79">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nu=0 Cartesian</span></span>
<span id="cb9-80">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> conv, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> conv_bc</span>
<span id="cb9-81">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pointwise in the 2 fields</span></span>
<span id="cb9-82">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># residence time at axial position z is t = T_LO + z/v, so k(z) is a</span></span>
<span id="cb9-83">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CONSTANT vector assembled once, never inside the Newton loop.  kt is</span></span>
<span id="cb9-84">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the k(t) interpolant, KT by default; a break row below hands in a</span></span>
<span id="cb9-85">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># CORRUPTED one so that one mis-transcribed k cell drives the solve and</span></span>
<span id="cb9-86">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the closed form it is scored against at the same time.</span></span>
<span id="cb9-87">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.k_z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (KT <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> kt)(</span>
<span id="cb9-88">            np.clip(T_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>v, T_LO, T_HI))[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb9-89">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.tile(d0, (ncell, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb9-90"></span>
<span id="cb9-91">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb9-92">        N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb9-93">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.concatenate([<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.k_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.k_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb9-94"></span>
<span id="cb9-95">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb9-96">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(c):</span>
<span id="cb9-97">            s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb9-98">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb9-99">                    <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js)</span>
<span id="cb9-100">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(resid, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb9-101">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow solve did not converge"</span></span>
<span id="cb9-102">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.x.reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb9-103">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span></span>
<span id="cb9-104"></span>
<span id="cb9-105">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> outlet(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb9-106">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""via compute_boundary_values, NOT off the last cell centre"""</span></span>
<span id="cb9-107">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.asarray(compute_boundary_values(</span>
<span id="cb9-108">            <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb9-109"></span>
<span id="cb9-110">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> outlet_last_cell(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb9-111">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the O(h) read, kept for the comparison in Validation"""</span></span>
<span id="cb9-112">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].copy()</span>
<span id="cb9-113"></span>
<span id="cb9-114"></span>
<span id="cb9-115"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: NumJac((1,2)) + newton for the batch marcher;"</span></span>
<span id="cb9-116">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">       construct_convflux_upwind + construct_div(nu=0) + NumJac((n,2))"</span></span>
<span id="cb9-117">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" + newton</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">       for the plug-flow fermenter, outlet via"</span></span>
<span id="cb9-118">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" compute_boundary_values."</span>)</span>
<span id="cb9-119"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prescribed k(t): monotone cubic through the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kk)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed k cells,"</span></span>
<span id="cb9-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm: NumJac((1,2)) + newton for the batch marcher;
       construct_convflux_upwind + construct_div(nu=0) + NumJac((n,2)) + newton
       for the plug-flow fermenter, outlet via compute_boundary_values.
prescribed k(t): monotone cubic through the 25 printed k cells, 1.00-13.50 h</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-refit-three-ways" class="level3">
<h3 class="anchored" data-anchor-id="the-refit-three-ways">1. The refit, three ways</h3>
<p>Route A is eq. (3) - the authors’ own plotting variables, so it is the closest thing to reproducing their straight edge. Route B is eq. (2), which is the same model weighted by <img src="https://latex.codecogs.com/png.latex?N%5E2">. Route C uses <strong>no differentiated column at all</strong>: it integrates eq. (2) and fits the measured <img src="https://latex.codecogs.com/png.latex?P"> column directly.</p>
<p>All three are <strong>fits</strong>, and all three are fits to the same fermentation the authors fitted. None of them is a test of the model on new data.</p>
<div id="221302d4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.465585Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.465455Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.478888Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.477967Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------------- ROUTE A: eq. (3)</span></span>
<span id="cb11-2">_f3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invN_dPdt_mg_per_UOD_h"</span>])</span>
<span id="cb11-3">K_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _f3.k_per_h.to_numpy()</span>
<span id="cb11-4">Y_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _f3.invN_dPdt_mg_per_UOD_h.to_numpy()</span>
<span id="cb11-5">N_FIT3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(K_OBS)</span>
<span id="cb11-6"></span>
<span id="cb11-7"></span>
<span id="cb11-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ols(X, y):</span>
<span id="cb11-9">    c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb11-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> c</span>
<span id="cb11-11"></span>
<span id="cb11-12"></span>
<span id="cb11-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_eq3(k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_OBS, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Y_OBS):</span>
<span id="cb11-14">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([k, np.ones_like(k)])</span>
<span id="cb11-15">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(X, y)</span>
<span id="cb11-16">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c</span>
<span id="cb11-17">    s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(k) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb11-18">    cov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.linalg.inv(X.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> X)</span>
<span id="cb11-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> c, r, cov</span>
<span id="cb11-20"></span>
<span id="cb11-21"></span>
<span id="cb11-22">C3, R3, COV3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_eq3()</span>
<span id="cb11-23">ALPHA_A, BETA_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(C3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(C3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb11-24">SE_ALPHA, SE_BETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(COV3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(COV3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb11-25">CORR_AB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(COV3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.sqrt(COV3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>COV3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb11-26">rms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt((np.asarray(r)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb11-27">RMS_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(R3)</span>
<span id="cb11-28">R2_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (R3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((Y_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Y_OBS.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb11-29"></span>
<span id="cb11-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------------- ROUTE B: eq. (2)</span></span>
<span id="cb11-31">_f2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>])</span>
<span id="cb11-32">DN_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _f2.dNdt_UOD_per_ml_h.to_numpy()</span>
<span id="cb11-33">N_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _f2.N_UOD_per_ml.to_numpy()</span>
<span id="cb11-34">DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _f2.dPdt_mg_per_ml_h.to_numpy()</span>
<span id="cb11-35">X2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([DN_OBS, N_OBS])</span>
<span id="cb11-36">C2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(X2, DP_OBS)</span>
<span id="cb11-37">ALPHA_B, BETA_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(C2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(C2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb11-38">RMS_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> C2)</span>
<span id="cb11-39">R2_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> C2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DP_OBS.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb11-40"></span>
<span id="cb11-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------- ROUTE C: the INTEGRAL form, no differentiated column</span></span>
<span id="cb11-42">_fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_mg_per_ml"</span>])</span>
<span id="cb11-43">_fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _fp[_fp.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> T_HI]</span>
<span id="cb11-44">TP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _fp.time_h.to_numpy()</span>
<span id="cb11-45">P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _fp.P_mg_per_ml.to_numpy()</span>
<span id="cb11-46">TP0, P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_OBS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb11-47">DN_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NT2(TP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT2(TP0)                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># N(t) - N(t_0), printed N column</span></span>
<span id="cb11-48">IN_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NT2_INT(TP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT2_INT(TP0)            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># int N dt</span></span>
<span id="cb11-49">XC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([DN_INT, IN_INT])</span>
<span id="cb11-50">CC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(XC, P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P0_OBS)</span>
<span id="cb11-51">ALPHA_C, BETA_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CC[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CC[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb11-52">RMS_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> CC)</span>
<span id="cb11-53"></span>
<span id="cb11-54">REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x, ref: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb11-55">A_REL_A, B_REL_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REL(ALPHA_A, ALPHA_PRINTED), REL(BETA_A, BETA_PRINTED)</span>
<span id="cb11-56">A_REL_B, B_REL_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REL(ALPHA_B, ALPHA_PRINTED), REL(BETA_B, BETA_PRINTED)</span>
<span id="cb11-57">A_REL_C, B_REL_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REL(ALPHA_C, ALPHA_PRINTED), REL(BETA_C, BETA_PRINTED)</span>
<span id="cb11-58">ALPHA_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ALPHA_A, ALPHA_B, ALPHA_C)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(ALPHA_A, ALPHA_B, ALPHA_C) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-59">BETA_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(BETA_A, BETA_B, BETA_C)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(BETA_A, BETA_B, BETA_C) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-60"></span>
<span id="cb11-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"REFIT OF THE pH 6.0 RUN - three routes, all of them FITS, none a test:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'route'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beta'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rms"</span>)</span>
<span id="cb11-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A  eq.(3) OLS, the authors own axes (Fig. 11)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/U.O.D. h"</span>)</span>
<span id="cb11-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'B  eq.(2) OLS, i.e. eq.(3) weighted by N^2'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml h"</span>)</span>
<span id="cb11-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'C  integral form, NO differentiated column'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml"</span>)</span>
<span id="cb11-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'   PRINTED, Table III pH 6.0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">against the printed pair:  A </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_REL_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_REL_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   B </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_REL_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_REL_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   C </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_REL_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_REL_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-73"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"spread across the three routes: alpha </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb11-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" beta </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-75"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ROUTE A standard errors: alpha </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SE_ALPHA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb11-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" beta </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SE_BETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-77">SE_ALPHA_DIST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ALPHA_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ALPHA_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SE_ALPHA)</span>
<span id="cb11-78">SE_BETA_DIST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BETA_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BETA_PRINTED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SE_BETA)</span>
<span id="cb11-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SE_ALPHA_DIST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> standard errors from"</span></span>
<span id="cb11-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the fitted alpha,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is"</span></span>
<span id="cb11-81">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SE_BETA_DIST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the fitted beta - BOTH INSIDE ONE."</span>)</span>
<span id="cb11-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  corr(alpha, beta) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CORR_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: the two constants trade off, so the"</span></span>
<span id="cb11-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pair matters</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  more than either number alone.  That is priced next."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>REFIT OF THE pH 6.0 RUN - three routes, all of them FITS, none a test:

route                                             alpha       beta   rms
A  eq.(3) OLS, the authors own axes (Fig. 11)   2.266562   0.528684   0.100792 mg/U.O.D. h
B  eq.(2) OLS, i.e. eq.(3) weighted by N^2     2.289913   0.510117   0.323004 mg/ml h
C  integral form, NO differentiated column     2.272660   0.510150   0.153769 mg/ml
   PRINTED, Table III pH 6.0                   2.200000   0.550000

against the printed pair:  A +3.0256% / -3.8757%   B +4.0870% / -7.2514%   C +3.3027% / -7.2455%
spread across the three routes: alpha 1.0302%, beta 3.6396%

ROUTE A standard errors: alpha 2.266562 +- 0.130928, beta 0.528684 +- 0.049837
  the printed 2.2 is 0.5084 standard errors from the fitted alpha,
  and the printed 0.55 is 0.4277 from the fitted beta - BOTH INSIDE ONE.
  corr(alpha, beta) = -0.891902: the two constants trade off, so the pair matters
  more than either number alone.  That is priced next.</code></pre>
</div>
</div>
</section>
<section id="the-printed-pair-sits-on-the-ridge" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-pair-sits-on-the-ridge">2. The printed pair sits on the ridge</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> are strongly anticorrelated in this fit, so quoting “+3 % on <img src="https://latex.codecogs.com/png.latex?%5Calpha">, −4 % on <img src="https://latex.codecogs.com/png.latex?%5Cbeta">” overstates the disagreement: those two errors largely cancel. The honest measures are (i) what one constant becomes when the other is <em>held at the authors’ value</em>, and (ii) what their pair costs in residual against the least-squares optimum.</p>
<div id="b6209aa6" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.480651Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.480461Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.485296Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.484395Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># beta refitted with alpha held at the printed value, and vice versa</span></span>
<span id="cb13-2">BETA_GIVEN_ALPHA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(Y_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_OBS))</span>
<span id="cb13-3">ALPHA_GIVEN_BETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(K_OBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Y_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BETA_PRINTED))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(K_OBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb13-4">BETA_GIVEN_ALPHA_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REL(BETA_GIVEN_ALPHA, BETA_PRINTED)</span>
<span id="cb13-5">ALPHA_GIVEN_BETA_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REL(ALPHA_GIVEN_BETA, ALPHA_PRINTED)</span>
<span id="cb13-6">RMS_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(Y_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BETA_PRINTED)</span>
<span id="cb13-7">RMS_PENALTY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RMS_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RMS_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb13-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"beta refitted with alpha HELD at the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span></span>
<span id="cb13-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_GIVEN_ALPHA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_GIVEN_ALPHA_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb13-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"alpha refitted with beta HELD at the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span></span>
<span id="cb13-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_GIVEN_BETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_GIVEN_BETA_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb13-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rms of eq.(3) residuals: least squares </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb13-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the printed pair </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; the authors' straight-edge fit costs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_PENALTY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in rms against"</span></span>
<span id="cb13-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the optimum."</span>)</span>
<span id="cb13-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Their eyeballed line off Fig. 11 is statistically indistinguishable from"</span></span>
<span id="cb13-19">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  ordinary least squares on the same 22 points.  THAT IS THE HEADLINE, and"</span></span>
<span id="cb13-20">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  it is a consistency result about their fitting, not about their model."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>beta refitted with alpha HELD at the printed 2.2: 0.551282  (+0.2331% from the printed 0.55)
alpha refitted with beta HELD at the printed 0.55: 2.216616  (+0.7553% from the printed 2.2)

rms of eq.(3) residuals: least squares 0.100792, the printed pair 0.101450
  -&gt; the authors' straight-edge fit costs 0.6521% in rms against the optimum.
  Their eyeballed line off Fig. 11 is statistically indistinguishable from
  ordinary least squares on the same 22 points.  THAT IS THE HEADLINE, and
  it is a consistency result about their fitting, not about their model.</code></pre>
</div>
</div>
</section>
<section id="the-two-nulls-in-both-of-the-windows-the-paper-distinguishes" class="level3">
<h3 class="anchored" data-anchor-id="the-two-nulls-in-both-of-the-windows-the-paper-distinguishes">3. The two nulls, in both of the windows the paper distinguishes</h3>
<p>Each null is one of the two statements the paper itself names on book p.&nbsp;410 and then rejects. They are fitted the same way, with their own best constant, so the comparison is between models and not between a model and a bad guess.</p>
<p><strong>The <em>direction</em> of every ratio below is algebraically guaranteed and carries no information.</strong> Each null is an exactly nested submodel of the two-term fit - same rows, same variables, one coefficient set to zero - so its residual sum cannot be smaller and <code>rms_null / rms_two-term</code> <img src="https://latex.codecogs.com/png.latex?%5Cge%201"> by construction. <strong>Only the magnitude is a finding</strong>, and a ratio near 1 would be a real result: it would say the second term earns nothing.</p>
<p><strong>Which is exactly what the paper says happens in the logarithmic phase, and that half of its sentence is tested here too.</strong> Book p.&nbsp;410 says the two one-term forms <em>“are both valid”</em> while <img src="https://latex.codecogs.com/png.latex?k"> is constant, <em>“neither”</em> holding outside that window. So the ratios are computed three times: over all the rows, over the logarithmic plateau alone, and over the rows outside it. The split is made at <img src="https://latex.codecogs.com/png.latex?k%20=%200%7B%5Ccdot%7D45">, which is not a tuned threshold - the printed <img src="https://latex.codecogs.com/png.latex?k"> column has a gap there, and every row above it lies in a narrow plateau whose width is printed below. That plateau <strong>is</strong> the paper’s <img src="https://latex.codecogs.com/png.latex?k_c">.</p>
<div id="a2203266" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.487138Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.486989Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.502343Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.501475Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- nulls in eq. (2)'s variables (rate form) -------------------------------</span></span>
<span id="cb15-2">A_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(X2[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], DP_OBS)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dP/dt = alpha dN/dt</span></span>
<span id="cb15-3">B_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(X2[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], DP_OBS)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dP/dt = beta N</span></span>
<span id="cb15-4">RMS_A_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A_ONLY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-5">RMS_B_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> B_ONLY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb15-6">GAIN_A_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RMS_A_ONLY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RMS_B)</span>
<span id="cb15-7">GAIN_B_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RMS_B_ONLY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RMS_B)</span>
<span id="cb15-8">R2_A_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A_ONLY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()</span>
<span id="cb15-9">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DP_OBS.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb15-10">R2_B_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> B_ONLY<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()</span>
<span id="cb15-11">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((DP_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DP_OBS.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb15-12"></span>
<span id="cb15-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- nulls in the integral form (P itself) ---------------------------------</span></span>
<span id="cb15-14">A_ONLY_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(XC[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P0_OBS)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-15">B_ONLY_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(XC[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P0_OBS)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-16">RMS_A_ONLY_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A_ONLY_INT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>XC[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-17">RMS_B_ONLY_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(P_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> B_ONLY_INT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>XC[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb15-18">GAIN_A_ONLY_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RMS_A_ONLY_INT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RMS_C)</span>
<span id="cb15-19">GAIN_B_ONLY_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RMS_B_ONLY_INT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RMS_C)</span>
<span id="cb15-20"></span>
<span id="cb15-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NULL BASELINES - both are the paper's own two rejected statements.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'model'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'best constant'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x two-term'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'RATE FORM, eq. (2) variables, mg/ml h'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  dP/dt = alpha dN/dt + beta N   (two-term)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  dP/dt = alpha dN/dt            (beta = 0)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_A_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_A_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  dP/dt = beta N                 (alpha = 0)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_B_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_B_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'INTEGRAL FORM, P itself, mg/ml'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  P = P0 + alpha dN + beta int N dt'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  P = P0 + alpha dN'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_ONLY_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_A_ONLY_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_A_ONLY_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  P = P0 + beta int N dt'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:52s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B_ONLY_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_B_ONLY_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_B_ONLY_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">R^2 in the rate form: two-term </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, growth-only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_A_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb15-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" density-only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_B_ONLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb15-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R^2 FLATTERS EVERY MODEL IN THE INTEGRAL FORM, because P(t) is dominated by"</span></span>
<span id="cb15-40">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">its monotone rise - which is why the rms ratios above are the numbers"</span></span>
<span id="cb15-41">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" reported</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">and the integral R^2 is not."</span>)</span>
<span id="cb15-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EVERY RATIO ABOVE IS &gt;= 1 BY CONSTRUCTION - each null is an exactly nested"</span></span>
<span id="cb15-43">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">submodel of the two-term fit on the same rows - so the direction is"</span></span>
<span id="cb15-44">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" algebra and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">only the MAGNITUDE is a finding.  Which makes the next block"</span></span>
<span id="cb15-45">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the real test:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">the paper says both one-term forms ARE valid inside the"</span></span>
<span id="cb15-46">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" logarithmic phase."</span>)</span>
<span id="cb15-47"></span>
<span id="cb15-48"></span>
<span id="cb15-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the paper's own qualifier, made quantitative in BOTH directions -------</span></span>
<span id="cb15-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> null_split(df, k_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, k_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb15-51">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Refit the two-term form and both nulls on a k-window of the rate data."""</span></span>
<span id="cb15-52">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df</span>
<span id="cb15-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_min <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb15-54">        f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f[f.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> k_min]</span>
<span id="cb15-55">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_max <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb15-56">        f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f[f.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> k_max]</span>
<span id="cb15-57">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([f.dNdt_UOD_per_ml_h.to_numpy(), f.N_UOD_per_ml.to_numpy()])</span>
<span id="cb15-58">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f.dPdt_mg_per_ml_h.to_numpy()</span>
<span id="cb15-59">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(x, y)</span>
<span id="cb15-60">    r2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c)</span>
<span id="cb15-61">    a1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(x[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], y)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-62">    b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(x[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], y)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-63">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(f), r2, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rms(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r2), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rms(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r2),</span>
<span id="cb15-64">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb15-65"></span>
<span id="cb15-66"></span>
<span id="cb15-67">K_LOG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the gap in the printed k column, not a fit</span></span>
<span id="cb15-68">_kv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sort(_f2.k_per_h.to_numpy())</span>
<span id="cb15-69">K_PLATEAU_LO, K_PLATEAU_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_kv[_kv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> K_LOG].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_kv.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb15-70">K_PLATEAU_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_PLATEAU_HI<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_PLATEAU_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb15-71">K_GAP_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_kv[_kv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> K_LOG].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb15-72">(N_ALL, RMS2_ALL, GAIN_A_ALL, GAIN_B_ALL, _, _) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> null_split(_f2)</span>
<span id="cb15-73">(N_LOG, RMS2_LOG, GAIN_A_LOG, GAIN_B_LOG,</span>
<span id="cb15-74"> ALPHA_LOG, BETA_LOG) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> null_split(_f2, k_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_LOG)</span>
<span id="cb15-75">(N_OUT, RMS2_OUT, GAIN_A_OUT, GAIN_B_OUT, _, _) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> null_split(_f2, k_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_LOG)</span>
<span id="cb15-76">N_OUT_EARLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_f2[_f2.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> K_LOG].time_h</span>
<span id="cb15-77">                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _f2[_f2.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> K_LOG].time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb15-78"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE PAPER'S OWN QUALIFIER, MEASURED (book p. 410: the two one-term forms"</span></span>
<span id="cb15-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">are BOTH VALID while k is constant, and NEITHER holds outside that"</span></span>
<span id="cb15-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" window)."</span>)</span>
<span id="cb15-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the printed k column jumps from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_GAP_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_PLATEAU_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with nothing"</span></span>
<span id="cb15-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" between,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and every row above the gap has k in"</span></span>
<span id="cb15-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_PLATEAU_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_PLATEAU_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] - a spread of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_PLATEAU_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb15-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THAT PLATEAU IS THE PAPER'S k_c.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rows'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two-term rms'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x growth-only'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x density-only'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, n, r_, ga, gb <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (</span>
<span id="cb15-88">        (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"all rows"</span>, N_ALL, RMS2_ALL, GAIN_A_ALL, GAIN_B_ALL),</span>
<span id="cb15-89">        (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"logarithmic plateau, k &gt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_LOG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, N_LOG, RMS2_LOG, GAIN_A_LOG,</span>
<span id="cb15-90">         GAIN_B_LOG),</span>
<span id="cb15-91">        (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"outside it, k &lt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_LOG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, N_OUT, RMS2_OUT, GAIN_A_OUT, GAIN_B_OUT)):</span>
<span id="cb15-92">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lbl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ga<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:15.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-93"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">INSIDE the window the paper says the one-term forms hold, they cost"</span></span>
<span id="cb15-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_A_LOG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_B_LOG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in rms - i.e. essentially"</span></span>
<span id="cb15-95">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" nothing, exactly as stated.  OUTSIDE it they cost</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_A_OUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x and"</span></span>
<span id="cb15-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_B_OUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x.  The paper's sentence is now quantitative in BOTH"</span></span>
<span id="cb15-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">directions, which the single all-rows ratios of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_A_ALL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x and"</span></span>
<span id="cb15-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAIN_B_ALL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x are not:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">those average the two regimes and get their"</span></span>
<span id="cb15-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" size from the second one alone."</span>)</span>
<span id="cb15-100"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_OUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows sit outside the plateau, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_OUT_EARLY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them BEFORE it"</span></span>
<span id="cb15-101">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - the lag-phase</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  t = 2.50 h row - so </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">outside</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is not the same as"</span></span>
<span id="cb15-102">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">after</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and it is not called that.)"</span>)</span>
<span id="cb15-103"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  WHY THE TWO CONSTANTS ARE NEARLY UNIDENTIFIABLE THERE: on the plateau"</span></span>
<span id="cb15-104">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" dN/dt = k_c N,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  so the two regressors are proportional and the fit"</span></span>
<span id="cb15-105">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" returns alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_LOG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_LOG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - nothing like"</span></span>
<span id="cb15-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the printed pair, and the log-phase-only break row</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  moves alpha_se_eq3"</span></span>
<span id="cb15-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" by more than an order of magnitude.  A ratio near 1 here is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  degeneracy,"</span></span>
<span id="cb15-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not agreement, and that is what the paper is describing."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>NULL BASELINES - both are the paper's own two rejected statements.

model                                                 best constant        rms  x two-term
RATE FORM, eq. (2) variables, mg/ml h               
  dP/dt = alpha dN/dt + beta N   (two-term)                           0.323004      1.0000
  dP/dt = alpha dN/dt            (beta = 0)                4.255537   1.792661      5.5500
  dP/dt = beta N                 (alpha = 0)               0.850473   1.587814      4.9158
INTEGRAL FORM, P itself, mg/ml                      
  P = P0 + alpha dN + beta int N dt                                   0.153769      1.0000
  P = P0 + alpha dN                                        4.039173   2.189919     14.2416
  P = P0 + beta int N dt                                   1.130276   2.736164     17.7940

R^2 in the rate form: two-term 0.983187, growth-only 0.482138, density-only 0.593728.
R^2 FLATTERS EVERY MODEL IN THE INTEGRAL FORM, because P(t) is dominated by
its monotone rise - which is why the rms ratios above are the numbers reported
and the integral R^2 is not.
EVERY RATIO ABOVE IS &gt;= 1 BY CONSTRUCTION - each null is an exactly nested
submodel of the two-term fit on the same rows - so the direction is algebra and
only the MAGNITUDE is a finding.  Which makes the next block the real test:
the paper says both one-term forms ARE valid inside the logarithmic phase.

THE PAPER'S OWN QUALIFIER, MEASURED (book p. 410: the two one-term forms
are BOTH VALID while k is constant, and NEITHER holds outside that window).
the printed k column jumps from 0.4 to 0.46 with nothing between,
and every row above the gap has k in [0.46, 0.48] - a spread of 4.3478%.  THAT PLATEAU IS THE PAPER'S k_c.

rows                                           n  two-term rms  x growth-only  x density-only
all rows                                      22      0.323004       5.549971        4.915776
logarithmic plateau, k &gt;= 0.45                12      0.102155       1.036042        1.033197
outside it, k &lt; 0.45                          10      0.447426       5.011873        3.708246

INSIDE the window the paper says the one-term forms hold, they cost 3.60% and
3.32% in rms - i.e. essentially nothing, exactly as stated.  OUTSIDE it they cost
5.01x and 3.71x.  The paper's sentence is now quantitative in BOTH
directions, which the single all-rows ratios of 5.55x and 4.92x are not:
those average the two regimes and get their size from the second one alone.
  (10 rows sit outside the plateau, 1 of them BEFORE it - the lag-phase
  t = 2.50 h row - so "outside" is not the same as "after", and it is not called that.)
  WHY THE TWO CONSTANTS ARE NEARLY UNIDENTIFIABLE THERE: on the plateau dN/dt = k_c N,
  so the two regressors are proportional and the fit returns alpha = 1.614396,
  beta = 0.792957 - nothing like the printed pair, and the log-phase-only break row
  moves alpha_se_eq3 by more than an order of magnitude.  A ratio near 1 here is
  degeneracy, not agreement, and that is what the paper is describing.</code></pre>
</div>
</div>
</section>
<section id="the-integral-test-does-the-model-reproduce-the-measured-acid-curve" class="level3">
<h3 class="anchored" data-anchor-id="the-integral-test-does-the-model-reproduce-the-measured-acid-curve">4. The integral test: does the model reproduce the measured acid curve?</h3>
<p>The constants were fitted in the <em>differentiated</em> variables. The <img src="https://latex.codecogs.com/png.latex?P"> column was not used in Route A or Route B. Feeding the authors’ own printed constants into the integrated eq. (2), with <img src="https://latex.codecogs.com/png.latex?N"> taken from Table II’s own <img src="https://latex.codecogs.com/png.latex?N"> column, therefore predicts a curve that no fit was tuned to.</p>
<p><strong>It is still not an independent dataset.</strong> Table II’s <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt"> column <em>is</em> the <img src="https://latex.codecogs.com/png.latex?P"> column graphically differentiated (book p.&nbsp;400), so this is the same measurements reduced a different way - a <strong>coherence check between two reductions of one run</strong>, not a validation. Labelled accordingly.</p>
<div id="e78b3705" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.504567Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.504267Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.509477Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.508768Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">P_PRED_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>DN_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>IN_INT</span>
<span id="cb17-2">P_PRED_REFIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ALPHA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>DN_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>IN_INT</span>
<span id="cb17-3">_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> TP0</span>
<span id="cb17-4">CURVE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P_PRED_PRINTED[_m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_OBS[_m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb17-5">CURVE_AT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TP[_m][np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P_PRED_PRINTED[_m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_OBS[_m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).argmax()])</span>
<span id="cb17-6">CURVE_RMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(P_PRED_PRINTED[_m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_OBS[_m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-7">P_FINAL_PRED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_PRED_PRINTED[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb17-8">P_FINAL_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_OBS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb17-9">P_FINAL_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> REL(P_FINAL_PRED, P_FINAL_OBS)</span>
<span id="cb17-10">CURVE_MAX_REFIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(P_PRED_REFIT[_m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_OBS[_m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb17-11">CURVE_RMS_REFIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(P_PRED_REFIT[_m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_OBS[_m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"integrated eq. (2) with the AUTHORS' printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and"</span></span>
<span id="cb17-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">starting from the first printed P"</span></span>
<span id="cb17-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0_OBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TP0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h), against the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(_m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> later"</span></span>
<span id="cb17-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed P values:"</span>)</span>
<span id="cb17-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  rms relative error </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CURVE_RMS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CURVE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CURVE_AT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb17-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  final acid: predicted </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_FINAL_PRED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the printed"</span></span>
<span id="cb17-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_FINAL_OBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_FINAL_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  with this page's refitted pair instead: rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CURVE_RMS_REFIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb17-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CURVE_MAX_REFIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">CONTEXT FOR THOSE PER CENTS, from the paper itself (book p. 400):"</span></span>
<span id="cb17-23">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  the dilution and sampling corrections, </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">if neglected, can be as high as"</span></span>
<span id="cb17-24">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  15-20 per cent</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">, and lactic recoveries </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ran consistently above 96 per"</span></span>
<span id="cb17-25">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  cent</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.  A 3 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% c</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">losure on the final acid is inside the paper's own"</span></span>
<span id="cb17-26">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  analytical error, which is why it is reported as a coherence check and"</span></span>
<span id="cb17-27">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  not as a precision claim."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>integrated eq. (2) with the AUTHORS' printed 2.2 and 0.55,
starting from the first printed P (0.8 mg/ml at t = 2.5 h), against the 21 later printed P values:
  rms relative error 0.016979, worst 0.038359 at t = 6.50 h
  final acid: predicted 44.649542 against the printed 43.3 mg/ml, +3.1167%
  with this page's refitted pair instead: rms 0.015474, worst 0.033901

CONTEXT FOR THOSE PER CENTS, from the paper itself (book p. 400):
  the dilution and sampling corrections, "if neglected, can be as high as
  15-20 per cent", and lactic recoveries "ran consistently above 96 per
  cent".  A 3 % closure on the final acid is inside the paper's own
  analytical error, which is why it is reported as a coherence check and
  not as a precision claim.</code></pre>
</div>
</div>
</section>
<section id="the-crossover-the-paper-describes-in-words" class="level3">
<h3 class="anchored" data-anchor-id="the-crossover-the-paper-describes-in-words">5. The crossover the paper describes in words</h3>
<p><em>“In the early phases … the first term of equation 3 is the important one, while towards the end of the fermentation the second term becomes more important.”</em> The two terms are equal at <img src="https://latex.codecogs.com/png.latex?k%5E%7B*%7D%20=%20%5Cbeta/%5Calpha">. <strong>The time at which the pH 6·0 run crosses it is root-found twice, on two column pairs that share nothing</strong>: once on the printed <img src="https://latex.codecogs.com/png.latex?k"> column, and once on the separate printed <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt"> and <img src="https://latex.codecogs.com/png.latex?N"> columns, where the condition is <img src="https://latex.codecogs.com/png.latex?%5Calpha%5C,%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt%20=%20%5Cbeta%20N">.</p>
<div id="3c5da56e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.511814Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.511630Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.535251Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.534366Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">K_STAR_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ALPHA_PRINTED)</span>
<span id="cb19-2">K_STAR_REFIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(BETA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ALPHA_A)</span>
<span id="cb19-3"></span>
<span id="cb19-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROUTE 1: root-find on the printed k column</span></span>
<span id="cb19-5">T_CROSS_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(KT(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_STAR_PRINTED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.0</span>,</span>
<span id="cb19-6">                         xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>))</span>
<span id="cb19-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROUTE 2: root-find on the SEPARATE printed dN/dt and N columns.  Different</span></span>
<span id="cb19-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cells of the table, a different interpolant, and never a quotient - so a</span></span>
<span id="cb19-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mis-transcribed k cell moves one route and not the other.</span></span>
<span id="cb19-10">_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>])</span>
<span id="cb19-11">DNT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_d.time_h.to_numpy(), _d.dNdt_UOD_per_ml_h.to_numpy())</span>
<span id="cb19-12">NNT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_d.time_h.to_numpy(), _d.N_UOD_per_ml.to_numpy())</span>
<span id="cb19-13">T_CROSS_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(</span>
<span id="cb19-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DNT(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(NNT(t)),</span>
<span id="cb19-15">    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>))</span>
<span id="cb19-16">CROSS_TWO_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T_CROSS_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_CROSS_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb19-17">T_CROSS_FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((T_CROSS_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_LO)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(T_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_LO))</span>
<span id="cb19-18"></span>
<span id="cb19-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the split of the acid actually made, over the tabulated window</span></span>
<span id="cb19-20">GA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.trapezoid(DN_OBS, _f2.time_h.to_numpy()))</span>
<span id="cb19-21">NG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.trapezoid(N_OBS, _f2.time_h.to_numpy()))</span>
<span id="cb19-22">TOT_MODEL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NG</span>
<span id="cb19-23">TOT_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.trapezoid(DP_OBS, _f2.time_h.to_numpy()))</span>
<span id="cb19-24">GA_SHARE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(GA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TOT_MODEL)</span>
<span id="cb19-25">CLOSURE_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TOT_MODEL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TOT_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb19-26"></span>
<span id="cb19-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HOW WELL IS t* ACTUALLY DETERMINED?  Not to the seven figures the root-find</span></span>
<span id="cb19-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># returns: both routes read the same printed cells through an INTERPOLANT, and</span></span>
<span id="cb19-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># swapping it for a linear one moves both.  That spread, not the agreement</span></span>
<span id="cb19-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># between the routes, is the band on t*.</span></span>
<span id="cb19-31">_klin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(T_LO, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>)</span>
<span id="cb19-32">KT_LIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_klin, np.interp(_klin, _kk.time_h.to_numpy(),</span>
<span id="cb19-33">                                            _kk.k_per_h.to_numpy()))</span>
<span id="cb19-34">T_CROSS_K_LIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(KT_LIN(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_STAR_PRINTED,</span>
<span id="cb19-35">                             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>))</span>
<span id="cb19-36">T_CROSS_INTERP_BAND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T_CROSS_K_LIN<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_CROSS_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb19-37"></span>
<span id="cb19-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"k* = beta/alpha at pH 6.0: printed pair </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_STAR_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h,"</span></span>
<span id="cb19-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" refitted pair </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_STAR_REFIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h"</span>)</span>
<span id="cb19-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">crossover time, ROOT-FOUND (never a swept crossing), two independent"</span></span>
<span id="cb19-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" column paths:"</span>)</span>
<span id="cb19-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  on the printed k column                   t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CROSS_K<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb19-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  on the printed dN/dt and N columns        t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CROSS_D<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h"</span>)</span>
<span id="cb19-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the two routes differ by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative"</span>)</span>
<span id="cb19-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CROSS_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the way through the tabulated"</span></span>
<span id="cb19-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h window,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     which is the paper's </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">towards the"</span></span>
<span id="cb19-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" end</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> made into a number."</span>)</span>
<span id="cb19-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THAT </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> IS AND IS NOT.  It is a"</span></span>
<span id="cb19-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" TRANSCRIPTION-CONSISTENCY RESIDUAL:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the two routes read different"</span></span>
<span id="cb19-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed cells, so a mis-transcribed k cell moves one</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and not the"</span></span>
<span id="cb19-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" other, and a break row that takes the second route on the first"</span></span>
<span id="cb19-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  route's column collapses it to zero.  IT IS NOT THE PRECISION OF"</span></span>
<span id="cb19-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" t*.  Re-running</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  route 1 through a LINEAR interpolant instead of the"</span></span>
<span id="cb19-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" monotone cubic gives"</span></span>
<span id="cb19-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CROSS_K_LIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CROSS_INTERP_BAND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> away - two"</span></span>
<span id="cb19-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" orders of magnitude wider than the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  agreement between the routes."</span></span>
<span id="cb19-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  And a single mis-transcribed Table III cell moves it</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  further still"</span></span>
<span id="cb19-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (the break table prices that below).  SO t* IS QUOTED AS"</span></span>
<span id="cb19-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ~</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_CROSS_K<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  with that band, and never to the digits brentq"</span></span>
<span id="cb19-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" returns."</span>)</span>
<span id="cb19-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">over that whole window, with the printed constants:"</span>)</span>
<span id="cb19-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  growth-associated   alpha int dN = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GA_SHARE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb19-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  non-growth          beta  int N dt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>GA_SHARE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb19-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  sum </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TOT_MODEL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against int dP/dt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TOT_OBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml,"</span></span>
<span id="cb19-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLOSURE_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  SO THE TWO MECHANISMS CONTRIBUTE ALMOST EQUALLY OVER A WHOLE BATCH, even"</span></span>
<span id="cb19-67">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  though each dominates half of it.  Neither term is a correction."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>k* = beta/alpha at pH 6.0: printed pair 0.250000 1/h, refitted pair 0.233254 1/h

crossover time, ROOT-FOUND (never a swept crossing), two independent column paths:
  on the printed k column                   t = 10.102704 h
  on the printed dN/dt and N columns        t = 10.102952 h
  the two routes differ by 2.450e-05 relative
  -&gt; 72.8216% of the way through the tabulated 1.00-13.50 h window,
     which is the paper's "towards the end" made into a number.

WHAT THAT 2.450e-05 IS AND IS NOT.  It is a TRANSCRIPTION-CONSISTENCY RESIDUAL:
  the two routes read different printed cells, so a mis-transcribed k cell moves one
  and not the other, and a break row that takes the second route on the first
  route's column collapses it to zero.  IT IS NOT THE PRECISION OF t*.  Re-running
  route 1 through a LINEAR interpolant instead of the monotone cubic gives
  t = 10.119048 h, 0.16% away - two orders of magnitude wider than the
  agreement between the routes.  And a single mis-transcribed Table III cell moves it
  further still (the break table prices that below).  SO t* IS QUOTED AS ~10.1 h
  with that band, and never to the digits brentq returns.

over that whole window, with the printed constants:
  growth-associated   alpha int dN = 20.724000 mg/ml   (46.6929%)
  non-growth          beta  int N dt = 23.659625 mg/ml   (53.3071%)
  sum 44.383625 against int dP/dt = 43.630000 mg/ml, +1.7273%
  SO THE TWO MECHANISMS CONTRIBUTE ALMOST EQUALLY OVER A WHOLE BATCH, even
  though each dominates half of it.  Neither term is a correction.</code></pre>
</div>
</div>
</section>
<section id="the-six-ph-levels---what-six-pairs-can-and-cannot-say" class="level3">
<h3 class="anchored" data-anchor-id="the-six-ph-levels---what-six-pairs-can-and-cannot-say">6. The six pH levels - what six pairs can and cannot say</h3>
<p>This is the part of the case the queue entry was written for, and it is also where the scope boundary bites. <strong>Five of these six rows have no printed raw data, so five of them cannot be refitted, cannot be residual-checked, and cannot be tested at all here.</strong> What can be done with six numbers is to state their trends and to say what those trends do <em>not</em> establish.</p>
<div id="7f057e5e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.538017Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.537841Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:41.548552Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:41.547877Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the one column of Table III that is printed TWICE in this paper --------</span></span>
<span id="cb21-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Book p. 400, running text: the six fermentations were "each of which was</span></span>
<span id="cb21-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># continuously controlled at a different pH level (6.0, 5.6, 5.4, 5.2, 4.8 and</span></span>
<span id="cb21-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4.5)".  That sentence is an EXTERNAL check on Table III's pH column - a third</span></span>
<span id="cb21-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of the table's cells - and it is asserted here rather than described.</span></span>
<span id="cb21-6">PH_RUNNING_TEXT_P400 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>)</span>
<span id="cb21-7">PH_TABLE_III <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span></span>
<span id="cb21-8">                     T3.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).pH.to_numpy())</span>
<span id="cb21-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> PH_TABLE_III <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> PH_RUNNING_TEXT_P400, (</span>
<span id="cb21-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III's pH column no longer matches the six levels printed in the"</span></span>
<span id="cb21-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" running text on book p. 400"</span>)</span>
<span id="cb21-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table III's pH column </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PH_TABLE_III<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">matches the six levels printed"</span></span>
<span id="cb21-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" again in running text on book p. 400: EXTERNAL CHECK PASSES.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(The alpha and beta columns have no second printing anywhere in the"</span></span>
<span id="cb21-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" paper.)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-16"></span>
<span id="cb21-17">T3S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).reset_index(drop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb21-18">T3S[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_star_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3S.beta_mg_lactic_per_UOD_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T3S.alpha_mg_lactic_per_UOD</span>
<span id="cb21-19">BETA_MONOTONE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(T3S.beta_mg_lactic_per_UOD_h.to_numpy()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb21-20">ALPHA_MONOTONE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(T3S.alpha_mg_lactic_per_UOD.to_numpy()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb21-21">KSTAR_MONOTONE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(T3S.k_star_per_h.to_numpy()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb21-22">BETA_RANGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T3S.beta_mg_lactic_per_UOD_h.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb21-23">                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T3S.beta_mg_lactic_per_UOD_h.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb21-24">ALPHA_RANGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T3S.alpha_mg_lactic_per_UOD.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb21-25">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T3S.alpha_mg_lactic_per_UOD.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-26">KSTAR_RANGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T3S.k_star_per_h.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T3S.k_star_per_h.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb21-27">ALPHA_FLAT_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((T3S.alpha_mg_lactic_per_UOD</span>
<span id="cb21-28">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T3S.alpha_mg_lactic_per_UOD.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb21-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III, with beta/alpha computed (the paper prints neither the ratio nor"</span></span>
<span id="cb21-30">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">any other derived column - see the sidecar on why nothing here checks"</span></span>
<span id="cb21-31">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" itself):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pH'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'beta'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k* = beta/alpha, 1/h'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-33"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T3S.iterrows():</span>
<span id="cb21-34">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha_mg_lactic_per_UOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-35">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>beta_mg_lactic_per_UOD_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_star_per_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta strictly decreasing as pH falls: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_MONOTONE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -  a factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_RANGE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over the range"</span>)</span>
<span id="cb21-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"alpha non-decreasing as pH falls:     </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_MONOTONE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -  a factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_RANGE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and FLAT at"</span></span>
<span id="cb21-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha_mg_lactic_per_UOD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the top </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_FLAT_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> levels"</span>)</span>
<span id="cb21-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"k* strictly decreasing as pH falls:   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KSTAR_MONOTONE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -  a factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KSTAR_RANGE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THAT MEANS PHYSICALLY: as the pH falls, the non-growth route to acid"</span></span>
<span id="cb21-44">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">is shut down five-fold while the growth-associated yield rises only 1.6"</span></span>
<span id="cb21-45">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" fold,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">so the fermentation becomes almost purely growth-associated - at pH"</span></span>
<span id="cb21-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 4.5 the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">two terms are equal only at k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T3S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_star_per_h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1/h, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KSTAR_RANGE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x lower than at pH 6.0."</span>)</span>
<span id="cb21-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT SIX PAIRS DO NOT ESTABLISH, and this page does not claim:"</span></span>
<span id="cb21-49">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  * NOT that the FORM holds at the other five pH levels.  The form is"</span></span>
<span id="cb21-50">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" tested by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    the linearity of (1/N)(dP/dt) against k, which is Fig. 11,"</span></span>
<span id="cb21-51">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" and only the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    pH 6.0 run's points are printed.  Six fitted pairs are"</span></span>
<span id="cb21-52">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" six OUTPUTS of that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    test, not the test."</span></span>
<span id="cb21-53">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  * NOT a functional form for alpha(pH) or beta(pH).  Six points, no"</span></span>
<span id="cb21-54">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" replicates,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    no stated uncertainty on any of them, and the paper itself"</span></span>
<span id="cb21-55">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" only plots them</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    (Fig. 10) and reads an inflection off the plot."</span></span>
<span id="cb21-56">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  * NOT that pH 5.4 is special.  The paper says a change of behaviour"</span></span>
<span id="cb21-57">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" occurs</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    there and locates an inflection of alpha(pH) at that pH from"</span></span>
<span id="cb21-58">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" Fig. 10; with</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    three of the six alpha values printed as the SAME"</span></span>
<span id="cb21-59">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" number, 2.2, nothing in</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">    Table III alone can put an inflection"</span></span>
<span id="cb21-60">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" anywhere."</span>)</span>
<span id="cb21-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> BETA_MONOTONE <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ALPHA_MONOTONE <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> KSTAR_MONOTONE</span>
<span id="cb21-62"></span>
<span id="cb21-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- WHY THIS CELL IS ALSO THE ARITHMETIC SETTLEMENT OF THE pH 5.6 MARK ----</span></span>
<span id="cb21-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The stray mark before that cell's leading zero could only be a sign.  Read it</span></span>
<span id="cb21-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># as one and the assertion two lines above FAILS, so the notebook would not</span></span>
<span id="cb21-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># execute at all.  Demonstrated rather than asserted:</span></span>
<span id="cb21-67">_minus <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3.copy()</span>
<span id="cb21-68">_minus.loc[_minus.pH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_mg_lactic_per_UOD_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.49</span></span>
<span id="cb21-69">_ms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _minus.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).beta_mg_lactic_per_UOD_h.to_numpy()</span>
<span id="cb21-70">BETA_MONOTONE_IF_MINUS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(_ms) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb21-71"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> BETA_MONOTONE <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> BETA_MONOTONE_IF_MINUS</span>
<span id="cb21-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE pH 5.6 MARK, SETTLED BY ARITHMETIC AND NOT BY PIXELS:"</span></span>
<span id="cb21-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  beta strictly decreasing with the mark read as a DOT   (0.49):"</span></span>
<span id="cb21-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_MONOTONE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  beta strictly decreasing with the mark read as a MINUS (-0.49):"</span></span>
<span id="cb21-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_MONOTONE_IF_MINUS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  -&gt; the minus reading breaks the assertion this cell just executed,"</span></span>
<span id="cb21-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     break row below prices the violation on"</span></span>
<span id="cb21-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" beta_monotone_margin.  The paper's own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     Fig. 10 (book p. 407)"</span></span>
<span id="cb21-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" plots this column on a ZERO-BASED axis with all six</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     points above"</span></span>
<span id="cb21-81">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the axis, which says the same thing independently.  The"</span></span>
<span id="cb21-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     connected-component measurement on the crop CORROBORATES a"</span></span>
<span id="cb21-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" conclusion two</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     arithmetic checks already reach; it does not carry"</span></span>
<span id="cb21-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" it alone."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Table III's pH column (6.0, 5.6, 5.4, 5.2, 4.8, 4.5)
matches the six levels printed again in running text on book p. 400: EXTERNAL CHECK PASSES.
(The alpha and beta columns have no second printing anywhere in the paper.)

Table III, with beta/alpha computed (the paper prints neither the ratio nor
any other derived column - see the sidecar on why nothing here checks itself):

   pH    alpha     beta   k* = beta/alpha, 1/h
  6.0     2.20     0.55               0.250000
  5.6     2.20     0.49               0.222727
  5.4     2.20     0.32               0.145455
  5.2     2.45     0.26               0.106122
  4.8     3.00     0.14               0.046667
  4.5     3.55     0.11               0.030986

beta strictly decreasing as pH falls: True  -  a factor of 5.0000 over the range
alpha non-decreasing as pH falls:     True  -  a factor of 1.613636, and FLAT at 2.2 for the top 3 levels
k* strictly decreasing as pH falls:   True  -  a factor of 8.068182

WHAT THAT MEANS PHYSICALLY: as the pH falls, the non-growth route to acid
is shut down five-fold while the growth-associated yield rises only 1.6 fold,
so the fermentation becomes almost purely growth-associated - at pH 4.5 the
two terms are equal only at k = 0.030986 1/h, 8.07x lower than at pH 6.0.

WHAT SIX PAIRS DO NOT ESTABLISH, and this page does not claim:
  * NOT that the FORM holds at the other five pH levels.  The form is tested by
    the linearity of (1/N)(dP/dt) against k, which is Fig. 11, and only the
    pH 6.0 run's points are printed.  Six fitted pairs are six OUTPUTS of that
    test, not the test.
  * NOT a functional form for alpha(pH) or beta(pH).  Six points, no replicates,
    no stated uncertainty on any of them, and the paper itself only plots them
    (Fig. 10) and reads an inflection off the plot.
  * NOT that pH 5.4 is special.  The paper says a change of behaviour occurs
    there and locates an inflection of alpha(pH) at that pH from Fig. 10; with
    three of the six alpha values printed as the SAME number, 2.2, nothing in
    Table III alone can put an inflection anywhere.

THE pH 5.6 MARK, SETTLED BY ARITHMETIC AND NOT BY PIXELS:
  beta strictly decreasing with the mark read as a DOT   (0.49): True
  beta strictly decreasing with the mark read as a MINUS (-0.49): False
  -&gt; the minus reading breaks the assertion this cell just executed, and the
     break row below prices the violation on beta_monotone_margin.  The paper's own
     Fig. 10 (book p. 407) plots this column on a ZERO-BASED axis with all six
     points above the axis, which says the same thing independently.  The
     connected-component measurement on the crop CORROBORATES a conclusion two
     arithmetic checks already reach; it does not carry it alone.</code></pre>
</div>
</div>
</section>
<section id="the-pymrm-models" class="level3">
<h3 class="anchored" data-anchor-id="the-pymrm-models">7. The pymrm models</h3>
<p>Both reactor models are closed by the paper’s own <img src="https://latex.codecogs.com/png.latex?k(t)">, and both are checked against the closed form rather than against data. <strong>Nothing in this paper tests either of them</strong>; they show that the Luedeking-Piret relation is a source term that transports, which is the form it has to be in for the <em>“rational design of continuous fermentation processes”</em> the Summary asks for.</p>
<div id="970c5480" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:41.550793Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:41.550662Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:43.851148Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:43.850056Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------------- batch marcher</span></span>
<span id="cb23-2">N_REF, P_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(N_closed(T_HI)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_closed(T_HI, ALPHA_PRINTED,</span>
<span id="cb23-3">                                                     BETA_PRINTED))</span>
<span id="cb23-4">MARCH_NT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>]</span>
<span id="cb23-5">MARCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {nt: batch_march(nt, ALPHA_PRINTED, BETA_PRINTED) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_NT}</span>
<span id="cb23-6">MARCH_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(MARCH[nt][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_NT]</span>
<span id="cb23-7">MARCH_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(MARCH_ERR[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MARCH_ERR[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb23-8">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MARCH_ERR) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb23-9">MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MARCH_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb23-10">MARCH_FINEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MARCH_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb23-11"></span>
<span id="cb23-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------------------- plug flow</span></span>
<span id="cb23-13">PFR_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>]</span>
<span id="cb23-14">PFR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: PlugFlowFermenter(n, ALPHA_PRINTED, BETA_PRINTED).solve()</span>
<span id="cb23-15">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_N}</span>
<span id="cb23-16">PFR_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: PFR[n].outlet() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_N}</span>
<span id="cb23-17">PFR_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(PFR_OUT[n][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_N]</span>
<span id="cb23-18">PFR_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(PFR_ERR[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_ERR[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb23-19">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PFR_ERR) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb23-20">PFR_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb23-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Richardson at first order on the two finest grids</span></span>
<span id="cb23-22">PFR_P_RICH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PFR_OUT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> PFR_OUT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-23">PFR_P_RICH_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(PFR_P_RICH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb23-24">PFR_P_FINEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_OUT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-25"></span>
<span id="cb23-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the last-cell read, for the comparison J4.2 made on its own physics</span></span>
<span id="cb23-27">PFR_CENTRE_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(PFR[n].outlet_last_cell()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb23-28">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_N]</span>
<span id="cb23-29">PFR_CENTRE_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(PFR_CENTRE_ERR[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_CENTRE_ERR[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb23-30">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PFR_CENTRE_ERR) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb23-31">PFR_CENTRE_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PFR_CENTRE_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb23-32">PFR_BOUNDARY_OVER_CENTRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_CENTRE_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-33">PFR_BOUNDARY_OVER_CENTRE_COARSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_CENTRE_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb23-34"></span>
<span id="cb23-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"closed-form reference at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h:  N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> U.O.D./ml,"</span></span>
<span id="cb23-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm BATCH, backward Euler + newton + NumJac((1,2)):"</span>)</span>
<span id="cb23-38"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(MARCH_NT, MARCH_ERR):</span>
<span id="cb23-39">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  nt </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   P </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MARCH[nt][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rel err </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed orders </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.4f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> o <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ORDERS]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MARCH_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, first order as backward Euler must be"</span>)</span>
<span id="cb23-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pymrm PLUG FLOW, construct_convflux_upwind + construct_div + newton:"</span>)</span>
<span id="cb23-43"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(PFR_N, PFR_ERR):</span>
<span id="cb23-44">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ncell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   P_out </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_OUT[n][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rel err </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed orders </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.4f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> o <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_ORDERS]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, first order as donor-cell upwind must be"</span>)</span>
<span id="cb23-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Richardson from the two finest grids: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_P_RICH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mg/ml,"</span></span>
<span id="cb23-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_P_RICH_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the closed form"</span>)</span>
<span id="cb23-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">BOUNDARY READ, MEASURED not assumed (the question J4.2 raised):"</span>)</span>
<span id="cb23-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  compute_boundary_values  order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs"</span></span>
<span id="cb23-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_CENTRE_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the last-cell read"</span>)</span>
<span id="cb23-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  error ratio, boundary read over last-cell read:"</span></span>
<span id="cb23-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_BOUNDARY_OVER_CENTRE_COARSE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at ncell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_N[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb23-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_BOUNDARY_OVER_CENTRE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at ncell </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PFR_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  MEASURED, NOT ASSUMED, AND IT DOES NOT SAY WHAT THE STANDING ADVICE"</span></span>
<span id="cb23-56">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" SAYS.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  Both reads are FIRST order, and the last-cell read is the CLOSER"</span></span>
<span id="cb23-57">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" of the two</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  at every grid, by a ratio that barely moves under"</span></span>
<span id="cb23-58">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" refinement.  That is what a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  zero-gradient outflow condition does, and"</span></span>
<span id="cb23-59">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" it is the same conclusion J4.2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  reached on different physics - so it is"</span></span>
<span id="cb23-60">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" re-measured here, not inherited.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  compute_boundary_values is kept"</span></span>
<span id="cb23-61">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" because it returns the value the flux</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  operator actually transports, so"</span></span>
<span id="cb23-62">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" a balance written on it closes:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  CONSISTENCY, NOT ACCURACY."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>closed-form reference at t = 13.5 h:  N = 9.68777169 U.O.D./ml,  P = 45.32220609 mg/ml

pymrm BATCH, backward Euler + newton + NumJac((1,2)):
  nt   200   P  47.83003730   rel err 5.533339e-02
  nt   400   P  46.54777733   rel err 2.704130e-02
  nt   800   P  45.92812486   rel err 1.336914e-02
  nt  1600   P  45.62347523   rel err 6.647274e-03
  observed orders ['1.0330', '1.0163', '1.0081'] -&gt; 1.0081, first order as backward Euler must be

pymrm PLUG FLOW, construct_convflux_upwind + construct_div + newton:
  ncell   200   P_out  48.14126932   rel err 6.220049e-02
  ncell   400   P_out  46.69758745   rel err 3.034674e-02
  ncell   800   P_out  46.00163487   rel err 1.499108e-02
  ncell  1600   P_out  45.65988826   rel err 7.450700e-03
  ncell  3200   P_out  45.49054320   rel err 3.714230e-03
  observed orders ['1.0354', '1.0174', '1.0087', '1.0043'] -&gt; 1.0043, first order as donor-cell upwind must be
  Richardson from the two finest grids: 45.32119815 mg/ml, 2.224e-05 from the closed form

BOUNDARY READ, MEASURED not assumed (the question J4.2 raised):
  compute_boundary_values  order 1.0043 vs 1.0043 for the last-cell read
  error ratio, boundary read over last-cell read: 1.016858 at ncell 200, 1.016655 at ncell 3200
  MEASURED, NOT ASSUMED, AND IT DOES NOT SAY WHAT THE STANDING ADVICE SAYS.
  Both reads are FIRST order, and the last-cell read is the CLOSER of the two
  at every grid, by a ratio that barely moves under refinement.  That is what a
  zero-gradient outflow condition does, and it is the same conclusion J4.2
  reached on different physics - so it is re-measured here, not inherited.
  compute_boundary_values is kept because it returns the value the flux
  operator actually transports, so a balance written on it closes:
  CONSISTENCY, NOT ACCURACY.</code></pre>
</div>
</div>
<div id="39d50afa" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:43.854289Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:43.854132Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:44.313806Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:44.313185Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------------------ figures</span></span>
<span id="cb25-2">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.9</span>))</span>
<span id="cb25-3"></span>
<span id="cb25-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) the fit, in the authors' own Fig. 11 variables</span></span>
<span id="cb25-5">kg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(K_OBS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb25-6">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(K_OBS, Y_OBS, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II, 22 rows"</span>)</span>
<span id="cb25-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(kg, ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_PRINTED, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb25-8">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> k + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(kg, ALPHA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_A, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREEN, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb25-10">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"OLS  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> k + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(kg, np.full_like(kg, Y_OBS.mean()), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb25-12">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null: constant"</span>)</span>
<span id="cb25-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$k$, 1/h"</span>)</span>
<span id="cb25-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$(1/N)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">,dP/dt$, mg/U.O.D. h"</span>)</span>
<span id="cb25-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(a) eq. (3), the authors' Fig. 11 axes"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb25-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.4</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb25-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb25-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb25-19"></span>
<span id="cb25-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) the integral test against the printed P column</span></span>
<span id="cb25-21">tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(TP0, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb25-22">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(TP, P_OBS, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II, printed $P$"</span>)</span>
<span id="cb25-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(tg, P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(NT2(tg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT2(TP0))</span>
<span id="cb25-24">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(NT2_INT(tg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT2_INT(TP0)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE,</span>
<span id="cb25-25">           lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (2) integrated, printed pair"</span>)</span>
<span id="cb25-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(tg, P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A_ONLY_INT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(NT2(tg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT2(TP0)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY,</span>
<span id="cb25-27">           lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null: growth-associated only"</span>)</span>
<span id="cb25-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(tg, P0_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_ONLY_INT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(NT2_INT(tg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT2_INT(TP0)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-."</span>,</span>
<span id="cb25-29">           color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_PURPLE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null: density only"</span>)</span>
<span id="cb25-30">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axvline(T_CROSS_K, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREEN, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)</span>
<span id="cb25-31">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time, h"</span>)</span>
<span id="cb25-32">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$P$, mg/ml"</span>)</span>
<span id="cb25-33">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(b) integral test; dashed line $k = k^*$"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb25-34">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.4</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb25-35"></span>
<span id="cb25-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (c) the six printed pairs</span></span>
<span id="cb25-37">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(T3S.pH, T3S.alpha_mg_lactic_per_UOD, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE,</span>
<span id="cb25-38">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">lpha</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, mg lactic/U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">O</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-39">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(T3S.pH, T3S.beta_mg_lactic_per_UOD_h, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE,</span>
<span id="cb25-40">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, mg lactic/U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">O</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/h"</span>)</span>
<span id="cb25-41">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(T3S.pH, T3S.k_star_per_h, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREEN,</span>
<span id="cb25-42">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">lpha</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, 1/h"</span>)</span>
<span id="cb25-43">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>)</span>
<span id="cb25-44">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(c) Table III, all six levels"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>)</span>
<span id="cb25-45">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.6</span>)</span>
<span id="cb25-46">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].invert_xaxis()</span>
<span id="cb25-47"></span>
<span id="cb25-48">fig.tight_layout()</span>
<span id="cb25-49">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.4-luedeking-piret/index_files/figure-html/cell-14-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p><strong>Ranked, and the top of the ranking is a refusal.</strong> The strongest validation available for a product-formation law would be a fermentation the constants were <em>not</em> fitted to. <strong>This paper prints exactly one fermentation’s raw data and that is the fermentation the pH 6·0 constants were fitted to</strong>, so that validation is not available and is not manufactured. What is below is what the printed numbers can actually support, in descending order of what it proves.</p>
<ol type="1">
<li><strong>Internal identities in Table II</strong> (transcription checks, proved by the paper’s own definitions on book p.&nbsp;400) - and their teeth are measured, not claimed.</li>
<li><strong>A second, independent column path for every derived quantity</strong> - the crossover time is root-found on the <img src="https://latex.codecogs.com/png.latex?k"> column <em>and</em> on the separate <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DN/%5Cmathrm%7Bd%7Dt"> and <img src="https://latex.codecogs.com/png.latex?N"> columns.</li>
<li><strong>A third fitting route that touches no differentiated column</strong> - the integral form.</li>
<li><strong>Two solver discretisations against a closed form the model has exactly</strong>, both refined, both with observed orders.</li>
<li><strong>Two null baselines</strong>, each the paper’s own rejected alternative.</li>
<li><strong>NOT: agreement with any plotted curve.</strong> Figs. 4-11 are not digitised, so this page does <strong>not</strong> establish empirical adequacy against anything in this paper that lives only in a figure - including all five of the other pH levels, the shape of <img src="https://latex.codecogs.com/png.latex?%5Calpha(%5Cmathrm%7BpH%7D)"> in Fig. 10, and the linearity of Fig. 11 at those five levels.</li>
</ol>
<p><strong>The one figure reading on this page, declared.</strong> Fig. 10’s lower panel was calibrated on its own gridlines and its six markers located, once, to confirm the <strong>sign</strong> of Table III’s pH 5·6 <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> cell - see <em>The data</em>. It ranks nowhere in the list above because it is not a validation: it settles a glyph. No value from it is in a CSV, in a fit, or in <code>agreement.json</code>, and the value 0·49 does not rest on it.</p>
<section id="what-this-page-cannot-conclude" class="level3">
<h3 class="anchored" data-anchor-id="what-this-page-cannot-conclude">What this page cannot conclude</h3>
<ul>
<li><strong>That the Luedeking-Piret relation is correct.</strong> One run, and the constants were fitted on it. The refit tests the <em>arithmetic</em> of the authors’ fit, not the model.</li>
<li><strong>That the form holds across pH.</strong> That claim needs the five other runs’ raw data, which are not printed.</li>
<li><strong>Anything about <img src="https://latex.codecogs.com/png.latex?%5Calpha(%5Cmathrm%7BpH%7D)"> or <img src="https://latex.codecogs.com/png.latex?%5Cbeta(%5Cmathrm%7BpH%7D)"> as functions.</strong> Six points, no replicates, no stated uncertainties.</li>
<li><strong>That the plug-flow extension describes a real fermenter.</strong> No experiment in this paper is continuous.</li>
</ul>
<div id="9b67ba91" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:44.316507Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:44.316371Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:44.346814Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:44.345982Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ================================================================== break table</span></span>
<span id="cb26-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># EVERY reported metric needs a row that moves it.  The rows are DEFECTS -</span></span>
<span id="cb26-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># things a careless transcription or a careless numerical choice would actually</span></span>
<span id="cb26-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># do - and the coverage map below is GENERATED from their measured moves, not</span></span>
<span id="cb26-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># written by hand.</span></span>
<span id="cb26-6">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb26-7"></span>
<span id="cb26-8"></span>
<span id="cb26-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, kinterp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pchip"</span>, quad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"trapz"</span>,</span>
<span id="cb26-10">               use_quotients<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, drop_first_P_row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, k_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb26-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Recompute every table-derived metric from (possibly corrupted) inputs."""</span></span>
<span id="cb26-12">    t2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> t2</span>
<span id="cb26-13">    t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> t1</span>
<span id="cb26-14">    t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t3 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> t3</span>
<span id="cb26-15">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb26-16">    f3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invN_dPdt_mg_per_UOD_h"</span>,</span>
<span id="cb26-17">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>])</span>
<span id="cb26-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_min <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break row: fit the log phase only</span></span>
<span id="cb26-19">        f3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f3[f3.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> k_min]</span>
<span id="cb26-20">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f3.k_per_h.to_numpy()</span>
<span id="cb26-21">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (f3.dPdt_mg_per_ml_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>f3.N_UOD_per_ml).to_numpy() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> use_quotients <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb26-22">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> f3.invN_dPdt_mg_per_UOD_h.to_numpy()</span>
<span id="cb26-23">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([k, np.ones_like(k)])</span>
<span id="cb26-24">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(X, y)</span>
<span id="cb26-25">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c</span>
<span id="cb26-26">    s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(k) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb26-27">    cov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.linalg.inv(X.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> X)</span>
<span id="cb26-28">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_refit_eq3"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_refit_eq3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-29">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_refit_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(r)</span>
<span id="cb26-30">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_R2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb26-31">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_se_eq3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb26-32">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_se_eq3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb26-33">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_beta_corr_eq3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb26-34">    r3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.loc[t3.pH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-35">    ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r3.alpha_mg_lactic_per_UOD)</span>
<span id="cb26-36">    bp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r3.beta_mg_lactic_per_UOD_h)</span>
<span id="cb26-37">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_refit_eq3_vs_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-38">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_refit_eq3_vs_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>bp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-39">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_alpha_in_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ap)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb26-40">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_beta_in_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bp)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb26-41">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_given_printed_alpha"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>k))</span>
<span id="cb26-42">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_given_printed_beta"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bp))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>k))</span>
<span id="cb26-43">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_printed_pair_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bp)</span>
<span id="cb26-44">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_printed_pair_rms_penalty"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rms(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bp)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms(r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-45"></span>
<span id="cb26-46">    f2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>,</span>
<span id="cb26-47">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>])</span>
<span id="cb26-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_min <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb26-49">        f2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f2[f2.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> k_min]</span>
<span id="cb26-50">    x2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([f2.dNdt_UOD_per_ml_h.to_numpy(),</span>
<span id="cb26-51">                          f2.N_UOD_per_ml.to_numpy()])</span>
<span id="cb26-52">    dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f2.dPdt_mg_per_ml_h.to_numpy()</span>
<span id="cb26-53">    c2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(x2, dp)</span>
<span id="cb26-54">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_refit_eq2"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_refit_eq2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-55">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_refit_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c2)</span>
<span id="cb26-56">    a1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(x2[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], dp)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-57">    b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(x2[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], dp)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-58">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_null_growth_only_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-59">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_null_density_only_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-60">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_null_growth_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-61">                                              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c2))</span>
<span id="cb26-62">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_null_density_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-63">                                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rms(dp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c2))</span>
<span id="cb26-64"></span>
<span id="cb26-65">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE PAPER'S OWN QUALIFIER, both halves.  Computed on the UNFILTERED table</span></span>
<span id="cb26-66">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so that the log-phase-only break row cannot empty one of the two windows.</span></span>
<span id="cb26-67">    fsp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>,</span>
<span id="cb26-68">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>])</span>
<span id="cb26-69">    _, r_lg, ga_lg, gb_lg, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> null_split(fsp, k_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_LOG)</span>
<span id="cb26-70">    _, r_ot, ga_ot, gb_ot, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> null_split(fsp, k_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_LOG)</span>
<span id="cb26-71">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_logphase_refit_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r_lg</span>
<span id="cb26-72">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_logphase_null_growth_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ga_lg</span>
<span id="cb26-73">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_logphase_null_density_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gb_lg</span>
<span id="cb26-74">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_outside_log_refit_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r_ot</span>
<span id="cb26-75">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_outside_log_null_growth_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ga_ot</span>
<span id="cb26-76">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_outside_log_null_density_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gb_ot</span>
<span id="cb26-77"></span>
<span id="cb26-78">    nn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>])</span>
<span id="cb26-79">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kinterp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pchip"</span>:</span>
<span id="cb26-80">        nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(nn.time_h.to_numpy(), nn.N_UOD_per_ml.to_numpy())</span>
<span id="cb26-81">        nti <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nt.antiderivative()</span>
<span id="cb26-82">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:                                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># linear, break-row alternative</span></span>
<span id="cb26-83">        _tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(nn.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), nn.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>)</span>
<span id="cb26-84">        _vg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.interp(_tg, nn.time_h.to_numpy(), nn.N_UOD_per_ml.to_numpy())</span>
<span id="cb26-85">        nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_tg, _vg)</span>
<span id="cb26-86">        nti <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nt.antiderivative()</span>
<span id="cb26-87">    fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_mg_per_ml"</span>])</span>
<span id="cb26-88">    fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fp[fp.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> t2.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>]</span>
<span id="cb26-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> drop_first_P_row:</span>
<span id="cb26-90">        fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fp.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]</span>
<span id="cb26-91">    tp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fp.time_h.to_numpy()</span>
<span id="cb26-92">    po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fp.P_mg_per_ml.to_numpy()</span>
<span id="cb26-93">    dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nt(tp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nt(tp[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-94">    inn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nti(tp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nti(tp[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-95">    xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([dn, inn])</span>
<span id="cb26-96">    cc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(xc, po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-97">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_refit_integral"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_refit_integral"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb26-98">                                                               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb26-99">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral_refit_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cc)</span>
<span id="cb26-100">    ai <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(xc[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-101">    bi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ols(xc[:, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-102">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral_null_growth_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb26-103">        rms(po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ai<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xc[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms(po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cc))</span>
<span id="cb26-104">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral_null_density_only_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb26-105">        rms(po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xc[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms(po <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cc))</span>
<span id="cb26-106">    pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> po[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>inn</span>
<span id="cb26-107">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> tp[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-108">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_curve_rms_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(pred[m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>po[m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-109">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_curve_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pred[m]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>po[m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-110">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_final_vs_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pred[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>po[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-111"></span>
<span id="cb26-112">    kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>])</span>
<span id="cb26-113">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kinterp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pchip"</span>:</span>
<span id="cb26-114">        kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(kk.time_h.to_numpy(), kk.k_per_h.to_numpy())</span>
<span id="cb26-115">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb26-116">        _tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(kk.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), kk.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>)</span>
<span id="cb26-117">        kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_tg, np.interp(_tg, kk.time_h.to_numpy(),</span>
<span id="cb26-118">                                              kk.k_per_h.to_numpy()))</span>
<span id="cb26-119">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_star_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ap)</span>
<span id="cb26-120">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kt(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ap,</span>
<span id="cb26-121">                                           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>))</span>
<span id="cb26-122">    dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>])</span>
<span id="cb26-123">    dnt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(dd.time_h.to_numpy(), dd.dNdt_UOD_per_ml_h.to_numpy())</span>
<span id="cb26-124">    nnt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(dd.time_h.to_numpy(), dd.N_UOD_per_ml.to_numpy())</span>
<span id="cb26-125">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_dNdt_route_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(</span>
<span id="cb26-126">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dnt(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nnt(t)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.0</span>,</span>
<span id="cb26-127">        xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>))</span>
<span id="cb26-128">    tf2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f2.time_h.to_numpy()</span>
<span id="cb26-129">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> quad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"trapz"</span>:</span>
<span id="cb26-130">        ga <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.trapezoid(x2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], tf2)</span>
<span id="cb26-131">        ng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.trapezoid(x2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], tf2)</span>
<span id="cb26-132">        tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.trapezoid(dp, tf2)</span>
<span id="cb26-133">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:                                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># left rectangle, break-row</span></span>
<span id="cb26-134">        w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.diff(tf2)</span>
<span id="cb26-135">        ga <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(x2[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>w)</span>
<span id="cb26-136">        ng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(x2[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>w)</span>
<span id="cb26-137">        tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(dp[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>w)</span>
<span id="cb26-138">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growth_assoc_share"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ga<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(ga <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ng))</span>
<span id="cb26-139">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integrated_closure_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((ga <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ng)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-140"></span>
<span id="cb26-141">    _kx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dNdt_UOD_per_ml_h"</span>])</span>
<span id="cb26-142">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_identity_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb26-143">        _kx.dNdt_UOD_per_ml_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_kx.N_UOD_per_ml<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_kx.k_per_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-144">    _qx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invN_dPdt_mg_per_UOD_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>,</span>
<span id="cb26-145">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>])</span>
<span id="cb26-146">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invN_identity_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb26-147">        _qx.dPdt_mg_per_ml_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_qx.N_UOD_per_ml<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_qx.invN_dPdt_mg_per_UOD_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-148"></span>
<span id="cb26-149">    n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(t1.time_h.to_numpy(), t1.N_UOD_per_ml.to_numpy())</span>
<span id="cb26-150">    ov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nn[(nn.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> t1.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (nn.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> t1.time_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())]</span>
<span id="cb26-151">    rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(n1(ov.time_h.to_numpy())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ov.N_UOD_per_ml.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb26-152">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_vs_table2_N_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-153">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_vs_table2_N_rms_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rms(rr)</span>
<span id="cb26-154"></span>
<span id="cb26-155">    s3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb26-156">    ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (s3.beta_mg_lactic_per_UOD_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s3.alpha_mg_lactic_per_UOD).to_numpy()</span>
<span id="cb26-157">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_range_ph6_over_ph45"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s3.beta_mg_lactic_per_UOD_h.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-158">                                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> s3.beta_mg_lactic_per_UOD_h.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-159">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_range_ph45_over_ph6"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s3.alpha_mg_lactic_per_UOD.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb26-160">                                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> s3.alpha_mg_lactic_per_UOD.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb26-161">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar_range_ph6_over_ph45"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ks[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ks[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-162">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar_ph45_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ks[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-163">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar_ph56_per_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ks[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb26-164">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the smallest step by which beta falls as pH falls: the margin by which the</span></span>
<span id="cb26-165">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># monotonicity the page reports actually holds.</span></span>
<span id="cb26-166">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_monotone_margin"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb26-167">        np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.diff(s3.beta_mg_lactic_per_UOD_h.to_numpy())))</span>
<span id="cb26-168">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_sum_all_ph"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s3.beta_mg_lactic_per_UOD_h.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb26-169">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb26-170"></span>
<span id="cb26-171"></span>
<span id="cb26-172">BASE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _refit_all()</span>
<span id="cb26-173">METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(BASE)</span>
<span id="cb26-174">METRICS.update({</span>
<span id="cb26-175">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digit_substitution_detection"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DIGIT_FRAC),</span>
<span id="cb26-176">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_marcher_order"</span>: MARCH_ORDER,</span>
<span id="cb26-177">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_marcher_finest_rel"</span>: MARCH_FINEST,</span>
<span id="cb26-178">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_grid_order"</span>: PFR_ORDER,</span>
<span id="cb26-179">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the key NAMES ITS GRID, as J4.2 does: a plug-flow outlet is not a</span></span>
<span id="cb26-180">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid-free quantity and a key that hides the grid invites one to be quoted.</span></span>
<span id="cb26-181">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_outlet_P_ncell3200"</span>: PFR_P_FINEST,</span>
<span id="cb26-182">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_richardson_vs_closed_form"</span>: PFR_P_RICH_REL,</span>
<span id="cb26-183">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_boundary_over_last_cell"</span>: PFR_BOUNDARY_OVER_CENTRE,</span>
<span id="cb26-184">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_P_final"</span>: P_REF,</span>
<span id="cb26-185">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_N_final"</span>: N_REF,</span>
<span id="cb26-186">})</span>
<span id="cb26-187"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two-route crossover residual is reported as its own metric</span></span>
<span id="cb26-188">METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_two_routes_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb26-189">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_h"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_dNdt_route_h"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb26-190"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>62 metrics.</code></pre>
</div>
</div>
<div id="f3230505" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:44.349170Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:44.349038Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:44.744751Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:44.743938Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------------ the break rows</span></span>
<span id="cb28-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _corrupt(df, mask_col, mask_val, col, new):</span>
<span id="cb28-3">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.copy()</span>
<span id="cb28-4">    d.loc[d[mask_col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> mask_val, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> new</span>
<span id="cb28-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> d</span>
<span id="cb28-6"></span>
<span id="cb28-7"></span>
<span id="cb28-8">BREAK_FNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb28-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: N at t = 9.50 h read 5.85 instead of 5.35 (a digit slip)"</span>,</span>
<span id="cb28-10">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.50</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.85</span>))),</span>
<span id="cb28-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: dP/dt at t = 8.00 h read 4.87 instead of 4.37"</span>,</span>
<span id="cb28-12">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.00</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dPdt_mg_per_ml_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.87</span>))),</span>
<span id="cb28-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># inside the logarithmic plateau, where dN/dt = k_c N makes the two</span></span>
<span id="cb28-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># regressors nearly proportional: the one place a single bad N cell can</span></span>
<span id="cb28-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># move a ratio that degeneracy otherwise pins near 1.</span></span>
<span id="cb28-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: N at t = 8.50 h read 3.96 instead of 3.46, inside the plateau"</span>,</span>
<span id="cb28-17">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.50</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.96</span>))),</span>
<span id="cb28-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: k at t = 10.00 h read 0.276 instead of 0.270"</span>,</span>
<span id="cb28-19">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.00</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_per_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.276</span>))),</span>
<span id="cb28-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: P at t = 13.50 h read 48.3 instead of 43.3"</span>,</span>
<span id="cb28-21">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.50</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_mg_per_ml"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">48.3</span>))),</span>
<span id="cb28-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: the one-significant-figure t = 2.50 h row dropped"</span>,</span>
<span id="cb28-23">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T2[T2.time_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.50</span>], drop_first_P_row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)),</span>
<span id="cb28-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: N at t = 9.30 h read 4.04 instead of 4.94"</span>,</span>
<span id="cb28-25">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T1, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.30</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_UOD_per_ml"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.04</span>))),</span>
<span id="cb28-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III: the pH 5.6 stray mark READ AS A MINUS SIGN, beta = -0.49"</span>,</span>
<span id="cb28-27">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_mg_lactic_per_UOD_h"</span>,</span>
<span id="cb28-28">                                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.49</span>))),</span>
<span id="cb28-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III: alpha at pH 6.0 read 2.7 instead of 2.2"</span>,</span>
<span id="cb28-30">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_mg_lactic_per_UOD"</span>,</span>
<span id="cb28-31">                                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.7</span>))),</span>
<span id="cb28-32">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The beta cell of the ONE row this whole page rests on was never corrupted</span></span>
<span id="cb28-33">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># by the original table.  It is an ordinary single-digit transcription</span></span>
<span id="cb28-34">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect on the cell the page rests on, and that is the whole of its</span></span>
<span id="cb28-35">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># justification.  The 5-for-3 is quoted as a KIND of mis-read this document</span></span>
<span id="cb28-36">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># demonstrably makes - this scan's text layer renders "pH 5.4" as "pH 3.4"</span></span>
<span id="cb28-37">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># on book p. 406 - NOT as the provenance of this particular substitution:</span></span>
<span id="cb28-38">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same rule licenses 0.53 and 0.33 just as readily, and the paper's own</span></span>
<span id="cb28-39">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># instance corrupts the digit BEFORE the mid-dot, which in 0.55 is the zero,</span></span>
<span id="cb28-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so no instantiation is the exact analogue.  What the alternatives would</span></span>
<span id="cb28-41">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># have moved is measured and printed below rather than argued.</span></span>
<span id="cb28-42">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III: beta at pH 6.0 read 0.35 instead of 0.55, a 5-for-3 of the kind"</span></span>
<span id="cb28-43">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" this scan's own text layer makes on book p. 406"</span>,</span>
<span id="cb28-44">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_mg_lactic_per_UOD_h"</span>,</span>
<span id="cb28-45">                                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>))),</span>
<span id="cb28-46">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III: mid-dot RELOCATED in alpha at pH 4.5, 3.55 read as 35.5"</span>,</span>
<span id="cb28-47">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_mg_lactic_per_UOD"</span>,</span>
<span id="cb28-48">                                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">35.5</span>))),</span>
<span id="cb28-49">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III: mid-dot DROPPED in beta at pH 4.5, 0.11 read as 1.1"</span>,</span>
<span id="cb28-50">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_mg_lactic_per_UOD_h"</span>,</span>
<span id="cb28-51">                                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>))),</span>
<span id="cb28-52">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (k &gt;= 0.45), the window"</span></span>
<span id="cb28-53">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" where the paper says BOTH one-term assumptions are also valid"</span>,</span>
<span id="cb28-54">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(k_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>)),</span>
<span id="cb28-55">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3) fitted on the UNROUNDED quotient dP/dt / N, not the printed column"</span>,</span>
<span id="cb28-56">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(use_quotients<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)),</span>
<span id="cb28-57">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear interpolation of k(t) and N(t) instead of monotone cubic"</span>,</span>
<span id="cb28-58">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(kinterp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear"</span>)),</span>
<span id="cb28-59">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left-rectangle instead of trapezoid for the integrated split"</span>,</span>
<span id="cb28-60">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _refit_all(quad<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rect"</span>)),</span>
<span id="cb28-61">]</span>
<span id="cb28-62"></span>
<span id="cb28-63">BREAKS, COVERAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}</span>
<span id="cb28-64"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS:</span>
<span id="cb28-65">    got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn()</span>
<span id="cb28-66">    BREAKS.append((lbl, got))</span>
<span id="cb28-67">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items():</span>
<span id="cb28-68">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb28-69">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb28-70">        base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> METRICS[k_]</span>
<span id="cb28-71">        denom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb28-72">        mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>denom</span>
<span id="cb28-73">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL:</span>
<span id="cb28-74">            COVERAGE.setdefault(k_, []).append((lbl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mv)))</span>
<span id="cb28-75"></span>
<span id="cb28-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- numerical rows, which move the solver metrics ---------------------------</span></span>
<span id="cb28-77"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _corrupt_k_closed_form(t_bad, k_bad):</span>
<span id="cb28-78">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""closed-form N and P at t_end with ONE k cell mis-transcribed"""</span></span>
<span id="cb28-79">    kv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(_kk.time_h.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> t_bad, k_bad, _kk.k_per_h.to_numpy())</span>
<span id="cb28-80">    kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_kk.time_h.to_numpy(), kv)</span>
<span id="cb28-81">    ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt.antiderivative()</span>
<span id="cb28-82">    nf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: N_LO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(ka(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ka(T_LO))</span>
<span id="cb28-83">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(T_LO, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160001</span>)</span>
<span id="cb28-84">    ni <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(g, nf(g)).antiderivative()</span>
<span id="cb28-85">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_N_final"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nf(T_HI)),</span>
<span id="cb28-86">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_P_final"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(nf(T_HI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_LO)</span>
<span id="cb28-87">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(ni(T_HI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ni(T_LO)))}</span>
<span id="cb28-88"></span>
<span id="cb28-89"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _corrupt_k_everywhere(t_bad, k_bad):</span>
<span id="cb28-90">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""ONE mis-transcribed k cell, driving the SOLVE and the REFERENCE together.</span></span>
<span id="cb28-91"></span>
<span id="cb28-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `_corrupt_k_closed_form` above corrupts only the closed form, which is the</span></span>
<span id="cb28-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    artificial half of the experiment: it decouples the two sides, and a metric</span></span>
<span id="cb28-94"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    that is a RATIO of two reads of the same solve is untouched by it.  Here the</span></span>
<span id="cb28-95"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    same corrupted k(t) is handed to the plug-flow fermenter AND used to build</span></span>
<span id="cb28-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the closed form that scores it, so the solution is consistently wrong and</span></span>
<span id="cb28-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the ratio of the two outlet reads is re-formed on it.  That is the only</span></span>
<span id="cb28-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    honest way to test the claim this page used to make about that ratio - and</span></span>
<span id="cb28-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the claim did not survive it.  The feed state is unchanged by construction:</span></span>
<span id="cb28-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    N(T_LO) = N_LO and P(T_LO) = 0 whatever k does later.</span></span>
<span id="cb28-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb28-102">    kv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(_kk.time_h.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> t_bad, k_bad, _kk.k_per_h.to_numpy())</span>
<span id="cb28-103">    kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(_kk.time_h.to_numpy(), kv)</span>
<span id="cb28-104">    ka <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt.antiderivative()</span>
<span id="cb28-105">    nf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: N_LO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(ka(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ka(T_LO))</span>
<span id="cb28-106">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(T_LO, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160001</span>)</span>
<span id="cb28-107">    ni <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PchipInterpolator(g, nf(g)).antiderivative()</span>
<span id="cb28-108">    p_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ALPHA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(nf(T_HI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_LO)</span>
<span id="cb28-109">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_PRINTED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(ni(T_HI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ni(T_LO)))</span>
<span id="cb28-110">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugFlowFermenter(PFR_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], ALPHA_PRINTED, BETA_PRINTED, kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt).solve()</span>
<span id="cb28-111">    e_bv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f.outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>p_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb28-112">    e_lc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f.outlet_last_cell()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>p_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb28-113">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_N_final"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nf(T_HI)),</span>
<span id="cb28-114">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_P_final"</span>: p_ref,</span>
<span id="cb28-115">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_outlet_P_ncell3200"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f.outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb28-116">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_boundary_over_last_cell"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(e_bv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e_lc)}</span>
<span id="cb28-117"></span>
<span id="cb28-118"></span>
<span id="cb28-119"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _self_convergence_order(vals):</span>
<span id="cb28-120">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The order you get by refining against your OWN finest grid.</span></span>
<span id="cb28-121"></span>
<span id="cb28-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    A standard mistake where an exact reference exists: the finest value</span></span>
<span id="cb28-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    carries its own O(h) error, which contaminates every difference and</span></span>
<span id="cb28-124"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    inflates the apparent order.  Here the closed form makes it measurable.</span></span>
<span id="cb28-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb28-126">    ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb28-127">    errs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> vals[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb28-128">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb28-129"></span>
<span id="cb28-130"></span>
<span id="cb28-131">PFR_ORDER_SELF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _self_convergence_order([PFR_OUT[n][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_N])</span>
<span id="cb28-132">MARCH_ORDER_SELF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _self_convergence_order([MARCH[nt][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_NT])</span>
<span id="cb28-133"></span>
<span id="cb28-134">NUM_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb28-135">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch marcher at nt = 200 instead of 1600"</span>,</span>
<span id="cb28-136">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_marcher_finest_rel"</span>: MARCH_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]}),</span>
<span id="cb28-137">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug flow at ncell = 200 instead of 3200"</span>,</span>
<span id="cb28-138">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_outlet_P_ncell3200"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_OUT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb28-139">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_richardson_vs_closed_form"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb28-140">          (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PFR_OUT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> PFR_OUT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))}),</span>
<span id="cb28-141">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow orders read off the two COARSEST grids instead of the two finest"</span>,</span>
<span id="cb28-142">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_grid_order"</span>: PFR_ORDERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_marcher_order"</span>: MARCH_ORDERS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]}),</span>
<span id="cb28-143">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BOTH orders taken by SELF-CONVERGENCE against the finest grid instead of"</span></span>
<span id="cb28-144">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" against the closed form"</span>,</span>
<span id="cb28-145">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_grid_order"</span>: PFR_ORDER_SELF, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch_marcher_order"</span>: MARCH_ORDER_SELF}),</span>
<span id="cb28-146">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet read off the last cell centre instead of compute_boundary_values"</span>,</span>
<span id="cb28-147">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_boundary_over_last_cell"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PFR_CENTRE_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])}),</span>
<span id="cb28-148">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form evaluated with the refitted pair instead of the printed one"</span>,</span>
<span id="cb28-149">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_P_final"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_closed(T_HI, ALPHA_A, BETA_A))}),</span>
<span id="cb28-150">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: k at t = 7.00 h read 0.98 instead of 0.48, in the closed form"</span>,</span>
<span id="cb28-151">     _corrupt_k_closed_form(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.00</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98</span>)),</span>
<span id="cb28-152">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE ROW THAT BROKE THIS PAGE'S ONE DECLARED BLIND SPOT.  t = 13.50 h is</span></span>
<span id="cb28-153">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the LAST printed k cell, so on a plug-flow grid whose axial coordinate IS</span></span>
<span id="cb28-154">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># residence time it sits in the OUTLET cell; 0.047 read as 0.947 is a</span></span>
<span id="cb28-155">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># single-digit substitution in the first decimal place, the same class as</span></span>
<span id="cb28-156">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the t = 7.00 row above (0.48 read as 0.98).</span></span>
<span id="cb28-157">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A defect there changes the LOCAL GRADIENT at the outlet, which is exactly</span></span>
<span id="cb28-158">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the quantity the boundary read and the last-cell read differ by.</span></span>
<span id="cb28-159">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: k at t = 13.50 h - the LAST k cell, so the OUTLET cell - read"</span></span>
<span id="cb28-160">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 0.947 instead of 0.047, in the solve AND in the reference"</span>,</span>
<span id="cb28-161">     _corrupt_k_everywhere(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.947</span>)),</span>
<span id="cb28-162">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the control for it: the SAME 0-for-9 substitution one printed row earlier,</span></span>
<span id="cb28-163">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># where the defect is no longer local to the outlet.</span></span>
<span id="cb28-164">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: the same 0-for-9 substitution ONE ROW EARLIER, k at t = 13.00 h"</span></span>
<span id="cb28-165">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" read 0.959 instead of 0.059, in the solve AND in the reference"</span>,</span>
<span id="cb28-166">     _corrupt_k_everywhere(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.00</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.959</span>)),</span>
<span id="cb28-167">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N closed form from a LINEAR k(t) interpolant"</span>,</span>
<span id="cb28-168">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed_form_N_final"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb28-169">         N_LO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(np.trapezoid(</span>
<span id="cb28-170">             np.interp(np.linspace(T_LO, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>),</span>
<span id="cb28-171">                       _kk.time_h.to_numpy(), _kk.k_per_h.to_numpy()),</span>
<span id="cb28-172">             np.linspace(T_LO, T_HI, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>))))}),</span>
<span id="cb28-173">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digit-substitution detection scored at a 10x tighter tolerance"</span>,</span>
<span id="cb28-174">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digit_substitution_detection"</span>:</span>
<span id="cb28-175">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(digit_detection(K_IDENT_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>DIGIT_TOTAL)}),</span>
<span id="cb28-176">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover second route taken on the SAME k column as the first"</span>,</span>
<span id="cb28-177">     {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_two_routes_rel"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>}),</span>
<span id="cb28-178">]</span>
<span id="cb28-179"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NUM_ROWS:</span>
<span id="cb28-180">    BREAKS.append((lbl, got))</span>
<span id="cb28-181">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items():</span>
<span id="cb28-182">        base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> METRICS[k_]</span>
<span id="cb28-183">        denom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb28-184">        mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>denom</span>
<span id="cb28-185">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL:</span>
<span id="cb28-186">            COVERAGE.setdefault(k_, []).append((lbl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mv)))</span>
<span id="cb28-187"></span>
<span id="cb28-188"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NOTHING here is structural: every metric has a row that moves it.  The</span></span>
<span id="cb28-189"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># crossover two-route residual is the closest thing to an identity on the page -</span></span>
<span id="cb28-190"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two column paths solve the same equation - but it is NOT zero, because the</span></span>
<span id="cb28-191"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># paths interpolate different printed cells, and a row that takes the second</span></span>
<span id="cb28-192"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route on the first route's column collapses it.  So it is covered, not</span></span>
<span id="cb28-193"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># excused.</span></span>
<span id="cb28-194">STRUCTURAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb28-195">uncovered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(STRUCTURAL))</span>
<span id="cb28-196"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"COVERAGE MAP, GENERATED FROM </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> DEFECT INJECTIONS"</span></span>
<span id="cb28-197">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics, move threshold </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOVE_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative):"</span>)</span>
<span id="cb28-198"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(METRICS):</span>
<span id="cb28-199">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE:</span>
<span id="cb28-200">        rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(COVERAGE[k_], key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-201">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(rows)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> row(s); strongest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-202">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  &lt;- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">52</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-203">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL:</span>
<span id="cb28-204">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> STRUCTURAL"</span>)</span>
<span id="cb28-205">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb28-206">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> UNCOVERED"</span>)</span>
<span id="cb28-207"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> uncovered, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics no break row moves and none named structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>uncovered<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-208">_moving <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS</span>
<span id="cb28-209">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE[k_])</span>
<span id="cb28-210">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got)}</span>
<span id="cb28-211">N_BREAK_ROWS, N_MOVING_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_moving)</span>
<span id="cb28-212">N_LINKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values())</span>
<span id="cb28-213"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> N_MOVING_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_BREAK_ROWS, (</span>
<span id="cb28-214">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a break row moves nothing: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({l <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS} <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _moving)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-215"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MOVING_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BREAK_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows move a reported metric;"</span></span>
<span id="cb28-216">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LINKS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> measured row-metric links."</span>)</span>
<span id="cb28-217">_cells <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS</span>
<span id="cb28-218">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl.startswith((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I:"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II:"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III:"</span>))</span>
<span id="cb28-219">          <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row dropped"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lbl}</span>
<span id="cb28-220">N_CELL_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_cells)</span>
<span id="cb28-221">N_METHOD_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_BREAK_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_CELL_ROWS</span>
<span id="cb28-222"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the rows split </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CELL_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_METHOD_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> between"</span></span>
<span id="cb28-223">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" MIS-TRANSCRIBING ONE PRINTED CELL and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CHANGING A METHOD or a"</span></span>
<span id="cb28-224">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" resolution, and that split is used below rather than asserted."</span>)</span>
<span id="cb28-225"></span>
<span id="cb28-226"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># COVERED IS NOT THE SAME AS COVERED FAR ENOUGH TO MATTER.  check_agreement.py</span></span>
<span id="cb28-227"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># compares at 5 %, so a metric whose strongest mover shifts it by less than that</span></span>
<span id="cb28-228"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is one no defect on this page could surface as a CI regression.  Rather than</span></span>
<span id="cb28-229"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># manufacture a bigger defect for each, the weak ones are NAMED, with what they</span></span>
<span id="cb28-230"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are blind to, and the set is pinned so it cannot grow silently.</span></span>
<span id="cb28-231">CI_REL_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb28-232">WEAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k_: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items()</span>
<span id="cb28-233">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> CI_REL_TOL}</span>
<span id="cb28-234">WEAKEST_COVER, WEAKEST_METRIC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v), k_)</span>
<span id="cb28-235">                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items())</span>
<span id="cb28-236"></span>
<span id="cb28-237"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT KIND OF ROW IS A METRIC'S STRONGEST MOVER?  Classified in code, because</span></span>
<span id="cb28-238"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># an earlier version of this page ASSERTED a mitigation - "each weak metric is</span></span>
<span id="cb28-239"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># still moved more than 5 % by a row that changes the method" - which its own</span></span>
<span id="cb28-240"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># definition of WEAK makes impossible: WEAK is the maximum over ALL rows.  The</span></span>
<span id="cb28-241"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># retraction is printed below and the true statement is computed.</span></span>
<span id="cb28-242">CELL_DEFECT_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS</span>
<span id="cb28-243">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl.startswith((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I:"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II:"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table III:"</span>))</span>
<span id="cb28-244">                    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row dropped"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lbl}</span>
<span id="cb28-245">METHOD_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS} <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CELL_DEFECT_ROWS</span>
<span id="cb28-246">KIND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one mis-transcribed cell"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CELL_DEFECT_ROWS</span>
<span id="cb28-247">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a change of METHOD"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS}</span>
<span id="cb28-248">STRONGEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k_: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items()}</span>
<span id="cb28-249"></span>
<span id="cb28-250"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHICH ROWS RESCUED WHICH METRIC - RECOMPUTED FROM THE COVERAGE MAP WITH THOSE</span></span>
<span id="cb28-251"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROWS TAKEN BACK OUT, never remembered.  The sentence this block replaces</span></span>
<span id="cb28-252"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># carried a hand-written, WORD-SPELLED count - "three of those six" - that the</span></span>
<span id="cb28-253"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># page's own numbers contradict, and that the mechanical sweep below cannot see</span></span>
<span id="cb28-254"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at any setting: its integer class is DIGIT strings of two or more digits.  The</span></span>
<span id="cb28-255"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># review rows are located by matching the live table, so deleting one stops the</span></span>
<span id="cb28-256"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># notebook rather than silently changing a count.</span></span>
<span id="cb28-257">ROW_BETA035 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>(l <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta at pH 6.0 read 0.35"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> l)</span>
<span id="cb28-258">ROW_SELFCONV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>(l <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> l.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BOTH orders"</span>))</span>
<span id="cb28-259">ROW_OUTLET_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>(l <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the LAST k cell"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> l)</span>
<span id="cb28-260">ROW_INLAND_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>(l <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ONE ROW EARLIER"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> l)</span>
<span id="cb28-261">REVIEW_WAVES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first review"</span>, {ROW_BETA035, ROW_SELFCONV}),</span>
<span id="cb28-262">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second review"</span>, {ROW_OUTLET_K, ROW_INLAND_K})]</span>
<span id="cb28-263">ALL_REVIEW_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>().union(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>[r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> REVIEW_WAVES])</span>
<span id="cb28-264"></span>
<span id="cb28-265"></span>
<span id="cb28-266"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _weak_without(excluded):</span>
<span id="cb28-267">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the weak set this page WOULD declare with those rows out of the table."""</span></span>
<span id="cb28-268">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb28-269">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb28-270">        mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>([m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.get(k_, []) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> excluded],</span>
<span id="cb28-271">                 default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb28-272">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> CI_REL_TOL:</span>
<span id="cb28-273">            out[k_] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mv</span>
<span id="cb28-274">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb28-275"></span>
<span id="cb28-276"></span>
<span id="cb28-277"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _weak_strongest(metric, excluded):</span>
<span id="cb28-278">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""label of a metric's strongest mover with those rows out of the table."""</span></span>
<span id="cb28-279">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(m, lbl) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.get(metric, []) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> excluded]</span>
<span id="cb28-280">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(rows)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rows <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb28-281"></span>
<span id="cb28-282"></span>
<span id="cb28-283">WEAK_BEFORE_REVIEW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _weak_without(ALL_REVIEW_ROWS)</span>
<span id="cb28-284">WEAK_LADDER, _excl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"before either review"</span>, WEAK_BEFORE_REVIEW)], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(ALL_REVIEW_ROWS)</span>
<span id="cb28-285"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _name, _rows <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> REVIEW_WAVES:</span>
<span id="cb28-286">    _excl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-=</span> _rows</span>
<span id="cb28-287">    WEAK_LADDER.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"+ the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_rows)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb28-288">                        _weak_without(_excl)))</span>
<span id="cb28-289"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> WEAK_LADDER[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].keys() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> WEAK.keys(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the ladder must end at WEAK"</span></span>
<span id="cb28-290">N_WEAK_BEFORE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK_BEFORE_REVIEW)</span>
<span id="cb28-291">N_LEFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_WEAK_BEFORE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK)</span>
<span id="cb28-292">N_LEFT_FIRST_WAVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_WEAK_BEFORE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK_LADDER[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-293">N_LEFT_VIA_REVIEW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WEAK_BEFORE_REVIEW</span>
<span id="cb28-294">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WEAK <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> STRONGEST[k_][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ALL_REVIEW_ROWS)</span>
<span id="cb28-295"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> N_LEFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_LEFT_VIA_REVIEW, (</span>
<span id="cb28-296">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a metric left the blind spot on a row that was already in the table, which"</span></span>
<span id="cb28-297">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" is not what this block says"</span>)</span>
<span id="cb28-298"></span>
<span id="cb28-299">_n, _is, _its <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"are"</span>,</span>
<span id="cb28-300">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"its"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"their"</span>)</span>
<span id="cb28-301"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">DECLARED BLIND SPOT: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_is<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> moved by"</span></span>
<span id="cb28-302">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_its<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> strongest</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">row by LESS than CI's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> comparison"</span></span>
<span id="cb28-303">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" tolerance."</span></span>
<span id="cb28-304">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THE SET IS EMPTY: every metric on this page is moved</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">past"</span></span>
<span id="cb28-305">         <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by at least one row, and the WEAKEST COVER ON THE"</span></span>
<span id="cb28-306">         <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" PAGE is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_COVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_METRIC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - the one metric"</span></span>
<span id="cb28-307">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" that WAS weak, until the row that breaks</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">it, described below, went"</span></span>
<span id="cb28-308">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" into the table above."</span></span>
<span id="cb28-309">         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> WEAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb28-310">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  A defect of the size injected here would not</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">surface as a regression"</span></span>
<span id="cb28-311">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" on them.  Named, not rounded away, with the row that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">moves each most"</span></span>
<span id="cb28-312">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" and what kind of row that is:"</span>))</span>
<span id="cb28-313"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(WEAK, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: WEAK[x]):</span>
<span id="cb28-314">    lbl, mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> STRONGEST[k_]</span>
<span id="cb28-315">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KIND[lbl]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            "</span></span>
<span id="cb28-316">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lbl[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">78</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-317"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THAT MEANS, AND WHAT IT DOES NOT - computed, not asserted:"</span>)</span>
<span id="cb28-318"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  * an earlier version of this page listed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_WEAK_BEFORE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> weak metrics"</span></span>
<span id="cb28-319">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and said each was </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">moved by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    more than </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by a row"</span></span>
<span id="cb28-320">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" that changes the method</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  That is false by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    construction - WEAK is"</span></span>
<span id="cb28-321">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the MAXIMUM move over ALL rows - and it is RETRACTED.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    Nothing in the"</span></span>
<span id="cb28-322">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" table those </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_WEAK_BEFORE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> were measured against moved any of them"</span></span>
<span id="cb28-323">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" past</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(WEAK_BEFORE_REVIEW.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and"</span></span>
<span id="cb28-324">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WEAK_BEFORE_REVIEW <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _weak_strongest(k_, ALL_REVIEW_ROWS) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METHOD_ROWS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-325">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_WEAK_BEFORE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> already had a METHOD-changing row as</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    their"</span></span>
<span id="cb28-326">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" strongest mover, so the mitigation inverted the causal story as well as"</span></span>
<span id="cb28-327">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    the arithmetic."</span>)</span>
<span id="cb28-328"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  * THE BLIND SPOT AS THE REVIEW ROWS WENT IN, each line recomputed with"</span></span>
<span id="cb28-329">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the later</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    rows REMOVED from the coverage map:"</span>)</span>
<span id="cb28-330"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _name, _w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WEAK_LADDER:</span>
<span id="cb28-331">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_w)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> weak of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-332"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    So </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LEFT_FIRST_WAVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_WEAK_BEFORE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> left on the first"</span></span>
<span id="cb28-333">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" review's two rows and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LEFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_LEFT_FIRST_WAVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the second's,"</span></span>
<span id="cb28-334">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LEFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in all - and for ALL </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LEFT_VIA_REVIEW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them the"</span></span>
<span id="cb28-335">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" strongest mover IS one of those rows.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    NOT ONE left on a row that"</span></span>
<span id="cb28-336">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" was already in the table.  A previous version of this</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    block said"</span></span>
<span id="cb28-337">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">three of those six</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: wrong on both halves, and word-spelled, so no"</span></span>
<span id="cb28-338">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    sweep on this page could have caught it."</span>)</span>
<span id="cb28-339"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(WEAK_BEFORE_REVIEW, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>WEAK_BEFORE_REVIEW[x]):</span>
<span id="cb28-340">    lbl, mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> STRONGEST[k_]</span>
<span id="cb28-341">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAK_BEFORE_REVIEW[k_]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt;</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-342">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a review row'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lbl <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ALL_REVIEW_ROWS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'an old row'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-343"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  * </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics ARE moved"</span></span>
<span id="cb28-344">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" past </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by something on this page,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    so CI can see a"</span></span>
<span id="cb28-345">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" regression in them."</span>)</span>
<span id="cb28-346">_ratio_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(COVERAGE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_boundary_over_last_cell"</span>])</span>
<span id="cb28-347">_ratio_out, _ratio_in <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _ratio_rows[ROW_OUTLET_K], _ratio_rows[ROW_INLAND_K]</span>
<span id="cb28-348">_ratio_swap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ratio_rows.items()</span>
<span id="cb28-349">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> l <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (ROW_OUTLET_K, ROW_INLAND_K))</span>
<span id="cb28-350"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  * WHY THE SURVIVOR DID NOT SURVIVE: pfr_boundary_over_last_cell is a"</span></span>
<span id="cb28-351">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" RATIO of two</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    reads of the SAME solve, and they agree to about"</span></span>
<span id="cb28-352">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(PFR_BOUNDARY_OVER_CENTRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on every grid -"</span></span>
<span id="cb28-353">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.6f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (PFR_ERR[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PFR_CENTRE_ERR[i]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PFR_N)))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-354">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    over a 16x refinement.  This page used to say that ANY defect"</span></span>
<span id="cb28-355">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" changing the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    solution moves BOTH reads and leaves the ratio where it"</span></span>
<span id="cb28-356">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" was, so that only</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    swapping which read is on top could move it."</span></span>
<span id="cb28-357">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THAT IS FALSE AS A UNIVERSAL AND</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    THE COUNTEREXAMPLE IS NOW A ROW."</span></span>
<span id="cb28-358">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  What is true is narrower: a defect acting AWAY</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    from the outlet does"</span></span>
<span id="cb28-359">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" move both reads together.  The SAME single-digit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    substitution one"</span></span>
<span id="cb28-360">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed row earlier moves the ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_ratio_in<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the only</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb28-361">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" other row that moves it at all is the read swap itself, at"</span></span>
<span id="cb28-362">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_ratio_swap<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    But k at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> h is the LAST printed k"</span></span>
<span id="cb28-363">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" cell, so it sits in the OUTLET cell,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    and a defect there changes the"</span></span>
<span id="cb28-364">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" local gradient - the one quantity the two reads</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    differ by.  It moves"</span></span>
<span id="cb28-365">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_ratio_out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, past CI's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CI_REL_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  The ratio was"</span></span>
<span id="cb28-366">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" never</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    structurally protected; it was protected by WHERE this page"</span></span>
<span id="cb28-367">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" happened to inject."</span>)</span>
<span id="cb28-368"></span>
<span id="cb28-369"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT THE PROVENANCE STORY IS WORTH, PRICED RATHER THAN ARGUED.  The beta row</span></span>
<span id="cb28-370"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># quotes a 5-for-3 as a KIND of mis-read this scan demonstrably makes, not as</span></span>
<span id="cb28-371"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the provenance of this particular substitution, because the same rule licenses</span></span>
<span id="cb28-372"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the OTHER 5 in 0.55 just as readily - and that choice is not free: under the</span></span>
<span id="cb28-373"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># other instantiation the two crossover metrics would have stayed weak.</span></span>
<span id="cb28-374">_beta_alts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(b, _refit_all(t3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_corrupt(T3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>,</span>
<span id="cb28-375">                                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_mg_lactic_per_UOD_h"</span>, b)))</span>
<span id="cb28-376">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.53</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>)]</span>
<span id="cb28-377">_alt_metrics <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_h"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_dNdt_route_h"</span>,</span>
<span id="cb28-378">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_given_printed_beta"</span>)</span>
<span id="cb28-379"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE beta ROW IS ONE INSTANTIATION OF ITS RULE, NOT THE ONLY ONE AND"</span></span>
<span id="cb28-380">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" NOT THE LARGEST.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The rule licenses the same 5-for-3 on either 5 of the"</span></span>
<span id="cb28-381">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed 0.55, or on both:"</span>)</span>
<span id="cb28-382"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _b, _g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _beta_alts:</span>
<span id="cb28-383">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  0.55 -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.2f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> _b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(</span>
<span id="cb28-384">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_g[k_] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> METRICS[k_])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(METRICS[k_])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-385">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _alt_metrics))</span>
<span id="cb28-386"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The injected row is the MIDDLE one, which is the opposite of tuning,"</span></span>
<span id="cb28-387">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" but the escape</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  of the two crossover metrics from the blind spot does"</span></span>
<span id="cb28-388">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" depend on the choice.  So the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  row rests on being a single-digit"</span></span>
<span id="cb28-389">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" transcription defect on the ONE Table III cell</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  this page rests on;"</span></span>
<span id="cb28-390">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the text-layer story is quoted as a KIND of mis-read this</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  document"</span></span>
<span id="cb28-391">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" makes, and the paper's own instance (pH 5.4 read as 3.4, book p. 406)"</span></span>
<span id="cb28-392">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  corrupts the digit BEFORE the mid-dot, which in 0.55 is the zero - so"</span></span>
<span id="cb28-393">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" no</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  instantiation is its exact analogue."</span>)</span>
<span id="cb28-394"></span>
<span id="cb28-395">WEAK_PINNED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>()</span>
<span id="cb28-396"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(WEAK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> WEAK_PINNED, (</span>
<span id="cb28-397">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a metric has become weakly covered without being named: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(WEAK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> WEAK_PINNED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-398"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">weakest cover on the page: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_COVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_METRIC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-399"></span>
<span id="cb28-400">ABS_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span></span>
<span id="cb28-401">BELOW_FLOOR_COMPANION <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_two_routes_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_h"</span>}</span>
<span id="cb28-402">below <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k_: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ABS_FLOOR}</span>
<span id="cb28-403"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(below) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(BELOW_FLOOR_COMPANION)), (</span>
<span id="cb28-404">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics below ABS_FLOOR with no companion named:"</span></span>
<span id="cb28-405">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(below) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(BELOW_FLOOR_COMPANION)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-406">N_BELOW_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(below)</span>
<span id="cb28-407"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">below CI's ABS_FLOOR = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ABS_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BELOW_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metric(s)."</span></span>
<span id="cb28-408">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Named with an above-floor companion:"</span>)</span>
<span id="cb28-409"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, comp <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BELOW_FLOOR_COMPANION.items():</span>
<span id="cb28-410">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'BELOW'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> below <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'above'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>METRICS[k_]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-411">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   companion </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>comp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>METRICS[comp]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-412"></span>
<span id="cb28-413">SECOND_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb28-414">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha, eq.(3) OLS vs the integral form (no differentiated column)"</span>:</span>
<span id="cb28-415">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ALPHA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ALPHA_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb28-416">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta,  eq.(3) OLS vs the integral form"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BETA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BETA_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb28-417">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha, eq.(3) OLS vs eq.(2) OLS (N^2 weighting)"</span>:</span>
<span id="cb28-418">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ALPHA_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ALPHA_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb28-419">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover time, k column vs dN/dt and N columns"</span>:</span>
<span id="cb28-420">        METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_two_routes_rel"</span>],</span>
<span id="cb28-421">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch P(t_end), pymrm marcher vs closed form"</span>: MARCH_FINEST,</span>
<span id="cb28-422">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow P_out, Richardson vs closed form"</span>: PFR_P_RICH_REL,</span>
<span id="cb28-423">}</span>
<span id="cb28-424"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> quantities computed a second way:"</span>)</span>
<span id="cb28-425"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SECOND_ROUTES.items():</span>
<span id="cb28-426">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-427"></span>
<span id="cb28-428"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb28-429">report_agreement(PAGE, METRICS)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>COVERAGE MAP, GENERATED FROM 28 DEFECT INJECTIONS (62 metrics, move threshold 1e-06 relative):
  P_curve_max_rel                        7 row(s); strongest 3.399e+00  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  P_curve_rms_rel                        7 row(s); strongest 6.433e+00  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  P_final_vs_printed                     7 row(s); strongest 6.373e+00  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  alpha_beta_corr_eq3                    3 row(s); strongest 1.211e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  alpha_given_printed_beta               5 row(s); strongest 2.114e-01  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  alpha_range_ph45_over_ph6              2 row(s); strongest 9.000e+00  &lt;- Table III: mid-dot RELOCATED in alpha at pH 4.5, 3.5
  alpha_refit_eq2                        5 row(s); strongest 2.950e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  alpha_refit_eq3                        4 row(s); strongest 8.873e-02  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  alpha_refit_eq3_vs_printed             5 row(s); strongest 6.306e+00  &lt;- Table III: alpha at pH 6.0 read 2.7 instead of 2.2
  alpha_refit_integral                   5 row(s); strongest 1.768e-01  &lt;- Table II: P at t = 13.50 h read 48.3 instead of 43.3
  alpha_se_eq3                           4 row(s); strongest 2.412e+01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  batch_marcher_finest_rel               1 row(s); strongest 7.324e+00  &lt;- batch marcher at nt = 200 instead of 1600
  batch_marcher_order                    2 row(s); strongest 5.884e-01  &lt;- BOTH orders taken by SELF-CONVERGENCE against the fi
  beta_given_printed_alpha               5 row(s); strongest 3.079e-01  &lt;- Table III: alpha at pH 6.0 read 2.7 instead of 2.2
  beta_monotone_margin                   3 row(s); strongest 3.300e+01  &lt;- Table III: mid-dot DROPPED in beta at pH 4.5, 0.11 r
  beta_range_ph6_over_ph45               2 row(s); strongest 9.000e-01  &lt;- Table III: mid-dot DROPPED in beta at pH 4.5, 0.11 r
  beta_refit_eq2                         5 row(s); strongest 5.545e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  beta_refit_eq3                         4 row(s); strongest 1.371e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  beta_refit_eq3_vs_printed              5 row(s); strongest 1.417e+01  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  beta_refit_integral                    5 row(s); strongest 2.726e-01  &lt;- Table II: P at t = 13.50 h read 48.3 instead of 43.3
  beta_se_eq3                            4 row(s); strongest 3.042e+01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  beta_sum_all_ph                        3 row(s); strongest 5.294e-01  &lt;- Table III: mid-dot DROPPED in beta at pH 4.5, 0.11 r
  closed_form_N_final                    4 row(s); strongest 6.905e-01  &lt;- Table II: the same 0-for-9 substitution ONE ROW EARL
  closed_form_P_final                    4 row(s); strongest 3.588e-01  &lt;- Table II: the same 0-for-9 substitution ONE ROW EARL
  crossover_time_dNdt_route_h            3 row(s); strongest 6.472e-02  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  crossover_time_h                       4 row(s); strongest 6.530e-02  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  crossover_two_routes_rel               1 row(s); strongest 1.000e+00  &lt;- crossover second route taken on the SAME k column as
  digit_substitution_detection           1 row(s); strongest 1.281e-01  &lt;- digit-substitution detection scored at a 10x tighter
  eq2_logphase_null_density_only_ratio   2 row(s); strongest 8.388e-01  &lt;- Table II: N at t = 8.50 h read 3.96 instead of 3.46,
  eq2_logphase_null_growth_only_ratio    2 row(s); strongest 3.241e-01  &lt;- Table II: N at t = 8.50 h read 3.96 instead of 3.46,
  eq2_logphase_refit_rms                 2 row(s); strongest 6.195e-01  &lt;- Table II: dP/dt at t = 8.00 h read 4.87 instead of 4
  eq2_null_density_only_ratio            5 row(s); strongest 7.898e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  eq2_null_density_only_rms              5 row(s); strongest 9.335e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  eq2_null_growth_only_ratio             5 row(s); strongest 8.133e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  eq2_null_growth_only_rms               3 row(s); strongest 9.410e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  eq2_outside_log_null_density_only_ratio 2 row(s); strongest 1.187e-01  &lt;- Table II: N at t = 9.50 h read 5.85 instead of 5.35 
  eq2_outside_log_null_growth_only_ratio 2 row(s); strongest 8.332e-02  &lt;- Table II: N at t = 9.50 h read 5.85 instead of 5.35 
  eq2_outside_log_refit_rms              2 row(s); strongest 9.089e-02  &lt;- Table II: N at t = 9.50 h read 5.85 instead of 5.35 
  eq2_refit_rms                          5 row(s); strongest 6.837e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  eq3_R2                                 4 row(s); strongest 9.595e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  eq3_printed_pair_rms                   6 row(s); strongest 1.222e+00  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  eq3_printed_pair_rms_penalty           6 row(s); strongest 1.886e+02  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  eq3_refit_rms                          4 row(s); strongest 3.801e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  growth_assoc_share                     7 row(s); strongest 4.036e-01  &lt;- eq. (3) fitted on the LOGARITHMIC-GROWTH rows only (
  integral_null_density_only_ratio       5 row(s); strongest 8.129e-01  &lt;- Table II: P at t = 13.50 h read 48.3 instead of 43.3
  integral_null_growth_only_ratio        5 row(s); strongest 7.156e-01  &lt;- Table II: P at t = 13.50 h read 48.3 instead of 43.3
  integral_refit_rms                     5 row(s); strongest 3.607e+00  &lt;- Table II: P at t = 13.50 h read 48.3 instead of 43.3
  integrated_closure_rel                 8 row(s); strongest 1.142e+01  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  invN_identity_max_rel                  3 row(s); strongest 6.072e+00  &lt;- Table II: N at t = 8.50 h read 3.96 instead of 3.46,
  k_identity_max_rel                     2 row(s); strongest 3.541e+00  &lt;- Table II: N at t = 8.50 h read 3.96 instead of 3.46,
  k_star_printed                         2 row(s); strongest 3.636e-01  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  kstar_ph45_per_h                       2 row(s); strongest 9.000e+00  &lt;- Table III: mid-dot DROPPED in beta at pH 4.5, 0.11 r
  kstar_ph56_per_h                       1 row(s); strongest 2.000e+00  &lt;- Table III: the pH 5.6 stray mark READ AS A MINUS SIG
  kstar_range_ph6_over_ph45              4 row(s); strongest 9.000e+00  &lt;- Table III: mid-dot RELOCATED in alpha at pH 4.5, 3.5
  pfr_boundary_over_last_cell            3 row(s); strongest 5.621e-02  &lt;- Table II: k at t = 13.50 h - the LAST k cell, so the
  pfr_grid_order                         2 row(s); strongest 5.868e-01  &lt;- BOTH orders taken by SELF-CONVERGENCE against the fi
  pfr_outlet_P_ncell3200                 3 row(s); strongest 3.597e-01  &lt;- Table II: the same 0-for-9 substitution ONE ROW EARL
  pfr_richardson_vs_closed_form          1 row(s); strongest 6.676e+01  &lt;- plug flow at ncell = 200 instead of 3200
  printed_alpha_in_se                    5 row(s); strongest 5.512e+00  &lt;- Table III: alpha at pH 6.0 read 2.7 instead of 2.2
  printed_beta_in_se                     5 row(s); strongest 7.383e+00  &lt;- Table III: beta at pH 6.0 read 0.35 instead of 0.55,
  table1_vs_table2_N_max_rel             3 row(s); strongest 2.520e+00  &lt;- Table II: N at t = 8.50 h read 3.96 instead of 3.46,
  table1_vs_table2_N_rms_rel             4 row(s); strongest 1.113e+00  &lt;- Table II: N at t = 8.50 h read 3.96 instead of 3.46,

28 of 28 rows move a reported metric; 235 measured row-metric links.
  the rows split 14 / 14 between MIS-TRANSCRIBING ONE PRINTED CELL and
  CHANGING A METHOD or a resolution, and that split is used below rather than asserted.

DECLARED BLIND SPOT: 0 of the 62 metrics are moved by their strongest
row by LESS than CI's 5% comparison tolerance.  THE SET IS EMPTY: every metric on this page is moved
past 5% by at least one row, and the WEAKEST COVER ON THE PAGE is 5.6207%,
on pfr_boundary_over_last_cell - the one metric that WAS weak, until the row that breaks
it, described below, went into the table above.

WHAT THAT MEANS, AND WHAT IT DOES NOT - computed, not asserted:
  * an earlier version of this page listed 6 weak metrics and said each was "moved by
    more than 5% by a row that changes the method".  That is false by
    construction - WEAK is the MAXIMUM move over ALL rows - and it is RETRACTED.
    Nothing in the table those 6 were measured against moved any of them past
    3.2496%, and 4 of the 6 already had a METHOD-changing row as
    their strongest mover, so the mitigation inverted the causal story as well as
    the arithmetic.
  * THE BLIND SPOT AS THE REVIEW ROWS WENT IN, each line recomputed with the later
    rows REMOVED from the coverage map:
      before either review                6 weak of 62
      + the 2 rows of the first review    1 weak of 62
      + the 2 rows of the second review   0 weak of 62
    So 5 of the 6 left on the first review's two rows and 1 on the second's,
    6 in all - and for ALL 6 of them the strongest mover IS one of those rows.
    NOT ONE left on a row that was already in the table.  A previous version of this
    block said "three of those six": wrong on both halves, and word-spelled, so no
    sweep on this page could have caught it.
      pfr_boundary_over_last_cell         3.2496% -&gt;  5.6207%   a review row
      pfr_grid_order                      3.0938% -&gt; 58.6773%   a review row
      crossover_time_h                    2.6391% -&gt;  6.5301%   a review row
      crossover_time_dNdt_route_h         2.6292% -&gt;  6.4717%   a review row
      batch_marcher_order                 2.4715% -&gt; 58.8393%   a review row
      alpha_given_printed_beta            2.1657% -&gt; 21.1414%   a review row
  * 62 of the 62 metrics ARE moved past 5% by something on this page,
    so CI can see a regression in them.
  * WHY THE SURVIVOR DID NOT SURVIVE: pfr_boundary_over_last_cell is a RATIO of two
    reads of the SAME solve, and they agree to about 1.67% on every grid - 1.016858 1.016749 1.016695 1.016668 1.016655
    over a 16x refinement.  This page used to say that ANY defect changing the
    solution moves BOTH reads and leaves the ratio where it was, so that only
    swapping which read is on top could move it.  THAT IS FALSE AS A UNIVERSAL AND
    THE COUNTEREXAMPLE IS NOW A ROW.  What is true is narrower: a defect acting AWAY
    from the outlet does move both reads together.  The SAME single-digit
    substitution one printed row earlier moves the ratio 0.1466%, and the only
    other row that moves it at all is the read swap itself, at 3.2496%.
    But k at t = 13.50 h is the LAST printed k cell, so it sits in the OUTLET cell,
    and a defect there changes the local gradient - the one quantity the two reads
    differ by.  It moves the ratio 5.6207%, past CI's 5%.  The ratio was never
    structurally protected; it was protected by WHERE this page happened to inject.

THE beta ROW IS ONE INSTANTIATION OF ITS RULE, NOT THE ONLY ONE AND NOT THE LARGEST.
The rule licenses the same 5-for-3 on either 5 of the printed 0.55, or on both:
  0.55 -&gt; 0.53  crossover_time_h:  0.4769%  crossover_time_dNdt_route_h:  0.4783%  alpha_given_printed_beta:  2.1141%
  0.55 -&gt; 0.35  crossover_time_h:  6.5301%  crossover_time_dNdt_route_h:  6.4717%  alpha_given_printed_beta: 21.1414%
  0.55 -&gt; 0.33  crossover_time_h:  7.5964%  crossover_time_dNdt_route_h:  7.5258%  alpha_given_printed_beta: 23.2556%
  The injected row is the MIDDLE one, which is the opposite of tuning, but the escape
  of the two crossover metrics from the blind spot does depend on the choice.  So the
  row rests on being a single-digit transcription defect on the ONE Table III cell
  this page rests on; the text-layer story is quoted as a KIND of mis-read this
  document makes, and the paper's own instance (pH 5.4 read as 3.4, book p. 406)
  corrupts the digit BEFORE the mid-dot, which in 0.55 is the zero - so no
  instantiation is its exact analogue.

weakest cover on the page: 5.6207% on pfr_boundary_over_last_cell

below CI's ABS_FLOOR = 1e-12: 0 metric(s).  Named with an above-floor companion:
  above  crossover_two_routes_rel           = 2.450e-05   companion crossover_time_h = 10.1027

6 quantities computed a second way:
  2.683e-03   alpha, eq.(3) OLS vs the integral form (no differentiated column)
  3.633e-02   beta,  eq.(3) OLS vs the integral form
  1.020e-02   alpha, eq.(3) OLS vs eq.(2) OLS (N^2 weighting)
  2.450e-05   crossover time, k column vs dN/dt and N columns
  6.647e-03   batch P(t_end), pymrm marcher vs closed form
  2.224e-05   plug-flow P_out, Richardson vs closed form

Agreement metrics for J4.4-luedeking-piret:
  alpha_refit_eq3                         = 2.2666
  beta_refit_eq3                          = 0.52868
  eq3_refit_rms                           = 0.10079
  eq3_R2                                  = 0.93744
  alpha_se_eq3                            = 0.13093
  beta_se_eq3                             = 0.049837
  alpha_beta_corr_eq3                     = -0.8919
  alpha_refit_eq3_vs_printed              = 0.030256
  beta_refit_eq3_vs_printed               = -0.038757
  printed_alpha_in_se                     = 0.50839
  printed_beta_in_se                      = 0.42771
  beta_given_printed_alpha                = 0.55128
  alpha_given_printed_beta                = 2.2166
  eq3_printed_pair_rms                    = 0.10145
  eq3_printed_pair_rms_penalty            = 0.0065211
  alpha_refit_eq2                         = 2.2899
  beta_refit_eq2                          = 0.51012
  eq2_refit_rms                           = 0.323
  eq2_null_growth_only_rms                = 1.7927
  eq2_null_density_only_rms               = 1.5878
  eq2_null_growth_only_ratio              = 5.55
  eq2_null_density_only_ratio             = 4.9158
  eq2_logphase_refit_rms                  = 0.10216
  eq2_logphase_null_growth_only_ratio     = 1.036
  eq2_logphase_null_density_only_ratio    = 1.0332
  eq2_outside_log_refit_rms               = 0.44743
  eq2_outside_log_null_growth_only_ratio  = 5.0119
  eq2_outside_log_null_density_only_ratio = 3.7082
  alpha_refit_integral                    = 2.2727
  beta_refit_integral                     = 0.51015
  integral_refit_rms                      = 0.15377
  integral_null_growth_only_ratio         = 14.242
  integral_null_density_only_ratio        = 17.794
  P_curve_rms_rel                         = 0.016979
  P_curve_max_rel                         = 0.038359
  P_final_vs_printed                      = 0.031167
  k_star_printed                          = 0.25
  crossover_time_h                        = 10.103
  crossover_time_dNdt_route_h             = 10.103
  growth_assoc_share                      = 0.46693
  integrated_closure_rel                  = 0.017273
  k_identity_max_rel                      = 0.027356
  invN_identity_max_rel                   = 0.01841
  table1_vs_table2_N_max_rel              = 0.033774
  table1_vs_table2_N_rms_rel              = 0.012495
  beta_range_ph6_over_ph45                = 5
  alpha_range_ph45_over_ph6               = 1.6136
  kstar_range_ph6_over_ph45               = 8.0682
  kstar_ph45_per_h                        = 0.030986
  kstar_ph56_per_h                        = 0.22273
  beta_monotone_margin                    = 0.03
  beta_sum_all_ph                         = 1.87
  digit_substitution_detection            = 0.8737
  batch_marcher_order                     = 1.0081
  batch_marcher_finest_rel                = 0.0066473
  pfr_grid_order                          = 1.0043
  pfr_outlet_P_ncell3200                  = 45.491
  pfr_richardson_vs_closed_form           = 2.224e-05
  pfr_boundary_over_last_cell             = 1.0167
  closed_form_P_final                     = 45.322
  closed_form_N_final                     = 9.6878
  crossover_two_routes_rel                = 2.4504e-05</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="15">
<pre><code>{'page': 'J4.4-luedeking-piret',
 'metrics': {'alpha_refit_eq3': 2.266562459014257,
  'beta_refit_eq3': 0.5286838633464783,
  'eq3_refit_rms': 0.10079229645369017,
  'eq3_R2': 0.9374392698851622,
  'alpha_se_eq3': 0.13092784705466373,
  'beta_se_eq3': 0.04983730744626089,
  'alpha_beta_corr_eq3': -0.8919021984281227,
  'alpha_refit_eq3_vs_printed': 0.03025566318829842,
  'beta_refit_eq3_vs_printed': -0.03875661209731218,
  'printed_alpha_in_se': 0.5083903883828939,
  'printed_beta_in_se': 0.4277144522004267,
  'beta_given_printed_alpha': 0.5512818181818182,
  'alpha_given_printed_beta': 2.2166161745924633,
  'eq3_printed_pair_rms': 0.10144957547292331,
  'eq3_printed_pair_rms_penalty': 0.006521123561612052,
  'alpha_refit_eq2': 2.289913060249211,
  'beta_refit_eq2': 0.5101174086190821,
  'eq2_refit_rms': 0.32300377894286736,
  'eq2_null_growth_only_rms': 1.7926614601592492,
  'eq2_null_density_only_rms': 1.5878141525349339,
  'eq2_null_growth_only_ratio': 5.549970548413719,
  'eq2_null_density_only_ratio': 4.9157757773966635,
  'eq2_logphase_refit_rms': 0.10215501374994357,
  'eq2_logphase_null_growth_only_ratio': 1.036042034585876,
  'eq2_logphase_null_density_only_ratio': 1.0331965393532425,
  'eq2_outside_log_refit_rms': 0.4474255232549434,
  'eq2_outside_log_null_growth_only_ratio': 5.011873183256333,
  'eq2_outside_log_null_density_only_ratio': 3.708246438382261,
  'alpha_refit_integral': 2.2726599980629043,
  'beta_refit_integral': 0.5101496820785338,
  'integral_refit_rms': 0.15376889558359727,
  'integral_null_growth_only_ratio': 14.24162832213242,
  'integral_null_density_only_ratio': 17.79399911516525,
  'P_curve_rms_rel': 0.01697922151025022,
  'P_curve_max_rel': 0.03835942622950839,
  'P_final_vs_printed': 0.031167244033872388,
  'k_star_printed': 0.25,
  'crossover_time_h': 10.102704423976958,
  'crossover_time_dNdt_route_h': 10.10295198561339,
  'growth_assoc_share': 0.4669289631029462,
  'integrated_closure_rel': 0.01727309190923698,
  'k_identity_max_rel': 0.027355623100303816,
  'invN_identity_max_rel': 0.018409714061888183,
  'table1_vs_table2_N_max_rel': 0.033774074074073956,
  'table1_vs_table2_N_rms_rel': 0.012495235900000401,
  'beta_range_ph6_over_ph45': 5.0,
  'alpha_range_ph45_over_ph6': 1.6136363636363635,
  'kstar_range_ph6_over_ph45': 8.068181818181818,
  'kstar_ph45_per_h': 0.030985915492957747,
  'kstar_ph56_per_h': 0.22272727272727272,
  'beta_monotone_margin': 0.030000000000000013,
  'beta_sum_all_ph': 1.8700000000000003,
  'digit_substitution_detection': 0.8736998514115899,
  'batch_marcher_order': 1.0080715033106198,
  'batch_marcher_finest_rel': 0.006647274302019834,
  'pfr_grid_order': 1.0043127341537246,
  'pfr_outlet_P_ncell3200': 45.490543201946736,
  'pfr_richardson_vs_closed_form': 2.2239563444381716e-05,
  'pfr_boundary_over_last_cell': 1.0166551979550138,
  'closed_form_P_final': 45.322206094044084,
  'closed_form_N_final': 9.687771692759386,
  'crossover_two_routes_rel': 2.4503891217553253e-05}}</code></pre>
</div>
</div>
<div id="7bd90d6f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-14T09:30:44.747691Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-14T09:30:44.747553Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-14T09:30:44.808302Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-14T09:30:44.807535Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------------------- prose sweep</span></span>
<span id="cb31-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number written in the markdown of this notebook, in meta.yaml, in</span></span>
<span id="cb31-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># README.md and in models_entry.yaml is checked here against the live</span></span>
<span id="cb31-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># computation.  The notebook FAILS TO EXECUTE if any of them drifts.</span></span>
<span id="cb31-5">CLAIMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb31-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha refit, eq. (3)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.266562</span>, ALPHA_A, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta refit, eq. (3)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.528684</span>, BETA_A, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha refit vs printed"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.030256</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_refit_eq3_vs_printed"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta refit vs printed"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.038757</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_refit_eq3_vs_printed"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-10">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha refit, eq. (2)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.289913</span>, ALPHA_B, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta refit, eq. (2)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.510117</span>, BETA_B, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-12">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha refit, integral form"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.272660</span>, ALPHA_C, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta refit, integral form"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.510150</span>, BETA_C, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha standard error"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.130928</span>, SE_ALPHA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta standard error"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.049837</span>, SE_BETA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed alpha, in se"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.508390</span>, SE_ALPHA_DIST, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed beta, in se"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.427714</span>, SE_BETA_DIST, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"corr(alpha, beta)"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.891902</span>, CORR_AB, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta given printed alpha"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.551282</span>, BETA_GIVEN_ALPHA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha given printed beta"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.216616</span>, ALPHA_GIVEN_BETA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms penalty of the printed pair"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.006521</span>, RMS_PENALTY, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3) rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.100792</span>, RMS_A, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3) R2"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.937439</span>, R2_A, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (2) rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.323004</span>, RMS_B, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral form rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.153769</span>, RMS_C, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread over the three routes, alpha"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.010302</span>, ALPHA_SPREAD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread over the three routes, beta"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.036396</span>, BETA_SPREAD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null growth-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.549971</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_null_growth_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null density-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.915776</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_null_density_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log-phase null growth-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.036042</span>,</span>
<span id="cb31-31">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_logphase_null_growth_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log-phase null density-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.033197</span>,</span>
<span id="cb31-33">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_logphase_null_density_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outside-log null growth-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.011873</span>,</span>
<span id="cb31-35">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_outside_log_null_growth_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-36">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outside-log null density-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.708246</span>,</span>
<span id="cb31-37">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_outside_log_null_density_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-38">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log-phase two-term rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.102155</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_logphase_refit_rms"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-39">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outside-log two-term rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.447426</span>,</span>
<span id="cb31-40">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_outside_log_refit_rms"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-41">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log-phase k plateau spread"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.043478</span>, K_PLATEAU_SPREAD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-42">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover, linear-interpolant band"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001621</span>, T_CROSS_INTERP_BAND, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-43">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow order by self-convergence"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.593616</span>, PFR_ORDER_SELF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-44">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch order by self-convergence"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.601213</span>, MARCH_ORDER_SELF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-45">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral null growth-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">14.241628</span>,</span>
<span id="cb31-46">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral_null_growth_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-47">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral null density-only ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">17.793999</span>,</span>
<span id="cb31-48">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integral_null_density_only_ratio"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-49">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P curve rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.016979</span>, CURVE_RMS, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-50">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P curve max"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.038359</span>, CURVE_MAX, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-51">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P final predicted"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.649542</span>, P_FINAL_PRED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-52">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P final vs printed"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.031167</span>, P_FINAL_REL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-53">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k identity max"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.027356</span>, K_IDENT_MAX, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-54">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invN identity max"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.018410</span>, Q_IDENT_MAX, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-55">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digit detection fraction"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.873700</span>, DIGIT_FRAC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-56">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I vs II, max"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.033774</span>, X_TABLE_MAX, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-57">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I vs II, rms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.012495</span>, X_TABLE_RMS, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-58">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k star printed"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, K_STAR_PRINTED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb31-59">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k star refitted"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.233254</span>, K_STAR_REFIT, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-60">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover time, k column"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.102704</span>, T_CROSS_K, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-61">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover time, dN/dt and N columns"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.102952</span>, T_CROSS_D, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-62">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover, two routes"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.450e-05</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_two_routes_rel"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-9</span>),</span>
<span id="cb31-63">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover as a fraction of the window"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.728216</span>, T_CROSS_FRAC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-64">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growth-associated share"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.466929</span>, GA_SHARE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-65">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integrated closure"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.017273</span>, CLOSURE_REL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-66">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta range"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta_range_ph6_over_ph45"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>),</span>
<span id="cb31-67">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha range"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.613636</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_range_ph45_over_ph6"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-68">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar range"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.068182</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar_range_ph6_over_ph45"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-69">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar at pH 4.5"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.030986</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar_ph45_per_h"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-70">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar at pH 5.6"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.222727</span>, METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kstar_ph56_per_h"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-71">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed-form N at 13.5 h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.687772</span>, N_REF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-72">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed-form P at 13.5 h"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">45.322206</span>, P_REF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-73">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch marcher order"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.008072</span>, MARCH_ORDER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-74">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch marcher finest"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.006647</span>, MARCH_FINEST, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-75">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr grid order"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.004313</span>, PFR_ORDER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-76">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr outlet, ncell 3200"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">45.490543</span>, PFR_P_FINEST, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-77">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr Richardson vs closed form"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.224e-05</span>, PFR_P_RICH_REL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-8</span>),</span>
<span id="cb31-78">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary over last-cell, finest"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.016655</span>, PFR_BOUNDARY_OVER_CENTRE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-79">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N span down Table II"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">78.333333</span>, N_SPAN, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-80">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover time, strongest break-row move"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.065301</span>,</span>
<span id="cb31-81">     STRONGEST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossover_time_h"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-82">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE COUNTS THE METADATA WRITES OUT.  A count in README.md or meta.yaml is</span></span>
<span id="cb31-83">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a hand-typed number in a file no computation can rewrite, so each one that</span></span>
<span id="cb31-84">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># matters is pinned here against the live value - including the SMALL ones,</span></span>
<span id="cb31-85">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which the integer sweep below cannot see (its class is digit strings of</span></span>
<span id="cb31-86">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two or more digits, and a count written as a word or as "5" is outside</span></span>
<span id="cb31-87">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it).  The wrong count this replaces - "three of those six" - was exactly</span></span>
<span id="cb31-88">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># that, on three surfaces at once.</span></span>
<span id="cb31-89">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break rows"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, N_BREAK_ROWS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-90">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that move something"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, N_MOVING_ROWS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-91">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row-metric links"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">235</span>, N_LINKS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-92">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that mis-transcribe one printed cell"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, N_CELL_ROWS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-93">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that change a method or a resolution"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, N_METHOD_ROWS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-94">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weak metrics now"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-95">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weak metrics before the review rows"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, N_WEAK_BEFORE, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-96">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of those, left on the first review's two rows"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, N_LEFT_FIRST_WAVE, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-97">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of those, left in all"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, N_LEFT, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-98">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of those, left because of a review row"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, N_LEFT_VIA_REVIEW, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb31-99">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weakest cover before the review rows"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.032496</span>,</span>
<span id="cb31-100">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(WEAK_BEFORE_REVIEW.values()), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-101">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weakest cover on the page now"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.056207</span>, WEAKEST_COVER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-102">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the outlet-cell k row, on the boundary/last-cell ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.056207</span>,</span>
<span id="cb31-103">     _ratio_out, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb31-104">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same substitution one row earlier, on that ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001466</span>,</span>
<span id="cb31-105">     _ratio_in, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb31-106">]</span>
<span id="cb31-107"></span>
<span id="cb31-108">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(n, w, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLAIMS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> t]</span>
<span id="cb31-109"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> bad, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PROSE DRIFT:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(</span>
<span id="cb31-110">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: page says </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, live value </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> bad)</span>
<span id="cb31-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLAIMS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose/metadata values checked against the live"</span></span>
<span id="cb31-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" computation: all agree."</span>)</span>
<span id="cb31-113"></span>
<span id="cb31-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- mechanical sweep of the metadata FILES AND THIS NOTEBOOK'S OWN PROSE ---</span></span>
<span id="cb31-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># TWO token classes are swept, because the first version of this sweep caught</span></span>
<span id="cb31-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only one and both of the page's factual errors came through the gap:</span></span>
<span id="cb31-117"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   DECIMALS, five or more places - the original sweep.  Five rather than four</span></span>
<span id="cb31-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     excludes the DOI (10.1002/...) without an exception list.</span></span>
<span id="cb31-119"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   INTEGERS of two or more digits - added after a review found "167 row-metric</span></span>
<span id="cb31-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     links" on three surfaces while the notebook printed 176, and "29 rows"</span></span>
<span id="cb31-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     stated for a CSV whose next cell printed 30.  EVERY COUNT ON THIS PAGE IS</span></span>
<span id="cb31-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     AN INTEGER, and the decimal sweep could not see a single one of them.</span></span>
<span id="cb31-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The notebook's own markdown is swept too, for the same reason: "29 rows" was</span></span>
<span id="cb31-124"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># written there, not in the metadata, so the file list did not cover it.</span></span>
<span id="cb31-125"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb31-126"></span>
<span id="cb31-127">LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.values())</span>
<span id="cb31-128">LIVE.update([ALPHA_A, BETA_A, ALPHA_B, BETA_B, ALPHA_C, BETA_C, SE_ALPHA,</span>
<span id="cb31-129">             SE_BETA, SE_ALPHA_DIST, SE_BETA_DIST, CORR_AB, BETA_GIVEN_ALPHA,</span>
<span id="cb31-130">             ALPHA_GIVEN_BETA, BETA_GIVEN_ALPHA_REL, ALPHA_GIVEN_BETA_REL,</span>
<span id="cb31-131">             RMS_A, RMS_B, RMS_C, RMS_PRINTED, RMS_PENALTY, R2_A, R2_B,</span>
<span id="cb31-132">             R2_A_ONLY, R2_B_ONLY, A_ONLY, B_ONLY, A_ONLY_INT, B_ONLY_INT,</span>
<span id="cb31-133">             RMS_A_ONLY, RMS_B_ONLY, RMS_A_ONLY_INT, RMS_B_ONLY_INT,</span>
<span id="cb31-134">             CURVE_RMS, CURVE_MAX, CURVE_RMS_REFIT, CURVE_MAX_REFIT,</span>
<span id="cb31-135">             P_FINAL_PRED, P_FINAL_REL, K_IDENT_MAX, K_IDENT_MEAN, Q_IDENT_MAX,</span>
<span id="cb31-136">             DIGIT_FRAC, X_TABLE_MAX, X_TABLE_RMS, X_TABLE_LIN_MAX,</span>
<span id="cb31-137">             K_STAR_PRINTED, K_STAR_REFIT, T_CROSS_K, T_CROSS_D, T_CROSS_FRAC,</span>
<span id="cb31-138">             GA, NG, GA_SHARE, TOT_MODEL, TOT_OBS, CLOSURE_REL, N_REF, P_REF,</span>
<span id="cb31-139">             MARCH_ORDER, MARCH_FINEST, PFR_ORDER, PFR_P_RICH, PFR_P_RICH_REL,</span>
<span id="cb31-140">             PFR_P_FINEST, PFR_CENTRE_ORDER, PFR_BOUNDARY_OVER_CENTRE,</span>
<span id="cb31-141">             PFR_BOUNDARY_OVER_CENTRE_COARSE,</span>
<span id="cb31-142">             ALPHA_SPREAD, BETA_SPREAD, A_REL_A, B_REL_A, A_REL_B, B_REL_B,</span>
<span id="cb31-143">             A_REL_C, B_REL_C, GAIN_A_ONLY, GAIN_B_ONLY, GAIN_A_ONLY_INT,</span>
<span id="cb31-144">             GAIN_B_ONLY_INT])</span>
<span id="cb31-145">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ERR] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ORDERS])</span>
<span id="cb31-146">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_ERR] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_ORDERS])</span>
<span id="cb31-147">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_CENTRE_ERR]</span>
<span id="cb31-148">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PFR_CENTRE_ORDERS])</span>
<span id="cb31-149">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T3S.k_star_per_h])</span>
<span id="cb31-150">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> g.values()])</span>
<span id="cb31-151">LIVE.update([K_PLATEAU_SPREAD, K_PLATEAU_LO, K_PLATEAU_HI, RMS2_LOG, RMS2_OUT,</span>
<span id="cb31-152">             GAIN_A_LOG, GAIN_B_LOG, GAIN_A_OUT, GAIN_B_OUT, ALPHA_LOG, BETA_LOG,</span>
<span id="cb31-153">             T_CROSS_K_LIN, T_CROSS_INTERP_BAND, PFR_ORDER_SELF,</span>
<span id="cb31-154">             MARCH_ORDER_SELF, N_SPAN, K_GAP_LO])</span>
<span id="cb31-155"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the MEASURED MOVES themselves are quoted in prose, so they are live values too</span></span>
<span id="cb31-156">LIVE.update([mv <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rows <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, mv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows])</span>
<span id="cb31-157">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(LIVE)])          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># signs are written as words</span></span>
<span id="cb31-158">LIVE.update([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(LIVE)])         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># percentages</span></span>
<span id="cb31-159">LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(x)}</span>
<span id="cb31-160"></span>
<span id="cb31-161"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># EVERY COUNT THE COMPUTATION PRODUCES.  An integer token in the prose must be</span></span>
<span id="cb31-162"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one of these or one of the pinned source-derived integers below.</span></span>
<span id="cb31-163">LIVE_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T2), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T3), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_k), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_q), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_n2), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_f2),</span>
<span id="cb31-164">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_f3), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_fp), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kk), N_FIT3, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(_m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()),</span>
<span id="cb31-165">            DIGIT_TOTAL, DIGIT_CAUGHT, DIGIT_TOTAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DIGIT_CAUGHT,</span>
<span id="cb31-166">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS), N_LINKS, N_MOVING_ROWS, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK),</span>
<span id="cb31-167">            N_CELL_ROWS, N_METHOD_ROWS, N_WEAK_BEFORE, N_LEFT,</span>
<span id="cb31-168">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES), N_ALL, N_LOG, N_OUT, N_OUT_EARLY, ALPHA_FLAT_N,</span>
<span id="cb31-169">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLAIMS), N_BELOW_FLOOR, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CI_REL_TOL)),</span>
<span id="cb31-170">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T3S), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(NUM_ROWS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(N_SPAN)}</span>
<span id="cb31-171">LIVE_INT.update(MARCH_NT)</span>
<span id="cb31-172">LIVE_INT.update(PFR_N)</span>
<span id="cb31-173"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">globals</span>().get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J41"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb31-174">    LIVE_INT.add(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(J41))</span>
<span id="cb31-175"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A MEASURED MOVE written as a whole-number percentage - "2800 %" - is the same</span></span>
<span id="cb31-176"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claim as the float 28.0 and must be checkable as one.  ONLY the break-row</span></span>
<span id="cb31-177"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># moves are admitted this way, and only when they are exact integers: taking</span></span>
<span id="cb31-178"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 100x of every live value would license hundreds of spurious integers.  (It</span></span>
<span id="cb31-179"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># did, in the first draft of this sweep: a corrupted beta_sum_all_ph of 1.67</span></span>
<span id="cb31-180"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># licensed the token 167, which is precisely the wrong count this sweep exists</span></span>
<span id="cb31-181"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to catch.  The assertion at the end of the cell now checks that it does not.)</span></span>
<span id="cb31-182">LIVE_INT.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rows <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values()</span>
<span id="cb31-183">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, mv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mv)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb31-184"></span>
<span id="cb31-185"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE DIGITS OF A PRINTED TABLE CELL.  Mid-dot decimals lose their point when a</span></span>
<span id="cb31-186"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># token is read out of prose - "0.46" leaves "46", "4.5" leaves "45" - so every</span></span>
<span id="cb31-187"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed cell of the three CSVs is admitted at 1x, 10x and 100x.  This set is</span></span>
<span id="cb31-188"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># derived from the loaded data, not typed: it moves when the transcription does.</span></span>
<span id="cb31-189">TABLE_INTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>()</span>
<span id="cb31-190"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _df <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (T1, T2, T3):</span>
<span id="cb31-191">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.asarray(_df.to_numpy(), dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).ravel():</span>
<span id="cb31-192">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(_v):</span>
<span id="cb31-193">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb31-194">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (_v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_v):</span>
<span id="cb31-195">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e8</span>:</span>
<span id="cb31-196">                TABLE_INTS.add(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_s)))</span>
<span id="cb31-197"></span>
<span id="cb31-198"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># INTEGERS QUOTED ONLY IN ORDER TO BE RETRACTED.  This page names the wrong</span></span>
<span id="cb31-199"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># numbers a review found in it, so the wrong numbers are in its prose on</span></span>
<span id="cb31-200"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># purpose; they are pinned here so that naming them cannot be confused with</span></span>
<span id="cb31-201"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claiming them.</span></span>
<span id="cb31-202">RETRACTED_INTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">37</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">167</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">176</span>}</span>
<span id="cb31-203"></span>
<span id="cb31-204"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># VALUES THIS PAGE INJECTS AS DEFECTS and quotes when describing the break row.</span></span>
<span id="cb31-205">INJECTED_INTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">35</span>}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Table III, pH 6.0 beta read 0.35 instead of 0.55</span></span>
<span id="cb31-206"></span>
<span id="cb31-207"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># INTEGERS THIS PAGE READS OFF THE SOURCE DOCUMENT OR ITS OWN PROVENANCE.  The</span></span>
<span id="cb31-208"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sweep CANNOT check these - they come from page images and file metadata, not</span></span>
<span id="cb31-209"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from the computation - so they are pinned by value and named, and the teeth</span></span>
<span id="cb31-210"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># measurement below reports honestly how much that costs.</span></span>
<span id="cb31-211">SOURCE_INTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb31-212">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1959</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">393</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">412</span>,                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># year and page range of the article</span></span>
<span id="cb31-213">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">398</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">401</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">402</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">406</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">407</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">408</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">409</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">410</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">411</span>,   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># book pages cited</span></span>
<span id="cb31-214">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">125</span>,                               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the U.O.D. definition, N = 0.125 r</span></span>
<span id="cb31-215">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">111</span>,                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the text layer's "Table 11" / "Table 111"</span></span>
<span id="cb31-216">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PDF page numbers and grep line context</span></span>
<span id="cb31-217">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">150</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>,                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># render/native ppi</span></span>
<span id="cb31-218">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">450</span>,                               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 150,000,000-450,000,000 cells per U.O.D.</span></span>
<span id="cb31-219">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2026</span>,                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dates in the provenance notes</span></span>
<span id="cb31-220">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">885270</span>,                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bytes of the PDF</span></span>
<span id="cb31-221">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>,                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># area of the page's one true hyphen</span></span>
<span id="cb31-222">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1023</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1026</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">545</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">547</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1030</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1044</span>,  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pixel bounds of the mark and the zero</span></span>
<span id="cb31-223">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">43</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span>,                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 43.3 mg/ml, 45 C, 96 per cent recoveries</span></span>
<span id="cb31-224">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">49</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">55</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>,                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mid-dot table values: 0.49, 0.55, ...</span></span>
<span id="cb31-225">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">75</span>,                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 75 per cent transmission</span></span>
<span id="cb31-226">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>,                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 16x grid refinement span</span></span>
<span id="cb31-227">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">392</span>,                               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># book page = PDF page + 392</span></span>
<span id="cb31-228">}</span>
<span id="cb31-229"></span>
<span id="cb31-230"></span>
<span id="cb31-231"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _int_tokens(text):</span>
<span id="cb31-232">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Integers of 2+ digits, standing alone, no leading zero.</span></span>
<span id="cb31-233"></span>
<span id="cb31-234"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    A leading zero never marks a count on this page - it marks a date field</span></span>
<span id="cb31-235"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    (2026-08-02) or a thousands group (150,000,000) - so those are skipped</span></span>
<span id="cb31-236"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    rather than mis-parsed, and the skip is counted and reported.</span></span>
<span id="cb31-237"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb31-238">    out, skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb31-239">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INT_TOKEN.findall(text):</span>
<span id="cb31-240">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>):</span>
<span id="cb31-241">            skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb31-242">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb31-243">        out.append(t)</span>
<span id="cb31-244">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out, skipped</span>
<span id="cb31-245"></span>
<span id="cb31-246"></span>
<span id="cb31-247">TOKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\.</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{5,}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-248">INT_TOKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{2,}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-249">FILES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"meta.yaml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"README.md"</span>,</span>
<span id="cb31-250">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/luedeking1959-table1-bacterial-density.meta.yaml"</span>,</span>
<span id="cb31-251">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/luedeking1959-table2-growth-acid.meta.yaml"</span>,</span>
<span id="cb31-252">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/luedeking1959-table3-alpha-beta-vs-ph.meta.yaml"</span>,</span>
<span id="cb31-253">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../models_entry.yaml"</span>,</span>
<span id="cb31-254">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index.ipynb"</span>]                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># markdown cells only; see _read_swept</span></span>
<span id="cb31-255"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE TOKEN COUNTS ARE SHAPE-DEPENDENT AND BOTH SHAPES ARE PINNED.</span></span>
<span id="cb31-256"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># integrate_case.py copies `page/` only and splices `models_entry.yaml` into the</span></span>
<span id="cb31-257"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># repository's models.yaml, so that file is swept HERE, in the queue tree, and is</span></span>
<span id="cb31-258"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># absent - and counted as absent - in the published page.  On Colab neither the</span></span>
<span id="cb31-259"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metadata nor the notebook file is reachable.  Quoting one count in the metadata</span></span>
<span id="cb31-260"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># while the shipped page printed the other is exactly the drift this exists to</span></span>
<span id="cb31-261"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># catch.</span></span>
<span id="cb31-262">SWEEP_TOKENS_BY_SHAPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">57</span>}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 5+-decimal tokens</span></span>
<span id="cb31-263">SWEEP_INTS_BY_SHAPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">517</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">470</span>}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2+-digit integer tokens</span></span>
<span id="cb31-264"></span>
<span id="cb31-265"></span>
<span id="cb31-266"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _read_swept(fn):</span>
<span id="cb31-267">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Text of a swept file - for the notebook, its MARKDOWN cells only.</span></span>
<span id="cb31-268"></span>
<span id="cb31-269"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Sweeping the notebook's code would sweep grid sizes and solver tolerances,</span></span>
<span id="cb31-270"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    which are code and not claims; its markdown is prose about the results and</span></span>
<span id="cb31-271"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    is exactly where an untested count can hide.</span></span>
<span id="cb31-272"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb31-273">    txt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path(fn).read_text(encoding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utf-8"</span>)</span>
<span id="cb31-274">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> fn.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".ipynb"</span>):</span>
<span id="cb31-275">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"source"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> json.loads(txt)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells"</span>]</span>
<span id="cb31-276">                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell_type"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"markdown"</span>)</span>
<span id="cb31-277">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> txt</span>
<span id="cb31-278"></span>
<span id="cb31-279"></span>
<span id="cb31-280"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _half_ulp(tok):</span>
<span id="cb31-281">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tok.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb31-282"></span>
<span id="cb31-283"></span>
<span id="cb31-284"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _matches(tok):</span>
<span id="cb31-285">    v, h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tok), _half_ulp(tok)</span>
<span id="cb31-286">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE)</span>
<span id="cb31-287"></span>
<span id="cb31-288"></span>
<span id="cb31-289"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _int_matches(tok):</span>
<span id="cb31-290">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(tok)</span>
<span id="cb31-291">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE_INT <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLE_INTS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SOURCE_INTS</span>
<span id="cb31-292">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RETRACTED_INTS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INJECTED_INTS)</span>
<span id="cb31-293"></span>
<span id="cb31-294"></span>
<span id="cb31-295">tokens, unmatched, rejected, corrupted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb31-296">ints, int_unmatched, int_rejected, int_live, int_skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb31-297"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES:</span>
<span id="cb31-298">    fp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path(fn)</span>
<span id="cb31-299">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> fp.is_file():</span>
<span id="cb31-300">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (skipped, not present next to the notebook: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb31-301">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb31-302">    text <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _read_swept(fn)</span>
<span id="cb31-303">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TOKEN.findall(text):</span>
<span id="cb31-304">        tokens.append((fn, t))</span>
<span id="cb31-305">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matches(t):</span>
<span id="cb31-306">            unmatched.append((fn, t))</span>
<span id="cb31-307">        bad_tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb31-308">        corrupted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb31-309">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matches(bad_tok):</span>
<span id="cb31-310">            rejected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb31-311">    got, skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _int_tokens(text)</span>
<span id="cb31-312">    int_skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> skipped</span>
<span id="cb31-313">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got:</span>
<span id="cb31-314">        ints.append((fn, t))</span>
<span id="cb31-315">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _int_matches(t):</span>
<span id="cb31-316">            int_unmatched.append((fn, t))</span>
<span id="cb31-317">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE_INT <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLE_INTS:</span>
<span id="cb31-318">            int_live <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb31-319">        bad_tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb31-320">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _int_matches(bad_tok):</span>
<span id="cb31-321">            int_rejected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb31-322">found, found_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tokens), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ints)</span>
<span id="cb31-323">n_files <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>([f <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Path(f).is_file()])</span>
<span id="cb31-324"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> unmatched, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metadata numbers with no live counterpart: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>unmatched<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-325"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> int_unmatched, (</span>
<span id="cb31-326">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"integer counts with no live and no pinned-source counterpart:"</span></span>
<span id="cb31-327">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(t <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> int_unmatched))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in"</span></span>
<span id="cb31-328">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(f <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> int_unmatched))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-329">_pin, _pin_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (SWEEP_TOKENS_BY_SHAPE.get(n_files),</span>
<span id="cb31-330">                  SWEEP_INTS_BY_SHAPE.get(n_files))</span>
<span id="cb31-331"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _pin <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, found), (</span>
<span id="cb31-332">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sweep found </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decimal tokens in the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape, not"</span></span>
<span id="cb31-333">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pin<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pinned for it"</span>)</span>
<span id="cb31-334"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _pin_int <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, found_int), (</span>
<span id="cb31-335">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sweep found </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> integer tokens in the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape,"</span></span>
<span id="cb31-336">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pin_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pinned for it"</span>)</span>
<span id="cb31-337"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _pin <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb31-338">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the counts are shape-dependent and BOTH shapes are pinned:"</span></span>
<span id="cb31-339">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decimal and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_INTS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-340">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" integer tokens</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  across the seven files in the queue tree,"</span></span>
<span id="cb31-341">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_INTS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the"</span></span>
<span id="cb31-342">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" published page, where</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  ../models_entry.yaml has been spliced into"</span></span>
<span id="cb31-343">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" models.yaml; the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape is the one</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  executing here"</span></span>
<span id="cb31-344">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and it is the pair asserted."</span>)</span>
<span id="cb31-345"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mechanical sweep of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FILES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> files"</span></span>
<span id="cb31-346">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (metadata + this notebook's markdown):"</span>)</span>
<span id="cb31-347"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> numbers written to 5+ decimals, all matching a live value to"</span></span>
<span id="cb31-348">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" half an ulp of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  their own printed digits."</span></span>
<span id="cb31-349">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Teeth: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rejected<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>corrupted<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-350">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(corrupted, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) of last-digit corruptions rejected."</span>)</span>
<span id="cb31-351"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> integers of 2+ digits (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_skipped<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> leading-zero tokens"</span></span>
<span id="cb31-352">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" skipped as dates and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  thousands groups):  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_live<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> match a COUNT the"</span></span>
<span id="cb31-353">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" computation produced or a printed table cell; the other"</span></span>
<span id="cb31-354">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> int_live<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  sit in the"</span></span>
<span id="cb31-355">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pinned sets - source-derived constants (book pages, ppi, pixel bounds,"</span></span>
<span id="cb31-356">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the year), the values this page injects as defects, and the wrong"</span></span>
<span id="cb31-357">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" numbers it quotes</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  in order to retract them - none of which any"</span></span>
<span id="cb31-358">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" computation here can check."</span>)</span>
<span id="cb31-359"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ACHIEVED DETECTION RATE, NOT COMPLETENESS: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_rejected<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-360">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(found_int, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) of last-digit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  corruptions of"</span></span>
<span id="cb31-361">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" those integers are rejected.  The rest land on another allowed value -"</span></span>
<span id="cb31-362">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  small counts and source constants are dense - so this sweep RAISES"</span></span>
<span id="cb31-363">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the cost of a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  wrong count, it does not make one impossible.  What it"</span></span>
<span id="cb31-364">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" WOULD have caught, both of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  them real: the metadata's </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">167 row-metric"</span></span>
<span id="cb31-365">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" links</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> while this notebook printed 176</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (it prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LINKS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> now),"</span></span>
<span id="cb31-366">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">29 rows</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> written of a CSV this page loads and whose</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  length is"</span></span>
<span id="cb31-367">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(J41) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">globals</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'J41'</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'unavailable here'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb31-368">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THAT IS CHECKED, NOT CLAIMED:"</span>)</span>
<span id="cb31-369">_would_catch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: (n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE_INT <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLE_INTS</span>
<span id="cb31-370">                    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SOURCE_INTS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INJECTED_INTS)</span>
<span id="cb31-371">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">167</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>)}</span>
<span id="cb31-372"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(_would_catch.values()), (</span>
<span id="cb31-373">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a wrong count this sweep is advertised as catching now matches an allowed"</span></span>
<span id="cb31-374">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" value: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_would_catch<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-375"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _would_catch.items():</span>
<span id="cb31-376">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is rejected by the live and source sets: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>caught<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-377">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (it is allowed only by RETRACTED_INTS, which exists so that naming"</span></span>
<span id="cb31-378">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">         past error is not the same as making one)"</span>)</span>
<span id="cb31-379"></span>
<span id="cb31-380"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># AND WHAT IT CANNOT SEE AT ALL - COUNTED, NOT HEDGED.  The integer class above</span></span>
<span id="cb31-381"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is DIGIT STRINGS OF TWO OR MORE DIGITS.  Two whole classes of count fall</span></span>
<span id="cb31-382"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># outside it: a count SPELLED AS A WORD, and a count written as a SINGLE DIGIT.</span></span>
<span id="cb31-383"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># This is not hypothetical - the most recent factual error found on this page</span></span>
<span id="cb31-384"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># was "THREE of those six were weak", a word-spelled count that was wrong by two</span></span>
<span id="cb31-385"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and sat on three surfaces at once, in prose this sweep reads every time it</span></span>
<span id="cb31-386"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># runs and could not check at any setting.  Bringing word numbers into the</span></span>
<span id="cb31-387"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># matcher was tried and rejected ON MEASUREMENT rather than on taste: the small</span></span>
<span id="cb31-388"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># integers this page legitimately produces are so dense that essentially every</span></span>
<span id="cb31-389"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># such token would match something, and the sweep would then report teeth it</span></span>
<span id="cb31-390"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># does not have.  WHAT PROTECTS THOSE COUNTS INSTEAD IS THE CLAIMS LIST ABOVE -</span></span>
<span id="cb31-391"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every count the metadata states is now checked against the live value there,</span></span>
<span id="cb31-392"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the ones in the retraction block are printed by the computation itself.</span></span>
<span id="cb31-393">WORD_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">-]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">zero</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">one</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">two</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">three</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">four</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">five</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">six</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">seven</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eight"</span></span>
<span id="cb31-394">                      <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">nine</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ten</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eleven</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">twelve</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">thirteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fourteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fifteen"</span></span>
<span id="cb31-395">                      <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">sixteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">seventeen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eighteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">nineteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">twenty</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">-]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb31-396">                      re.IGNORECASE)</span>
<span id="cb31-397">ONE_DIGIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.,]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.,]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-398">n_word <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_one <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb31-399"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES:</span>
<span id="cb31-400">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> Path(fn).is_file():</span>
<span id="cb31-401">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb31-402">    _t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _read_swept(fn)</span>
<span id="cb31-403">    n_word <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WORD_INT.findall(_t))</span>
<span id="cb31-404">    n_one <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONE_DIGIT.findall(_t))</span>
<span id="cb31-405"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  OUTSIDE THE SWEEP ENTIRELY, and counted so that it is not mistaken for"</span></span>
<span id="cb31-406">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" covered:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_word<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> word-spelled small integers and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_one<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-407">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" single-digit numbers stand in the swept</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  prose.  NEITHER TOKEN CLASS"</span></span>
<span id="cb31-408">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" IS CHECKED HERE against anything.  The counts that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  matter are pinned"</span></span>
<span id="cb31-409">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" one by one in CLAIMS above instead - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLAIMS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values, including"</span></span>
<span id="cb31-410">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  every count this page's metadata states about its own break table -"</span></span>
<span id="cb31-411">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  blind-spot block prints its counts from the coverage map"</span></span>
<span id="cb31-412">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rather than writing them."</span>)</span>
<span id="cb31-413"></span>
<span id="cb31-414"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># structural assertions, asserted rather than asserted-by-eye</span></span>
<span id="cb31-415"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> SE_ALPHA_DIST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> SE_BETA_DIST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, (</span>
<span id="cb31-416">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed pair is no longer inside one standard error of the refit"</span>)</span>
<span id="cb31-417"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> RMS_PENALTY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed pair no longer sits on the fit ridge"</span></span>
<span id="cb31-418"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> GAIN_A_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> GAIN_B_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a one-term null now fits as well"</span></span>
<span id="cb31-419"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> T_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> T_CROSS_K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> T_HI</span>
<span id="cb31-420"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> PFR_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span></span>
<span id="cb31-421"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> PFR_BOUNDARY_OVER_CENTRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, (</span>
<span id="cb31-422">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the boundary read is no longer the LESS accurate of the two, which is the"</span></span>
<span id="cb31-423">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" measured claim this page makes against the standing advice"</span>)</span>
<span id="cb31-424"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural assertions: all pass."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>82 prose/metadata values checked against the live computation: all agree.
  (skipped, not present next to the notebook: ../models_entry.yaml)
  the counts are shape-dependent and BOTH shapes are pinned: 80 decimal and 517 integer tokens
  across the seven files in the queue tree, 57 and 470 in the published page, where
  ../models_entry.yaml has been spliced into models.yaml; the 6-file shape is the one
  executing here and it is the pair asserted.
mechanical sweep of 6 of the 7 files (metadata + this notebook's markdown):
  57 numbers written to 5+ decimals, all matching a live value to half an ulp of
  their own printed digits.  Teeth: 57/57 (100.0%) of last-digit corruptions rejected.
  470 integers of 2+ digits (26 leading-zero tokens skipped as dates and
  thousands groups):  324 match a COUNT the computation produced or a printed table cell; the other 146
  sit in the pinned sets - source-derived constants (book pages, ppi, pixel bounds,
  the year), the values this page injects as defects, and the wrong numbers it quotes
  in order to retract them - none of which any computation here can check.
  ACHIEVED DETECTION RATE, NOT COMPLETENESS: 202/470 (43.0%) of last-digit
  corruptions of those integers are rejected.  The rest land on another allowed value -
  small counts and source constants are dense - so this sweep RAISES the cost of a
  wrong count, it does not make one impossible.  What it WOULD have caught, both of
  them real: the metadata's "167 row-metric links" while this notebook printed 176
  (it prints 235 now), and "29 rows" written of a CSV this page loads and whose
  length is 30.  THAT IS CHECKED, NOT CLAIMED:
     167 is rejected by the live and source sets: True  (it is allowed only by RETRACTED_INTS, which exists so that naming a
         past error is not the same as making one)
      29 is rejected by the live and source sets: True  (it is allowed only by RETRACTED_INTS, which exists so that naming a
         past error is not the same as making one)
  OUTSIDE THE SWEEP ENTIRELY, and counted so that it is not mistaken for covered:
  443 word-spelled small integers and 410 single-digit numbers stand in the swept
  prose.  NEITHER TOKEN CLASS IS CHECKED HERE against anything.  The counts that
  matter are pinned one by one in CLAIMS above instead - 82 values, including
  every count this page's metadata states about its own break table - and the
  blind-spot block prints its counts from the coverage map rather than writing them.
structural assertions: all pass.</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Honestly: not much to the <em>fit</em>, and the page says so.</strong> Refitting a two-parameter linear model to 22 printed rows is <code>numpy.linalg.lstsq</code>, and pymrm is not involved in the headline numbers at all. What pymrm adds is downstream of the fit, and it is worth two things.</p>
<p><strong>1. It makes the relation composable.</strong> Eq. (2) is a source term, and once it is written as one it drops into a batch marcher and into a plug-flow fermenter with no change to the kinetics - the same <code>source(c)</code> function serves both, handed to <code>NumJac</code> in the shape whose last axis is the field index. That is the form the Summary’s <em>“rational design of continuous fermentation processes”</em> needs and the paper never writes.</p>
<p><strong>2. It gives the relation a closed form to be checked against, which the fit does not have.</strong> With <img src="https://latex.codecogs.com/png.latex?k(t)"> prescribed, eq. (2) integrates exactly, so both discretisations have an analytic reference - and both come back first order, as backward Euler and donor-cell upwind must. That is the whole of the numerical validation on this page and it is deliberately modest.</p>
<p><strong>What pymrm does <em>not</em> add here, stated plainly:</strong> no new physics, no extension of the model to conditions the paper did not measure, and no resolution of the five pH levels whose data are not printed. The plug-flow result is an illustration of composability, not a prediction anyone has tested.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>Fit <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> in the variables you will report them in, and say which.</strong> Eq. (3) and eq. (2) are the same model, but least squares on them are two different fits - the second is the first weighted by <img src="https://latex.codecogs.com/png.latex?N%5E2">, and <img src="https://latex.codecogs.com/png.latex?N"> spans a factor of 78 down this run. Here that is worth 1.0 % on <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and 3.6 % on <img src="https://latex.codecogs.com/png.latex?%5Cbeta">: small, but larger than the difference between this page’s fit and the authors’ straight edge.</p>
<p><strong>Quote the pair, not the constants.</strong> <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> come out of this fit anticorrelated at <img src="https://latex.codecogs.com/png.latex?-0.89">. A refit that lands 3 % high on <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and 4 % low on <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> has not disagreed with anything: hold <img src="https://latex.codecogs.com/png.latex?%5Calpha"> at the other value and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> returns to within 0.23 %, and the two pairs differ by 0.65 % in residual. <strong>Report <img src="https://latex.codecogs.com/png.latex?k%5E%7B*%7D%20=%20%5Cbeta/%5Calpha"> alongside them</strong> - it is the combination that is actually well determined, it has physical meaning (the specific growth rate at which the two mechanisms contribute equally), and the paper’s own qualitative account of the fermentation is a statement about it.</p>
<p><strong>A two-term product law is not decoration.</strong> Against its own two one-term degenerate cases, each fitted with its own best constant, the two-term form is <strong>5.5x</strong> and <strong>4.9x</strong> better in rms on the rate data and <strong>14x</strong> and <strong>18x</strong> better on the integrated acid curve. Over a whole batch the two terms contribute <strong>46.7 %</strong> and <strong>53.3 %</strong> of the acid - neither is a correction to the other, even though each dominates one half of the run.</p>
<p><strong>Before you trust a printed rate column, check it against the columns it was divided by.</strong> Table II’s <img src="https://latex.codecogs.com/png.latex?k"> and <img src="https://latex.codecogs.com/png.latex?(1/N)(%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt)"> are quotients of its other columns by the paper’s own definition, and testing that caught <strong>87.4 %</strong> of all single-digit substitutions in this transcription. Where a table offers no such identity - Table III offers none at all - say so, and do not pretend a pixel argument is an arithmetic one.</p>
<p><strong>And the scope lesson, which is the transferable one.</strong> This paper’s headline claim is that <img src="https://latex.codecogs.com/png.latex?%5Calpha"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta"> depend on pH, and it prints six pairs to support it. <strong>Six fitted constants are six outputs of a test, not the test</strong>: the form is tested by the linearity of <img src="https://latex.codecogs.com/png.latex?(1/N)(%5Cmathrm%7Bd%7DP/%5Cmathrm%7Bd%7Dt)"> against <img src="https://latex.codecogs.com/png.latex?k">, and the paper prints those points for exactly one of the six levels. When a source gives you fitted parameters at <img src="https://latex.codecogs.com/png.latex?n"> conditions and raw data at one, what you can check is one condition. Check that one properly and scope the rest out; do not digitise the figure to manufacture the other five.</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier2</category>
  <category>phase:liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.4-luedeking-piret/</guid>
  <pubDate>Fri, 14 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The gel effect without a switch: Chiu, Carratt and Soong’s diffusion-controlled termination</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J5.3-chiu-gel-effect/</link>
  <description><![CDATA[ 




<section id="the-gel-effect-without-a-switch" class="level1">
<h1>The gel effect without a switch</h1>
<p><strong>Catalog ID:</strong> <code>J5.3</code> · <strong>Structures:</strong> <code>S1</code> · <strong>Tier:</strong> T0</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>The source is on disk and all ten of its pages were read at the file’s native resolution:</p>
<blockquote class="blockquote">
<p><strong>Chiu, W. Y.</strong>, <strong>Carratt, G. M.</strong> and <strong>Soong, D. S.</strong>, <em>A Computer Model for the Gel Effect in Free-Radical Polymerization</em>, <strong>Macromolecules 16</strong>(3), 348-357 (1983), doi:<code>10.1021/ma00237a002</code>.</p>
</blockquote>
<p>Identity was confirmed from the document’s own title block on a 300 ppi render - the title, the by-line <em>“Wen Yen Chiu, Gregory M. Carratt, and David S. Soong”</em>, the department line <em>“Department of Chemical Engineering, University of California, Berkeley, California 94720”</em>, <em>“Received July 1, 1982”</em> and the running head <em>“Macromolecules 1983, 16, 348-357”</em>. <code>pdfimages -list</code> reports every page as CCITT-G4 bilevel at 300x300 ppi, so 300 ppi is native and rendering higher would be interpolation.</p>
<section id="the-file-straddles-three-articles-at-both-ends" class="level3">
<h3 class="anchored" data-anchor-id="the-file-straddles-three-articles-at-both-ends">The file straddles three articles, at both ends</h3>
<p><strong>PDF page 1 opens with the References and Notes of the PRECEDING article</strong> - a Zambelli stereochemistry paper, references 1-28 - and Chiu et al.&nbsp;begin below them, halfway down the page. <strong>PDF page 10 opens the NEXT article</strong>: the running head there reads <em>“Macromolecules 1983, 16, 357-359”</em> and the title is <em>“Radical Reactions of Highly Polar Molecules. Hydrocarbons as Chain-Transfer Agents in Fluoro Olefin Telomerizations”</em> by Leonard O. Moore. That article has a <strong>Table I of its own</strong>, about the chain length of normal alkanes, so a search for “Table” over the whole file conflates two papers.</p>
<p>Every numeral used on this page was therefore located twice: first on a page whose running head reads <em>“Gel Effect in Free-Radical Polymerization”</em> or <em>“Chiu, Carratt, and Soong”</em>, and then on a crop of that page enlarged to digit scale. <strong>Chiu’s own tables are Table I on book p.&nbsp;352 and Table II on book p.&nbsp;353</strong>, both inside PDF pages 1-9.</p>
</section>
<section id="what-the-paper-prints-in-numerals-and-what-it-does-not" class="level3">
<h3 class="anchored" data-anchor-id="what-the-paper-prints-in-numerals-and-what-it-does-not">What the paper prints in numerals, and what it does not</h3>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>where</th>
<th>what</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Table I</td>
<td>book p.&nbsp;352 (PDF 5)</td>
<td><em>“Numerical Values of Parameters Used in Model Calculation”</em> - eight lines of constants, attributed by its own heading to refs 6 and 7</td>
</tr>
<tr class="even">
<td>Table II</td>
<td>book p.&nbsp;353 (PDF 6)</td>
<td><em>“Model Parameters Used in Fitting Experimental Data”</em> - six rows of the four fitted parameters</td>
</tr>
<tr class="odd">
<td>running text</td>
<td>book pp.&nbsp;354-356</td>
<td>six stated numerical results about the model’s own output</td>
</tr>
<tr class="even">
<td>Figures 3-9</td>
<td>book pp.&nbsp;352-354</td>
<td>the <strong>experimental data</strong>, Marten &amp; Hamielec’s, plotted against the model’s curves</td>
</tr>
</tbody>
</table>
<p><strong>The comparison with experiment lives only in the figures, so that half of the case is out of scope and no curve is digitised.</strong> The paper reports no measurement of its own: reference 7, Marten, F. L. &amp; Hamielec, A. E., <em>ACS Symp. Ser.</em> <strong>1979</strong>, No.&nbsp;104, 43, supplies the conversion and molecular-weight data, and none of it is tabulated here. The page therefore establishes nothing about this model’s empirical adequacy, and says so wherever that matters.</p>
<p><strong>What is left is worth more than it sounds.</strong> Table II’s parameters were <em>fitted</em> to those figures - the table says so in its title - so anything computed from them and compared with the paper is a <strong>consistency check on the authors’ own fit and on this page’s transcription, never a validation against nature</strong>. But the paper also states six numerical results about its own output, prints two correlations that its own tables must satisfy, and makes two structural claims about the model that are checkable without any data at all. Those are what this page tests.</p>
<div id="89528a5e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:29.023022Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:29.022788Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:29.425869Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:29.425203Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-2">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb1-4">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm</span></code></pre></div></div>
</div>
</section>
<section id="what-this-page-finds" class="level3">
<h3 class="anchored" data-anchor-id="what-this-page-finds">What this page finds</h3>
<p><strong>The paper’s own onset construction, reconstructed and computed.</strong> Book p.&nbsp;354 defines the onset of the gel effect as the intersection of a line extrapolated from <em>“the sloped region”</em> of the <code>log k_t</code> curve with <em>“the initial value”</em>, and states the answers: <em>“This intersection occurs around a conversion level of 0.26 for 50 °C, 0.35 for 70 °C, and 0.45 for 90 °C.”</em> Reconstructed as a least-squares line over the decades <code>L_0-2</code> to <code>L_0-4</code> and extrapolated to <code>L_0 = log10 k_t^0</code>, the model gives <strong>0.25516, 0.34838 and 0.44034</strong> - all three low, by 0.00484, 0.00162 and <strong>0.00966</strong> at worst, with the increase with temperature reproduced.</p>
<p><strong>Those are at <code>I_0 = 0.0258</code> mol/L, and the choice is stated rather than implied.</strong> The paper quotes <strong>one</strong> onset per temperature; Figures 10-12 plot <strong>both</strong> loadings and the sentence names neither. 0.0258 is the loading listed first in all three legends and the one Figures 16-18 plot, and that is the whole basis for the choice - the paper gives no other. <strong>The same construction on the 0.01548 curve of the same figures misses by up to 0.03126</strong>, 3.24 times the headline miss, and the page prints both columns beside each other.</p>
<p><strong>The construction is a graphical one described in words, so its definitional band matters more than its precision.</strong> Seven defensible readings - six of <em>“the sloped region”</em> (four decade windows and two tangents) and one of <em>“the initial value”</em> - spread the answer by up to <strong>0.09009</strong>, <strong>9.33 times</strong> the largest miss. <strong>That band is a spread over seven readings and not a bound over every reading of the sentence</strong>: the most literal reading of all, the tangent at the steepest point of the descent, gives 0.44783, 0.47680 and 0.51866 and lies outside it. It is excluded for a measured reason, printed with the number - its tangent point sits at <code>x = 0.86</code>, the right edge of <em>this page’s</em> window, at all six conditions, so that reading is set by where the curve is truncated rather than by the curve.</p>
<p><strong>One reading is kept out and the exclusion is measured, so the same measurement has to be applied to every reading the band keeps in.</strong> The 4-6-decade window is the widest-swinging of the seven - 0.29957, 0.41999 and 0.49516 - and leaving it out was therefore the flattering choice; the notebook applies the truncation test to it and it passes, its fit mask ending inside <code>x = 0.86</code> at four of the six conditions, including the condition at which the reported band is widest. It is in the band because the page cannot exclude it on a measurement, which is the only ground on which anything here is excluded.</p>
<p><strong>Two arithmetic floors, neither of which is what limits the number.</strong> The resampling grid moves the onsets by <strong>1.311e-05</strong> relative - the sixth decimal of every onset here is grid noise, which is why five are quoted - and a completely independent integration reproduces them to <strong>below 1e-10</strong> relative, round-off whose exact digits differ from machine to machine. That second number prices the <em>attractor</em>, not the integration: <code>lambda_0(x)</code> sits on a strongly attracting manifold, so two parametrisations of the same equations land on the same <code>log k_t(x)</code> however they got there. Both floors are orders of magnitude inside the definitional band, and the page says so rather than quoting the digits the fit returns.</p>
<p><strong>Two of the paper’s own correlations, recomputed from its own Table II.</strong> Figure 13’s Arrhenius plots give <strong>34.908161 and 34.516600 kcal/mol</strong> for <code>theta_t</code> at the two initiator loadings against the printed <strong>34</strong> (+2.67 % and +1.52 %, mean 34.712380, +2.10 %), and <strong>27.771564</strong> for <code>theta_p</code> against the printed <strong>28</strong> (-0.82 %). Figure 15’s <em>“All three points fall on the same straight line”</em> holds to <strong>8.819e-04</strong> relative - against <strong>1.535e-02</strong> for the same three points fitted linearly in <code>T</code> instead, <strong>17.4057x</strong> worse, and the two forms are not nested, so the direction of that ratio is evidence and not algebra. The <code>T_gp</code> that would make the three <code>A</code> values exactly collinear is <strong>111.42857 °C</strong> against Table I’s printed 114, but the printed rounding of <code>A</code> alone admits <strong>[102.2222, 128.0000] °C</strong>, so the three cells cannot distinguish them and the page reports the interval rather than the point. The exponent the same three cells pick out at the printed <code>T_gp</code> is <strong>2.0659</strong>.</p>
<p><strong>And the 17.4057x is the gain at one admissible <code>T_gp</code>, not a property of the data - so what the comparison establishes is concavity in <code>T</code>, not the Fujita/glass-transition form.</strong> The same gain is <strong>3.6124x</strong> and <strong>3.5347x</strong> at the two ends of that interval and <em>diverges</em> at 111.42857 °C, where the three points are exactly collinear by construction. And the quadratic is not singled out: <code>A</code> against <code>1/T</code> beats linear-in-<code>T</code> by <strong>5.5926x</strong> and <code>A</code> against <code>(T - 130)^2</code> by <strong>3.2607x</strong>, both two-parameter, neither nested. With three points and one residual degree of freedom, what every one of them is reading is that <code>A</code> is <strong>concave</strong> in <code>T</code> - the three values are equally spaced in <code>T</code> and their second difference is <strong>-0.007000</strong> - which linear-in-<code>T</code> cannot represent and any sufficiently curved regressor can. The page claims the concavity.</p>
<p><strong>“Only a small number of adjustable parameters” - counted, then exercised.</strong> The paper names four (<code>theta_t</code>, <code>theta_p</code>, <code>A</code>, <code>B</code>); Table II fits <strong>13 distinct numbers</strong> across <strong>6 conditions</strong>, 2.1667 per condition. Its own Figures 13 and 15 compress those 13 to <strong>8</strong> - and the compression reproduces <code>A</code> to 0.0882 %, <code>theta_p</code> to 8.3695 % but <code>theta_t</code> only to <strong>18.8281 %</strong>, which moves the onset conversion by <strong>0.01633</strong>, <strong>1.691 times</strong> the distance by which this page’s reconstruction misses the printed onsets. So <em>“Figures 13 and 15 provide an effective means to estimate all the model parameters”</em> is true as a procedure and lossy as an identity, and the loss sits in <code>theta_t</code>.</p>
<p><strong>“In a somewhat ad hoc fashion” - the criticism holds, and here is the measurement.</strong> Eq. 31 and 32 carry no branch: <code>k_t</code> and <code>k_p</code> are smooth in <code>x</code> everywhere, and the implementation contains no conditional except the one that builds the counterfactual. The nearest thing to an onset knob is <code>theta_t</code>, and it moves the onset by <strong>-0.21735 per decade</strong>; a prescribed critical conversion moves it by 1.0 per unit of itself, by construction, so it takes <strong>4.601 decades</strong> of <code>theta_t</code> to buy one unit of onset. And the counterfactual settles the paper’s own argument on book p.&nbsp;353: the same model switched on at <code>x_c = 0.3</code> is <strong>concave down over 100 % of its pre-switch portion</strong> (largest <code>d2x/dt2</code> there, <code>-1.391e-06</code>) and jumps <strong>0.760194</strong> of a decade in <code>log k_t</code> at the switch - both factors of that expression evaluated at <code>x_c</code> exactly, the radical concentration root-found on the dense solution rather than read off the nearest grid point - while the published model is concave <em>up</em> from <code>x = 0.30643</code> to the sharp rise, with every onset inside that window; the smallest margin is <strong>0.129</strong>. <strong>One qualification the paper does not make</strong>: the published model’s conversion curve is concave <em>down</em> below that lower bound - initiator depletion, before diffusion limitation takes over - so “concave upward preceding the sharp rise” is true of the region the paper means and not of the whole pre-gel curve.</p>
<p><strong>The quasi-steady-state assumption, measured at all six conditions instead of one.</strong> Book p.&nbsp;356: <em>“The QSSA solution overestimates the radical concentration by more than a factor of 2.”</em> At the condition Figures 16-18 plot - 50 °C, <code>I_0 = 0.0258</code> - it is <strong>3.5176x</strong>, and the conversion history nevertheless differs by at most <strong>0.038611</strong> in <code>x</code>, which is the paper’s <em>“surprisingly consistent”</em>. Across all six conditions the factor runs 1.4889 to 4.8466 and <strong>exceeds 2 at three of them and fails at three</strong>; it falls with temperature and rises as the initiator loading falls. The paper states it for the one condition it plots and claims no more, and this page measures the other five.</p>
<p><strong>Five identities proved rather than asserted.</strong> Eq. 24 and eq. 26 are re-derived symbolically from eq. 21 with the paper’s own boundary conditions and come out <strong>exactly zero</strong>; eq. 22’s <em>“Since <code>r_D &gt;&gt; r_m</code>”</em> is shown to cost <strong>exactly <code>r_m/r_D</code></strong>, symbolically and then a second time <strong>through the flux a pymrm spherical-shell BVP actually computes</strong> - <code>4 pi r^2 D dC/dr</code> read off the solved profile, which lands on <code>r_m/r_D</code> to <strong>1.858e-05</strong> over five ratios at <code>n = 6400</code> and converges onto it at observed order <strong>1.8953</strong>; and the moment equations 12-17 reproduce eq. 4a, 4b and 5 summed over a seeded finite population to a relative residual <strong>below 1e-14</strong>, both with <code>k_tc = 0</code> and with a non-zero <code>k_tc</code> that no printed condition exercises.</p>
<p><strong>And one thing the model does that the paper’s prose does not mention.</strong> <em>“The limiting conversion at long times is lowest at 50 °C and gradually increases with the polymerization temperature”</em> is reproduced as an <strong>ordering</strong> - 0.95535, 0.98173, 0.99289 at a stated rate threshold, smallest gap 0.011165 - but <strong>this model has no limiting conversion in the mathematical sense</strong>: as <code>x -&gt; 1</code> the Fujita-Doolittle factor returns to 1, <code>1/k_p -&gt; 1/k_p^0 + theta_p lambda_0</code> stays finite, and <code>dx/dt</code> vanishes only through <code>(1-x)</code>. Integrated far enough every condition creeps on, to 0.97897, 0.99850 and 0.99998 at the horizons used here and still rising. The plateau in Figures 3-5 is where the curve stops being drawn.</p>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p><strong>Mechanism and balances (eq. 1-9).</strong> Initiation <code>I -&gt; 2R</code>, <code>R + M -&gt; P_1</code>; propagation <code>P_n + M -&gt; P_{n+1}</code>; termination by combination <code>P_n + P_m -&gt; M_{n+m}</code> (rate constant <code>k_tc</code>) and by disproportionation <code>P_n + P_m -&gt; M_n + M_m</code> (<code>k_td</code>), with <code>k_t = k_tc + k_td</code>. The species balances are written per unit volume of a batch whose volume contracts with conversion, <code>V = V_0 (1 + eps x)</code> with <code>eps = (d_m - d_p)/d_p</code> (eq. 6), and the chain-length distributions are reduced by the method of moments, <code>lambda_k = sum n^k P_n</code> for the growing radicals and <code>mu_k = sum n^k M_n</code> for the dead polymer (eq. 8-9).</p>
<p><strong>The eight equations this page integrates (eq. 10-18).</strong> In the paper’s own form, with the quasi-steady-state assumption applied to the PRIMARY radical <code>R</code> only (eq. 18, <code>k_i R M = 2 f k_d I</code>) and <em>not</em> to the polymer radicals:</p>
<pre><code>dI/dt      = -k_d I - [eps I/(1+eps x)] lambda_0 (1-x) k_p                (10)
dx/dt      =  k_p (1-x) lambda_0                                          (11)
dlambda_0/dt = -[eps lambda_0/(1+eps x)] lambda_0 (1-x) k_p
               + 2 f k_d I - k_t lambda_0^2                               (12)
dlambda_1/dt = ... + 2 f k_d I - k_t lambda_0 lambda_1
               + k_p lambda_0 M_0 (1-x)/(1+eps x)                         (13)
dlambda_2/dt = ... + 2 f k_d I - k_t lambda_0 lambda_2
               + k_p M_0 (1-x)/(1+eps x) (2 lambda_1 + lambda_0)          (14)
dmu_0/dt   = ... + k_td lambda_0^2 + (1/2) k_tc lambda_0^2                (15)
dmu_1/dt   = ... + k_td lambda_0 lambda_1 + k_tc lambda_0 lambda_1        (16)
dmu_2/dt   = ... + k_td lambda_0 lambda_2
               + k_tc (lambda_2 lambda_0 + lambda_1^2)                    (17)</code></pre>
<p>with <code>I = I_0</code> and <code>x = lambda_k = mu_k = 0</code> at <code>t = 0</code>, and average molecular weights from eq. 19 and 20, which <strong>keep the growing-radical moments</strong>: <code>Mn = (mu_1 + lambda_1)/(mu_0 + lambda_0)</code>, <code>Mw = (mu_2 + lambda_2)/(mu_1 + lambda_1)</code>.</p>
<p><strong>The constitutive part, which is what the paper is about (eq. 21-32).</strong> A radical pair terminates only after one radical migrates to within <code>r_m</code> of the other. Between <code>r_m</code> and a far radius <code>r_D</code> the migration is a steady spherical diffusion problem,</p>
<pre><code>4 pi r^2 D dC/dr = K,     C(r_m) = C_m,  C(r_D) = C_b                     (21)</code></pre>
<p>whose first integral, with <code>r_D &gt;&gt; r_m</code>, is eq. 22, and which balanced against the consumption inside <code>r_m</code> (eq. 23) gives eq. 24, eq. 25 and finally</p>
<pre><code>1/k_t = 1/k_t^0 + r_m^2 C_b/(3 D)                                         (26)</code></pre>
<p><strong>a series of a reaction resistance and a mass-transfer resistance, with no switch anywhere.</strong> Splitting <code>D</code> into a front factor and a conversion-dependent part, <code>D = D_0 f(x)</code>, and calling <code>theta_t = r_m^2/(3 D_0)</code> gives eq. 27; the same argument applied to monomer diffusion to the radical end gives eq. 28 for <code>k_p</code>; and the Fujita-Doolittle free-volume form (eq. 29) with the monomer volume fraction of eq. 30 closes both:</p>
<pre><code>1/k_t = 1/k_t^0(T) + theta_t(T, I_0) P / exp[2.3 phi_m/(A(T) + B phi_m)]  (31)
1/k_p = 1/k_p^0(T) + theta_p(T)      P / exp[2.3 phi_m/(A(T) + B phi_m)]  (32)</code></pre>
<p>where <code>P = lambda_0</code> and <code>phi_m = (1-x)/(1+eps x)</code>. <strong>Eq. 31 and 32 are the whole model of the gel and glass effects, and they carry no branch, no critical conversion and no conditional of any kind.</strong> That is the paper’s central claim and this page checks it as a claim, not as a slogan.</p>
<section id="the-two-claims-of-the-papers-own-framing-which-this-page-tests" class="level3">
<h3 class="anchored" data-anchor-id="the-two-claims-of-the-papers-own-framing-which-this-page-tests">The two claims of the paper’s own framing, which this page tests</h3>
<p><strong>On parameter count</strong>, book p.&nbsp;349:</p>
<blockquote class="blockquote">
<p><em>“In order for the model to be useful in process simulation and design calculation, it must quantitatively predict experimental data obtained under well-controlled conditions while requiring only a small number of adjustable parameters.”</em></p>
</blockquote>
<p><strong>On the alternative treatments</strong>, book p.&nbsp;351:</p>
<blockquote class="blockquote">
<p><em>“The second difficulty with the conventional modeling approach is associated with the somewhat artificial introduction of a sudden onset of diffusion influence on <code>k_t</code>. In other words, <code>k_t</code> remains constant until either the concentration or some sort of combination of concentration and molecular weight (of the dead polymer) reaches a prescribed critical value, whereupon <code>k_t</code> becomes proportional to the diffusion coefficient. This creates an adjustable parameter to determine when the gel effect computation is switched on - in a somewhat ad hoc fashion.”</em></p>
</blockquote>
<p>Both are checkable. The first by counting the fitted numbers and then exercising the paper’s own compression of them; the second by asking what in <em>this</em> model plays the part a critical conversion plays in the others, and measuring how directly it sets the answer.</p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Everything numerical comes from the two tables, parsed out of CSVs rather than retyped in a cell.</strong> Table I is not this paper’s measurement: its own heading carries the reference marks 6,7, so the constants are Schmidt &amp; Ray’s and Marten &amp; Hamielec’s. Neither of those is on disk, so nothing here is traced past this table and both are recorded as origins not consulted.</p>
<p><strong>One input is a reconstruction and it is labelled one everywhere.</strong> The moment equations 13, 14, 16 and 17 need the initial monomer concentration <code>M_0 = d_m/MW</code>, and <strong>the molar mass of methyl methacrylate is printed nowhere in the paper</strong>. The paper prints the monomer density line and, on book p.&nbsp;356, the Registry No.&nbsp;80-62-6; <code>MW = 100.117 g/mol</code> follows from C5H8O2 and standard atomic weights. <strong>It cannot touch any headline on this page</strong>, and the notebook demonstrates that rather than asserting it: doubling <code>MW</code> moves the conversion history by less than 1e-10 and <code>lambda_0</code> by less than 1e-9 relative - both solver noise - and <code>mu_1</code> by 0.499939, exactly the factor it should. Eq. 10, 11 and 12 contain no <code>M_0</code> at all, so <code>x(t)</code>, <code>lambda_0</code>, <code>k_t</code>, <code>k_p</code> and every onset number are independent of it; only the molecular weights are not.</p>
<p><strong>Two printed features of Table I are reported and not repaired.</strong></p>
<ul>
<li><strong><code>k_d</code> is printed with the units <code>L/min</code></strong> although eq. 1, <code>(1/V) d(IV)/dt = -k_d I</code>, makes it a first-order constant whose units are <code>1/min</code>. The CSV carries the printed string; the page uses <code>1/min</code> and labels that an inference from eq. 1.</li>
<li><strong><code>k_tc = 0</code></strong>, <em>“[termination by disproportionation only]”</em>. That is the authors’ choice and it makes part of their own published model inert: every <code>k_tc</code> term in eq. 5, 15, 16 and 17 is unexercised by any condition the paper reports. The paper states the consequence itself on book p.&nbsp;352 - <em>“Note that termination by recombination is ignored in the calculation, so the molecular weight predictions will be underestimated”</em> - and this page exercises those terms once, in the moment identity, with a <code>k_tc</code> that is printed nowhere.</li>
</ul>
<p><strong>And one arithmetic check settles the transcription of Table I.</strong> Evaluated at the three temperatures, the printed constants give <code>log10 k_t^0</code> = 9.2952, 9.3229, 9.3475 and <code>log10 k_p^0</code> = 4.5256, 4.6972, 4.8499, and Figures 10, 11 and 12 plot exactly those two quantities against conversion on an axis labelled 0 to 12, with the plateaux at about 9.3 and about 4.5. <strong>That is a corroboration of the transcription and not a data source</strong>: no value read off any figure enters a CSV, a fit or a metric anywhere on this page.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Three CSVs, all transcription of printed numerals, <strong>provenance tier 6</strong> - the paper’s own tabulated values and stated results, nothing digitised:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>dataset</th>
<th>rows</th>
<th>what</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>chiu1983-table1-rate-constants</code></td>
<td>8</td>
<td>Table I, parsed into <code>kind</code>/<code>a</code>/<code>b</code> plus the line as printed</td>
</tr>
<tr class="even">
<td><code>chiu1983-table2-model-parameters</code></td>
<td>6</td>
<td>Table II, <code>(T, I_0, theta_t, theta_p, A, B)</code></td>
</tr>
<tr class="odd">
<td><code>chiu1983-stated-results</code></td>
<td>6</td>
<td>the six numerical results the running text and Figure 13’s caption state, each with the sentence it was read from</td>
</tr>
</tbody>
</table>
<p><strong>FIT, NOT TEST, and the page says so at every use.</strong> Table II’s title is <em>“Model Parameters Used in Fitting Experimental Data”</em> and Figure 13’s caption repeats it - <em>“Model parameters theta_t and theta_p chosen for the best fit of experimental data”</em>. So <code>theta_t</code>, <code>theta_p</code> and <code>A</code> were chosen to make the model match Figures 3-9, and every number this page computes from them is a <strong>consistency check on that fit and on this transcription</strong>. The stated results are the model’s own output, so reproducing them is <strong>reproduction, not validation</strong>. Nothing on this page is a comparison with a measurement, because every measurement in this paper is a marker on a figure.</p>
<p><strong>A printed discrepancy in the initiator loading, reported and not repaired.</strong> Table II’s lower loading is <code>0.01548</code> mol/L, and so are the legends of Figures 4, 5 and 8 and the captions of Figures 6 and 8. <strong>The legend of Figure 3 prints <code>0.01584</code></strong> - the last two digits transposed - read at 3x on the 300 ppi bilevel image, where the glyphs are unambiguous. Five printings against one make <code>0.01548</code> the value the CSV carries, and the odd one out is recorded rather than corrected. Nothing on the page depends on which is right: Table II is what the model is run from.</p>
<p><strong>One typographical defect elsewhere, quoted verbatim.</strong> Book p.&nbsp;353 reads <em>“The presence model, however, successfully correlates Mw and Mn at various conversion levels with temperature and initiator loading”</em> [sic] - <em>presence</em> for <em>present</em>. Reported, not repaired, and nothing depends on it.</p>
<div id="336bbd37" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:29.428491Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:29.428237Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:29.871062Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:29.870020Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> json</span>
<span id="cb6-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb6-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys</span>
<span id="cb6-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb6-5"></span>
<span id="cb6-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb6-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb6-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb6-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_ivp</span>
<span id="cb6-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.interpolate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> CubicSpline</span>
<span id="cb6-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb6-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse.linalg <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> spsolve</span>
<span id="cb6-13"></span>
<span id="cb6-14"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> NumJac, construct_div, construct_grad, newton</span>
<span id="cb6-15"></span>
<span id="cb6-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gallery_utils: from the checkout when there is one, from raw GitHub on Colab</span></span>
<span id="cb6-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb6-18">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb6-19">    urllib.request.urlretrieve(</span>
<span id="cb6-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb6-21">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb6-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb6-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents):</span>
<span id="cb6-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb6-25">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))</span>
<span id="cb6-26">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb6-27"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, cite_data, load_data, load_meta, parse_literal</span>
<span id="cb6-28"></span>
<span id="cb6-29">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J5.3-chiu-gel-effect"</span></span>
<span id="cb6-30">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb6-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, assigned in fixed order and never cycled</span></span>
<span id="cb6-32">C_BLUE, C_ORANGE, C_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span></span>
<span id="cb6-33">C_PURPLE, C_YELLOW, C_GREY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span></span>
<span id="cb6-34"></span>
<span id="cb6-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: nothing on this page is stochastic.  No sampling, no bootstrap,</span></span>
<span id="cb6-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># no random initial guess and no continuation chain - every integration starts</span></span>
<span id="cb6-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from the same t = 0 state, so no answer can depend on a sweep order.  The one</span></span>
<span id="cb6-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pseudo-random object on the page is the test population of the moment-closure</span></span>
<span id="cb6-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># identity, and it is drawn from a SEEDED generator.</span></span>
<span id="cb6-40">SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19830348</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># volume and first page of the article</span></span>
<span id="cb6-41"></span>
<span id="cb6-42">T1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chiu1983-table1-rate-constants.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb6-43">T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chiu1983-table2-model-parameters.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb6-44">TS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chiu1983-stated-results.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb6-45"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chiu1983-table1-rate-constants.csv"</span>,</span>
<span id="cb6-46">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chiu1983-table2-model-parameters.csv"</span>,</span>
<span id="cb6-47">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chiu1983-stated-results.csv"</span>):</span>
<span id="cb6-48">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(_n, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb6-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table I  : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed lines"</span>)</span>
<span id="cb6-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table II : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>polym_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>nunique()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> temperatures,"</span></span>
<span id="cb6-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>initiator_loading_mol_per_L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>nunique()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> initiator loadings"</span>)</span>
<span id="cb6-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"stated   : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> numerical results quoted in text or captions"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Chiu, W. Y.; Carratt, G. M.; Soong, D. S. (1983) — "A Computer Model for the Gel Effect in Free-Radical Polymerization", Macromolecules 16(3) 348-357 (1983), Department of Chemical Engineering, University of California, Berkeley, California 94720
 — doi:10.1021/ma00237a002 — transcription
Chiu, W. Y.; Carratt, G. M.; Soong, D. S. (1983) — "A Computer Model for the Gel Effect in Free-Radical Polymerization", Macromolecules 16(3) 348-357 (1983)
 — doi:10.1021/ma00237a002 — transcription
Chiu, W. Y.; Carratt, G. M.; Soong, D. S. (1983) — "A Computer Model for the Gel Effect in Free-Radical Polymerization", Macromolecules 16(3) 348-357 (1983)
 — doi:10.1021/ma00237a002 — transcription

Table I  : 8 printed lines
Table II : 6 rows, 3 temperatures, 2 initiator loadings
stated   : 6 numerical results quoted in text or captions</code></pre>
</div>
</div>
<div id="ddc91108" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:29.873045Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:29.872834Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:29.881458Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:29.880701Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Table I, parsed from the CSV.  No constant is retyped in a cell. -------</span></span>
<span id="cb8-2">R_CAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.987</span>                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the gas constant Table I itself writes into k_t0</span></span>
<span id="cb8-3">_t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"symbol"</span>)</span>
<span id="cb8-4"></span>
<span id="cb8-5"></span>
<span id="cb8-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _row(sym):</span>
<span id="cb8-7">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _t1.loc[sym]</span>
<span id="cb8-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(r.kind), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.a), (np.nan <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pd.isna(r.b) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.b))</span>
<span id="cb8-9"></span>
<span id="cb8-10"></span>
<span id="cb8-11">F_EFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb8-12">KD_A, KD_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_d"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_d"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-13">KT0_A, KT0_E <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_t0"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_t0"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-14">KP0_A, KP0_E <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_p0"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_p0"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-15">KTC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_tc"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb8-16">D_POLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb8-17">DM_A, DM_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_m"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_m"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb8-18">T_GP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_gp"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb8-19"></span>
<span id="cb8-20"></span>
<span id="cb8-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> k_d(T):</span>
<span id="cb8-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""1/min.  Table I prints the units as L/min; eq. 1 makes it first order."""</span></span>
<span id="cb8-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> KD_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>KD_B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T)</span>
<span id="cb8-24"></span>
<span id="cb8-25"></span>
<span id="cb8-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> k_t0(T):</span>
<span id="cb8-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> KT0_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>KT0_E<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(R_CAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T))</span>
<span id="cb8-28"></span>
<span id="cb8-29"></span>
<span id="cb8-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> k_p0(T):</span>
<span id="cb8-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> KP0_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>KP0_E<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(R_CAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T))</span>
<span id="cb8-32"></span>
<span id="cb8-33"></span>
<span id="cb8-34"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> d_m(T):</span>
<span id="cb8-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> DM_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DM_B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.0</span>)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 273, not 273.15, as printed</span></span>
<span id="cb8-36"></span>
<span id="cb8-37"></span>
<span id="cb8-38">MW_MMA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.117</span>              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RECONSTRUCTION - see the note below</span></span>
<span id="cb8-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I as parsed:"</span>)</span>
<span id="cb8-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _t1.index:</span>
<span id="cb8-41">    k, a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _row(s)</span>
<span id="cb8-42">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:24s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;12g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> b = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>isnan(b) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at 50/70/90 degC:"</span>)</span>
<span id="cb8-44"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb8-45">    T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span></span>
<span id="cb8-46">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC: k_d = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_d(T)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/min   log10 k_t0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(k_t0(T))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-47">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   log10 k_p0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(k_p0(T))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   d_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d_m(T)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/cm3"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Table I as parsed:
  f      constant                 a = 0.58         b = 
  k_d    arrhenius_over_T         a = 6.32e+16     b = 15430.0
  k_t0   arrhenius_over_RT        a = 5.88e+09     b = 701.0
  k_p0   arrhenius_over_RT        a = 2.95e+07     b = 4353.0
  k_tc   constant                 a = 0            b = 
  d_p    constant                 a = 1.2          b = 
  d_m    linear_in_T_minus_273    a = 0.973        b = 0.001164
  T_gp   constant                 a = 114          b = 

at 50/70/90 degC:
  50 degC: k_d = 1.158004e-04 1/min   log10 k_t0 = 9.2952   log10 k_p0 = 4.5256   d_m = 0.914625 g/cm3
  70 degC: k_d = 1.872131e-03 1/min   log10 k_t0 = 9.3229   log10 k_p0 = 4.6972   d_m = 0.891345 g/cm3
  90 degC: k_d = 2.227592e-02 1/min   log10 k_t0 = 9.3475   log10 k_p0 = 4.8499   d_m = 0.868065 g/cm3</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p><strong>This is an <code>S1</code> case - an ODE initial-value problem in time, no space - so what pymrm contributes is a solver and a Jacobian, not an operator stack.</strong> Two pieces of pymrm are used and both are exercised with a refinement study under <em>Validation</em>:</p>
<ol type="1">
<li><strong>A backward-Euler marcher on the eight fields</strong> built from <code>newton</code> and <code>NumJac((1, 8))</code>. The shape is <code>(1, 8)</code> and not <code>(8,)</code> deliberately: with a bare 1-D shape the last axis is read as <em>space</em>, the default stencil declares every cell coupled to every other, and the Jacobian comes out dense. Here that is 8x8 either way, but the shape is written the way that generalises. The eight fields are <strong>scaled before marching</strong>, because <code>newton</code> tests the infinity norm of the Newton <em>update</em> and these states span twenty orders of magnitude (<code>lambda_0 ~ 1e-8 mol/L</code> against <code>mu_2 ~ 1e8</code>); one absolute tolerance means nothing across that range and everything in the scaled ones.</li>
<li><strong>The paper’s own eq. 21 as a 1-D spherical BVP</strong>, with <code>construct_grad</code> and <code>construct_div(nu=2)</code> on the shell <code>r_m &lt;= r &lt;= r_D</code> and Dirichlet data at both ends. This is where pymrm buys something the paper does not have: eq. 22 drops the <code>1/r_D</code> term with the words <em>“Since <code>r_D &gt;&gt; r_m</code>”</em>, and solving the shell problem prices that approximation exactly.</li>
</ol>
<p>The physics itself is a plain <code>Chiu</code> class - the eight right-hand sides of eq. 10-17 and the two constitutive equations 31-32 - integrated with <code>BDF</code> for the reference solution, because the system is stiff by four orders of magnitude once the gel effect sets in. <strong>The class contains one <code>if</code>, and it is not in the model</strong>: it selects the <em>counterfactual</em> switched-on variant used to test the paper’s argument in <em>Validation</em>. The published model is the branch-free one.</p>
<div id="ff7c848a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:29.883507Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:29.883327Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:29.898335Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:29.897598Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the published model, eq. 10-18 with the constitutive eq. 31-32 --------</span></span>
<span id="cb10-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Chiu:</span>
<span id="cb10-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One experimental condition of Table II.</span></span>
<span id="cb10-4"></span>
<span id="cb10-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    States, in the order the residual uses them:</span></span>
<span id="cb10-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        I, x, lam0, lam1, lam2, mu0, mu1, mu2</span></span>
<span id="cb10-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    eq. 10-17 verbatim; eq. 18 (the QSSA on the PRIMARY radical R) is already</span></span>
<span id="cb10-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    substituted, which is what turns k_i R M into 2 f k_d I.</span></span>
<span id="cb10-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb10-10"></span>
<span id="cb10-11">    FIELDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu2"</span>)</span>
<span id="cb10-12"></span>
<span id="cb10-13">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, T_C, I0, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, theta_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb10-14">                 ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ln10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span>, switch_xc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb10-15">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2[(T2.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> T_C)</span>
<span id="cb10-16">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(T2.initiator_loading_mol_per_L, I0)]</span>
<span id="cb10-17">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table II has no unique row for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>I0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mol/L"</span></span>
<span id="cb10-18">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb10-19">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T_C, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.I0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T_C), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(I0)</span>
<span id="cb10-20">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span></span>
<span id="cb10-21">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.theta_t_min) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> theta_t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> theta_t</span>
<span id="cb10-22">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.theta_p_min) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> theta_p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> theta_p</span>
<span id="cb10-23">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.A) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> A <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> A</span>
<span id="cb10-24">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.B) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> B <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> B</span>
<span id="cb10-25">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ktc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KTC <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ktc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ktc</span>
<span id="cb10-26">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ln10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ln10                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the 2.3 eq. 31 prints, not ln(10)</span></span>
<span id="cb10-27">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.switch_xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> switch_xc        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># None = the published model, no switch</span></span>
<span id="cb10-28">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kd, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt0, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kp0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k_d(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T), k_t0(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T), k_p0(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T)</span>
<span id="cb10-29">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.dm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d_m(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.T)</span>
<span id="cb10-30">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.dm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D_POLY)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_POLY      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># volume expansion factor</span></span>
<span id="cb10-31">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.M0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.dm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MW_MMA           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># needs the RECONSTRUCTED MW</span></span>
<span id="cb10-32"></span>
<span id="cb10-33">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------ constitutive part</span></span>
<span id="cb10-34">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> phi_m(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, x):</span>
<span id="cb10-35">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eq. 30: volume fraction of monomer."""</span></span>
<span id="cb10-36">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x)</span>
<span id="cb10-37"></span>
<span id="cb10-38">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fujita(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, x):</span>
<span id="cb10-39">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""D/D_0 from eq. 29 as eq. 31/32 write it, exp[2.3 phi_m/(A+B phi_m)]."""</span></span>
<span id="cb10-40">        pm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.phi_m(x)</span>
<span id="cb10-41">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ln10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>pm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>pm))</span>
<span id="cb10-42"></span>
<span id="cb10-43">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> kt_kp(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, x, P):</span>
<span id="cb10-44">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eq. 31 and 32.  NO BRANCH: one expression over the whole range."""</span></span>
<span id="cb10-45">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.fujita(x)</span>
<span id="cb10-46">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.switch_xc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb10-47">            kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>g)</span>
<span id="cb10-48">            kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kp0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>g)</span>
<span id="cb10-49">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kt, kp</span>
<span id="cb10-50">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the COUNTERFACTUAL the paper argues against: constant until x_c</span></span>
<span id="cb10-51">        on <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.switch_xc</span>
<span id="cb10-52">        kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(on, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>g), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt0)</span>
<span id="cb10-53">        kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(on, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kp0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.theta_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>g), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kp0)</span>
<span id="cb10-54">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kt, kp</span>
<span id="cb10-55"></span>
<span id="cb10-56">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------------ the ODE set</span></span>
<span id="cb10-57">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, t, y):</span>
<span id="cb10-58">        I, x, l0, l1, l2, m0, m1, m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb10-59">        x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb10-60">        kt, kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt_kp(x, l0)</span>
<span id="cb10-61">        ktd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ktc                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k_t = k_tc + k_td, eq. 4b</span></span>
<span id="cb10-62">        e, M0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.M0</span>
<span id="cb10-63">        dil <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1/V) dV/dt</span></span>
<span id="cb10-64">        M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 7</span></span>
<span id="cb10-65">        gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>F_EFF<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 18 substituted</span></span>
<span id="cb10-66">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([</span>
<span id="cb10-67">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I,                                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 10</span></span>
<span id="cb10-68">            kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0,                                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 11</span></span>
<span id="cb10-69">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0,                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 12</span></span>
<span id="cb10-70">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M,                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 13</span></span>
<span id="cb10-71">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l0),           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 14</span></span>
<span id="cb10-72">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0,                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 15</span></span>
<span id="cb10-73">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l1,                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 16</span></span>
<span id="cb10-74">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(l2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l1),          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 17</span></span>
<span id="cb10-75">        ])</span>
<span id="cb10-76"></span>
<span id="cb10-77">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> y0(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb10-78">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""book p. 350: I = I_0 and x = lam = mu = 0 at t = 0."""</span></span>
<span id="cb10-79">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.I0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>])</span>
<span id="cb10-80"></span>
<span id="cb10-81">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, t_end, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-20</span>, x_stop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb10-82">        ev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb10-83">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> x_stop <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb10-84">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ev(t, y):</span>
<span id="cb10-85">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x_stop</span>
<span id="cb10-86">            ev.terminal, ev.direction <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-87">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.rhs, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, t_end), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.y0(), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF"</span>,</span>
<span id="cb10-88">                      rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>atol, dense_output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, events<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ev)</span>
<span id="cb10-89">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.success, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"BDF failed for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>T_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>I0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mol/L"</span></span>
<span id="cb10-90">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s</span>
<span id="cb10-91"></span>
<span id="cb10-92">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --------------------------------------------------- quasi-steady radicals</span></span>
<span id="cb10-93">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lam0_qssa(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, x, I):</span>
<span id="cb10-94">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eq. 12 with the left-hand side set to zero, root-found."""</span></span>
<span id="cb10-95">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> h(l):</span>
<span id="cb10-96">            kt, kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt_kp(x, l)</span>
<span id="cb10-97">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x)</span>
<span id="cb10-98">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>F_EFF<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l)</span>
<span id="cb10-99">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> brentq(h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-18</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-28</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb10-100"></span>
<span id="cb10-101">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve_qssa(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, t_end, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>):</span>
<span id="cb10-102">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eq. 12-14 replaced by algebraic equations; only I and x are marched."""</span></span>
<span id="cb10-103">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs2(t, y):</span>
<span id="cb10-104">            I, x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb10-105">            x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb10-106">            l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.lam0_qssa(x, I)</span>
<span id="cb10-107">            kt, kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kt_kp(x, l0)</span>
<span id="cb10-108">            dil <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x)</span>
<span id="cb10-109">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.kd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I, kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0]</span>
<span id="cb10-110">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs2, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, t_end), [<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.I0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF"</span>,</span>
<span id="cb10-111">                      rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>atol, dense_output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb10-112">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA solve failed"</span></span>
<span id="cb10-113">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s</span>
<span id="cb10-114"></span>
<span id="cb10-115"></span>
<span id="cb10-116">T_END <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">900.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">300.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">90.0</span>}      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># min, long enough to plateau</span></span>
<span id="cb10-117">CONDITIONS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.polym_temp_C), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.initiator_loading_mol_per_L))</span>
<span id="cb10-118">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T2.iterrows()]</span>
<span id="cb10-119">MODELS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: Chiu(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS}</span>
<span id="cb10-120"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MODELS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> conditions built from Table II:"</span>)</span>
<span id="cb10-121"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.items():</span>
<span id="cb10-122">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, I0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> theta_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>theta_t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-123">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>theta_p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>eps<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-124">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  M0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>M0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mol/L"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>6 conditions built from Table II:
  50 degC, I0 = 0.0258   theta_t = 1500     theta_p = 3500     A = 0.134  eps = -0.237812  M0 = 9.1356 mol/L
  50 degC, I0 = 0.01548  theta_t = 2330     theta_p = 3500     A = 0.134  eps = -0.237812  M0 = 9.1356 mol/L
  70 degC, I0 = 0.0258   theta_t = 49       theta_p = 250      A = 0.152  eps = -0.257212  M0 = 8.9030 mol/L
  70 degC, I0 = 0.01548  theta_t = 83       theta_p = 250      A = 0.152  eps = -0.257212  M0 = 8.9030 mol/L
  90 degC, I0 = 0.0258   theta_t = 3.8      theta_p = 30       A = 0.163  eps = -0.276612  M0 = 8.6705 mol/L
  90 degC, I0 = 0.01548  theta_t = 6.3      theta_p = 30       A = 0.163  eps = -0.276612  M0 = 8.6705 mol/L</code></pre>
</div>
</div>
<div id="7470c97d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:29.900332Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:29.900036Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:31.216597Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:31.215890Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- what the reconstructed molar mass can and cannot touch -----------------</span></span>
<span id="cb12-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># M_0 = d_m/MW enters eq. 13, 14, 16 and 17 only.  eq. 10, 11, 12 - and hence</span></span>
<span id="cb12-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># x(t), lambda_0(t), k_t and k_p - contain no M_0 at all.  DEMONSTRATED, not</span></span>
<span id="cb12-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># asserted: the whole solve is repeated with MW doubled.</span></span>
<span id="cb12-5">_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb12-6">_s_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _m.solve(T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb12-7">_m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)</span>
<span id="cb12-8">_m2.M0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _m.M0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MW doubled</span></span>
<span id="cb12-9">_s_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _m2.solve(T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb12-10">_tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># past t = 0, where lambda_0 is 0</span></span>
<span id="cb12-11">MW_X_MAXDIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_s_ref.sol(_tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _s_alt.sol(_tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb12-12">MW_L0_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_s_alt.sol(_tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_s_ref.sol(_tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb12-13">MW_MU1_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_s_alt.sol(_tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.maximum(</span>
<span id="cb12-14">    _s_ref.sol(_tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-30</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb12-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Both are solver noise (BDF at rtol 1e-11), whose digits differ between BLAS</span></span>
<span id="cb12-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kernels, so they are printed against their bounds.</span></span>
<span id="cb12-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"MW doubled:  max |dx| below 1e-10 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_X_MAXDIFF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb12-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max rel change in lambda_0 below 1e-9 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_L0_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb12-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"             max rel change in mu_1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_MU1_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb12-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   &lt;- the moments DO move, and only they do"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>MW doubled:  max |dx| below 1e-10 (here 1.3e-12)   max rel change in lambda_0 below 1e-9 (here 1.6e-11)
             max rel change in mu_1 = 0.499939   &lt;- the moments DO move, and only they do</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<p>The six conditions of Table II, integrated to the plateau. The first panel is the conversion history at all three temperatures (the time axes are rescaled to a common length, so only the shapes are comparable); the second is the apparent <code>k_t</code> and <code>k_p</code> of eq. 31 and 32 along each trajectory, which is what Figures 10-12 plot; the third is the growing-radical concentration, which is Figure 16’s quantity and the reason the paper refuses the quasi-steady-state assumption.</p>
<div id="19dfb9a1" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:31.218565Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:31.218377Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:39.375262Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:39.374371Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- k_t(x), k_p(x) and the conversion histories ---------------------------</span></span>
<span id="cb14-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># X_HI IS THIS PAGE'S OWN CHOICE OF A COMMON WINDOW, NOT A PROPERTY OF THE</span></span>
<span id="cb14-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PAPER'S THREE FIGURES.  Read on 300 ppi crops of book pp. 354-355: Figure 10</span></span>
<span id="cb14-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (50 degC) stops at about 0.86, but FIGURE 11 (70 degC) RUNS TO ABOUT 0.93 AND</span></span>
<span id="cb14-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># FIGURE 12 (90 degC) TO ABOUT 0.96.  0.86 is the shortest of the three and is</span></span>
<span id="cb14-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># used at all three temperatures so that the curves are compared over the same</span></span>
<span id="cb14-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interval.  Every decade fit window lies well inside it - the counts are</span></span>
<span id="cb14-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed with the onsets below - but one reading of the onset construction, the</span></span>
<span id="cb14-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># steepest-slope tangent, has its tangent point AT this edge at all six</span></span>
<span id="cb14-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># conditions, and that is why it is reported separately instead of entering the</span></span>
<span id="cb14-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># definitional band.</span></span>
<span id="cb14-12">X_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.86</span>            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the shortest of the three figures' conversion ranges</span></span>
<span id="cb14-13">X_LO_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># past the radical build-up transient; see Validation</span></span>
<span id="cb14-14"></span>
<span id="cb14-15"></span>
<span id="cb14-16"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> curve(model, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>, x_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_LO_FIT, x_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_HI, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb14-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""log10 k_t and log10 k_p along the trajectory, resampled uniformly in x.</span></span>
<span id="cb14-18"></span>
<span id="cb14-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    THE HORIZON IS EXTENDED UNTIL THE TRAJECTORY ACTUALLY REACHES x_hi.  A</span></span>
<span id="cb14-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    perturbed parameter set can slow the reaction enough that it does not, and</span></span>
<span id="cb14-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    resampling on [x_lo, x_hi] would then EXTRAPOLATE the spline past the data</span></span>
<span id="cb14-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    and invent a bend.  For theta_t doubled that would make the onset</span></span>
<span id="cb14-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    non-monotone in theta_t.</span></span>
<span id="cb14-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb14-25">    t_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_end <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> T_END[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(model.T_C)]</span>
<span id="cb14-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>):</span>
<span id="cb14-27">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.solve(t_end, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, x_stop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x_hi)</span>
<span id="cb14-28">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> x_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>:</span>
<span id="cb14-29">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb14-30">        t_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb14-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> x_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, (</span>
<span id="cb14-32">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the trajectory never reaches x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>model<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>T_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC,"</span></span>
<span id="cb14-33">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>model<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>theta_t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-34">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, s.t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>)</span>
<span id="cb14-35">    xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s.sol(tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb14-36">    keep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.r_[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, np.diff(xg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb14-37">    t_of_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CubicSpline(xg[keep], tg[keep])</span>
<span id="cb14-38">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(x_lo, x_hi, nx)</span>
<span id="cb14-39">    Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s.sol(t_of_x(xs))</span>
<span id="cb14-40">    kt, kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vectorize(model.kt_kp)(xs, Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb14-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xs, t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_of_x(xs), lam0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kp,</span>
<span id="cb14-42">                Lt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log10(kt), Lp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log10(kp), sol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s)</span>
<span id="cb14-43"></span>
<span id="cb14-44"></span>
<span id="cb14-45">CURVES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: curve(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.items()}</span>
<span id="cb14-46"></span>
<span id="cb14-47">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>))</span>
<span id="cb14-48"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)):</span>
<span id="cb14-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0, col, ls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, C_BLUE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>, C_ORANGE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)):</span>
<span id="cb14-50">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[(TC, I0)].solve(T_END[TC])</span>
<span id="cb14-51">        tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, T_END[TC], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>)</span>
<span id="cb14-52">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(tg <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> TC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> tg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_END[TC]), s.sol(tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb14-53">                   ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> TC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>)</span>
<span id="cb14-54">        cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(TC, I0)]</span>
<span id="cb14-55">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb14-56">                   alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>i)</span>
<span id="cb14-57">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lp"</span>], ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb14-58">                   alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>i)</span>
<span id="cb14-59">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].semilogy(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam0"</span>], ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb14-60">                       alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.22</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>i)</span>
<span id="cb14-61">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time (min), rescaled to a common axis"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion x"</span>,</span>
<span id="cb14-62">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion histories, 50/70/90 degC"</span>)</span>
<span id="cb14-63">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion x"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k (L/(min mol))"</span>,</span>
<span id="cb14-64">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"apparent k_t (upper) and k_p (lower)"</span>)</span>
<span id="cb14-65">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion x"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_0 (mol/L)"</span>,</span>
<span id="cb14-66">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growing-radical concentration"</span>)</span>
<span id="cb14-67"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ax:</span>
<span id="cb14-68">    a.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb14-69">fig.tight_layout()</span>
<span id="cb14-70">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J5.3-chiu-gel-effect/index_files/figure-html/cell-7-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="158de882" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:39.378430Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:39.378237Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:39.426790Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:39.425946Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the onset construction, ROOT-FOUND and not sampled ---------------------</span></span>
<span id="cb15-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Book p. 354: "The 'bend' of the log k_t curve determined by extrapolating the</span></span>
<span id="cb15-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sloped region to intersect with the initial value gives a qualitative</span></span>
<span id="cb15-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># impression of the 'onset' of gel effect."  The paper prints no rule for which</span></span>
<span id="cb15-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># straight line.  RECONSTRUCTION, stated: the sloped region is represented by</span></span>
<span id="cb15-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># its LEAST-CURVED point - the local maximum of the second derivative of L past</span></span>
<span id="cb15-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the bend, found as a root of the THIRD derivative - and the tangent there is</span></span>
<span id="cb15-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># extrapolated back to the</span></span>
<span id="cb15-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># x -&gt; 0 value of log10 k_t, which is log10 k_t0 exactly because lambda_0(0) = 0.</span></span>
<span id="cb15-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> onset_from(x, L, L0, mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flattest"</span>):</span>
<span id="cb15-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The paper's graphical construction, reconstructed and root-found.</span></span>
<span id="cb15-12"></span>
<span id="cb15-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    BOTH FEATURES ARE THE **FIRST** OF THEIR KIND, NOT THE LARGEST, and that</span></span>
<span id="cb15-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    matters: log10 k_t has a second region of strong downward curvature at high</span></span>
<span id="cb15-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    conversion where the GLASS effect takes over, and for a large enough theta_t</span></span>
<span id="cb15-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    that second feature is the deeper one.  Taking the global minimum of the</span></span>
<span id="cb15-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    second derivative therefore jumps to the glass region and makes the onset</span></span>
<span id="cb15-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    NON-MONOTONE in theta_t.  Reading the FIRST local minimum of the second</span></span>
<span id="cb15-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    derivative (bend) and then the FIRST local maximum after it (the</span></span>
<span id="cb15-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    least-curved point of the sloped branch) picks the gel-effect feature at</span></span>
<span id="cb15-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    every parameter set tried.</span></span>
<span id="cb15-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    THE GUARD IS ON THIS FUNCTION.  `onset_window`, the derivative-free</span></span>
<span id="cb15-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    least-squares fit, has no curvature-feature selection and so cannot show</span></span>
<span id="cb15-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    this defect; and at the tabulated theta_t the two feature selections agree</span></span>
<span id="cb15-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    exactly.  Both constructions are asserted monotone in theta_t, in the</span></span>
<span id="cb15-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    leverage cell below.</span></span>
<span id="cb15-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb15-28">    cs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CubicSpline(x, L)</span>
<span id="cb15-29">    d1, d2, d3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cs.derivative(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), cs.derivative(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), cs.derivative(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb15-30">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], x[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20000</span>)</span>
<span id="cb15-31">    v3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3(g)</span>
<span id="cb15-32">    down <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where((v3[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (v3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first local MIN of L''</span></span>
<span id="cb15-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(down):</span>
<span id="cb15-34">        x_bend <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(d3, g[down[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], g[down[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb15-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb15-36">        x_bend <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g[np.argmin(d2(g))])</span>
<span id="cb15-37">    gg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g[g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> x_bend]</span>
<span id="cb15-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flattest"</span>:</span>
<span id="cb15-39">        vv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3(gg)</span>
<span id="cb15-40">        up <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where((vv[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (vv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first local MAX of L''</span></span>
<span id="cb15-41">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(up):</span>
<span id="cb15-42">            xs, refined <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(d3, gg[up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], gg[up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span></span>
<span id="cb15-43">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb15-44">            <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> minimize_scalar</span>
<span id="cb15-45">            rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d2(v)),</span>
<span id="cb15-46">                                 bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(gg[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], gg[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb15-47">                                 options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>})</span>
<span id="cb15-48">            xs, refined <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rr.x), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span></span>
<span id="cb15-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decade3"</span>:</span>
<span id="cb15-50">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ALTERNATIVE READING: the tangent taken three decades below the</span></span>
<span id="cb15-51">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plateau, wherever that falls.  Always exists, always root-found.</span></span>
<span id="cb15-52">        xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: cs(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>), x_bend, gg[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb15-53">        refined <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span></span>
<span id="cb15-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest"</span>:</span>
<span id="cb15-55">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE MOST LITERAL READING OF "the sloped region" - the tangent at the</span></span>
<span id="cb15-56">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># steepest point of the descent - AND THE ONE READING THIS PAGE KEEPS</span></span>
<span id="cb15-57">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUT OF THE DEFINITIONAL BAND, for a reason it measures rather than</span></span>
<span id="cb15-58">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># asserts: at every one of the six conditions the steepest point sits AT</span></span>
<span id="cb15-59">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># x = X_HI, the right edge of the window this page chose, so the reading</span></span>
<span id="cb15-60">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is set by where the curve is truncated and not by the curve.  The</span></span>
<span id="cb15-61">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interior stationary points of L' are root-found on L'' and the edge</span></span>
<span id="cb15-62">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># competes against them explicitly, so the winner is the global steepest</span></span>
<span id="cb15-63">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># point of the window and never a sampled one.</span></span>
<span id="cb15-64">        v2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d2(gg)</span>
<span id="cb15-65">        cross <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where((v2[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (v2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-66">        cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [brentq(d2, gg[k], gg[k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> cross]</span>
<span id="cb15-67">        cand.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(gg[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb15-68">        xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(cand, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d1(v)))</span>
<span id="cb15-69">        refined <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edge"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> gg[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span></span>
<span id="cb15-70">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb15-71">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(mode)</span>
<span id="cb15-72">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(x_onset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cs(xs))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>d1(xs)), x_tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(xs),</span>
<span id="cb15-73">                slope<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d1(xs)), x_bend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x_bend), L_tangent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cs(xs)),</span>
<span id="cb15-74">                refined<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>refined)</span>
<span id="cb15-75"></span>
<span id="cb15-76"></span>
<span id="cb15-77"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> onset_window(x, L, L0, lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>):</span>
<span id="cb15-78">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""THE PRIMARY READING: the straight line least-squares-fitted to log10 k_t</span></span>
<span id="cb15-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    over the stated decade window L0-lo .. L0-hi, extrapolated to L0.</span></span>
<span id="cb15-80"></span>
<span id="cb15-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    It is derivative-free, so it does not have to decide which curvature</span></span>
<span id="cb15-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    feature is "the bend", and the intersection is exact algebra rather than a</span></span>
<span id="cb15-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    swept crossing.  The tangent constructions below are kept as ALTERNATIVE</span></span>
<span id="cb15-84"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    readings and their spread is reported as the definitional band.</span></span>
<span id="cb15-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb15-86">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi)</span>
<span id="cb15-87">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the decade window holds too few points"</span></span>
<span id="cb15-88">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.polyfit(x[m], L[m], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb15-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-90"></span>
<span id="cb15-91"></span>
<span id="cb15-92"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> onset_x(x, L, L0, mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window24"</span>):</span>
<span id="cb15-93">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Dispatcher: one name for every reading of 'extrapolating the sloped region'."""</span></span>
<span id="cb15-94">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window24"</span>:</span>
<span id="cb15-95">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> onset_window(x, L, L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-96">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window13"</span>:</span>
<span id="cb15-97">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> onset_window(x, L, L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-98">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window35"</span>:</span>
<span id="cb15-99">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> onset_window(x, L, L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-100">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window46"</span>:</span>
<span id="cb15-101">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> onset_window(x, L, L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-102">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> onset_from(x, L, L0, mode)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb15-103"></span>
<span id="cb15-104"></span>
<span id="cb15-105"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE HEADLINE LOADING IS I_0 = 0.0258 mol/L AND THE CHOICE IS STATED, NOT</span></span>
<span id="cb15-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># IMPLIED.  The paper quotes ONE onset per temperature, but Figures 10-12 plot</span></span>
<span id="cb15-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOTH loadings and the sentence names neither; 0.0258 is the loading listed</span></span>
<span id="cb15-108"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first in all three legends and the one Figures 16-18 plot, and that is the</span></span>
<span id="cb15-109"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># whole basis for the choice - the paper gives no other.  What the choice costs</span></span>
<span id="cb15-110"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is measured below and printed beside the headline rather than left in the</span></span>
<span id="cb15-111"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># table: the SAME construction on the 0.01548 curve of the SAME figures misses</span></span>
<span id="cb15-112"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed onsets by up to ONSET_DEV_OTHER_MAX.</span></span>
<span id="cb15-113">I0_HEADLINE, I0_OTHER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span></span>
<span id="cb15-114"></span>
<span id="cb15-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE SEVEN READINGS.  Six are readings of "the sloped region" - four decade</span></span>
<span id="cb15-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># windows and two tangents - and the seventh reads "the initial value" the other</span></span>
<span id="cb15-117"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># way, off the post-transient plateau instead of log10 k_t^0.  An eighth,</span></span>
<span id="cb15-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `steepest`, is computed and reported but deliberately NOT in the band; the</span></span>
<span id="cb15-119"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reason is measured in the printout below.</span></span>
<span id="cb15-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE 4-6-DECADE WINDOW IS IN THE BAND BECAUSE THE PAGE'S OWN EXCLUSION </span><span class="al" style="color: #AD0000;
background-color: null;
font-style: inherit;">TEST</span></span>
<span id="cb15-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ACQUITS IT.  It is the widest-swinging reading, so leaving it out would</span></span>
<span id="cb15-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># flatter the band; the only ground on</span></span>
<span id="cb15-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which this page excludes anything is that the reading is set by X_HI rather</span></span>
<span id="cb15-124"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># than by the curve, and that test is MEASURED below - the 4-6 window's fit mask</span></span>
<span id="cb15-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ends well inside X_HI at four of the six conditions, and the band's reported</span></span>
<span id="cb15-126"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># maximum is attained at one of those four.</span></span>
<span id="cb15-127">ONSET_READINGS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window24"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window13"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window35"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window46"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flattest"</span>,</span>
<span id="cb15-128">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decade3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plateau_L0"</span>)</span>
<span id="cb15-129">ONSET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb15-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c, cv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CURVES.items():</span>
<span id="cb15-131">    L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[c].kt0))</span>
<span id="cb15-132">    xo, npts, slope <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_window(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0)</span>
<span id="cb15-133">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(x_onset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xo, n_window<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>npts, slope<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>slope, L0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>L0)</span>
<span id="cb15-134">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_flattest"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_from(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb15-135">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_decade3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_from(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decade3"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb15-136">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_1_3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_window(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-137">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_3_5"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_window(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-138">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_4_6"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_window(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-139">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHERE THE 4-6-DECADE WINDOW'S FIT MASK ENDS.  Measured, because "the</span></span>
<span id="cb15-140">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reading is set by X_HI and not by the curve" is the only ground on which</span></span>
<span id="cb15-141">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this page keeps any reading out of the band, and it has to be applied to</span></span>
<span id="cb15-142">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this window as well as to the steepest tangent.</span></span>
<span id="cb15-143">    _m46 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> L0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>)</span>
<span id="cb15-144">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_window_4_6_hi"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>][_m46].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb15-145">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_4_6_interior"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_window_4_6_hi"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> X_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb15-146">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the seventh reading: the "initial value" taken as the post-transient plateau</span></span>
<span id="cb15-147">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_plateau_L0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_window(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-148">    _st_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_from(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], L0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest"</span>)</span>
<span id="cb15-149">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_steepest"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _st_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb15-150">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest_x_tangent"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _st_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_tangent"</span>]</span>
<span id="cb15-151">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest_at_edge"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(_st_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refined"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edge"</span>)</span>
<span id="cb15-152">    _alts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_1_3"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_3_5"</span>],</span>
<span id="cb15-153">             o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_4_6"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_flattest"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_decade3"</span>],</span>
<span id="cb15-154">             o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_plateau_L0"</span>]]</span>
<span id="cb15-155">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_alts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_alts))</span>
<span id="cb15-156">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the band without the 4-6-decade window, for the break table</span></span>
<span id="cb15-157">    _six <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_1_3"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_flattest"</span>],</span>
<span id="cb15-158">            o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_decade3"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_plateau_L0"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_3_5"</span>]]</span>
<span id="cb15-159">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_six_readings"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_six) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_six))</span>
<span id="cb15-160">    ONSET[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o</span>
<span id="cb15-161"></span>
<span id="cb15-162">_st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TS.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb15-163">ONSET_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {TC: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_st.loc[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_conversion_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb15-164">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)}</span>
<span id="cb15-165"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gel-effect onset conversion - the paper's graphical construction,"</span></span>
<span id="cb15-166">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" reconstructed and root-found</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-167"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-168">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n pts'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'slope'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'defn band'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-169"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb15-170">    o, pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ONSET[c], ONSET_PRINTED[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb15-171">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-172">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_window'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-173">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'slope'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'band'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-174">ONSET_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {TC: ONSET[(TC, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET_PRINTED[TC]</span>
<span id="cb15-175">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)}</span>
<span id="cb15-176">ONSET_DEV_OTHER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {TC: ONSET[(TC, I0_OTHER)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET_PRINTED[TC]</span>
<span id="cb15-177">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)}</span>
<span id="cb15-178">ONSET_MAX_ABS_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_DEV.values()))</span>
<span id="cb15-179">ONSET_DEV_OTHER_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_DEV_OTHER.values()))</span>
<span id="cb15-180">ONSET_MAX_BAND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb15-181">ONSET_BAND_SIX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_six_readings"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb15-182">ONSET_I0_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {TC: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ONSET[(TC, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb15-183">                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET[(TC, I0_OTHER)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>])</span>
<span id="cb15-184">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)}</span>
<span id="cb15-185">ONSET_I0_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET_I0_SHIFT.values()))</span>
<span id="cb15-186"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONSET_READINGS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> readings, at each condition:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-187"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'win 2-4'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'win 1-3'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'win 3-5'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-188">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'win 4-6'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'flattest'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'3-decade'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'plateau'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-189">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'band'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-190"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb15-191">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ONSET[c]</span>
<span id="cb15-192">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_window_1_3'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-193">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_window_3_5'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_window_4_6'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-194">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_flattest'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-195">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_decade3'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_plateau_L0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-196">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'band'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-197"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max |model - printed| at I_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>I0_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mol/L (the headline"</span></span>
<span id="cb15-198">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" loading) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_MAX_ABS_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in conversion"</span>)</span>
<span id="cb15-199"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"THE SAME CONSTRUCTION ON THE OTHER LOADING OF THE SAME FIGURES misses"</span></span>
<span id="cb15-200">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" by up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_DEV_OTHER_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-201"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_DEV_OTHER[TC]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb15-202">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_DEV_OTHER_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET_MAX_ABS_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the headline miss.  The"</span></span>
<span id="cb15-203">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" paper quotes one onset per</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  temperature and gives no basis for"</span></span>
<span id="cb15-204">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" preferring either curve, so BOTH are printed and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  headline says"</span></span>
<span id="cb15-205">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" which it uses."</span>)</span>
<span id="cb15-206"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">widest spread over the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONSET_READINGS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> readings ="</span></span>
<span id="cb15-207">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_MAX_BAND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-208">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_MAX_BAND<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET_MAX_ABS_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the largest miss)"</span>)</span>
<span id="cb15-209"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THE BAND IS NOT CHOSEN TO FLATTER: nothing is kept out of it that this"</span></span>
<span id="cb15-210">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" page cannot exclude on</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  a measurement."</span>)</span>
<span id="cb15-211"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"largest shift between the two initiator loadings ="</span></span>
<span id="cb15-212">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_I0_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;- the paper: 'initiator loading has very little"</span></span>
<span id="cb15-213">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" effect on both curves'"</span>)</span>
<span id="cb15-214"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE READING THE BAND DOES NOT COVER, NAMED AND PRICED RATHER THAN OMITTED.</span></span>
<span id="cb15-215">ONSET_STEEPEST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_steepest"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb15-216">N_STEEPEST_AT_EDGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest_at_edge"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb15-217">N_W46_INTERIOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_4_6_interior"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb15-218"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE SAME TEST, APPLIED TO THE READING THAT WAS ADMITTED RATHER THAN"</span></span>
<span id="cb15-219">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" EXCLUDED.  The 4-6-decade</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">window gives"</span></span>
<span id="cb15-220">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[(TC, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_window_4_6'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-221">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at 50/70/90 degC and is the widest-swinging reading in the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">band, so"</span></span>
<span id="cb15-222">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" leaving it out would be the flattering choice - and the exclusion test"</span></span>
<span id="cb15-223">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ACQUITS it: its fit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mask ends at"</span></span>
<span id="cb15-224">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_window_4_6_hi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb15-225">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" i.e. INSIDE x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_W46_INTERIOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the"</span></span>
<span id="cb15-226">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CONDITIONS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> conditions,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the band's reported maximum"</span></span>
<span id="cb15-227">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_MAX_BAND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is attained at one of those"</span></span>
<span id="cb15-228">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_W46_INTERIOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - so the number</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">above is not set by the truncation"</span></span>
<span id="cb15-229">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" either.  It touches the edge only at 90 degC, where the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">paper's own"</span></span>
<span id="cb15-230">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Figure 12 runs to about 0.96 and would not truncate it at all."</span>)</span>
<span id="cb15-231"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> N_W46_INTERIOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ONSET[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb15-232">    CONDITIONS, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> c: ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band"</span>])][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window_4_6_interior"</span>], (</span>
<span id="cb15-233">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 4-6-decade window's fit mask now reaches the window edge where the band"</span></span>
<span id="cb15-234">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" is widest, so the reason for admitting it rather than excluding it - the"</span></span>
<span id="cb15-235">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" same truncation test the steepest-slope tangent fails - no longer holds"</span>)</span>
<span id="cb15-236"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND THE BAND IS A SPREAD OVER </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONSET_READINGS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> READINGS, NOT A"</span></span>
<span id="cb15-237">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" BOUND OVER EVERY"</span></span>
<span id="cb15-238">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" READING OF THE SENTENCE.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The most literal reading - the tangent at the"</span></span>
<span id="cb15-239">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" STEEPEST point of the descent - gives"</span></span>
<span id="cb15-240">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[(TC, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_steepest'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-241">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at 50/70/90 degC, outside the band at every condition.  IT IS EXCLUDED"</span></span>
<span id="cb15-242">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  FOR A MEASURED REASON: its tangent point sits at x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the"</span></span>
<span id="cb15-243">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" right edge of this page's</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  own window, at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_STEEPEST_AT_EDGE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the"</span></span>
<span id="cb15-244">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CONDITIONS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> conditions - so that reading is set by where the"</span></span>
<span id="cb15-245">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" curve is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  TRUNCATED and not by the curve.  Figures 11 and 12 run"</span></span>
<span id="cb15-246">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" further right than Figure 10 does,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  so the paper's own plots would"</span></span>
<span id="cb15-247">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not place it there."</span>)</span>
<span id="cb15-248"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest_at_edge"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS), (</span>
<span id="cb15-249">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the steepest-slope tangent no longer sits at the window edge, so the stated"</span></span>
<span id="cb15-250">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" reason for keeping it out of the definitional band no longer holds"</span>)</span>
<span id="cb15-251"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> (ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb15-252">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed trend with T is not reproduced"</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>gel-effect onset conversion - the paper's graphical construction, reconstructed and root-found

   T        I0   x_onset  printed       dev   n pts    slope  defn band
  50    0.0258   0.25516     0.26  -0.00484     866  -11.052    0.05848
  50   0.01548   0.23760     0.26  -0.02240     881  -10.877    0.04665
  70    0.0258   0.34838     0.35  -0.00162     865  -11.022    0.09009
  70   0.01548   0.32167     0.35  -0.02833     890  -10.719    0.08444
  90    0.0258   0.44034     0.45  -0.00966     829  -11.448    0.07740
  90   0.01548   0.41874     0.45  -0.03126     854  -11.139    0.07782

the 7 readings, at each condition:

   T        I0   win 2-4   win 1-3   win 3-5   win 4-6  flattest  3-decade   plateau      band
  50    0.0258   0.25516   0.24109   0.25761   0.29957   0.25453   0.25718   0.25996   0.05848
  50   0.01548   0.23760   0.22396   0.23478   0.27061   0.23507   0.23995   0.24332   0.04665
  70    0.0258   0.34838   0.32990   0.36832   0.41999   0.34976   0.34932   0.35121   0.09009
  70   0.01548   0.32167   0.30435   0.33514   0.38878   0.32318   0.32317   0.32533   0.08444
  90    0.0258   0.44034   0.41775   0.46901   0.49516   0.43888   0.44079   0.44199   0.07740
  90   0.01548   0.41874   0.39733   0.44404   0.47515   0.41948   0.41949   0.42083   0.07782

max |model - printed| at I_0 = 0.0258 mol/L (the headline loading) = 0.00966 in conversion
THE SAME CONSTRUCTION ON THE OTHER LOADING OF THE SAME FIGURES misses by up to 0.03126
  (50 degC -0.02240, 70 degC -0.02833, 90 degC -0.03126) - 3.24x the headline miss.  The paper quotes one onset per
  temperature and gives no basis for preferring either curve, so BOTH are printed and the
  headline says which it uses.

widest spread over the 7 readings = 0.09009  (9.33x the largest miss)
  THE BAND IS NOT CHOSEN TO FLATTER: nothing is kept out of it that this page cannot exclude on
  a measurement.
largest shift between the two initiator loadings = 0.02671   &lt;- the paper: 'initiator loading has very little effect on both curves'

THE SAME TEST, APPLIED TO THE READING THAT WAS ADMITTED RATHER THAN EXCLUDED.  The 4-6-decade
window gives 0.29957, 0.41999, 0.49516 at 50/70/90 degC and is the widest-swinging reading in the
band, so leaving it out would be the flattering choice - and the exclusion test ACQUITS it: its fit
mask ends at 0.7766, 0.7733, 0.8568, 0.8484, 0.8600, 0.8600, i.e. INSIDE x = 0.86 at 4 of the 6 conditions,
and the band's reported maximum 0.09009 is attained at one of those 4 - so the number
above is not set by the truncation either.  It touches the edge only at 90 degC, where the
paper's own Figure 12 runs to about 0.96 and would not truncate it at all.

AND THE BAND IS A SPREAD OVER 7 READINGS, NOT A BOUND OVER EVERY READING OF THE SENTENCE.
The most literal reading - the tangent at the STEEPEST point of the descent - gives
  0.44783, 0.47680, 0.51866 at 50/70/90 degC, outside the band at every condition.  IT IS EXCLUDED
  FOR A MEASURED REASON: its tangent point sits at x = 0.86, the right edge of this page's
  own window, at 6 of the 6 conditions - so that reading is set by where the curve is
  TRUNCATED and not by the curve.  Figures 11 and 12 run further right than Figure 10 does,
  so the paper's own plots would not place it there.</code></pre>
</div>
</div>
<div id="d19be4b5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:39.429444Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:39.429263Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:47.186886Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:47.185938Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- SECOND, INDEPENDENT ROUTE to the same curve: integrate in x -------------</span></span>
<span id="cb17-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The same six ODEs re-parametrised by conversion - divide eq. 10 and 12 by</span></span>
<span id="cb17-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 11 - so the independent variable, the step sequence and the error control</span></span>
<span id="cb17-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are all different.  It shares the state at x = X_LO_FIT with the t-route and</span></span>
<span id="cb17-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># therefore tests the integration over the sloped branch, NOT the start-up.</span></span>
<span id="cb17-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> curve_x(model, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>, x_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_LO_FIT, x_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_HI, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, y_start<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb17-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> y_start <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb17-8">        cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(model.T_C), model.I0)]</span>
<span id="cb17-9">        y_start <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sol"</span>].sol(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam0"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb17-10">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs_x(x, y):</span>
<span id="cb17-11">        I, l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y</span>
<span id="cb17-12">        kt, kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.kt_kp(x, l0)</span>
<span id="cb17-13">        dxdt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0</span>
<span id="cb17-14">        dil <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> model.eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x)</span>
<span id="cb17-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>model.kd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dxdt,</span>
<span id="cb17-16">                (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dil<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>F_EFF<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>model.kd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>l0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dxdt]</span>
<span id="cb17-17">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(x_lo, x_hi, nx)</span>
<span id="cb17-18">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs_x, (x_lo, x_hi), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(y_start), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Radau"</span>,</span>
<span id="cb17-19">                  rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-18</span>, t_eval<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xs)</span>
<span id="cb17-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x-parametrised solve failed"</span></span>
<span id="cb17-21">    kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([model.kt_kp(xi, pi)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> xi, pi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(xs, s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])])</span>
<span id="cb17-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xs, np.log10(kt), s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb17-23"></span>
<span id="cb17-24"></span>
<span id="cb17-25">ONSET_X_ROUTE, ONSET_TWO_ROUTE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}</span>
<span id="cb17-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb17-27">    xs, Lt, l0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve_x(MODELS[c])</span>
<span id="cb17-28">    ONSET_X_ROUTE[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(xs, Lt, ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L0"</span>])</span>
<span id="cb17-29">    ONSET_TWO_ROUTE[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ONSET_X_ROUTE[c]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-30">ONSET_TWO_ROUTE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET_TWO_ROUTE.values()))</span>
<span id="cb17-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t-parametrised vs x-parametrised integration, same onset construction:"</span>)</span>
<span id="cb17-32"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb17-33">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, I0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  t-route </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-34">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   x-route </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_X_ROUTE[c]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rel </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_TWO_ROUTE[c]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-35"></span>
<span id="cb17-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT THAT RESIDUAL MEASURES, AND WHAT IT DOES NOT.  It is NOT the arithmetic</span></span>
<span id="cb17-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># floor of the onset.  lambda_0(x) sits on a strongly attracting manifold, so</span></span>
<span id="cb17-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two integrations of the same equations converge onto the same log k_t(x)</span></span>
<span id="cb17-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># whatever path they took to get there; the residual therefore prices the</span></span>
<span id="cb17-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ATTRACTOR - that both parametrisations land on the same constitutive curve -</span></span>
<span id="cb17-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and not the accuracy of either integration.  The floor that does limit the</span></span>
<span id="cb17-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed digits is the RESAMPLING of that curve onto a uniform grid in x, and</span></span>
<span id="cb17-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it is measured here instead of assumed.</span></span>
<span id="cb17-44">ONSET_NX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8001</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16001</span>]</span>
<span id="cb17-45">ONSET_NX_VALS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb17-46"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb17-47">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb17-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nx <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_NX:</span>
<span id="cb17-49">        cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (CURVES[(TC, I0_HEADLINE)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span></span>
<span id="cb17-50">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> curve(MODELS[(TC, I0_HEADLINE)], nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nx))</span>
<span id="cb17-51">        vals.append(onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], ONSET[(TC, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L0"</span>]))</span>
<span id="cb17-52">    ONSET_NX_VALS[TC] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vals</span>
<span id="cb17-53"></span>
<span id="cb17-54"></span>
<span id="cb17-55"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _resample_floor(vals_by_TC, ks):</span>
<span id="cb17-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ks) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ks))</span>
<span id="cb17-57">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v[ks[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> vals_by_TC.values()))</span>
<span id="cb17-58"></span>
<span id="cb17-59"></span>
<span id="cb17-60">ONSET_RESAMPLE_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _resample_floor(ONSET_NX_VALS, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONSET_NX))))</span>
<span id="cb17-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the onset against the RESAMPLING grid (nx points uniform in x over"</span></span>
<span id="cb17-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_LO_FIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nx='</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(n)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_NX)</span>
<span id="cb17-64">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'spread'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb17-66">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ONSET_NX_VALS[TC]</span>
<span id="cb17-67">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v)</span>
<span id="cb17-68">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  RELATIVE SPREAD OVER THE FOUR GRIDS: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_RESAMPLE_FLOOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - at"</span></span>
<span id="cb17-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" least five orders of magnitude larger than</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the gap between the two"</span></span>
<span id="cb17-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" integration routes, below 1e-10 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_TWO_ROUTE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">).  So the"</span></span>
<span id="cb17-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" arithmetic floor on the onset</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  is the resampling, the sixth decimal"</span></span>
<span id="cb17-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" of every onset printed on this page is grid noise,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and the page"</span></span>
<span id="cb17-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" quotes five.  Both floors are far inside the"</span></span>
<span id="cb17-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_MAX_BAND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> definitional band,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  which is what actually"</span></span>
<span id="cb17-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" limits the number."</span>)</span>
<span id="cb17-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the start-up itself, pinned against the algebraic quasi-steady value</span></span>
<span id="cb17-78">QSS_START_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb17-79"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb17-80">    cv, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[c], MODELS[c]</span>
<span id="cb17-81">    I_at <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sol"</span>].sol(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-82">    QSS_START_REL[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m.lam0_qssa(X_LO_FIT, I_at)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam0"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-83">QSS_START_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(QSS_START_REL.values()))</span>
<span id="cb17-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the shared start state is pinned separately: at x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_LO_FIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the"</span></span>
<span id="cb17-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" marched lambda_0 is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSS_START_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the ALGEBRAIC"</span></span>
<span id="cb17-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" quasi-steady root of eq. 12 - so the piece the two</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">routes share is"</span></span>
<span id="cb17-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" itself checked against a root-find that shares no time stepping."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>t-parametrised vs x-parametrised integration, same onset construction:
  50 degC, I0 = 0.0258    t-route 0.255161   x-route 0.255161   rel 9.077e-12
  50 degC, I0 = 0.01548   t-route 0.237599   x-route 0.237599   rel 6.691e-12
  70 degC, I0 = 0.0258    t-route 0.348378   x-route 0.348378   rel 3.836e-13
  70 degC, I0 = 0.01548   t-route 0.321672   x-route 0.321672   rel 5.324e-12
  90 degC, I0 = 0.0258    t-route 0.440339   x-route 0.440339   rel 5.208e-13
  90 degC, I0 = 0.01548   t-route 0.418739   x-route 0.418739   rel 8.207e-13

the onset against the RESAMPLING grid (nx points uniform in x over [0.02, 0.86]):

   T       nx=2001       nx=4001       nx=8001      nx=16001     spread
  50   0.255163107   0.255161103   0.255163192   0.255163689   2.59e-06
  70   0.348375921   0.348377542   0.348378352   0.348378757   2.84e-06
  90   0.440338593   0.440338511   0.440338468   0.440344242   5.77e-06

  RELATIVE SPREAD OVER THE FOUR GRIDS: 1.311e-05 - at least five orders of magnitude larger than
  the gap between the two integration routes, below 1e-10 (here 9.1e-12).  So the arithmetic floor on the onset
  is the resampling, the sixth decimal of every onset printed on this page is grid noise,
  and the page quotes five.  Both floors are far inside the 0.09009 definitional band,
  which is what actually limits the number.

the shared start state is pinned separately: at x = 0.02, the marched lambda_0 is
within 7.362e-06 of the ALGEBRAIC quasi-steady root of eq. 12 - so the piece the two
routes share is itself checked against a root-find that shares no time stepping.</code></pre>
</div>
</div>
<div id="b32f91c4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:47.189201Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:47.189047Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:47.199900Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:47.199040Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Figure 13's activation energies, recomputed from Table II --------------</span></span>
<span id="cb19-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> arrhenius(theta, T_K):</span>
<span id="cb19-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""least squares of ln(1/theta) on 1/T; returns E in kcal/mol."""</span></span>
<span id="cb19-4">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.asarray(theta, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb19-5">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(T_K), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T_K]).T</span>
<span id="cb19-6">    c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb19-7">    res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c</span>
<span id="cb19-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>R_CAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt((res<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean())),</span>
<span id="cb19-9">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(res))))</span>
<span id="cb19-10"></span>
<span id="cb19-11"></span>
<span id="cb19-12">TK3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">70.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">90.0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span></span>
<span id="cb19-13">TH_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {I0: np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2[(T2.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC)</span>
<span id="cb19-14">                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(T2.initiator_loading_mol_per_L, I0)]</span>
<span id="cb19-15">                            .theta_t_min.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)])</span>
<span id="cb19-16">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)}</span>
<span id="cb19-17">TH_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2[T2.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC].theta_p_min.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb19-18">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)])</span>
<span id="cb19-19">E_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {I0: arrhenius(v, TK3) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_T.items()}</span>
<span id="cb19-20">E_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> arrhenius(TH_P, TK3)</span>
<span id="cb19-21">E_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_st.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"activation_energy_theta_t"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb19-22">E_P_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_st.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"activation_energy_theta_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb19-23">E_T_MEAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean([E_T[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_T]))</span>
<span id="cb19-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Arrhenius fits to Table II's own theta values (Figure 13):"</span>)</span>
<span id="cb19-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>):</span>
<span id="cb19-26">    E, rms, mx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_T[I0]</span>
<span id="cb19-27">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  theta_t, I0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>I0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  dE = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/mol   ln-residual"</span></span>
<span id="cb19-28">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rms<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> max </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   vs printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_T_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-29">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>E_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb19-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  theta_p                  dE = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/mol   ln-residual"</span></span>
<span id="cb19-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> max </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   vs printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_P_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>E_P_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb19-33">E_T_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {I0: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E_T[I0][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>E_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_T}</span>
<span id="cb19-34">E_P_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>E_P_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb19-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">both loadings' theta_t lines average </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_T_MEAN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/mol"</span></span>
<span id="cb19-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_T_MEAN<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>E_T_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_T_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Arrhenius fits to Table II's own theta values (Figure 13):
  theta_t, I0 = 0.0258    dE = 34.9082 kcal/mol   ln-residual rms 0.12159 max 0.17186   vs printed 34  (+2.67%)
  theta_t, I0 = 0.01548   dE = 34.5166 kcal/mol   ln-residual rms 0.09702 max 0.13713   vs printed 34  (+1.52%)
  theta_p                  dE = 27.7716 kcal/mol   ln-residual rms 0.05687 max 0.08038   vs printed 28  (-0.82%)

both loadings' theta_t lines average 34.7124 kcal/mol (+2.10% on the printed 34).</code></pre>
</div>
</div>
<div id="0e3f081c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:47.201871Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:47.201689Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:47.215603Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:47.214807Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Figure 15's claim, tested on Table I's T_gp and Table II's A -----------</span></span>
<span id="cb21-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Figure 15 caption: "All three points fall on the same straight line".</span></span>
<span id="cb21-3">A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2[T2.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC].A.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)])</span>
<span id="cb21-4">TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">70.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">90.0</span>])</span>
<span id="cb21-5">U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_GP)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb21-6">_X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(U), U]).T</span>
<span id="cb21-7">_c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(_X, A3, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb21-8">A_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _c</span>
<span id="cb21-9">A_LIN_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(A_RESID<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3)))</span>
<span id="cb21-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NULL BASELINE: the same three points, two parameters, a different regressor</span></span>
<span id="cb21-11">_X1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(TC3), TC3]).T</span>
<span id="cb21-12">_c1, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(_X1, A3, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb21-13">A_NULL_T_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _X1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _c1)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3)))</span>
<span id="cb21-14">A_NULL_GAIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_NULL_T_MAXREL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A_LIN_MAXREL</span>
<span id="cb21-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what T_gp would make the three points EXACTLY collinear</span></span>
<span id="cb21-16"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _collinear(Tg):</span>
<span id="cb21-17">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb21-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-19"></span>
<span id="cb21-20"></span>
<span id="cb21-21">T_GP_IMPLIED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(_collinear, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">200.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb21-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and what the printed rounding of A alone allows</span></span>
<span id="cb21-23">_lo, _hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.inf, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.inf</span>
<span id="cb21-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>):</span>
<span id="cb21-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>):</span>
<span id="cb21-26">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>):</span>
<span id="cb21-27">            Ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.array([d0, d1, d2])</span>
<span id="cb21-28">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _g(Tg, Ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ap):</span>
<span id="cb21-29">                u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb21-30">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-31">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb21-32">                v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_g, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb21-33">                _lo, _hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_lo, v), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_hi, v)</span>
<span id="cb21-34">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb21-35">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb21-36">T_GP_BAND_LO, T_GP_BAND_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_lo), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_hi)</span>
<span id="cb21-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and which EXPONENT the three points actually pick out, at the printed T_gp</span></span>
<span id="cb21-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _expo(q):</span>
<span id="cb21-39">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T_GP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TC3)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>q</span>
<span id="cb21-40">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-41"></span>
<span id="cb21-42"></span>
<span id="cb21-43">Q_IMPLIED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(_expo, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb21-44"></span>
<span id="cb21-45"></span>
<span id="cb21-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT THE 17.4x IS A FUNCTION OF, AND WHAT SURVIVES ITS BEING ONE.  The gain is</span></span>
<span id="cb21-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a strong function of T_gp, and this page has already shown that the three</span></span>
<span id="cb21-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed A values cannot determine T_gp.  So the gain is evaluated at the two</span></span>
<span id="cb21-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ENDS of the admissible interval as well as at the printed 114 - four exact</span></span>
<span id="cb21-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># evaluations, no extremum claimed - and beside two OTHER two-parameter,</span></span>
<span id="cb21-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># non-nested regressors on the same three points.</span></span>
<span id="cb21-52"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _gain_at(Tg):</span>
<span id="cb21-53">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb21-54">    Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(u), u]).T</span>
<span id="cb21-55">    cg, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(Xg, A3, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb21-56">    lin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3)))</span>
<span id="cb21-57">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> A_NULL_T_MAXREL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>lin <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lin <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.inf</span>
<span id="cb21-58"></span>
<span id="cb21-59"></span>
<span id="cb21-60"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _maxrel_on(X):</span>
<span id="cb21-61">    cc, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, A3, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb21-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3)))</span>
<span id="cb21-63"></span>
<span id="cb21-64"></span>
<span id="cb21-65">A_GAIN_BAND_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _gain_at(T_GP_BAND_LO)</span>
<span id="cb21-66">A_GAIN_BAND_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _gain_at(T_GP_BAND_HI)</span>
<span id="cb21-67">A_GAIN_BAND_ENDS_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(A_GAIN_BAND_LO, A_GAIN_BAND_HI))</span>
<span id="cb21-68">A_ALT_CENTRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">130.0</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># an arbitrary alternative centre, stated as one</span></span>
<span id="cb21-69">A_ALT_REGRESSORS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb21-70">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A against 1/T (degC)"</span>: np.vstack([np.ones_like(TC3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TC3]).T,</span>
<span id="cb21-71">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"A against (T - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_ALT_CENTRE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)^2"</span>:</span>
<span id="cb21-72">        np.vstack([np.ones_like(TC3), (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A_ALT_CENTRE)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]).T,</span>
<span id="cb21-73">}</span>
<span id="cb21-74">A_ALT_GAIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: A_NULL_T_MAXREL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_maxrel_on(X) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, X <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A_ALT_REGRESSORS.items()}</span>
<span id="cb21-75">A_ALT_GAIN_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(A_ALT_GAIN.values()))</span>
<span id="cb21-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the three A values are equally spaced in T, so their second difference IS the</span></span>
<span id="cb21-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># discrete curvature, and it is what any of these regressors is picking up.</span></span>
<span id="cb21-78">A_SECOND_DIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb21-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"A against (T - T_gp)^2 with T_gp = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC as Table I prints it:"</span>)</span>
<span id="cb21-80"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  least-squares line   A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (T-T_gp)^2"</span>)</span>
<span id="cb21-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  residuals            </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>array2string(A_RESID, precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  max relative residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_LIN_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;- 'all three points fall on"</span></span>
<span id="cb21-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the same straight line'"</span>)</span>
<span id="cb21-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  NULL, A linear in T   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_NULL_T_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_NULL_GAIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x worse;"</span></span>
<span id="cb21-85">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not a nested submodel, so the direction is evidence)"</span>)</span>
<span id="cb21-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  T_gp making the three A values EXACTLY collinear:"</span></span>
<span id="cb21-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC"</span>)</span>
<span id="cb21-88"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  T_gp still admissible if each printed A is +-0.0005:"</span></span>
<span id="cb21-89">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_BAND_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_BAND_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] degC"</span>)</span>
<span id="cb21-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC sits inside that interval, so the three"</span></span>
<span id="cb21-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rounded A values</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     CANNOT distinguish it from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span></span>
<span id="cb21-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the page reports the interval, not the point."</span>)</span>
<span id="cb21-93"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  exponent q making A exactly linear in (T_gp - T)^q at the printed"</span></span>
<span id="cb21-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" T_gp: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AND THE GAIN IS A FUNCTION OF T_gp, WHICH THESE THREE CELLS CANNOT"</span></span>
<span id="cb21-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" DETERMINE.  Evaluated at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the two ends of the interval they DO admit:"</span></span>
<span id="cb21-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_GAIN_BAND_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_BAND_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC and"</span></span>
<span id="cb21-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_GAIN_BAND_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_BAND_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, against"</span></span>
<span id="cb21-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_NULL_GAIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x at the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; and it DIVERGES at"</span></span>
<span id="cb21-100">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_GP_IMPLIED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  where the residual is exactly zero by"</span></span>
<span id="cb21-101">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" construction.  So </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_NULL_GAIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x is the gain at ONE admissible"</span></span>
<span id="cb21-102">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  T_gp and not a property of the data."</span>)</span>
<span id="cb21-103"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A_ALT_GAIN.items():</span>
<span id="cb21-104">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:24s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> max rel residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_maxrel_on(A_ALT_REGRESSORS[k_])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-105">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   gain vs linear-in-T </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb21-106"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  BOTH OF THOSE ARE TWO-PARAMETER AND NEITHER NESTS IN linear-in-T"</span></span>
<span id="cb21-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" EITHER, so the comparison</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  does NOT single out the"</span></span>
<span id="cb21-108">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Fujita/glass-transition form.  What it establishes is that A is"</span></span>
<span id="cb21-109">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CONCAVE in T - the three values are equally spaced in T and their"</span></span>
<span id="cb21-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" second difference is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_SECOND_DIFF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - which linear-in-T cannot"</span></span>
<span id="cb21-111">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" represent and any sufficiently curved</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  two-parameter regressor can."</span></span>
<span id="cb21-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The page claims the concavity, not the quadratic."</span>)</span>
<span id="cb21-113"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> T_GP_BAND_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> T_GP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> T_GP_BAND_HI</span>
<span id="cb21-114"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> A_SECOND_DIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> A_GAIN_BAND_ENDS_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>A against (T - T_gp)^2 with T_gp = 114 degC as Table I prints it:
  least-squares line   A = 0.167833 -8.247292e-06 (T-T_gp)^2
  residuals            [-5.17941774e-05  1.34055518e-04 -8.22613406e-05]
  max relative residual 8.819e-04  &lt;- 'all three points fall on the same straight line'
  NULL, A linear in T   1.535e-02   (17.4057x worse; not a nested submodel, so the direction is evidence)

  T_gp making the three A values EXACTLY collinear: 111.42857 degC
  T_gp still admissible if each printed A is +-0.0005: [102.2222, 128.0000] degC
  -&gt; the printed 114 degC sits inside that interval, so the three rounded A values
     CANNOT distinguish it from 111.43; the page reports the interval, not the point.
  exponent q making A exactly linear in (T_gp - T)^q at the printed T_gp: 2.06586

  AND THE GAIN IS A FUNCTION OF T_gp, WHICH THESE THREE CELLS CANNOT DETERMINE.  Evaluated at
  the two ends of the interval they DO admit: 3.6124x at 102.2222 degC and 3.5347x at
  128.0000 degC, against 17.4057x at the printed 114; and it DIVERGES at 111.42857 degC,
  where the residual is exactly zero by construction.  So 17.4057x is the gain at ONE admissible
  T_gp and not a property of the data.
  A against 1/T (degC)     max rel residual 2.745e-03   gain vs linear-in-T 5.5926x
  A against (T - 130)^2    max rel residual 4.708e-03   gain vs linear-in-T 3.2607x

  BOTH OF THOSE ARE TWO-PARAMETER AND NEITHER NESTS IN linear-in-T EITHER, so the comparison
  does NOT single out the Fujita/glass-transition form.  What it establishes is that A is
  CONCAVE in T - the three values are equally spaced in T and their second difference is
  -0.007000 - which linear-in-T cannot represent and any sufficiently curved
  two-parameter regressor can.  The page claims the concavity, not the quadratic.</code></pre>
</div>
</div>
<div id="072d71c8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:47.217913Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:47.217730Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:14:56.174271Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:14:56.173184Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the quasi-steady-state assumption, book p. 356 -------------------------</span></span>
<span id="cb23-2">QSSA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb23-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb23-4">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[c]</span>
<span id="cb23-5">    te <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb23-6">    se, sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.solve(te), m.solve_qssa(te)</span>
<span id="cb23-7">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, te, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20001</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># t &gt;= 1 min: past the radical build-up</span></span>
<span id="cb23-8">    Ye, Yq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> se.sol(tg), sq.sol(tg)</span>
<span id="cb23-9">    l0q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([m.lam0_qssa(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), I)</span>
<span id="cb23-10">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x, I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])])</span>
<span id="cb23-11">    ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> l0q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb23-12">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(ratio))</span>
<span id="cb23-13">    QSSA[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(max_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ratio.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), x_at_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][i]),</span>
<span id="cb23-14">                   t_at_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tg[i]), end_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ratio[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb23-15">                   max_dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))),</span>
<span id="cb23-16">                   x_end_exact<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), x_end_qssa<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb23-17">QSSA_FACTOR_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_st.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_radical_overestimate_factor"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb23-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA against the exact solution (t &gt;= 1 min, past the radical build-up):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max lam0 QSSA/exact'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;21}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'at x'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max |dx|'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_end exact'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_end QSSA'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb23-22">    q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> QSSA[c]</span>
<span id="cb23-23">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:21.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_at_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-24">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max_dx'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_end_exact'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_end_qssa'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-25">QSSA_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> QSSA[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the condition of Figures 16-18</span></span>
<span id="cb23-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Figures 16-18 are PMMA at 50 degC, I0 = 0.0258 mol/L - this row:"</span>)</span>
<span id="cb23-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  radical concentration overestimated by up to"</span></span>
<span id="cb23-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSSA_REF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x, and the paper says 'more than a factor of"</span></span>
<span id="cb23-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSSA_FACTOR_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'."</span>)</span>
<span id="cb23-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  conversion history differs by at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSSA_REF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max_dx'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in x -"</span></span>
<span id="cb23-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 'surprisingly consistent'."</span>)</span>
<span id="cb23-32">QSSA_OTHER_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(QSSA[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS</span>
<span id="cb23-33">                           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>))</span>
<span id="cb23-34">QSSA_N_ABOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(QSSA[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> QSSA_FACTOR_PRINTED</span>
<span id="cb23-35">                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb23-36">_above <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> QSSA[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> QSSA_FACTOR_PRINTED]</span>
<span id="cb23-37">_below <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> QSSA[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> QSSA_FACTOR_PRINTED]</span>
<span id="cb23-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  THE PAPER STATES THAT FACTOR FOR ONE CONDITION AND THIS PAGE"</span></span>
<span id="cb23-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" MEASURES ALL SIX.  It holds at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSSA_N_ABOVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them"</span></span>
<span id="cb23-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _above)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - and FAILS at"</span></span>
<span id="cb23-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the other </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_below)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb23-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSSA[c][<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> QSSA[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _below)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span></span>
<span id="cb23-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  The factor falls with temperature and rises as the initiator"</span></span>
<span id="cb23-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" loading falls, so the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  paper's sentence is a statement about its own"</span></span>
<span id="cb23-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Figure 16 and not about the model."</span>)</span>
<span id="cb23-46"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> QSSA_REF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> QSSA_FACTOR_PRINTED</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>QSSA against the exact solution (t &gt;= 1 min, past the radical build-up):

   T        I0   max lam0 QSSA/exact     at x   max |dx|  x_end exact  x_end QSSA
  50    0.0258                3.5176   0.6984    0.03861      0.94882     0.94891
  50   0.01548                4.8466   0.6991    0.05143      0.94651     0.94665
  70    0.0258                1.9342   0.7497    0.01896      0.98595     0.98597
  70   0.01548                2.5481   0.7502    0.02850      0.98508     0.98513
  90    0.0258                1.4889   0.7959    0.01099      0.99726     0.99727
  90   0.01548                1.7875   0.7998    0.01662      0.99684     0.99686

Figures 16-18 are PMMA at 50 degC, I0 = 0.0258 mol/L - this row:
  radical concentration overestimated by up to 3.5176x, and the paper says 'more than a factor of 2'.
  conversion history differs by at most 0.03861 in x - 'surprisingly consistent'.

  THE PAPER STATES THAT FACTOR FOR ONE CONDITION AND THIS PAGE MEASURES ALL SIX.  It holds at
  3 of them - 50 degC/0.0258, 50 degC/0.01548, 70 degC/0.01548 - and FAILS at the other 3:
  70 degC/0.0258 at 1.9342x, 90 degC/0.0258 at 1.4889x, 90 degC/0.01548 at 1.7875x.
  The factor falls with temperature and rises as the initiator loading falls, so the
  paper's sentence is a statement about its own Figure 16 and not about the model.</code></pre>
</div>
</div>
<div id="cb9c0cd8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:14:56.176720Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:14:56.176387Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:01.547338Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:01.546431Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the paper's own argument against a switched-on gel effect ---------------</span></span>
<span id="cb25-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Book p. 353: "Note that these curves are concave upward preceding the sharp</span></span>
<span id="cb25-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rise.  If the gel effect were suddenly switched on at a certain critical</span></span>
<span id="cb25-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># conversion level, the portion of the conversion curve under examination would</span></span>
<span id="cb25-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># be concave downward due to the gradual depletion of monomer."</span></span>
<span id="cb25-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> concavity(model, t_end, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>, t_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb25-7">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.solve(t_end)</span>
<span id="cb25-8">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(t_lo, t_end, n)</span>
<span id="cb25-9">    cs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CubicSpline(tg, s.sol(tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb25-10">    d2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cs.derivative(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)(tg)</span>
<span id="cb25-11">    sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(np.diff(np.sign(d2)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb25-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> cs, tg, d2, sgn</span>
<span id="cb25-13"></span>
<span id="cb25-14"></span>
<span id="cb25-15">CONCAVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb25-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb25-17">    cs, tg, d2, sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> concavity(MODELS[c], T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]])</span>
<span id="cb25-18">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cs(tg[k])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sgn]</span>
<span id="cb25-19">    CONCAVE[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(x_sign_changes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xs[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], x_up_from<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> xs <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan,</span>
<span id="cb25-20">                      x_up_to<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(xs) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb25-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"where d2x/dt2 changes sign (the published model, no switch):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb25-23">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CONCAVE[c]</span>
<span id="cb25-24">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, I0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> concave UP over x in"</span></span>
<span id="cb25-25">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_up_from'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_up_to'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span></span>
<span id="cb25-26">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   onset </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inside: "</span></span>
<span id="cb25-27">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_up_from'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> k[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_up_to'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-28">CONCAVE_LOW_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(CONCAVE[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_up_from"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb25-29">CONCAVE_ONSET_MARGIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CONCAVE[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_up_from"</span>]</span>
<span id="cb25-30">                                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb25-31"></span>
<span id="cb25-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE COUNTERFACTUAL: the same model with the diffusion terms switched on only</span></span>
<span id="cb25-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at a critical conversion - what the paper says the alternatives do.</span></span>
<span id="cb25-34">X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span></span>
<span id="cb25-35">_sw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, switch_xc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X_CRIT)</span>
<span id="cb25-36">_cs_sw, _tg_sw, _d2_sw, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> concavity(_sw, T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb25-37">_xs_sw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _cs_sw(_tg_sw)</span>
<span id="cb25-38">_pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (_xs_sw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (_xs_sw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb25-39">SWITCH_D2_MAX_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_d2_sw[_pre]))</span>
<span id="cb25-40">SWITCH_FRAC_CONCAVE_DOWN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(_d2_sw[_pre] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb25-41">_post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (_xs_sw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (_xs_sw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb25-42">SWITCH_D2_MIN_POST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_d2_sw[_post]))</span>
<span id="cb25-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the slope discontinuity the switch creates in log k_t at x_c.</span></span>
<span id="cb25-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOTH FACTORS ARE EVALUATED AT x_c EXACTLY.  lambda_0 is taken from the dense</span></span>
<span id="cb25-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BDF solution at the ROOT of x(t) = x_c, not at the nearest point of the</span></span>
<span id="cb25-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># resampling grid: on the 4001-point grid the nearest point to 0.30 is 0.29993,</span></span>
<span id="cb25-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and reading the Fujita factor at 0.30 while reading lambda_0 at 0.29993 puts</span></span>
<span id="cb25-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two factors of one expression at two different conversions.</span></span>
<span id="cb25-49"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lam0_at_x(model, xv):</span>
<span id="cb25-50">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""lambda_0 at exactly conversion xv, root-found on the dense solution."""</span></span>
<span id="cb25-51">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.solve(T_END[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(model.T_C)], x_stop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999</span>))</span>
<span id="cb25-52">    t_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.sol(t)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb25-53">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb25-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.sol(t_star)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t_star)</span>
<span id="cb25-55"></span>
<span id="cb25-56"></span>
<span id="cb25-57">_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _sw.fujita(X_CRIT)</span>
<span id="cb25-58">_P, _T_AT_XC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lam0_at_x(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], X_CRIT)</span>
<span id="cb25-59">SWITCH_LOGKT_JUMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(_sw.kt0)</span>
<span id="cb25-60">                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_sw.kt0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _sw.theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_g)))</span>
<span id="cb25-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the counterfactual - the SAME model with the diffusion terms switched"</span></span>
<span id="cb25-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" on at x_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb25-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  over 0.05 &lt; x &lt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the largest d2x/dt2 is"</span></span>
<span id="cb25-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWITCH_D2_MAX_PRE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWITCH_FRAC_CONCAVE_DOWN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the"</span></span>
<span id="cb25-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" samples are negative"</span>)</span>
<span id="cb25-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; concave DOWN throughout the pre-switch portion, which is exactly"</span></span>
<span id="cb25-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" what the paper says"</span>)</span>
<span id="cb25-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and log10 k_t jumps by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWITCH_LOGKT_JUMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the switch, a"</span></span>
<span id="cb25-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" discontinuity the published</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">     model does not have anywhere:"</span></span>
<span id="cb25-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" eq. 31 and 32 carry no branch at all."</span>)</span>
<span id="cb25-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     (both factors at x_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_CRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exactly: lambda_0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" mol/L, root-found at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_T_AT_XC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min)"</span>)</span>
<span id="cb25-73"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">IN THE PUBLISHED MODEL the conversion curve is concave DOWN below"</span></span>
<span id="cb25-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CONCAVE_LOW_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(initiator depletion, before diffusion"</span></span>
<span id="cb25-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" limitation takes over) and concave UP from there</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to the sharp rise."</span></span>
<span id="cb25-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The paper's sentence is about the portion 'preceding the sharp rise'"</span></span>
<span id="cb25-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and every onset sits inside the concave-up window, by at least"</span></span>
<span id="cb25-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CONCAVE_ONSET_MARGIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in x - but the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">model's pre-gel curve is"</span></span>
<span id="cb25-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" NOT concave upward everywhere, and the paper does not say it is."</span>)</span>
<span id="cb25-80"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> SWITCH_D2_MAX_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> CONCAVE_ONSET_MARGIN</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>where d2x/dt2 changes sign (the published model, no switch):

  50 degC, I0 = 0.0258   concave UP over x in [0.08409, 0.62142]   onset 0.25516 inside: True
  50 degC, I0 = 0.01548  concave UP over x in [0.06486, 0.62353]   onset 0.23760 inside: True
  70 degC, I0 = 0.0258   concave UP over x in [0.18922, 0.67635]   onset 0.34838 inside: True
  70 degC, I0 = 0.01548  concave UP over x in [0.16182, 0.67573]   onset 0.32167 inside: True
  90 degC, I0 = 0.0258   concave UP over x in [0.30643, 0.72917]   onset 0.44034 inside: True
  90 degC, I0 = 0.01548  concave UP over x in [0.28940, 0.73164]   onset 0.41874 inside: True

the counterfactual - the SAME model with the diffusion terms switched on at x_c = 0.3:
  over 0.05 &lt; x &lt; 0.29 the largest d2x/dt2 is -1.391e-06 and 100.0% of the samples are negative
  -&gt; concave DOWN throughout the pre-switch portion, which is exactly what the paper says
  and log10 k_t jumps by 0.760194 at the switch, a discontinuity the published
     model does not have anywhere: eq. 31 and 32 carry no branch at all.
     (both factors at x_c = 0.3 exactly: lambda_0 = 1.0317492344e-07 mol/L, root-found at t = 188.979197 min)

IN THE PUBLISHED MODEL the conversion curve is concave DOWN below x = 0.30643
(initiator depletion, before diffusion limitation takes over) and concave UP from there
to the sharp rise.  The paper's sentence is about the portion 'preceding the sharp rise'
and every onset sits inside the concave-up window, by at least 0.12933 in x - but the
model's pre-gel curve is NOT concave upward everywhere, and the paper does not say it is.</code></pre>
</div>
</div>
<div id="0e90e3ff" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:01.549711Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:01.549570Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:07.473950Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:07.473104Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- "only a small number of adjustable parameters" (book p. 349) -----------</span></span>
<span id="cb27-2">N_COND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T2)</span>
<span id="cb27-3">N_DISTINCT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(T2.theta_t_min.nunique() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> T2.theta_p_min.nunique()</span>
<span id="cb27-4">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> T2.A.nunique() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> T2.B.nunique())</span>
<span id="cb27-5">N_NAMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># theta_t, theta_p, A, B - the paper's own count</span></span>
<span id="cb27-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the paper names </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_NAMED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> adjustable parameters (book p. 352: 'the"</span></span>
<span id="cb27-7">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" remaining four model</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">parameters, theta_t, theta_p, A, and B').  Table"</span></span>
<span id="cb27-8">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" II fits </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_DISTINCT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> DISTINCT NUMBERS across"</span></span>
<span id="cb27-9">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_COND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> experimental conditions:"</span></span>
<span id="cb27-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>theta_t_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>nunique()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> theta_t (one per condition),"</span></span>
<span id="cb27-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>theta_p_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>nunique()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> theta_p and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>nunique()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> A (one per"</span></span>
<span id="cb27-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" temperature),</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>nunique()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> B (global) -"</span></span>
<span id="cb27-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_DISTINCT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>N_COND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> fitted numbers per condition."</span>)</span>
<span id="cb27-14"></span>
<span id="cb27-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE PAPER'S OWN COMPRESSION: Figures 13 and 15 turn those 13 into a smaller</span></span>
<span id="cb27-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># set.  "Figures 13 and 15 provide an effective means to estimate all the model</span></span>
<span id="cb27-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># parameters for model predictions ... over a wide temperature range."</span></span>
<span id="cb27-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _arr_pred(theta, TK, E_kcal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, shared<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb27-19">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.asarray(theta, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb27-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb27-21">        X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(TK), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK]).T</span>
<span id="cb27-22">        c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb27-23">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb27-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb27-25"></span>
<span id="cb27-26"></span>
<span id="cb27-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a) theta_t with a SHARED activation energy and one prefactor per loading: 3</span></span>
<span id="cb27-28">_y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>]), np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>])])</span>
<span id="cb27-29">_X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb27-30">_X[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb27-31">_X[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb27-32">_X[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3])</span>
<span id="cb27-33">_cs3, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(_X, _y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb27-34">TH_T_SHARED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(_X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _cs3)</span>
<span id="cb27-35">E_T_SHARED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_cs3[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>R_CAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>)</span>
<span id="cb27-36">TH_T_SHARED_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb27-37">    TH_T_SHARED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.concatenate([TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>], TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>]]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb27-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># b) theta_p Arrhenius: 2</span></span>
<span id="cb27-39">_yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_P)</span>
<span id="cb27-40">_Xp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T</span>
<span id="cb27-41">_cp, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(_Xp, _yp, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb27-42">TH_P_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(_Xp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _cp)</span>
<span id="cb27-43">TH_P_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TH_P_FIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb27-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># c) A linear in (T - T_gp)^2: 2   d) B: 1</span></span>
<span id="cb27-45">A_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _X_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(U), U]).T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _c</span>
<span id="cb27-46">A_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(A_FIT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb27-47">N_COMPRESSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb27-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the paper's OWN correlations compress those </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_DISTINCT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> into"</span></span>
<span id="cb27-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_COMPRESSED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: theta_t Arrhenius with a shared</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">activation energy"</span></span>
<span id="cb27-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_T_SHARED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kcal/mol) and one prefactor per loading = 3,"</span></span>
<span id="cb27-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta_p Arrhenius = 2,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A linear in (T - T_gp)^2 = 2, B = 1.  What"</span></span>
<span id="cb27-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" that costs on the tabulated values:"</span>)</span>
<span id="cb27-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  theta_t reproduced to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TH_T_SHARED_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   theta_p to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TH_P_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   A to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-55"></span>
<span id="cb27-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and what it costs on the ANSWER: rerun the onset with compressed parameters</span></span>
<span id="cb27-57">ONSET_COMPRESSED, ONSET_COMPRESSED_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}</span>
<span id="cb27-58"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)):</span>
<span id="cb27-59">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, I0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)):</span>
<span id="cb27-60">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(TC, I0, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TH_T_SHARED[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> i]),</span>
<span id="cb27-61">                 theta_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TH_P_FIT[i]), A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(A_FIT[i]))</span>
<span id="cb27-62">        cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(m, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb27-63">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0)))</span>
<span id="cb27-64">        ONSET_COMPRESSED[(TC, I0)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb27-65">        ONSET_COMPRESSED_SHIFT[(TC, I0)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET[(TC, I0)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>])</span>
<span id="cb27-66">ONSET_COMPRESSED_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET_COMPRESSED_SHIFT.values()))</span>
<span id="cb27-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AND ON THE ANSWER, WHICH IS WHERE THE CLAIM GETS ITS TEETH: the"</span></span>
<span id="cb27-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" largest shift in the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  onset conversion when the model is run from the"</span></span>
<span id="cb27-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_COMPRESSED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> compressed parameters instead of the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_DISTINCT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tabulated ones is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_COMPRESSED_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in x -"</span></span>
<span id="cb27-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_COMPRESSED_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET_MAX_ABS_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the"</span></span>
<span id="cb27-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET_MAX_ABS_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by which</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  this page's reconstruction misses"</span></span>
<span id="cb27-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the printed onsets.  So the compression is NOT free at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the"</span></span>
<span id="cb27-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" resolution of the paper's own stated results: 'Figures 13 and 15"</span></span>
<span id="cb27-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" provide an</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  effective means to estimate all the model parameters'"</span></span>
<span id="cb27-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (book p. 355) is true as a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  procedure and lossy as an identity, and"</span></span>
<span id="cb27-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the loss is concentrated in theta_t, whose six</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  tabulated values the"</span></span>
<span id="cb27-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" two Arrhenius lines reproduce only to"</span></span>
<span id="cb27-79">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TH_T_SHARED_MAXREL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb27-80"></span>
<span id="cb27-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HOW DIRECTLY DOES A KNOB SET THE ONSET?  A switched model's x_c IS the onset,</span></span>
<span id="cb27-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># by construction: d(onset)/d(x_c) = 1.  Here the nearest thing to an onset knob</span></span>
<span id="cb27-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is theta_t, and its leverage is measured rather than argued.</span></span>
<span id="cb27-84">_c0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)</span>
<span id="cb27-85">_m0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[_c0]</span>
<span id="cb27-86">_pert, _pert_flat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb27-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fac <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb27-88">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_m0.theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>fac)</span>
<span id="cb27-89">    cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(m, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb27-90">    _pert.append(onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0))))</span>
<span id="cb27-91">    _pert_flat.append(onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0)),</span>
<span id="cb27-92">                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flattest"</span>))</span>
<span id="cb27-93"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ONSET[_c0][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], (</span>
<span id="cb27-94">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the onset is not monotone in theta_t"</span>)</span>
<span id="cb27-95"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE GUARD THAT MATTERS IS THIS SECOND ONE.  The assertion above exercises</span></span>
<span id="cb27-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># onset_window, which is derivative-free and has no curvature-feature</span></span>
<span id="cb27-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># selection, so it cannot detect a construction that picks the glass-effect</span></span>
<span id="cb27-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># feature.  The construction that can is onset_from, and it is asserted</span></span>
<span id="cb27-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># monotone here, on the same three parameter sets.</span></span>
<span id="cb27-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE SAME CONSTRUCTION AT THE PERTURBATION LADDER'S OWN RESOLUTION.  The</span></span>
<span id="cb27-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># triples above are built at nx = 2001 while ONSET is built at nx = 4001, so the</span></span>
<span id="cb27-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tabulated-theta_t tangent is computed at BOTH resolutions here and the</span></span>
<span id="cb27-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># monotonicity is asserted at both.  The 2e-5 between them is the resampling</span></span>
<span id="cb27-104"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># floor this page measures elsewhere, not a disagreement between constructions.</span></span>
<span id="cb27-105">_cv0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(_m0, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb27-106">FLAT_TABULATED_2001 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(_cv0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], _cv0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>],</span>
<span id="cb27-107">                              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(_m0.kt0)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flattest"</span>)</span>
<span id="cb27-108"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> (_pert_flat[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ONSET[_c0][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_flattest"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _pert_flat[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-109">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _pert_flat[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> FLAT_TABULATED_2001 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _pert_flat[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), (</span>
<span id="cb27-110">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the TANGENT onset is not monotone in theta_t - which is the symptom that"</span></span>
<span id="cb27-111">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" exposed the construction picking the glass-effect feature instead of the"</span></span>
<span id="cb27-112">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" gel-effect one; see the note in onset_from"</span>)</span>
<span id="cb27-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  MONOTONICITY IN theta_t, ASSERTED ON BOTH CONSTRUCTIONS at half, one"</span></span>
<span id="cb27-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and twice the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  tabulated theta_t (50 degC): window fit"</span></span>
<span id="cb27-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[_c0][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x_onset'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span></span>
<span id="cb27-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  flattest-point tangent </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pert_flat[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &gt;"</span></span>
<span id="cb27-117">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[_c0][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_flattest'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pert_flat[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb27-118"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  READ THE MIDDLE ENTRIES AT THE SAME RESOLUTION BEFORE COMPARING THEM."</span></span>
<span id="cb27-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The two outer</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  values above come from nx = 2001 curves and"</span></span>
<span id="cb27-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ONSET[_c0][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_flattest'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the nx = 4001 curve the rest of"</span></span>
<span id="cb27-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" this</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  page uses; the SAME tangent construction at nx = 2001 gives"</span></span>
<span id="cb27-122">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FLAT_TABULATED_2001<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ONSET[_c0][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alt_flattest'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FLAT_TABULATED_2001)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> between the"</span></span>
<span id="cb27-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" two lines is this page's own</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  resampling floor and not a"</span></span>
<span id="cb27-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" disagreement between the constructions."</span>)</span>
<span id="cb27-126">D_ONSET_D_DECADE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((_pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)))</span>
<span id="cb27-127"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  LEVERAGE OF THE NEAREST THING TO AN ONSET KNOB: halving and doubling"</span></span>
<span id="cb27-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta_t at 50 degC</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  moves the onset from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to"</span></span>
<span id="cb27-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pert[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_ONSET_D_DECADE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in conversion per DECADE"</span></span>
<span id="cb27-130">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  theta_t.  A prescribed critical conversion moves the onset by"</span></span>
<span id="cb27-131">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1.0 per unit of itself, by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  construction.  That ratio -"</span></span>
<span id="cb27-132">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_ONSET_D_DECADE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades of theta_t per unit of onset -"</span></span>
<span id="cb27-133">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is the page's</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  quantitative answer to whether this model has merely"</span></span>
<span id="cb27-134">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" renamed the switch."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>the paper names 4 adjustable parameters (book p. 352: 'the remaining four model
parameters, theta_t, theta_p, A, and B').  Table II fits 13 DISTINCT NUMBERS across
6 experimental conditions: 6 theta_t (one per condition), 3 theta_p and 3 A (one per temperature),
1 B (global) - 2.1667 fitted numbers per condition.

the paper's OWN correlations compress those 13 into 8: theta_t Arrhenius with a shared
activation energy (34.7124 kcal/mol) and one prefactor per loading = 3, theta_p Arrhenius = 2,
A linear in (T - T_gp)^2 = 2, B = 1.  What that costs on the tabulated values:
  theta_t reproduced to 18.8281%   theta_p to 8.3695%   A to 0.0882%

  AND ON THE ANSWER, WHICH IS WHERE THE CLAIM GETS ITS TEETH: the largest shift in the
  onset conversion when the model is run from the 8 compressed parameters instead of the
  13 tabulated ones is 0.01633 in x - 1.6907 times the 0.00966 by which
  this page's reconstruction misses the printed onsets.  So the compression is NOT free at
  the resolution of the paper's own stated results: 'Figures 13 and 15 provide an
  effective means to estimate all the model parameters' (book p. 355) is true as a
  procedure and lossy as an identity, and the loss is concentrated in theta_t, whose six
  tabulated values the two Arrhenius lines reproduce only to 18.8281%.

  MONOTONICITY IN theta_t, ASSERTED ON BOTH CONSTRUCTIONS at half, one and twice the
  tabulated theta_t (50 degC): window fit 0.31916 &gt; 0.25516 &gt; 0.18830;
  flattest-point tangent 0.32043 &gt; 0.25453 &gt; 0.18436.
  READ THE MIDDLE ENTRIES AT THE SAME RESOLUTION BEFORE COMPARING THEM.  The two outer
  values above come from nx = 2001 curves and 0.25453 from the nx = 4001 curve the rest of this
  page uses; the SAME tangent construction at nx = 2001 gives 0.25455, and the
  2.1e-05 between the two lines is this page's own
  resampling floor and not a disagreement between the constructions.

  LEVERAGE OF THE NEAREST THING TO AN ONSET KNOB: halving and doubling theta_t at 50 degC
  moves the onset from 0.31916 to 0.18830, i.e. -0.21735 in conversion per DECADE of
  theta_t.  A prescribed critical conversion moves the onset by 1.0 per unit of itself, by
  construction.  That ratio - 4.6009 decades of theta_t per unit of onset - is the page's
  quantitative answer to whether this model has merely renamed the switch.</code></pre>
</div>
</div>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Ranked by what each thing proves, strongest first. <strong>The strongest validation available for a gel-effect model would be a conversion history the parameters were not fitted to, and this paper contains none in numerals</strong> - the data are Marten &amp; Hamielec’s and they are markers on Figures 3-9. That validation is therefore not available and is not manufactured. What is done instead:</p>
<ol type="1">
<li><strong>Internal identities the paper must satisfy, proved symbolically or on an explicit finite population</strong> - the eq. 21 -&gt; 26 chain, and the moment reduction of eq. 4a, 4b and 5 into eq. 12-17.</li>
<li><strong>Two correlations the paper draws through its own Table II</strong> - Figure 13’s activation energies and Figure 15’s straight line - recomputed from the same cells, one of them against a null.</li>
<li><strong>The paper’s six stated numerical results</strong>, reproduced from the model. Reproduction, not validation: these are two computations of the same published equations.</li>
<li><strong>Two discretisations refined to observed order</strong>, each against a reference that shares no assembly with it - and a third refinement, of the shell BVP’s own flux, which is what prices eq. 22.</li>
<li><strong>53 defect injections</strong>, with the coverage map generated from their measured moves rather than written by hand.</li>
<li><strong>A refinement of the resampling grid the onsets are read on</strong>, which is what fixes how many digits of them are worth printing.</li>
</ol>
<p><strong>No figure is digitised anywhere on this page.</strong></p>
<div id="282416ad" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:07.476142Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:07.475958Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:07.487549Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:07.486740Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the moment equations, checked against the chain-length equations -------</span></span>
<span id="cb29-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 12-17 are eq. 4a, 4b and 5 summed over n with weights n^0, n^1, n^2.  That</span></span>
<span id="cb29-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is an IDENTITY, and it is checked here on an explicit finite population rather</span></span>
<span id="cb29-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># than argued: a seeded random P_1..P_N and M_1..M_N with a zero tail, so the</span></span>
<span id="cb29-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># telescoping and convolution boundary terms vanish exactly.</span></span>
<span id="cb29-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> moment_identity(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>, ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, seed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEED, break_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, support<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb29-7">    rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.random.default_rng(seed)</span>
<span id="cb29-8">    n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.arange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb29-9">    P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rng.random(N)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span>)</span>
<span id="cb29-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ZERO TAIL ON THE UPPER HALF, so that BOTH truncations are exact: the</span></span>
<span id="cb29-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># telescoping in eq. 4b needs P_N = 0, and the convolution in eq. 5 needs</span></span>
<span id="cb29-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every pair (m, n-m) with P_m P_{n-m} nonzero to have m + (n-m) &lt;= N.</span></span>
<span id="cb29-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `support` widens it past N//2 on purpose, which is what the truncation</span></span>
<span id="cb29-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># companion below measures.</span></span>
<span id="cb29-15">    P[(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> support <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> support):] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb29-16">    kp, kt, M, gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1e4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7e9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.9e-6</span></span>
<span id="cb29-17">    ktd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ktc</span>
<span id="cb29-18">    lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)])</span>
<span id="cb29-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># chain-length equations, eq. 4a/4b and 5, WITHOUT the dilution term (which</span></span>
<span id="cb29-20">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is common to both sides and cancels from the identity)</span></span>
<span id="cb29-21">    dP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty(N)</span>
<span id="cb29-22">    dP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb29-23">    dP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(P[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb29-24">    conv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(P[:i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>::<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][:i]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(N)])  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sum_{m&lt;n}</span></span>
<span id="cb29-25">    dMn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>conv</span>
<span id="cb29-26">    lhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dP) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)]</span>
<span id="cb29-27">                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dMn) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)])</span>
<span id="cb29-28">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the moment equations as this notebook implements them, eq. 12-17</span></span>
<span id="cb29-29">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(l0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb29-30">             l1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb29-31">             l2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>gen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb29-32">             m0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb29-33">             m1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb29-34">             m2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ktd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> lam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb29-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> break_term <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb29-36">        c[break_term] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c[break_term]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb29-37">    rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l0"</span>], c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l1"</span>], c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l2"</span>], c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m0"</span>], c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m1"</span>], c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2"</span>]])</span>
<span id="cb29-38">    scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lhs), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb29-39">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lhs)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>scale)), lhs, rhs</span>
<span id="cb29-40"></span>
<span id="cb29-41"></span>
<span id="cb29-42">MOMENT_ID_KTC0, _lhs0, _rhs0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> moment_identity(ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb29-43">MOMENT_ID_KTC, _lhsc, _rhsc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> moment_identity(ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0e8</span>)</span>
<span id="cb29-44">MOMENT_ID_BROKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(moment_identity(ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0e8</span>, break_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb29-45">                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2"</span>))</span>
<span id="cb29-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the ABOVE-FLOOR COMPANION with content: the same identity with the</span></span>
<span id="cb29-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># convolution's truncation deliberately violated (P kept nonzero past N/2, so</span></span>
<span id="cb29-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pairs m + (n-m) &gt; N fall off the end of eq. 5's sum).  Unlike the sign flip,</span></span>
<span id="cb29-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this number depends on the population and therefore moves.</span></span>
<span id="cb29-50">MOMENT_ID_TRUNC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> moment_identity(ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0e8</span>, support<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb29-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment-closure identity, eq. 12-17 against eq. 4a/4b and 5 summed:"</span>)</span>
<span id="cb29-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  with k_tc = 0 as Table I prints it : max relative residual below"</span></span>
<span id="cb29-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1e-14 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOMENT_ID_KTC0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb29-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  with k_tc = 4.0e8 (NOT PRINTED)    : max relative residual below"</span></span>
<span id="cb29-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1e-14 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOMENT_ID_KTC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb29-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  worst single sign flip in one term : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOMENT_ID_BROKEN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   &lt;- STRUCTURAL: flipping a term that"</span>)</span>
<span id="cb29-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                                        matches exactly gives"</span></span>
<span id="cb29-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" |-2c|/|c| = 2 on ANY population, so this"</span>)</span>
<span id="cb29-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                                        number cannot move and is"</span></span>
<span id="cb29-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" declared structural below."</span>)</span>
<span id="cb29-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  convolution truncation violated    : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOMENT_ID_TRUNC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   &lt;- the companion that DOES depend on"</span>)</span>
<span id="cb29-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                                        the population, and moves"</span></span>
<span id="cb29-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" with it"</span>)</span>
<span id="cb29-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT IS INERT IN THE PAPER'S OWN CALCULATION: Table I sets k_tc = 0,"</span></span>
<span id="cb29-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" so the combination</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">terms of eq. 5, 15, 16 and 17 - every term"</span></span>
<span id="cb29-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" carrying k_tc - are never exercised by any</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">condition the paper"</span></span>
<span id="cb29-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" reports.  They are exercised HERE, with a k_tc that is not printed</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"anywhere in the paper, purely so that the transcription of those terms"</span></span>
<span id="cb29-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is tested; no</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">conversion, radical concentration or molecular weight"</span></span>
<span id="cb29-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" on this page uses a non-zero k_tc.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The paper states the consequence"</span></span>
<span id="cb29-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" itself (book p. 352): 'Note that termination by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">recombination is"</span></span>
<span id="cb29-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ignored in the calculation, so the molecular weight predictions will"</span></span>
<span id="cb29-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" be</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">underestimated.'"</span>)</span>
<span id="cb29-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># both residuals are registered as bounds (identity, 1e-14) in the claims cell</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>moment-closure identity, eq. 12-17 against eq. 4a/4b and 5 summed:
  with k_tc = 0 as Table I prints it : max relative residual below 1e-14 (here 2.1e-16)
  with k_tc = 4.0e8 (NOT PRINTED)    : max relative residual below 1e-14 (here 1.6e-16)
  worst single sign flip in one term : 2.000e+00   &lt;- STRUCTURAL: flipping a term that
                                        matches exactly gives |-2c|/|c| = 2 on ANY population, so this
                                        number cannot move and is declared structural below.
  convolution truncation violated    : 3.125e-02   &lt;- the companion that DOES depend on
                                        the population, and moves with it

WHAT IS INERT IN THE PAPER'S OWN CALCULATION: Table I sets k_tc = 0, so the combination
terms of eq. 5, 15, 16 and 17 - every term carrying k_tc - are never exercised by any
condition the paper reports.  They are exercised HERE, with a k_tc that is not printed
anywhere in the paper, purely so that the transcription of those terms is tested; no
conversion, radical concentration or molecular weight on this page uses a non-zero k_tc.
The paper states the consequence itself (book p. 352): 'Note that termination by
recombination is ignored in the calculation, so the molecular weight predictions will be
underestimated.'</code></pre>
</div>
</div>
<div id="7d93d626" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:07.489359Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:07.489181Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:08.041073Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:08.040235Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- eq. 21-26 re-derived, and eq. 22's approximation priced ----------------</span></span>
<span id="cb31-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb31-3"></span>
<span id="cb31-4">r, rm, rD, D, Cb, Cm, kt0s, K, C0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(</span>
<span id="cb31-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r r_m r_D D C_b C_m k_t0 K C_0"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb31-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 21: 4 pi r^2 D dC/dr = K.  Integrated once, with the paper's own boundary</span></span>
<span id="cb31-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># conditions C(r_m) = C_m and C(r_D) = C_b, both printed under eq. 21.</span></span>
<span id="cb31-8">Cr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> C0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.integrate(K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D), r)</span>
<span id="cb31-9">_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve([sp.Eq(Cr.subs(r, rm), Cm), sp.Eq(Cr.subs(r, rD), Cb)],</span>
<span id="cb31-10">              [C0, K], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb31-11">K_EXACT_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(_c[K])</span>
<span id="cb31-12">C_PROFILE_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(Cr.subs(_c))</span>
<span id="cb31-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sp.simplify(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.diff(C_PROFILE_SYM, r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_EXACT_SYM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb31-14">K_APPROX_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Cb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cm)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 22</span></span>
<span id="cb31-15">EQ22_REL_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_APPROX_SYM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_EXACT_SYM)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># = r_m/r_D</span></span>
<span id="cb31-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 23 -&gt; 24 -&gt; 25 -&gt; 26, all the way to the printed eq. 26</span></span>
<span id="cb31-17">Cm_sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve(sp.Eq(K_APPROX_SYM.subs(Cm, Cm), sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb31-18">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kt0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cb), Cm)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb31-19">EQ24_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(Cm_sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kt0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb31-20">kt_sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(kt0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cm_sol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Cb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 25</span></span>
<span id="cb31-21">EQ26_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kt_sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kt0s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D)))</span>
<span id="cb31-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># evaluated at O(1) arguments deliberately: the residual is a SYMBOLIC zero, and</span></span>
<span id="cb31-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the point of evaluating it is to give the break row below room to move it away</span></span>
<span id="cb31-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from zero by more than the coverage threshold.</span></span>
<span id="cb31-25">SUBS_O1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {D: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>, rm: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span>, kt0s: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>, Cb: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>}</span>
<span id="cb31-26">EQ24_RESID_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.Abs(EQ24_RESID.subs(SUBS_O1)))</span>
<span id="cb31-27">EQ26_RESID_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.Abs(EQ26_RESID.subs(SUBS_O1)))</span>
<span id="cb31-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 21 integrated symbolically with the printed boundary conditions:"</span>)</span>
<span id="cb31-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  K (exact)                = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>simplify(K_EXACT_SYM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  K (eq. 22, printed)      = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_APPROX_SYM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  1 - K_22/K_exact         = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ22_REL_SYM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;- exactly r_m/r_D"</span>)</span>
<span id="cb31-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  eq. 24 residual (symbolic </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ24_RESID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), evaluated: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ24_RESID_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  eq. 26 residual (symbolic </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ26_RESID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), evaluated: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ26_RESID_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sp.simplify(EQ22_REL_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb31-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> EQ24_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> EQ26_RESID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. 21 integrated symbolically with the printed boundary conditions:
  K (exact)                = 4*pi*D*r_D*r_m*(C_b - C_m)/(r_D - r_m)
  K (eq. 22, printed)      = 4*pi*D*r_m*(C_b - C_m)
  1 - K_22/K_exact         = r_m/r_D   &lt;- exactly r_m/r_D
  eq. 24 residual (symbolic 0), evaluated: 0.000e+00
  eq. 26 residual (symbolic 0), evaluated: 0.000e+00</code></pre>
</div>
</div>
<div id="7ced1776" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:08.043463Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:08.043047Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:08.110991Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:08.110165Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb33-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- eq. 21 solved as a pymrm 1-D spherical BVP -----------------------------</span></span>
<span id="cb33-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The paper's own diffusion problem, on the shell r_m &lt;= r &lt;= r_D, with the</span></span>
<span id="cb33-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># operators rather than the closed form: nu = 2 is spherical geometry.</span></span>
<span id="cb33-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> shell_bvp(n, ratio, Cm_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, Cb_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, D_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, rm_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb33-5">    rD_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ratio</span>
<span id="cb33-6">    shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (n, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb33-7">    r_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(rm_, rD_, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb33-8">    r_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(r_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb33-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a dC/dn + b C = d on the OUTWARD normal; both ends are Dirichlet, so a = 0</span></span>
<span id="cb33-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the sign of the normal does not enter:</span></span>
<span id="cb33-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   r = r_m : C = C_m     r = r_D : C = C_b</span></span>
<span id="cb33-12">    bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: Cm_}, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: Cb_})</span>
<span id="cb33-13">    grad, grad_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_grad(shape, r_f, r_c, bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb33-14">    div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(shape, r_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nu=2: spherical</span></span>
<span id="cb33-15">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spsolve((div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>D_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>grad)).tocsc(),</span>
<span id="cb33-16">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>D_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>grad_bc)).toarray().ravel())</span>
<span id="cb33-17">    dCdr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray((grad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> grad_bc)).ravel()</span>
<span id="cb33-18">    K_faces <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r_f<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dCdr                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 21's left side</span></span>
<span id="cb33-19">    C_exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cb_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (Cm_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cb_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD_)</span>
<span id="cb33-20">    K_exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Cb_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cm_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD_)</span>
<span id="cb33-21">    K_approx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rm_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Cb_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cm_)                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 22</span></span>
<span id="cb33-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> C_exact)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb33-23">                K_spread<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_faces.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_faces.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()),</span>
<span id="cb33-24">                K_mid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_faces[n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), K_exact<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_exact),</span>
<span id="cb33-25">                K_approx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K_approx))</span>
<span id="cb33-26"></span>
<span id="cb33-27"></span>
<span id="cb33-28">BVP_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">320</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1280</span>]</span>
<span id="cb33-29">BVP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [shell_bvp(n, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BVP_N]</span>
<span id="cb33-30">BVP_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BVP]</span>
<span id="cb33-31">BVP_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(BVP_ERR[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BVP_ERR[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb33-32">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BVP_ERR) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb33-33">BVP_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BVP_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb33-34">BVP_K_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BVP[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_mid"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BVP[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_exact"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb33-35">BVP_K_SPREAD_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(BVP[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_spread"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BVP[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_exact"</span>])</span>
<span id="cb33-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 21 as a pymrm spherical-shell BVP (construct_grad + construct_div,"</span></span>
<span id="cb33-37">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" nu = 2):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms error'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'order'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'K(mid)/K_exact - 1'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;20}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-39"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(BVP_N):</span>
<span id="cb33-40">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BVP_ORDERS[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-41">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BVP_ERR[i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-42">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BVP[i][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'K_mid'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>BVP[i][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'K_exact'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:20.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  eq. 21 says 4 pi r^2 D dC/dr is the SAME CONSTANT at every radius;"</span></span>
<span id="cb33-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the discrete</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  solution holds that to below 1e-8 relative (here"</span></span>
<span id="cb33-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BVP_K_SPREAD_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) across all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BVP_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> faces."</span>)</span>
<span id="cb33-46"></span>
<span id="cb33-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- eq. 22 PRICED AGAINST THE FLUX THE DISCRETE SOLUTION CARRIES ------------</span></span>
<span id="cb33-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE COMPARISON IS K_mid, NOT K_exact, AND THAT IS THE WHOLE POINT.  K_mid is</span></span>
<span id="cb33-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4 pi r^2 D dC/dr read off the SOLVED profile at the middle face - it exists</span></span>
<span id="cb33-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only because construct_grad, construct_div(nu=2) and the solve produced it.</span></span>
<span id="cb33-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># K_exact and K_approx are both closed-form scalars, so 1 - K_approx/K_exact is</span></span>
<span id="cb33-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the algebraic identity 1 - r_m(1/r_m - 1/r_D) = r_m/r_D evaluated in floating</span></span>
<span id="cb33-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># point: it returns round-off with nu = 0, with two cells, and with no pymrm in</span></span>
<span id="cb33-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the room at all.  It is neither a pymrm BVP result nor a second route: the</span></span>
<span id="cb33-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># identity is already proved symbolically in the cell above, and evaluating it</span></span>
<span id="cb33-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># twice is one route, not two.  What the BVP can genuinely test is whether the</span></span>
<span id="cb33-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># flux the OPERATORS compute agrees with the closed form well enough to price</span></span>
<span id="cb33-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 22 - so that is what is measured, on a refinement ladder, with the</span></span>
<span id="cb33-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># observed order reported.</span></span>
<span id="cb33-60">RATIOS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>]</span>
<span id="cb33-61">EQ22_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>]</span>
<span id="cb33-62"></span>
<span id="cb33-63"></span>
<span id="cb33-64">EQ22_ARGMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># n -&gt; the ratio that attains the max, recorded as it goes</span></span>
<span id="cb33-65"></span>
<span id="cb33-66"></span>
<span id="cb33-67"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eq22_dev(n, flux<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_mid"</span>):</span>
<span id="cb33-68">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max over the five ratios of |(1 - K_22/K_disc) - r_m/r_D|."""</span></span>
<span id="cb33-69">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb33-70">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RATIOS:</span>
<span id="cb33-71">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shell_bvp(n, q)</span>
<span id="cb33-72">        out.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_approx"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b[flux] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q))</span>
<span id="cb33-73">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> flux <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_mid"</span>:</span>
<span id="cb33-74">        EQ22_ARGMAX[n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RATIOS[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(out))])</span>
<span id="cb33-75">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(out))</span>
<span id="cb33-76"></span>
<span id="cb33-77"></span>
<span id="cb33-78">EQ22_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [_eq22_dev(n) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EQ22_N]</span>
<span id="cb33-79">EQ22_MAXDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EQ22_DEV[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb33-80">EQ22_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(EQ22_DEV[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>EQ22_DEV[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb33-81">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EQ22_DEV) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb33-82">EQ22_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EQ22_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb33-83">_b22 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [shell_bvp(EQ22_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], q) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RATIOS]</span>
<span id="cb33-84">EQ22_MEASURED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_approx"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_mid"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _b22]</span>
<span id="cb33-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and eq. 22's 'Since r_D &gt;&gt; r_m' costs exactly r_m/r_D - priced"</span></span>
<span id="cb33-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" against the flux the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  DISCRETE solution carries, at n ="</span></span>
<span id="cb33-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ22_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb33-88"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(RATIOS, EQ22_MEASURED):</span>
<span id="cb33-89">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    r_m/r_D = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; 1 - K_22/K_mid = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-90">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   deviation </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-91"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max deviation from r_m/r_D'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;28}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'order'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-92"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(EQ22_N):</span>
<span id="cb33-93">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ22_ORDERS[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-94">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ22_DEV[i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:28.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    the deviation VANISHES UNDER REFINEMENT at observed order"</span></span>
<span id="cb33-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ22_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which is the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    statement that the discrete flux"</span></span>
<span id="cb33-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" agrees with eq. 22's error being exactly r_m/r_D.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    The identity"</span></span>
<span id="cb33-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" itself is proved symbolically above; this is the second route to it,"</span></span>
<span id="cb33-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    and it is a route: the nu = 0 break row below moves this number by"</span></span>
<span id="cb33-100">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" four orders."</span>)</span>
<span id="cb33-101">_amx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({EQ22_ARGMAX[n] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EQ22_N})</span>
<span id="cb33-102"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    WHERE THE MAXIMUM SITS: it is attained at r_m/r_D ="</span></span>
<span id="cb33-103">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _amx)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - the tightest shell, the one"</span></span>
<span id="cb33-104">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    whose boundary layer the grid resolves worst - at EVERY n on the"</span></span>
<span id="cb33-105">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ladder, so this metric is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    in effect the discretisation error of"</span></span>
<span id="cb33-106">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ONE of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(RATIOS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> geometries.  The other four are"</span></span>
<span id="cb33-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    beside it above and none of them is hidden by the max."</span>)</span>
<span id="cb33-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  THE PAPER PRINTS NO NUMBER FOR r_m OR r_D ANYWHERE, so the size of"</span></span>
<span id="cb33-109">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" this correction</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  cannot be evaluated for PMMA from this paper.  The"</span></span>
<span id="cb33-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" search behind that: the only</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  quantity in which r_m appears at all is"</span></span>
<span id="cb33-111">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta_t = r_m^2/(3 D_0) (eq. 27), which is fitted as</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  a whole;"</span></span>
<span id="cb33-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" `pdftotext` over PDF pages 1-9 - the pages whose running heads name this"</span></span>
<span id="cb33-113">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  article - returns r_m only in the derivation of eq. 21-27 on book"</span></span>
<span id="cb33-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pp. 351-352 and in the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  caption of Figure 2, never beside a numeral,"</span></span>
<span id="cb33-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and every one of those nine pages was</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  also read as an image."</span>)</span>
<span id="cb33-116"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> EQ22_MAXDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> EQ22_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, (</span>
<span id="cb33-117">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the discrete flux no longer converges onto eq. 22's exact r_m/r_D error"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. 21 as a pymrm spherical-shell BVP (construct_grad + construct_div, nu = 2):

     n    rms error    order   K(mid)/K_exact - 1
    40    1.733e-03                    -4.234e-03
    80    2.307e-04    2.909            1.056e-03
   160    5.424e-05    2.089            6.742e-04
   320    1.925e-05    1.494            2.332e-04
   640    5.852e-06    1.718            6.740e-05
  1280    1.610e-06    1.862            1.806e-05

  eq. 21 says 4 pi r^2 D dC/dr is the SAME CONSTANT at every radius; the discrete
  solution holds that to below 1e-8 relative (here 1.5e-10) across all 1281 faces.

  and eq. 22's 'Since r_D &gt;&gt; r_m' costs exactly r_m/r_D - priced against the flux the
  DISCRETE solution carries, at n = 6400:
    r_m/r_D = 0.5    -&gt; 1 - K_22/K_mid = 0.50000000   deviation +1.783e-09
    r_m/r_D = 0.2    -&gt; 1 - K_22/K_mid = 0.20000003   deviation +3.228e-08
    r_m/r_D = 0.1    -&gt; 1 - K_22/K_mid = 0.10000016   deviation +1.635e-07
    r_m/r_D = 0.05   -&gt; 1 - K_22/K_mid = 0.05000072   deviation +7.247e-07
    r_m/r_D = 0.01   -&gt; 1 - K_22/K_mid = 0.01001858   deviation +1.858e-05

       n   max deviation from r_m/r_D    order
     400                    9.687e-04         
     800                    6.747e-04    0.522
    1600                    2.375e-04    1.506
    3200                    6.913e-05    1.781
    6400                    1.858e-05    1.895

    the deviation VANISHES UNDER REFINEMENT at observed order 1.8953, which is the
    statement that the discrete flux agrees with eq. 22's error being exactly r_m/r_D.
    The identity itself is proved symbolically above; this is the second route to it,
    and it is a route: the nu = 0 break row below moves this number by four orders.
    WHERE THE MAXIMUM SITS: it is attained at r_m/r_D = 0.01 - the tightest shell, the one
    whose boundary layer the grid resolves worst - at EVERY n on the ladder, so this metric is
    in effect the discretisation error of ONE of the 5 geometries.  The other four are printed
    beside it above and none of them is hidden by the max.

  THE PAPER PRINTS NO NUMBER FOR r_m OR r_D ANYWHERE, so the size of this correction
  cannot be evaluated for PMMA from this paper.  The search behind that: the only
  quantity in which r_m appears at all is theta_t = r_m^2/(3 D_0) (eq. 27), which is fitted as
  a whole; `pdftotext` over PDF pages 1-9 - the pages whose running heads name this
  article - returns r_m only in the derivation of eq. 21-27 on book pp. 351-352 and in the
  caption of Figure 2, never beside a numeral, and every one of those nine pages was
  also read as an image.</code></pre>
</div>
</div>
<div id="7968a693" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:08.112951Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:08.112762Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:15.574599Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:15.573699Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the pymrm implementation: backward Euler + newton + NumJac -------------</span></span>
<span id="cb35-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> march(model, nt, t_end, y0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb35-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Backward Euler on the eight fields with pymrm's newton and NumJac.</span></span>
<span id="cb35-4"></span>
<span id="cb35-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    NumJac((1, 8)): the LAST axis is the field index, so the default stencil</span></span>
<span id="cb35-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    couples the eight fields in full and nothing else - the right shape for a</span></span>
<span id="cb35-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    pointwise source.  A bare (8,) shape would make the last axis "space",</span></span>
<span id="cb35-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    which would declare every cell coupled to every other and build a dense</span></span>
<span id="cb35-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Jacobian.</span></span>
<span id="cb35-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    THE FIELDS ARE SCALED before marching, because pymrm's `newton` tests the</span></span>
<span id="cb35-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    infinity norm of the Newton UPDATE and these eight states span twenty</span></span>
<span id="cb35-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    orders of magnitude (lambda_0 ~ 1e-8 mol/L against mu_2 ~ 1e8).  An</span></span>
<span id="cb35-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    absolute tolerance is meaningless across that range; in the scaled</span></span>
<span id="cb35-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    variables every field is O(1) and one tolerance means the same thing for</span></span>
<span id="cb35-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    all of them.</span></span>
<span id="cb35-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb35-17">    dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>nt</span>
<span id="cb35-18">    jac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(model.FIELDS)))</span>
<span id="cb35-19">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (model.y0() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> y0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> y0).reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).copy()</span>
<span id="cb35-20">    sc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.maximum(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.asarray(scale, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-30</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> scale <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb35-21">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.maximum(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(y.ravel()), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb35-22">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sc</span>
<span id="cb35-23"></span>
<span id="cb35-24">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> src(uu):</span>
<span id="cb35-25">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty_like(uu)</span>
<span id="cb35-26">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(uu.shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]):</span>
<span id="cb35-27">            out[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.rhs(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, uu[k]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sc</span>
<span id="cb35-28">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb35-29"></span>
<span id="cb35-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(nt):</span>
<span id="cb35-31">        u_old <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> u.copy()</span>
<span id="cb35-32"></span>
<span id="cb35-33">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(uu):</span>
<span id="cb35-34">            s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> jac(src, uu.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb35-35">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (uu.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u_old)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s</span>
<span id="cb35-36">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), np.eye(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(model.FIELDS))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js.toarray()</span>
<span id="cb35-37"></span>
<span id="cb35-38">        sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(resid, u, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb35-39">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sol.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward-Euler step did not converge"</span></span>
<span id="cb35-40">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sol.x.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb35-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sc).ravel()</span>
<span id="cb35-42"></span>
<span id="cb35-43"></span>
<span id="cb35-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># marched over the gel-effect region itself, from the BDF state at t_march_lo</span></span>
<span id="cb35-45">_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb35-46">_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _M.solve(T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb35-47">T_MARCH_LO, T_MARCH_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">120.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">260.0</span></span>
<span id="cb35-48">_y_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _ref.sol(T_MARCH_LO)</span>
<span id="cb35-49">X_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_ref.sol(T_MARCH_HI)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb35-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the fixed scale vector: the state at the </span><span class="re">END</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"> of the marched interval, so no</span></span>
<span id="cb35-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># field is scaled by a number that grows through the gel effect</span></span>
<span id="cb35-52">MARCH_SCALE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_ref.sol(T_MARCH_HI)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb35-53">MARCH_NT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>]</span>
<span id="cb35-54">MARCH_X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(march(_M, nt, T_MARCH_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_MARCH_LO, _y_lo, MARCH_SCALE)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb35-55">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_NT]</span>
<span id="cb35-56">MARCH_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_REF) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_X]</span>
<span id="cb35-57">MARCH_ORDERS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(MARCH_ERR[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MARCH_ERR[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb35-58">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MARCH_ERR) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb35-59">MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MARCH_ORDERS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb35-60">MARCH_FINEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(MARCH_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb35-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm backward-Euler marcher through the gel region"</span></span>
<span id="cb35-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_MARCH_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_MARCH_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min, 50 degC):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb35-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nt'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x(t_hi)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|error|'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'order'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb35-64"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(MARCH_NT):</span>
<span id="cb35-65">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MARCH_ORDERS[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb35-66">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MARCH_X[i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MARCH_ERR[i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb35-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reference x(t_hi) from the BDF solve = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span></span>
<span id="cb35-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" first order, as backward Euler must be."</span>)</span>
<span id="cb35-69"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm backward-Euler marcher through the gel region (t = 120 to 260 min, 50 degC):

    nt      x(t_hi)      |error|    order
   200   0.82466560    3.724e-04         
   400   0.82447056    1.773e-04    1.070
   800   0.82437967    8.645e-05    1.037
  1600   0.82433589    4.267e-05    1.019
  3200   0.82431442    2.120e-05    1.009

reference x(t_hi) from the BDF solve = 0.82429322; first order, as backward Euler must be.</code></pre>
</div>
</div>
<div id="d2d60d36" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:15.577206Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:15.577009Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:19.389606Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:19.388725Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb37-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- eq. 19/20 against the approximation the paper warns about --------------</span></span>
<span id="cb37-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Book p. 350: "eq 19 and 20 are often approximated by Mn = mu_1/mu_0 and</span></span>
<span id="cb37-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Mw = mu_2/mu_1, where the growing-radical contributions are ignored.  The</span></span>
<span id="cb37-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># accuracy of this approximation diminishes at high conversions beyond the onset</span></span>
<span id="cb37-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of the autoacceleration region as a result of a large accumulation of growing</span></span>
<span id="cb37-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># radicals."</span></span>
<span id="cb37-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mol_weights(model, t_end, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>):</span>
<span id="cb37-8">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.solve(t_end)</span>
<span id="cb37-9">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, t_end, n)</span>
<span id="cb37-10">    Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s.sol(tg)</span>
<span id="cb37-11">    x, l0, l1, l2, m0, m1, m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>]</span>
<span id="cb37-12">    ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb37-13">    Mn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l1)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(m0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l0)                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 19</span></span>
<span id="cb37-14">    Mw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(m1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l1)                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 20</span></span>
<span id="cb37-15">    Mn_ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(ok, m1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.maximum(m0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>), np.nan)</span>
<span id="cb37-16">    Mw_ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(ok, m2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.maximum(m1, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>), np.nan)</span>
<span id="cb37-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> x, Mn, Mw, Mn_ap, Mw_ap, ok</span>
<span id="cb37-18"></span>
<span id="cb37-19"></span>
<span id="cb37-20">MW_TAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb37-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb37-22">    x, Mn, Mw, Mna, Mwa, ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mol_weights(MODELS[c], T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]])</span>
<span id="cb37-23">    on <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb37-24">    pre, post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> on), ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> on)</span>
<span id="cb37-25">    MW_TAB[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb37-26">        pre_Mn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mna[pre]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mn[pre] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb37-27">        post_Mn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mna[post]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mn[post] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb37-28">        pre_Mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mwa[pre]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mw[pre] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb37-29">        post_Mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mwa[post]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mw[post] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb37-30">        Mn_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Mn[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>MW_MMA), Mw_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Mw[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>MW_MMA))</span>
<span id="cb37-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 19/20 against mu_1/mu_0 and mu_2/mu_1 - largest relative difference,"</span></span>
<span id="cb37-32">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" before and after</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">the onset conversion:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'T'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Mn before'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Mn after'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Mw before'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Mw after'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Mn_end g/mol'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb37-36">    w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MW_TAB[c]</span>
<span id="cb37-37">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pre_Mn'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'post_Mn'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-38">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pre_Mw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'post_Mw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Mn_end'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-39">MW_GAIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(MW_TAB[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post_Mn"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MW_TAB[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pre_Mn"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb37-40">MW_POST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(MW_TAB[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post_Mn"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb37-41">MW_PRE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(MW_TAB[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pre_Mn"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS))</span>
<span id="cb37-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the approximation is at worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_PRE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> before the onset and"</span></span>
<span id="cb37-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_POST_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> after it -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">a factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_GAIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  THE PAPER'S"</span></span>
<span id="cb37-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" SENTENCE IS REPRODUCED, and it is reproduction: these are</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">two readings"</span></span>
<span id="cb37-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" of the same computed moments, not a comparison with anything measured."</span></span>
<span id="cb37-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Every number in this cell depends on the RECONSTRUCTED MW_MMA; the"</span></span>
<span id="cb37-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ratios do not, and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">g/mol column does."</span>)</span>
<span id="cb37-48"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> MW_POST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>MW_PRE_MAX</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. 19/20 against mu_1/mu_0 and mu_2/mu_1 - largest relative difference, before and after
the onset conversion:

   T        I0   Mn before   Mn after   Mw before   Mw after  Mn_end g/mol
  50    0.0258   4.726e-04  4.405e-01   6.177e-04  1.941e-01     2.931e+05
  50   0.01548   8.212e-04  5.240e-01   1.084e-03  2.414e-01     4.872e+05
  70    0.0258   3.140e-05  1.276e-01   3.902e-05  9.347e-02     6.843e+04
  70   0.01548   3.762e-05  1.894e-01   4.936e-05  1.368e-01     1.139e+05
  90    0.0258   3.410e-05  4.217e-02   4.375e-05  5.001e-02     3.353e+04
  90   0.01548   3.929e-05  5.663e-02   5.122e-05  7.800e-02     5.579e+04

the approximation is at worst 8.212e-04 before the onset and 5.240e-01 after it -
a factor of 5034.  THE PAPER'S SENTENCE IS REPRODUCED, and it is reproduction: these are
two readings of the same computed moments, not a comparison with anything measured.
Every number in this cell depends on the RECONSTRUCTED MW_MMA; the ratios do not, and the
g/mol column does.</code></pre>
</div>
</div>
<div id="4f185bf8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:19.391573Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:19.391434Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:28.246943Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:28.246006Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb39-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the limiting conversion, root-found on the rate, not sampled -----------</span></span>
<span id="cb39-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Book p. 353: "the limiting conversion at long times is lowest at 50 degC and</span></span>
<span id="cb39-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gradually increases with the polymerization temperature.  This is consistent</span></span>
<span id="cb39-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with the glass effect".</span></span>
<span id="cb39-5">T_END_LONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">240.0</span>}     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># min</span></span>
<span id="cb39-6">RATE_FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of the peak rate; a stated, scale-free threshold</span></span>
<span id="cb39-7"></span>
<span id="cb39-8"></span>
<span id="cb39-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> limiting_conversion(model, t_end, frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RATE_FRAC):</span>
<span id="cb39-10">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model.solve(t_end)</span>
<span id="cb39-11">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, t_end, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40001</span>)</span>
<span id="cb39-12">    Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s.sol(tg)</span>
<span id="cb39-13">    rate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([model.kt_kp(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), p)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>p</span>
<span id="cb39-14">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x, p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])])</span>
<span id="cb39-15">    ip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(rate))</span>
<span id="cb39-16">    thr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rate[ip]</span>
<span id="cb39-17">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(rate[ip:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> thr))</span>
<span id="cb39-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ip, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the rate never falls to the stated fraction of its peak"</span></span>
<span id="cb39-19">    t_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(CubicSpline(tg, rate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> thr), tg[k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], tg[k], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb39-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CubicSpline(tg, Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])(t_star)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t_star),</span>
<span id="cb39-21">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rate[ip]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tg[ip]))</span>
<span id="cb39-22"></span>
<span id="cb39-23"></span>
<span id="cb39-24">XLIM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: limiting_conversion(MODELS[c], T_END_LONG[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS}</span>
<span id="cb39-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"conversion at which dx/dt has fallen to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RATE_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of its own peak,"</span></span>
<span id="cb39-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" root-found:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb39-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb39-28">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> XLIM[c]</span>
<span id="cb39-29">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC, I0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  x_lim = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  at t ="</span></span>
<span id="cb39-30">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min   (peak rate </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/min at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb39-31">XLIM_50, XLIM_70, XLIM_90 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (XLIM[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], XLIM[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb39-32">                             XLIM[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb39-33">XLIM_MARGIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(XLIM_70 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XLIM_50, XLIM_90 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XLIM_70))</span>
<span id="cb39-34">X_ASYMPTOTE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(MODELS[c].solve(T_END_LONG[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]).y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb39-35">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS}</span>
<span id="cb39-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">monotone in T at both loadings; smallest gap </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XLIM_MARGIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so the"</span></span>
<span id="cb39-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" paper's ORDERING is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reproduced.  A value is not, and cannot be:"</span>)</span>
<span id="cb39-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  THIS MODEL HAS NO LIMITING CONVERSION IN THE MATHEMATICAL SENSE."</span></span>
<span id="cb39-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  As x -&gt; 1, phi_m -&gt; 0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and the Fujita-Doolittle factor of eq. 32"</span></span>
<span id="cb39-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" returns to 1, so 1/k_p -&gt; 1/k_p0 + theta_p lambda_0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  stays FINITE and"</span></span>
<span id="cb39-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" dx/dt = k_p (1-x) lambda_0 vanishes only through (1-x).  Integrated far"</span></span>
<span id="cb39-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  enough, every condition creeps on: at the horizons used here"</span></span>
<span id="cb39-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" x reaches"</span></span>
<span id="cb39-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_ASYMPTOTE[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb39-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  at 50, 70 and 90 degC and is still rising.  The 'limiting conversion"</span></span>
<span id="cb39-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at long times' the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  paper reads off Figures 3-5 is a PRACTICAL"</span></span>
<span id="cb39-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" PLATEAU set by where the curve stops being</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  drawn, and the number"</span></span>
<span id="cb39-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" above is set by the stated threshold: a break row moves the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb39-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  threshold and prices exactly that.  The paper prints no numerical"</span></span>
<span id="cb39-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" limiting conversion</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  anywhere - the claim it makes is the ordering,"</span></span>
<span id="cb39-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and the ordering is what is tested."</span>)</span>
<span id="cb39-52"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> XLIM_50 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> XLIM_70 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> XLIM_90</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>conversion at which dx/dt has fallen to 0.001 of its own peak, root-found:

  50 degC, I0 = 0.0258    x_lim = 0.95535  at t =  1067.71 min   (peak rate 3.3959e-02 1/min at t = 233.40)
  50 degC, I0 = 0.01548   x_lim = 0.95797  at t =  1198.93 min   (peak rate 3.0221e-02 1/min at t = 282.22)
  70 degC, I0 = 0.0258    x_lim = 0.98173  at t =   252.47 min   (peak rate 1.0563e-01 1/min at t = 56.89)
  70 degC, I0 = 0.01548   x_lim = 0.98254  at t =   271.59 min   (peak rate 9.9272e-02 1/min at t = 67.92)
  90 degC, I0 = 0.0258    x_lim = 0.99289  at t =    63.76 min   (peak rate 2.7188e-01 1/min at t = 16.59)
  90 degC, I0 = 0.01548   x_lim = 0.99349  at t =    70.14 min   (peak rate 2.4625e-01 1/min at t = 20.63)

monotone in T at both loadings; smallest gap 0.01117, so the paper's ORDERING is
reproduced.  A value is not, and cannot be:
  THIS MODEL HAS NO LIMITING CONVERSION IN THE MATHEMATICAL SENSE.  As x -&gt; 1, phi_m -&gt; 0
  and the Fujita-Doolittle factor of eq. 32 returns to 1, so 1/k_p -&gt; 1/k_p0 + theta_p lambda_0
  stays FINITE and dx/dt = k_p (1-x) lambda_0 vanishes only through (1-x).  Integrated far
  enough, every condition creeps on: at the horizons used here x reaches 0.97897, 0.99850, 0.99998
  at 50, 70 and 90 degC and is still rising.  The 'limiting conversion at long times' the
  paper reads off Figures 3-5 is a PRACTICAL PLATEAU set by where the curve stops being
  drawn, and the number above is set by the stated threshold: a break row moves the
  threshold and prices exactly that.  The paper prints no numerical limiting conversion
  anywhere - the claim it makes is the ordering, and the ordering is what is tested.</code></pre>
</div>
</div>
<div id="70812d19" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:28.249425Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:28.249231Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:28.254927Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:28.254123Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb41-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- "initiator loading has very little effect on both curves" -------------</span></span>
<span id="cb41-2">I0_EFFECT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb41-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb41-4">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)]</span>
<span id="cb41-5">    I0_EFFECT[TC] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(dLt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>]))),</span>
<span id="cb41-6">                         dLp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lp"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lp"</span>]))),</span>
<span id="cb41-7">                         theta_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(MODELS[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)].theta_t</span>
<span id="cb41-8">                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> MODELS[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].theta_t))</span>
<span id="cb41-9">I0_DLT_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dLt"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I0_EFFECT.values()))</span>
<span id="cb41-10">I0_DLP_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dLp"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I0_EFFECT.values()))</span>
<span id="cb41-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"largest gap between the two initiator loadings over"</span></span>
<span id="cb41-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_LO_FIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;= x &lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb41-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb41-14">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> I0_EFFECT[TC]</span>
<span id="cb41-15">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degC: max |d log10 k_t| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dLt'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decade,"</span></span>
<span id="cb41-16">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  max |d log10 k_p| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dLp'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decade"</span></span>
<span id="cb41-17">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (theta_t ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'theta_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb41-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">so a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'theta_ratio'</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I0_EFFECT.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x change in"</span></span>
<span id="cb41-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" theta_t moves log10 k_t by at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>I0_DLT_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of a decade and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb41-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"log10 k_p by at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>I0_DLP_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: 'very little effect' is"</span></span>
<span id="cb41-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" quantified, and the reason is that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lambda_0 moves the other way -"</span></span>
<span id="cb41-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the diffusion term of eq. 31 is theta_t * lambda_0, and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">product"</span></span>
<span id="cb41-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" is far more nearly invariant than either factor."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>largest gap between the two initiator loadings over 0.02 &lt;= x &lt;= 0.86:

  50 degC: max |d log10 k_t| = 0.15367 decade,  max |d log10 k_p| = 0.15409 decade   (theta_t ratio 1.5533)
  70 degC: max |d log10 k_t| = 0.21997 decade,  max |d log10 k_p| = 0.09535 decade   (theta_t ratio 1.6939)
  90 degC: max |d log10 k_t| = 0.17308 decade,  max |d log10 k_p| = 0.09489 decade   (theta_t ratio 1.6579)

so a 1.6939x change in theta_t moves log10 k_t by at most 0.21997 of a decade and
log10 k_p by at most 0.15409: 'very little effect' is quantified, and the reason is that
lambda_0 moves the other way - the diffusion term of eq. 31 is theta_t * lambda_0, and the
product is far more nearly invariant than either factor.</code></pre>
</div>
</div>
<div id="f087e4cc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:28.256850Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:28.256666Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:28.954640Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:28.953825Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb43-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- what the printed 2.3 costs against ln(10) -----------------------------</span></span>
<span id="cb43-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. 31 and 32 print exp[2.3 phi_m/(A + B phi_m)] where eq. 29's log is base</span></span>
<span id="cb43-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ten, so the exact conversion factor is ln(10) = 2.302585...  Reported, not</span></span>
<span id="cb43-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># repaired: the model is run with the printed 2.3 everywhere and the difference</span></span>
<span id="cb43-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is measured here.</span></span>
<span id="cb43-6">LN10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>))</span>
<span id="cb43-7">_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, ln10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LN10)</span>
<span id="cb43-8">_cva <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(_alt, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb43-9">LN10_ONSET_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(onset_x(_cva[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], _cva[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>],</span>
<span id="cb43-10">                                     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(_alt.kt0)))</span>
<span id="cb43-11">                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]))</span>
<span id="cb43-12">LN10_LT_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb43-13">    _cva[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.interp(_cva[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], CURVES[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>],</span>
<span id="cb43-14">                           CURVES[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>]))))</span>
<span id="cb43-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. 31 printed with 2.3; ln(10) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LN10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LN10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> larger."</span>)</span>
<span id="cb43-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  replacing 2.3 by ln(10) at 50 degC / 0.0258 mol/L moves log10 k_t by up"</span></span>
<span id="cb43-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LN10_LT_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  of a decade and the onset conversion by"</span></span>
<span id="cb43-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LN10_ONSET_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - about"</span></span>
<span id="cb43-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LN10_ONSET_SHIFT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET_MAX_ABS_DEV, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the"</span></span>
<span id="cb43-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" distance by</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  which the reconstruction misses the printed onsets, so"</span></span>
<span id="cb43-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" it is NOT negligible at this</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  page's resolution.  The page keeps the"</span></span>
<span id="cb43-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed 2.3 and prices the alternative."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. 31 printed with 2.3; ln(10) = 2.302585 is +0.1124% larger.
  replacing 2.3 by ln(10) at 50 degC / 0.0258 mol/L moves log10 k_t by up to 0.00924
  of a decade and the onset conversion by 0.00116 - about 0.12 times the distance by
  which the reconstruction misses the printed onsets, so it is NOT negligible at this
  page's resolution.  The page keeps the printed 2.3 and prices the alternative.</code></pre>
</div>
</div>
<div id="30071a99" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:28.956768Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:28.956636Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:28.963017Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:28.962206Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb45-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- every number this page reports, in one dictionary ----------------------</span></span>
<span id="cb45-2">METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb45-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the headline: the paper's own three onset conversions</span></span>
<span id="cb45-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_x_50C"</span>: ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>],</span>
<span id="cb45-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_x_70C"</span>: ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>],</span>
<span id="cb45-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_x_90C"</span>: ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>],</span>
<span id="cb45-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_50C"</span>: ONSET_DEV[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>],</span>
<span id="cb45-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_70C"</span>: ONSET_DEV[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>],</span>
<span id="cb45-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_90C"</span>: ONSET_DEV[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>],</span>
<span id="cb45-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>: ONSET_MAX_ABS_DEV,</span>
<span id="cb45-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_other_loading_max"</span>: ONSET_DEV_OTHER_MAX,</span>
<span id="cb45-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_definition_band_max"</span>: ONSET_MAX_BAND,</span>
<span id="cb45-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_two_route_max_rel"</span>: ONSET_TWO_ROUTE_MAX,</span>
<span id="cb45-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_resample_floor_max_rel"</span>: ONSET_RESAMPLE_FLOOR,</span>
<span id="cb45-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_i0_shift_max"</span>: ONSET_I0_MAX,</span>
<span id="cb45-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_compressed_shift_max"</span>: ONSET_COMPRESSED_MAX,</span>
<span id="cb45-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_per_decade_theta_t"</span>: D_ONSET_D_DECADE,</span>
<span id="cb45-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qss_start_max_rel"</span>: QSS_START_MAX,</span>
<span id="cb45-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Figure 13</span></span>
<span id="cb45-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_0258_kcal"</span>: E_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb45-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_01548_kcal"</span>: E_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb45-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_p_kcal"</span>: E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb45-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_rel_vs_printed"</span>: E_T_REL[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>],</span>
<span id="cb45-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_p_rel_vs_printed"</span>: E_P_REL,</span>
<span id="cb45-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Figure 15</span></span>
<span id="cb45-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_linear_in_Tgp2_max_rel"</span>: A_LIN_MAXREL,</span>
<span id="cb45-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_null_linear_in_T_max_rel"</span>: A_NULL_T_MAXREL,</span>
<span id="cb45-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_null_gain"</span>: A_NULL_GAIN,</span>
<span id="cb45-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tgp_implied_C"</span>: T_GP_IMPLIED,</span>
<span id="cb45-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tgp_band_width_C"</span>: T_GP_BAND_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_GP_BAND_LO,</span>
<span id="cb45-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_exponent_implied"</span>: Q_IMPLIED,</span>
<span id="cb45-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_gain_min_at_Tgp_band_ends"</span>: A_GAIN_BAND_ENDS_MIN,</span>
<span id="cb45-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_second_difference"</span>: A_SECOND_DIFF,</span>
<span id="cb45-34">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- QSSA</span></span>
<span id="cb45-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_50C"</span>: QSSA[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>],</span>
<span id="cb45-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_other_max"</span>: QSSA_OTHER_MAX,</span>
<span id="cb45-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_conv_max_dev_50C"</span>: QSSA[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_dx"</span>],</span>
<span id="cb45-38">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the switch</span></span>
<span id="cb45-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_up_lower_x_max"</span>: CONCAVE_LOW_MAX,</span>
<span id="cb45-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_onset_margin_min"</span>: CONCAVE_ONSET_MARGIN,</span>
<span id="cb45-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"switch_d2x_max_pre"</span>: SWITCH_D2_MAX_PRE,</span>
<span id="cb45-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"switch_logkt_jump"</span>: SWITCH_LOGKT_JUMP,</span>
<span id="cb45-43">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- parameter compression</span></span>
<span id="cb45-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_t_max_rel"</span>: TH_T_SHARED_MAXREL,</span>
<span id="cb45-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_p_max_rel"</span>: TH_P_MAXREL,</span>
<span id="cb45-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_A_max_rel"</span>: A_MAXREL,</span>
<span id="cb45-47">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- identities</span></span>
<span id="cb45-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_max_rel"</span>: MOMENT_ID_KTC0,</span>
<span id="cb45-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_ktc_max_rel"</span>: MOMENT_ID_KTC,</span>
<span id="cb45-50">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_broken_max_rel"</span>: MOMENT_ID_BROKEN,</span>
<span id="cb45-51">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_trunc_max_rel"</span>: MOMENT_ID_TRUNC,</span>
<span id="cb45-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq26_symbolic_residual"</span>: EQ26_RESID_F,</span>
<span id="cb45-53">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rm_over_rD_max_dev"</span>: EQ22_MAXDEV,</span>
<span id="cb45-54">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- pymrm discretisations</span></span>
<span id="cb45-55">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_rms_err_finest"</span>: BVP_ERR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb45-56">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_order"</span>: BVP_ORDER,</span>
<span id="cb45-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_K_spread_rel"</span>: BVP_K_SPREAD_REL,</span>
<span id="cb45-58">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_order"</span>: MARCH_ORDER,</span>
<span id="cb45-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_err_finest"</span>: MARCH_FINEST,</span>
<span id="cb45-60">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the rest of the model's behaviour</span></span>
<span id="cb45-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_approx_pre_onset_max"</span>: MW_PRE_MAX,</span>
<span id="cb45-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_approx_post_onset_max"</span>: MW_POST_MAX,</span>
<span id="cb45-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xlim_50C"</span>: XLIM_50,</span>
<span id="cb45-64">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xlim_monotone_margin"</span>: XLIM_MARGIN,</span>
<span id="cb45-65">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i0_dlogkt_max"</span>: I0_DLT_MAX,</span>
<span id="cb45-66">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ln10_onset_shift"</span>: LN10_ONSET_SHIFT,</span>
<span id="cb45-67">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_reconstruction_x_maxdiff"</span>: MW_X_MAXDIFF,</span>
<span id="cb45-68">}</span>
<span id="cb45-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics"</span>)</span>
<span id="cb45-70"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(METRICS):</span>
<span id="cb45-71">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>METRICS[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">: .8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>56 metrics
  A_exponent_implied                  2.0658641
  A_gain_min_at_Tgp_band_ends         3.5346809
  A_linear_in_Tgp2_max_rel            0.0008819442
  A_null_gain                         17.405724
  A_null_linear_in_T_max_rel          0.015350877
  A_second_difference                -0.007
  Tgp_band_width_C                    25.777778
  Tgp_implied_C                       111.42857
  bvp_K_spread_rel                    1.505037e-10
  bvp_order                           1.8617772
  bvp_rms_err_finest                  1.6099989e-06
  compress_A_max_rel                  0.0008819442
  compress_theta_p_max_rel            0.083695415
  compress_theta_t_max_rel            0.1882808
  concave_onset_margin_min            0.12933478
  concave_up_lower_x_max              0.30643075
  dE_theta_p_kcal                     27.771564
  dE_theta_p_rel_vs_printed           0.0081584246
  dE_theta_t_01548_kcal               34.5166
  dE_theta_t_0258_kcal                34.908161
  dE_theta_t_rel_vs_printed           0.026710609
  eq22_rm_over_rD_max_dev             1.8582692e-05
  eq26_symbolic_residual              0
  i0_dlogkt_max                       0.21996847
  ln10_onset_shift                    0.0011582886
  march_err_finest                    2.1196164e-05
  march_order                         1.0094352
  moment_identity_broken_max_rel      2
  moment_identity_ktc_max_rel         1.5941656e-16
  moment_identity_max_rel             2.0950178e-16
  moment_identity_trunc_max_rel       0.031251084
  mw_approx_post_onset_max            0.52403331
  mw_approx_pre_onset_max             0.00082117954
  mw_reconstruction_x_maxdiff         1.3419266e-12
  onset_compressed_shift_max          0.016334236
  onset_definition_band_max           0.090094009
  onset_dev_50C                      -0.0048388967
  onset_dev_70C                      -0.0016224585
  onset_dev_90C                      -0.0096614888
  onset_dev_other_loading_max         0.031260607
  onset_i0_shift_max                  0.026705668
  onset_max_abs_dev                   0.0096614888
  onset_per_decade_theta_t           -0.21734734
  onset_resample_floor_max_rel        1.311124e-05
  onset_two_route_max_rel             9.0767394e-12
  onset_x_50C                         0.2551611
  onset_x_70C                         0.34837754
  onset_x_90C                         0.44033851
  qss_start_max_rel                   7.3617031e-06
  qssa_conv_max_dev_50C               0.038610887
  qssa_lam0_ratio_50C                 3.5175514
  qssa_lam0_ratio_other_max           2.548091
  switch_d2x_max_pre                 -1.3914688e-06
  switch_logkt_jump                   0.76019378
  xlim_50C                            0.95534844
  xlim_monotone_margin                0.011165333</code></pre>
</div>
</div>
<div id="58afc792" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:28.965370Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:28.965194Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:15:28.984470Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:15:28.983626Z&quot;}}" data-execution_count="23">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb47-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- defect injection: does each metric MOVE when something is broken? ------</span></span>
<span id="cb47-2">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb47-3"></span>
<span id="cb47-4"></span>
<span id="cb47-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _recompute(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb47-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Re-run the parts of the page that a mis-transcribed printed cell touches.</span></span>
<span id="cb47-7"></span>
<span id="cb47-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    t1/t2/ts are (row-key, column, new value) substitutions into the three</span></span>
<span id="cb47-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    CSVs.  Everything downstream is rebuilt from the substituted tables, so a</span></span>
<span id="cb47-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    single wrong digit propagates exactly as it would have on the real page.</span></span>
<span id="cb47-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb47-12">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(T1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T1.copy(), T2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T2.copy(), TS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TS.copy())</span>
<span id="cb47-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb47-14">        sym, col, val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1</span>
<span id="cb47-15">        g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T1"</span>].loc[g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T1"</span>].symbol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> sym, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val</span>
<span id="cb47-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb47-17">        (TC, I0), col, val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2</span>
<span id="cb47-18">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T2"</span>].polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(</span>
<span id="cb47-19">            g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T2"</span>].initiator_loading_mol_per_L, I0)</span>
<span id="cb47-20">        g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T2"</span>].loc[m, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val</span>
<span id="cb47-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ts <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb47-22">        key, val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ts</span>
<span id="cb47-23">        g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TS"</span>].loc[g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TS"</span>].key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> key, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val</span>
<span id="cb47-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> g</span>
<span id="cb47-25"></span>
<span id="cb47-26"></span>
<span id="cb47-27"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _onsets_under(T1x, T2x, ln10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span>, mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window24"</span>):</span>
<span id="cb47-28">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb47-29">    _t1x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1x.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"symbol"</span>)</span>
<span id="cb47-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb47-31">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>):</span>
<span id="cb47-32">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2x[(T2x.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC)</span>
<span id="cb47-33">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(T2x.initiator_loading_mol_per_L, I0)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb47-34">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(TC, I0, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.theta_t_min),</span>
<span id="cb47-35">                     theta_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.theta_p_min), A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.A), B<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.B),</span>
<span id="cb47-36">                     ln10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ln10)</span>
<span id="cb47-37">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Table I substitutions act through the module-level constants, so</span></span>
<span id="cb47-38">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># patch the instance directly for the ones a row touches</span></span>
<span id="cb47-39">            m.kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_d"</span>].a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_d"</span>].b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>m.T)</span>
<span id="cb47-40">            m.kt0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_t0"</span>].a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(</span>
<span id="cb47-41">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_t0"</span>].b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(R_CAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m.T))</span>
<span id="cb47-42">            m.kp0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_p0"</span>].a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(</span>
<span id="cb47-43">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_p0"</span>].b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(R_CAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m.T))</span>
<span id="cb47-44">            m.dm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_m"</span>].a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_m"</span>].b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(m.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.0</span>)</span>
<span id="cb47-45">            m.eps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m.dm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p"</span>].a))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p"</span>].a)</span>
<span id="cb47-46">            m.M0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.dm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MW_MMA</span>
<span id="cb47-47">            cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(m, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb47-48">            out[(TC, I0)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0)), mode)</span>
<span id="cb47-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb47-50"></span>
<span id="cb47-51"></span>
<span id="cb47-52"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _algebra_under(T1x, T2x, TSx):</span>
<span id="cb47-53">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Everything on the page that is pure algebra on the printed tables."""</span></span>
<span id="cb47-54">    _t1x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1x.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"symbol"</span>)</span>
<span id="cb47-55">    Tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_t1x.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_gp"</span>].a)</span>
<span id="cb47-56">    A3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2x[T2x.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC].A.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb47-57">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)])</span>
<span id="cb47-58">    thT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {I0: np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2x[(T2x.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC)</span>
<span id="cb47-59">                                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(T2x.initiator_loading_mol_per_L, I0)]</span>
<span id="cb47-60">                               .theta_t_min.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)])</span>
<span id="cb47-61">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> I0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)}</span>
<span id="cb47-62">    thP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T2x[T2x.polym_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> TC].theta_p_min.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb47-63">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)])</span>
<span id="cb47-64">    Ux <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb47-65">    Xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(Ux), Ux]).T</span>
<span id="cb47-66">    cx, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(Xx, A3x, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb47-67">    resx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cx</span>
<span id="cb47-68">    X1x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(TC3), TC3]).T</span>
<span id="cb47-69">    c1x, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X1x, A3x, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb47-70">    nullx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X1x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c1x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3x)))</span>
<span id="cb47-71">    linx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(resx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3x)))</span>
<span id="cb47-72">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _col(Tg_):</span>
<span id="cb47-73">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb47-74">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb47-75">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb47-76">        tgi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(_col, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>))</span>
<span id="cb47-77">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb47-78">        tgi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.nan</span>
<span id="cb47-79">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _ex(q):</span>
<span id="cb47-80">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TC3)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>q</span>
<span id="cb47-81">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb47-82">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb47-83">        qi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(_ex, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb47-84">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb47-85">        qi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.nan</span>
<span id="cb47-86">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the admissible T_gp interval under the same +-0.0005 rounding, and the</span></span>
<span id="cb47-87">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gain at its two ends - the honest version of the "17.4x", rebuilt under</span></span>
<span id="cb47-88">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># whatever defect this row injected</span></span>
<span id="cb47-89">    blo, bhi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.inf, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.inf</span>
<span id="cb47-90">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>):</span>
<span id="cb47-91">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>):</span>
<span id="cb47-92">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>):</span>
<span id="cb47-93">                Ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.array([d0, d1, d2])</span>
<span id="cb47-94">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _gg(Tg_, Ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ap):</span>
<span id="cb47-95">                    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb47-96">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb47-97">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb47-98">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb47-99">                    vv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_gg, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb47-100">                    blo, bhi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(blo, vv), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(bhi, vv)</span>
<span id="cb47-101">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb47-102">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb47-103"></span>
<span id="cb47-104">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _gain_end(Tg_):</span>
<span id="cb47-105">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb47-106">        Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(u), u]).T</span>
<span id="cb47-107">        cg, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(Xg, A3x, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb47-108">        lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3x)))</span>
<span id="cb47-109">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> nullx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>lr <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lr <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.inf</span>
<span id="cb47-110"></span>
<span id="cb47-111">    gmin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_gain_end(blo), _gain_end(bhi)))</span>
<span id="cb47-112">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(blo) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> np.isfinite(bhi) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb47-113">    stt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TSx.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb47-114">    ETp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(stt.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"activation_energy_theta_t"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb47-115">    EPp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(stt.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"activation_energy_theta_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb47-116">    ya <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> arrhenius(thT[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>], TK3)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb47-117">    yb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> arrhenius(thT[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>], TK3)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb47-118">    yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> arrhenius(thP, TK3)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb47-119">    _yy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>thT[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>]), np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>thT[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>])])</span>
<span id="cb47-120">    _XX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb47-121">    _XX[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb47-122">    _XX[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb47-123">    _XX[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3])</span>
<span id="cb47-124">    _cc, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(_XX, _yy, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb47-125">    thT_sh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(_XX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _cc)</span>
<span id="cb47-126">    _cpx, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T,</span>
<span id="cb47-127">                               np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>thP), rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb47-128">    thP_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _cpx)</span>
<span id="cb47-129">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {</span>
<span id="cb47-130">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_0258_kcal"</span>: ya, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_01548_kcal"</span>: yb,</span>
<span id="cb47-131">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_p_kcal"</span>: yp,</span>
<span id="cb47-132">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_rel_vs_printed"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ya<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ETp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb47-133">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_p_rel_vs_printed"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(yp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>EPp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb47-134">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_linear_in_Tgp2_max_rel"</span>: linx,</span>
<span id="cb47-135">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_null_linear_in_T_max_rel"</span>: nullx,</span>
<span id="cb47-136">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_null_gain"</span>: nullx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>linx <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> linx <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan,</span>
<span id="cb47-137">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tgp_implied_C"</span>: tgi, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_exponent_implied"</span>: qi,</span>
<span id="cb47-138">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_gain_min_at_Tgp_band_ends"</span>: gmin,</span>
<span id="cb47-139">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_second_difference"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb47-140">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_t_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb47-141">            thT_sh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.concatenate([thT[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>], thT[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>]]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb47-142">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_p_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(thP_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>thP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb47-143">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_A_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((Xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cx)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb47-144">    }</span>
<span id="cb47-145"></span>
<span id="cb47-146"></span>
<span id="cb47-147"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, ts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, onsets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb47-148">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _recompute(t1, t2, ts)</span>
<span id="cb47-149">    got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _algebra_under(g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T1"</span>], g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T2"</span>], g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TS"</span>])</span>
<span id="cb47-150">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> onsets:</span>
<span id="cb47-151">        o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _onsets_under(g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T1"</span>], g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T2"</span>])</span>
<span id="cb47-152">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb47-153">            got[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_x_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb47-154">        stt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TS"</span>].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb47-155">        dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {TC: o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb47-156">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(stt.loc[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_conversion_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb47-157">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)}</span>
<span id="cb47-158">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb47-159">            got[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev[TC]</span>
<span id="cb47-160">        got[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> dev.values()))</span>
<span id="cb47-161">        got[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_other_loading_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb47-162">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)]</span>
<span id="cb47-163">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(stt.loc[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_conversion_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]))</span>
<span id="cb47-164">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)))</span>
<span id="cb47-165">        got[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_i0_shift_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb47-166">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)))</span>
<span id="cb47-167">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> got</span>
<span id="cb47-168"></span>
<span id="cb47-169"></span>
<span id="cb47-170">BREAK_FNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb47-171">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- one mis-transcribed printed cell -----------------------------------</span></span>
<span id="cb47-172">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: k_t0 pre-exponential 5.88e9 -&gt; 5.68e9"</span>,</span>
<span id="cb47-173">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_t0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.68e9</span>))),</span>
<span id="cb47-174">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: k_p0 activation energy 4353 -&gt; 4553 cal/mol"</span>,</span>
<span id="cb47-175">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_p0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4553.0</span>))),</span>
<span id="cb47-176">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: k_d exponent 15430 -&gt; 15480 K"</span>,</span>
<span id="cb47-177">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15480.0</span>))),</span>
<span id="cb47-178">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: f 0.58 -&gt; 0.53"</span>,</span>
<span id="cb47-179">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.53</span>))),</span>
<span id="cb47-180">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: d_m intercept 0.973 -&gt; 0.978"</span>,</span>
<span id="cb47-181">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_m"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.978</span>))),</span>
<span id="cb47-182">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: d_p 1.2 -&gt; 1.3 g/cm3"</span>,</span>
<span id="cb47-183">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>))),</span>
<span id="cb47-184">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: T_gp 114 -&gt; 111 degC"</span>,</span>
<span id="cb47-185">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_gp"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">111.0</span>), onsets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)),</span>
<span id="cb47-186">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min"</span>,</span>
<span id="cb47-187">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1800.0</span>))),</span>
<span id="cb47-188">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_t(90, 0.0258) 3.80 -&gt; 3.30 min"</span>,</span>
<span id="cb47-189">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.30</span>))),</span>
<span id="cb47-190">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_t(70, 0.01548) 83.0 -&gt; 88.0 min"</span>,</span>
<span id="cb47-191">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">88.0</span>))),</span>
<span id="cb47-192">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_t(50, 0.01548) 2.33e3 read as 3.23e3"</span>,</span>
<span id="cb47-193">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3230.0</span>))),</span>
<span id="cb47-194">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)"</span>,</span>
<span id="cb47-195">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1050.0</span>))),</span>
<span id="cb47-196">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min"</span>,</span>
<span id="cb47-197">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_p_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40.0</span>))),</span>
<span id="cb47-198">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: theta_p(70) 250 -&gt; 2500 min, both rows"</span>,</span>
<span id="cb47-199">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_p_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2500.0</span>))),</span>
<span id="cb47-200">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: A(70) 0.152 -&gt; 0.142"</span>,</span>
<span id="cb47-201">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.142</span>))),</span>
<span id="cb47-202">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: A(90) 0.163 -&gt; 0.168"</span>,</span>
<span id="cb47-203">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.168</span>))),</span>
<span id="cb47-204">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258"</span>,</span>
<span id="cb47-205">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(t2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>))),</span>
<span id="cb47-206">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stated: printed onset at 70 degC 0.35 -&gt; 0.30"</span>,</span>
<span id="cb47-207">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(ts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_conversion_70C"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>), onsets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)),</span>
<span id="cb47-208">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stated: printed dE(theta_p) 28 -&gt; 24 kcal/mol"</span>,</span>
<span id="cb47-209">     <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: _row_cell(ts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"activation_energy_theta_p"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">24.0</span>), onsets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)),</span>
<span id="cb47-210">]</span>
<span id="cb47-211"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cell-level defect rows defined"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>19 cell-level defect rows defined</code></pre>
</div>
</div>
<div id="9e55338d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:15:28.986813Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:15:28.986633Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:17:29.469648Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:17:29.468651Z&quot;}}" data-execution_count="24">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb49-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the method rows, and the coverage map GENERATED from the moves ---------</span></span>
<span id="cb49-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _method_rows():</span>
<span id="cb49-3">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb49-4"></span>
<span id="cb49-5">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> add(lbl, fn):</span>
<span id="cb49-6">        rows.append((lbl, fn))</span>
<span id="cb49-7"></span>
<span id="cb49-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># onset construction read a different way</span></span>
<span id="cb49-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _alt_defn():</span>
<span id="cb49-10">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-11">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb49-12">            cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb49-13">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], ONSET[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L0"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flattest"</span>)</span>
<span id="cb49-14">            out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_x_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb49-15">            out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET_PRINTED[TC]</span>
<span id="cb49-16">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb49-17">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)))</span>
<span id="cb49-18">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-19">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset read at the flattest point of the sloped branch, not by the"</span></span>
<span id="cb49-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" window fit"</span>, _alt_defn)</span>
<span id="cb49-21"></span>
<span id="cb49-22">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _win():</span>
<span id="cb49-23">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb49-25">            cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb49-26">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], ONSET[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L0"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window13"</span>)</span>
<span id="cb49-27">            out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_x_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb49-28">            out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET_PRINTED[TC]</span>
<span id="cb49-29">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb49-30">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)))</span>
<span id="cb49-31">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-32">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4"</span>, _win)</span>
<span id="cb49-33"></span>
<span id="cb49-34">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _ln10():</span>
<span id="cb49-35">        o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _onsets_under(T1, T2, ln10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.35</span>)</span>
<span id="cb49-36">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"onset_x_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C"</span>: o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)}</span>
<span id="cb49-37">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ln10_onset_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb49-38">                                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>])</span>
<span id="cb49-39">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb49-40">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET_PRINTED[TC]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)))</span>
<span id="cb49-41">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-42">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 31/32's printed 2.3 read as 2.35 instead of ln(10)"</span>, _ln10)</span>
<span id="cb49-43"></span>
<span id="cb49-44">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _xroute_coarse():</span>
<span id="cb49-45">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-46">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb49-47">            xs, Lt, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve_x(MODELS[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">801</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb49-48">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> onset_x(xs, Lt, ONSET[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L0"</span>])</span>
<span id="cb49-49">            out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_two_route_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb49-50">                out.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_two_route_max_rel"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>),</span>
<span id="cb49-51">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-52">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-53">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second route run at rtol 1e-6 on 801 points"</span>, _xroute_coarse)</span>
<span id="cb49-54"></span>
<span id="cb49-55">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _qss_start_shift():</span>
<span id="cb49-56">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-57">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-58">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-59">            m, cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[c], CURVES[c]</span>
<span id="cb49-60">            I_at <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sol"</span>].sol(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-61">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m.lam0_qssa(X_LO_FIT, I_at)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.03</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam0"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb49-62">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qss_start_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb49-63">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-64">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start-up check run against a lambda_0 that is 3 % wrong"</span>, _qss_start_shift)</span>
<span id="cb49-65"></span>
<span id="cb49-66">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _qssa_floor():</span>
<span id="cb49-67">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-68">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb49-69">        te <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>]</span>
<span id="cb49-70">        se, sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.solve(te), m.solve_qssa(te)</span>
<span id="cb49-71">        tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, te, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20001</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># start the window 30x later</span></span>
<span id="cb49-72">        Ye, Yq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> se.sol(tg), sq.sol(tg)</span>
<span id="cb49-73">        l0q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([m.lam0_qssa(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), I)</span>
<span id="cb49-74">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x, I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])])</span>
<span id="cb49-75">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_50C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(l0q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb49-76">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_conv_max_dev_50C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb49-77">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-78">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA window opened at t = 30 min instead of t = 1 min"</span>, _qssa_floor)</span>
<span id="cb49-79"></span>
<span id="cb49-80">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _switch_other_xc():</span>
<span id="cb49-81">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, switch_xc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>)</span>
<span id="cb49-82">        cs, tg, d2, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> concavity(m, T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb49-83">        xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cs(tg)</span>
<span id="cb49-84">        pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.44</span>)</span>
<span id="cb49-85">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.fujita(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>)</span>
<span id="cb49-86">        P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lam0_at_x(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># root-found, as above</span></span>
<span id="cb49-87">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"switch_d2x_max_pre"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(d2[pre])),</span>
<span id="cb49-88">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"switch_logkt_jump"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(</span>
<span id="cb49-89">                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>m.kt0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m.theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>g)))}</span>
<span id="cb49-90">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the counterfactual switched at x_c = 0.45 instead of 0.30"</span>,</span>
<span id="cb49-91">        _switch_other_xc)</span>
<span id="cb49-92"></span>
<span id="cb49-93">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _concave_floor():</span>
<span id="cb49-94">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb49-95">        lo, mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.inf</span>
<span id="cb49-96">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-97">            cs, tg, d2, sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> concavity(MODELS[c], T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20001</span>, t_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)</span>
<span id="cb49-98">            xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cs(tg[k])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sgn]</span>
<span id="cb49-99">            lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(lo, xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-100">            mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(mg, ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-101">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_up_lower_x_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lo</span>
<span id="cb49-102">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_onset_margin_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mg</span>
<span id="cb49-103">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-104">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concavity scan started at t = 5 min on a 10x coarser grid"</span>, _concave_floor)</span>
<span id="cb49-105"></span>
<span id="cb49-106">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _moment_break():</span>
<span id="cb49-107">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_max_rel"</span>: moment_identity(ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb49-108">                                                           break_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l1"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb49-109">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_ktc_max_rel"</span>: moment_identity(</span>
<span id="cb49-110">                    ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0e8</span>, break_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb49-111">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_trunc_max_rel"</span>: moment_identity(</span>
<span id="cb49-112">                    ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0e8</span>, support<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">52</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]}</span>
<span id="cb49-113">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one sign flipped in eq. 13, in eq. 17, and in eq. 12"</span>, _moment_break)</span>
<span id="cb49-114"></span>
<span id="cb49-115">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _moment_pop():</span>
<span id="cb49-116">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_max_rel"</span>: moment_identity(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb49-117">                                                           seed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb49-118">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_ktc_max_rel"</span>: moment_identity(</span>
<span id="cb49-119">                    N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.9e7</span>, seed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb49-120">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_trunc_max_rel"</span>: moment_identity(</span>
<span id="cb49-121">                    N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, ktc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.9e7</span>, seed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, support<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]}</span>
<span id="cb49-122">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment identity on a different seeded population, N = 24"</span>, _moment_pop)</span>
<span id="cb49-123"></span>
<span id="cb49-124">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _bvp_coarse():</span>
<span id="cb49-125">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [shell_bvp(n, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>)]</span>
<span id="cb49-126">        e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [x[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> b]</span>
<span id="cb49-127">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_rms_err_finest"</span>: e[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb49-128">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(e[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb49-129">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_K_spread_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_spread"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_exact"</span>])}</span>
<span id="cb49-130">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BVP refined only to n = 80 instead of n = 640"</span>, _bvp_coarse)</span>
<span id="cb49-131"></span>
<span id="cb49-132">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _bvp_cartesian():</span>
<span id="cb49-133">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""nu = 0 instead of nu = 2: the geometry eq. 21 is written in."""</span></span>
<span id="cb49-134">        n, ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">320</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb49-135">        rm_, rD_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb49-136">        shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (n, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb49-137">        r_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(rm_, rD_, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb49-138">        r_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(r_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb49-139">        bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>}, {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>})</span>
<span id="cb49-140">        grad, grad_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_grad(shape, r_f, r_c, bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb49-141">        div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(shape, r_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WRONG geometry</span></span>
<span id="cb49-142">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spsolve((div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>grad)).tocsc(),</span>
<span id="cb49-143">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>grad_bc)).toarray().ravel())</span>
<span id="cb49-144">        dCdr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray((grad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> grad_bc)).ravel()</span>
<span id="cb49-145">        Kf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r_f<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dCdr</span>
<span id="cb49-146">        Ke <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD_)</span>
<span id="cb49-147">        Cex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rD_)</span>
<span id="cb49-148">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># AND the eq. 22 pricing, which reads the discrete flux and therefore</span></span>
<span id="cb49-149">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DOES see the geometry.</span></span>
<span id="cb49-150">        dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb49-151">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RATIOS:</span>
<span id="cb49-152">            nn, rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>q</span>
<span id="cb49-153">            rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, rr, nn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb49-154">            rc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(rf[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rf[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb49-155">            g2, g2b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_grad((nn, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), rf, rc, bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb49-156">            d2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div((nn, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), rf, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WRONG geometry</span></span>
<span id="cb49-157">            cc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spsolve((d2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>g2)).tocsc(),</span>
<span id="cb49-158">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(d2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>g2b)).toarray().ravel())</span>
<span id="cb49-159">            dc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray((g2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> cc.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> g2b)).ravel()</span>
<span id="cb49-160">            Kmid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dc)[nn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb49-161">            dev.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Kmid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q))</span>
<span id="cb49-162">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_rms_err_finest"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cex)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb49-163">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_K_spread_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((Kf.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kf.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ke),</span>
<span id="cb49-164">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rm_over_rD_max_dev"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(dev))}</span>
<span id="cb49-165">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"construct_div with nu = 0 (Cartesian) instead of nu = 2"</span>, _bvp_cartesian)</span>
<span id="cb49-166"></span>
<span id="cb49-167">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eq22_wrong():</span>
<span id="cb49-168">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb49-169">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RATIOS:</span>
<span id="cb49-170">            b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shell_bvp(EQ22_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], q)</span>
<span id="cb49-171">            out.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_mid"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q))</span>
<span id="cb49-172">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rm_over_rD_max_dev"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(out))}</span>
<span id="cb49-173">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 22 compared against a K_approx 10 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% o</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ff"</span>, _eq22_wrong)</span>
<span id="cb49-174"></span>
<span id="cb49-175">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eq22_coarse():</span>
<span id="cb49-176">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the same pricing read off a 16x coarser shell."""</span></span>
<span id="cb49-177">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rm_over_rD_max_dev"</span>: _eq22_dev(EQ22_N[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)}</span>
<span id="cb49-178">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 22 priced on a shell refined only to n = 40"</span>, _eq22_coarse)</span>
<span id="cb49-179"></span>
<span id="cb49-180">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _eq26_wrong():</span>
<span id="cb49-181">        bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kt_sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kt0s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Cb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>D)))    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3 -&gt; 2</span></span>
<span id="cb49-182">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq26_symbolic_residual"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.Abs(bad.subs(SUBS_O1)))}</span>
<span id="cb49-183">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 26's 3 D written as 2 D"</span>, _eq26_wrong)</span>
<span id="cb49-184"></span>
<span id="cb49-185">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _march_coarse():</span>
<span id="cb49-186">        e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(march(_M, nt, T_MARCH_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_MARCH_LO, _y_lo,</span>
<span id="cb49-187">                             MARCH_SCALE)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_REF) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)]</span>
<span id="cb49-188">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_err_finest"</span>: e[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb49-189">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))}</span>
<span id="cb49-190">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler refined only to nt = 200 instead of nt = 3200"</span>,</span>
<span id="cb49-191">        _march_coarse)</span>
<span id="cb49-192"></span>
<span id="cb49-193">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _mw_split():</span>
<span id="cb49-194">        out_pre, out_post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-195">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-196">            x, Mn, Mw, Mna, Mwa, ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mol_weights(MODELS[c], T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1201</span>)</span>
<span id="cb49-197">            sp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># split at a higher x</span></span>
<span id="cb49-198">            pre, post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> sp_), ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> sp_)</span>
<span id="cb49-199">            out_pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(out_pre, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mna[pre]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mn[pre] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))))</span>
<span id="cb49-200">            out_post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(out_post, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mna[post]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mn[post] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))))</span>
<span id="cb49-201">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_approx_pre_onset_max"</span>: out_pre,</span>
<span id="cb49-202">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_approx_post_onset_max"</span>: out_post}</span>
<span id="cb49-203">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"molecular-weight split moved from the onset to halfway to x = 1"</span>,</span>
<span id="cb49-204">        _mw_split)</span>
<span id="cb49-205"></span>
<span id="cb49-206">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _xlim_floor():</span>
<span id="cb49-207">        vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: limiting_conversion(MODELS[c], T_END_LONG[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb49-208">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS}</span>
<span id="cb49-209">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xlim_50C"</span>: vals[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)],</span>
<span id="cb49-210">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xlim_monotone_margin"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(</span>
<span id="cb49-211">                    vals[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vals[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)],</span>
<span id="cb49-212">                    vals[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vals[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]))}</span>
<span id="cb49-213">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limiting-conversion threshold 1e-3 -&gt; 1e-2 of the peak rate"</span>,</span>
<span id="cb49-214">        _xlim_floor)</span>
<span id="cb49-215"></span>
<span id="cb49-216">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _i0_window():</span>
<span id="cb49-217">        v_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-218">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb49-219">            a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)]</span>
<span id="cb49-220">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># half the window</span></span>
<span id="cb49-221">            v_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v_t, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>][m] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>][m]))))</span>
<span id="cb49-222">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i0_dlogkt_max"</span>: v_t}</span>
<span id="cb49-223">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"initiator-loading gap measured over x &lt; 0.5 only"</span>, _i0_window)</span>
<span id="cb49-224"></span>
<span id="cb49-225">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _mw_recon():</span>
<span id="cb49-226">        m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)</span>
<span id="cb49-227">        m2.M0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].M0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb49-228">        m2.kp0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m2.kp0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.001</span>                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a 0.1 % change that IS in eq. 11</span></span>
<span id="cb49-229">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m2.solve(T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb49-230">        tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, T_END[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>)</span>
<span id="cb49-231">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_reconstruction_x_maxdiff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb49-232">            _s_ref.sol(tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s.sol(tg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))}</span>
<span id="cb49-233">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MW test contaminated with a 0.1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% c</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">hange in k_p0"</span>, _mw_recon)</span>
<span id="cb49-234"></span>
<span id="cb49-235">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _compress_two():</span>
<span id="cb49-236">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""theta_t Arrhenius fitted per loading (4 params) instead of shared (3)."""</span></span>
<span id="cb49-237">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> arrhenius(TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>], TK3)</span>
<span id="cb49-238">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> arrhenius(TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>], TK3)</span>
<span id="cb49-239">        pa <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T</span>
<span id="cb49-240">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> np.linalg.lstsq(</span>
<span id="cb49-241">                            np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T,</span>
<span id="cb49-242">                            np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>]), rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-243">        pb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T</span>
<span id="cb49-244">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> np.linalg.lstsq(</span>
<span id="cb49-245">                            np.vstack([np.ones_like(TK3), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TK3]).T,</span>
<span id="cb49-246">                            np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>]), rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-247">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_t_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb49-248">            np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pa<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb49-249">            np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TH_T[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))))}</span>
<span id="cb49-250">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t compressed with 4 parameters (one line per loading) not 3"</span>,</span>
<span id="cb49-251">        _compress_two)</span>
<span id="cb49-252"></span>
<span id="cb49-253">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _theta_leverage():</span>
<span id="cb49-254">        p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb49-255">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fac <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb49-256">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>fac)</span>
<span id="cb49-257">            cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(m, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1201</span>)</span>
<span id="cb49-258">            p.append(onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0))))</span>
<span id="cb49-259">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_per_decade_theta_t"</span>:</span>
<span id="cb49-260">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)))}</span>
<span id="cb49-261">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_t leverage measured at 90 degC instead of 50 degC"</span>,</span>
<span id="cb49-262">        _theta_leverage)</span>
<span id="cb49-263"></span>
<span id="cb49-264">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _compressed_shift():</span>
<span id="cb49-265">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-266">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>)):</span>
<span id="cb49-267">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TH_T_SHARED[i]),</span>
<span id="cb49-268">                     theta_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TH_P_FIT[i]), A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(A_FIT[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>)</span>
<span id="cb49-269">            cv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(m, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1201</span>)</span>
<span id="cb49-270">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(onset_x(cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], cv[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0)))</span>
<span id="cb49-271">                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ONSET[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]))</span>
<span id="cb49-272">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_compressed_shift_max"</span>: v}</span>
<span id="cb49-273">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compressed A perturbed by 1 % before the onset is recomputed"</span>,</span>
<span id="cb49-274">        _compressed_shift)</span>
<span id="cb49-275"></span>
<span id="cb49-276">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _tgp_band():</span>
<span id="cb49-277">        lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.inf, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.inf</span>
<span id="cb49-278">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>):</span>
<span id="cb49-279">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>):</span>
<span id="cb49-280">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>):</span>
<span id="cb49-281">                    Ap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.array([d0, d1, d2])</span>
<span id="cb49-282">                    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _g(Tg, Ap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ap):</span>
<span id="cb49-283">                        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TC3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Tg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb49-284">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb49-285">                                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb49-286">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb49-287">                        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(_g, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb49-288">                        lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(lo, v), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(hi, v)</span>
<span id="cb49-289">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:</span>
<span id="cb49-290">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb49-291">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tgp_band_width_C"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo)}</span>
<span id="cb49-292">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_gp band computed at +-0.001 in A instead of +-0.0005"</span>, _tgp_band)</span>
<span id="cb49-293"></span>
<span id="cb49-294">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _qssa_other():</span>
<span id="cb49-295">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-296">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-297">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>:</span>
<span id="cb49-298">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb49-299">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MODELS[c]</span>
<span id="cb49-300">            te <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb49-301">            se, sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.solve(te), m.solve_qssa(te)</span>
<span id="cb49-302">            tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, te, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8001</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># window opened 5x earlier</span></span>
<span id="cb49-303">            Ye, Yq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> se.sol(tg), sq.sol(tg)</span>
<span id="cb49-304">            l0q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([m.lam0_qssa(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), I)</span>
<span id="cb49-305">                            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x, I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])])</span>
<span id="cb49-306">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(l0q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])))</span>
<span id="cb49-307">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_other_max"</span>: v}</span>
<span id="cb49-308">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"70/90 degC QSSA window opened at t = 0.2 min"</span>, _qssa_other)</span>
<span id="cb49-309"></span>
<span id="cb49-310">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _qssa_kt0():</span>
<span id="cb49-311">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the QSSA comparison rebuilt on a 5 % smaller k_t0."""</span></span>
<span id="cb49-312">        out, other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-313">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-314">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)</span>
<span id="cb49-315">            m.kt0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.kt0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span></span>
<span id="cb49-316">            te <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb49-317">            se, sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.solve(te), m.solve_qssa(te)</span>
<span id="cb49-318">            tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, te, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8001</span>)</span>
<span id="cb49-319">            Ye, Yq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> se.sol(tg), sq.sol(tg)</span>
<span id="cb49-320">            l0q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([m.lam0_qssa(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), I)</span>
<span id="cb49-321">                            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x, I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])])</span>
<span id="cb49-322">            rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(l0q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb49-323">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>):</span>
<span id="cb49-324">                out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_50C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rr</span>
<span id="cb49-325">                out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_conv_max_dev_50C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb49-326">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>:</span>
<span id="cb49-327">                other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(other, rr)</span>
<span id="cb49-328">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_other_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> other</span>
<span id="cb49-329">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-330">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA comparison rebuilt on a k_t0 5 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">maller"</span>, _qssa_kt0)</span>
<span id="cb49-331"></span>
<span id="cb49-332">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _concave_theta():</span>
<span id="cb49-333">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""concavity recomputed with theta_t doubled - the parameter that sets</span></span>
<span id="cb49-334"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        WHERE diffusion limitation takes over from initiator depletion, which is</span></span>
<span id="cb49-335"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        precisely the conversion at which d2x/dt2 changes sign."""</span></span>
<span id="cb49-336">        lo, mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.inf</span>
<span id="cb49-337">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-338">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>MODELS[c].theta_t)</span>
<span id="cb49-339">            cs, tg, d2, sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> concavity(m, T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]])</span>
<span id="cb49-340">            xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cs(tg[k])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sgn]</span>
<span id="cb49-341">            lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(lo, xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-342">            mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(mg, ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-343">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_up_lower_x_max"</span>: lo, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_onset_margin_min"</span>: mg}</span>
<span id="cb49-344">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concavity recomputed with theta_t doubled"</span>, _concave_theta)</span>
<span id="cb49-345"></span>
<span id="cb49-346">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _concave_kp0():</span>
<span id="cb49-347">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""concavity recomputed on a 2 % larger k_p0."""</span></span>
<span id="cb49-348">        lo, mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.inf</span>
<span id="cb49-349">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-350">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)</span>
<span id="cb49-351">            m.kp0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.kp0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span></span>
<span id="cb49-352">            cs, tg, d2, sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> concavity(m, T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]])</span>
<span id="cb49-353">            xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cs(tg[k])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sgn]</span>
<span id="cb49-354">            lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(lo, xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-355">            mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(mg, ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> xs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb49-356">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_up_lower_x_max"</span>: lo, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_onset_margin_min"</span>: mg}</span>
<span id="cb49-357">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concavity recomputed on a k_p0 2 % larger"</span>, _concave_kp0)</span>
<span id="cb49-358"></span>
<span id="cb49-359">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _i0_theta():</span>
<span id="cb49-360">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the initiator-loading gap with theta_t(50, 0.01548) 10 % smaller."""</span></span>
<span id="cb49-361">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-362">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> TC <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>):</span>
<span id="cb49-363">            a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)]</span>
<span id="cb49-364">            mb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>, theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MODELS[(TC, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01548</span>)].theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb49-365">            b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve(mb, nx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb49-366">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb49-367">                np.interp(b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>], a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lt"</span>]))))</span>
<span id="cb49-368">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"i0_dlogkt_max"</span>: v}</span>
<span id="cb49-369">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"initiator-loading gap with every theta_t(0.01548) 40 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">maller"</span>,</span>
<span id="cb49-370">        _i0_theta)</span>
<span id="cb49-371"></span>
<span id="cb49-372">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _qssa_theta():</span>
<span id="cb49-373">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the QSSA comparison rebuilt with theta_t doubled - the parameter that</span></span>
<span id="cb49-374"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        sets how fast k_t collapses, and therefore how far the radicals depart</span></span>
<span id="cb49-375"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        from quasi-steady."""</span></span>
<span id="cb49-376">        out, other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-377">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-378">            m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chiu(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], theta_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>MODELS[c].theta_t)</span>
<span id="cb49-379">            te <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb49-380">            se, sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.solve(te), m.solve_qssa(te)</span>
<span id="cb49-381">            tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, te, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8001</span>)</span>
<span id="cb49-382">            Ye, Yq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> se.sol(tg), sq.sol(tg)</span>
<span id="cb49-383">            l0q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([m.lam0_qssa(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), I)</span>
<span id="cb49-384">                            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x, I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])])</span>
<span id="cb49-385">            rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(l0q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb49-386">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>):</span>
<span id="cb49-387">                out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_50C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rr</span>
<span id="cb49-388">                out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_conv_max_dev_50C"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Yq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ye[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb49-389">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>:</span>
<span id="cb49-390">                other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(other, rr)</span>
<span id="cb49-391">        out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_other_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> other</span>
<span id="cb49-392">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb49-393">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA comparison rebuilt with theta_t doubled"</span>, _qssa_theta)</span>
<span id="cb49-394"></span>
<span id="cb49-395">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _mw_horizon():</span>
<span id="cb49-396">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""molecular weights read only to half the horizon."""</span></span>
<span id="cb49-397">        pre, post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-398">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-399">            x, Mn, Mw, Mna, Mwa, ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mol_weights(MODELS[c], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T_END[c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]],</span>
<span id="cb49-400">                                                  n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1201</span>)</span>
<span id="cb49-401">            on <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]</span>
<span id="cb49-402">            a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> on), ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> on)</span>
<span id="cb49-403">            pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(pre, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mna[a]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mn[a] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))))</span>
<span id="cb49-404">            post <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(post, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Mna[b]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Mn[b] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))))</span>
<span id="cb49-405">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_approx_pre_onset_max"</span>: pre, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_approx_post_onset_max"</span>: post}</span>
<span id="cb49-406">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"molecular weights read only to half the integration horizon"</span>,</span>
<span id="cb49-407">        _mw_horizon)</span>
<span id="cb49-408"></span>
<span id="cb49-409">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _band_other():</span>
<span id="cb49-410">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The five readings that leave BOTH the 3-5- and the 4-6-decade</span></span>
<span id="cb49-411"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        windows out.  Both are decade windows of the same family as the two</span></span>
<span id="cb49-412"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        that are in, and leaving them out narrows the band."""</span></span>
<span id="cb49-413">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb49-414">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS:</span>
<span id="cb49-415">            vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>], ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_1_3"</span>],</span>
<span id="cb49-416">                    ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_flattest"</span>], ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_decade3"</span>],</span>
<span id="cb49-417">                    ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_plateau_L0"</span>]]</span>
<span id="cb49-418">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(vals) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(vals)))</span>
<span id="cb49-419">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_definition_band_max"</span>: v}</span>
<span id="cb49-420">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"definition band formed without the 3-5 and 4-6 decade windows"</span>,</span>
<span id="cb49-421">        _band_other)</span>
<span id="cb49-422"></span>
<span id="cb49-423">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _band_six():</span>
<span id="cb49-424">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the 3-5-decade window in, the 4-6 out."""</span></span>
<span id="cb49-425">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_definition_band_max"</span>: ONSET_BAND_SIX}</span>
<span id="cb49-426">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"definition band formed without the 4-6 decade window"</span>, _band_six)</span>
<span id="cb49-427"></span>
<span id="cb49-428">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _resample_short():</span>
<span id="cb49-429">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the resampling floor read off the three coarsest grids only."""</span></span>
<span id="cb49-430">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_resample_floor_max_rel"</span>:</span>
<span id="cb49-431">                _resample_floor(ONSET_NX_VALS, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])}</span>
<span id="cb49-432">    add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resampling floor measured over nx = 2001/4001/8001 only"</span>,</span>
<span id="cb49-433">        _resample_short)</span>
<span id="cb49-434"></span>
<span id="cb49-435">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> rows</span>
<span id="cb49-436"></span>
<span id="cb49-437"></span>
<span id="cb49-438">BREAKS, COVERAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}</span>
<span id="cb49-439"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK_FNS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _method_rows():</span>
<span id="cb49-440">    got <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn()</span>
<span id="cb49-441">    BREAKS.append((lbl, got))</span>
<span id="cb49-442">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items():</span>
<span id="cb49-443">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb49-444">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb49-445">        base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> METRICS[k_]</span>
<span id="cb49-446">        denom <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb49-447">        mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>denom</span>
<span id="cb49-448">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL:</span>
<span id="cb49-449">            COVERAGE.setdefault(k_, []).append((lbl, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mv)))</span>
<span id="cb49-450"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> defect rows run"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>53 defect rows run</code></pre>
</div>
</div>
<div id="05f3c037" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:17:29.472084Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:17:29.471951Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:17:29.486960Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:17:29.486141Z&quot;}}" data-execution_count="25">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb51-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the coverage map, ASSERTED against METRICS key for key -----------------</span></span>
<span id="cb51-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ONE METRIC IS STRUCTURAL AND IS NAMED AS ONE.  Flipping the sign of a moment</span></span>
<span id="cb51-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># term that matches its chain-length sum exactly turns |rhs - lhs|/|lhs| into</span></span>
<span id="cb51-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># |-2c|/|c| = 2 on ANY population, so the number is 2 by construction and no</span></span>
<span id="cb51-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># perturbation can move it.  What it therefore CANNOT detect: it says the</span></span>
<span id="cb51-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># identity has teeth against a sign, and nothing about magnitude, about the</span></span>
<span id="cb51-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># truncation, or about the population - which is why</span></span>
<span id="cb51-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># moment_identity_trunc_max_rel exists beside it and IS covered.</span></span>
<span id="cb51-9">STRUCTURAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_broken_max_rel"</span>:</span>
<span id="cb51-10">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly 2 by construction; see the note in the break-table cell"</span>}</span>
<span id="cb51-11">uncovered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(METRICS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(STRUCTURAL))</span>
<span id="cb51-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"COVERAGE MAP, GENERATED FROM </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> DEFECT INJECTIONS"</span></span>
<span id="cb51-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics, move threshold </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOVE_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative):"</span>)</span>
<span id="cb51-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(METRICS):</span>
<span id="cb51-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE:</span>
<span id="cb51-16">        rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(COVERAGE[k_], key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb51-17">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(rows)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> row(s); strongest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb51-18">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  &lt;- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL:</span>
<span id="cb51-20">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> STRUCTURAL - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STRUCTURAL[k_]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb51-22">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> UNCOVERED"</span>)</span>
<span id="cb51-23"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> uncovered, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics no break row moves and none named structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>uncovered<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb51-24">_moving <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS</span>
<span id="cb51-25">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> lbl <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE[k_])</span>
<span id="cb51-26">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got)}</span>
<span id="cb51-27">N_BREAK_ROWS, N_MOVING_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_moving)</span>
<span id="cb51-28">N_LINKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values())</span>
<span id="cb51-29"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> N_MOVING_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_BREAK_ROWS, (</span>
<span id="cb51-30">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a break row moves nothing: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({l <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS} <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _moving)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-31">N_CELL_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK_FNS)</span>
<span id="cb51-32">N_METHOD_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_BREAK_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_CELL_ROWS</span>
<span id="cb51-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MOVING_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BREAK_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows move a reported metric;"</span></span>
<span id="cb51-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_LINKS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> measured row-metric links."</span>)</span>
<span id="cb51-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the rows split </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CELL_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_METHOD_ROWS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> between MIS-TRANSCRIBING"</span></span>
<span id="cb51-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ONE PRINTED CELL and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  CHANGING A METHOD or a resolution, and the"</span></span>
<span id="cb51-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" notebook computes that split rather than</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  asserting it."</span>)</span>
<span id="cb51-38"></span>
<span id="cb51-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The round-off quantities, the orders and the sign-flip identity are BOUNDS</span></span>
<span id="cb51-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (docs/claims-design.md), registered below.  A relative move means nothing for</span></span>
<span id="cb51-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a number at round-off, so the 5 % comparison applies to the values only; a</span></span>
<span id="cb51-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bound is broken when a row takes it outside its bound.</span></span>
<span id="cb51-43">BOUNDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb51-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_two_route_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-45">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb51-46">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the onset; x-route Radau at rtol 1e-10 against the t-route BDF at"</span></span>
<span id="cb51-47">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" rtol 1e-11; measured 8.9e-12 to 9.2e-12 across BLAS kernels, the bound is"</span></span>
<span id="cb51-48">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" about 11x that"</span>),</span>
<span id="cb51-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_reconstruction_x_maxdiff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-50">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb51-51">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion, absolute; x contains no M_0, so the gap is BDF at rtol 1e-11;"</span></span>
<span id="cb51-52">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" measured 1.0e-12 to 1.7e-12 across BLAS kernels, the bound is about 60x"</span></span>
<span id="cb51-53">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" that"</span>),</span>
<span id="cb51-54">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-55">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb51-56">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to each moment's chain-length sum; measured 2.1e-16"</span>),</span>
<span id="cb51-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_ktc_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-58">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb51-59">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to each moment's chain-length sum; measured 1.6e-16"</span>),</span>
<span id="cb51-60">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_broken_max_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-61">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.99</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.01</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb51-62">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a sign flip on an exactly matching term gives |-2c|/|c| = 2 on any"</span></span>
<span id="cb51-63">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" population, so no break row can move it"</span>),</span>
<span id="cb51-64">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq26_symbolic_residual"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-65">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb51-66">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy simplifies eq. 26 minus its own integration of eq. 21 to 0"</span>),</span>
<span id="cb51-67">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_K_spread_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-68">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb51-69">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to K_exact; the flux of a conservative finite-volume scheme with no"</span></span>
<span id="cb51-70">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" source is the same at every face to round-off of the solve; measured"</span></span>
<span id="cb51-71">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1.5e-10, the bound is about 66x that"</span>),</span>
<span id="cb51-72">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-73">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb51-74">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second-order finite volumes on the spherical shell; 1.86 at n = 1280"</span>),</span>
<span id="cb51-75">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb51-76">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler is first order in dt;"</span></span>
<span id="cb51-77">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1.0094 over a 16x refinement"</span>),</span>
<span id="cb51-78">}</span>
<span id="cb51-79">CI_REL_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb51-80">WEAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k_: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items()</span>
<span id="cb51-81">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> CI_REL_TOL}</span>
<span id="cb51-82">WEAKEST_COVER, WEAKEST_METRIC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v), k_)</span>
<span id="cb51-83">                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS)</span>
<span id="cb51-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">weakest cover among the value claims: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_COVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAKEST_METRIC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"value claims whose strongest mover is below check_agreement.py's 5 %:"</span></span>
<span id="cb51-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(WEAK):</span>
<span id="cb51-88">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> strongest mover </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WEAK[k_]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-89"></span>
<span id="cb51-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every metric is registered ONCE with how it is checked (docs/claims-design.md):</span></span>
<span id="cb51-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a value against the committed baseline within its rtol, a bound against its</span></span>
<span id="cb51-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bound on every machine.  The set of names is fixed and never depends on a</span></span>
<span id="cb51-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># value.  Residuals, identities and solver-tolerance gaps are bounds, whatever</span></span>
<span id="cb51-94"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># their size, and their round-off digits differ between BLAS kernels, so the</span></span>
<span id="cb51-95"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># prose states the bound and never the digits.  Every other metric is a</span></span>
<span id="cb51-96"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># physical, data or discretisation result, far above its measured spread across</span></span>
<span id="cb51-97"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kernels; the default rtol of 0.05 is caught by the break table, whose weakest</span></span>
<span id="cb51-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cover is 5.4 %.</span></span>
<span id="cb51-99">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE)</span>
<span id="cb51-100">VALUE_NOTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb51-101">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qss_start_max_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the quasi-steady-state error of lambda_0 at the start state,"</span></span>
<span id="cb51-102">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" set by the kinetics, not by a solver tolerance (BDF at rtol"</span></span>
<span id="cb51-103">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1e-11)"</span>,</span>
<span id="cb51-104">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_resample_floor_max_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a discretisation result: the onset against the"</span></span>
<span id="cb51-105">                                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" resampling grid"</span>,</span>
<span id="cb51-106">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_onset_margin_min"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spreads 1e-5 absolute across BLAS kernels; quoted to"</span></span>
<span id="cb51-107">                                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" three decimals"</span>,</span>
<span id="cb51-108">}</span>
<span id="cb51-109"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.items():</span>
<span id="cb51-110">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS:</span>
<span id="cb51-111">        claims.bound(k_, v, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>BOUNDS[k_])</span>
<span id="cb51-112">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb51-113">        claims.value(k_, v, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>VALUE_NOTES.get(k_))</span>
<span id="cb51-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break table, wired row by row to the claims it recomputes: a row breaks a</span></span>
<span id="cb51-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claim when the claim's own check (rtol or bound) fails on the injected value</span></span>
<span id="cb51-116"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl, got <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb51-117">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got.items():</span>
<span id="cb51-118">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS:</span>
<span id="cb51-119">            claims.breaks(lbl, k_, v)</span>
<span id="cb51-120">_kinds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {kd: [k_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kd]</span>
<span id="cb51-121">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)}</span>
<span id="cb51-122"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics registered as claims: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values,"</span></span>
<span id="cb51-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bound'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exact'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact.  The bounds:"</span>)</span>
<span id="cb51-124"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>]:</span>
<span id="cb51-125">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[k_]</span>
<span id="cb51-126">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>), c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>)</span>
<span id="cb51-127">    rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-128">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:32s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rng<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'basis'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-129"></span>
<span id="cb51-130">SECOND_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb51-131">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the constitutive curve, t-parametrised vs x-parametrised integration"</span></span>
<span id="cb51-132">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (an ATTRACTOR test, not an accuracy one - see the note in that cell)"</span>:</span>
<span id="cb51-133">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_two_route_max_rel"</span>,</span>
<span id="cb51-134">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the shared start state, marched lambda_0 vs the algebraic QSS root"</span>:</span>
<span id="cb51-135">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qss_start_max_rel"</span>,</span>
<span id="cb51-136">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 26, the paper's chain vs sympy's integration of eq. 21"</span>:</span>
<span id="cb51-137">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq26_symbolic_residual"</span>,</span>
<span id="cb51-138">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 22's error, the pymrm BVP's own DISCRETE FLUX vs the symbolic r_m/r_D"</span></span>
<span id="cb51-139">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (at n = 6400, converging at order 1.9)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rm_over_rD_max_dev"</span>,</span>
<span id="cb51-140">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 12-17, moment equations vs the chain-length equations summed"</span>:</span>
<span id="cb51-141">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_ktc_max_rel"</span>,</span>
<span id="cb51-142">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same identity with the convolution truncation violated"</span>:</span>
<span id="cb51-143">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_trunc_max_rel"</span>,</span>
<span id="cb51-144">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x through the gel region, pymrm backward Euler vs BDF"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_err_finest"</span>,</span>
<span id="cb51-145">}</span>
<span id="cb51-146"></span>
<span id="cb51-147"></span>
<span id="cb51-148"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _shown(k_):</span>
<span id="cb51-149">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""a value with its digits; a bound as the bound, with this run's number."""</span></span>
<span id="cb51-150">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[k_]</span>
<span id="cb51-151">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>:</span>
<span id="cb51-152">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb51-153">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>:</span>
<span id="cb51-154">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly 0"</span></span>
<span id="cb51-155">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb51-156"></span>
<span id="cb51-157"></span>
<span id="cb51-158"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> quantities computed a second way -"</span></span>
<span id="cb51-159">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them by an INDEPENDENT route:"</span>)</span>
<span id="cb51-160"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lbl_, k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SECOND_ROUTES.items():</span>
<span id="cb51-161">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_shown(k_)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:28s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lbl_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb51-162"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  ONE OF THE SEVEN IS THE FIRST ROUTE DELIBERATELY BROKEN (the"</span></span>
<span id="cb51-163">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" truncation companion), which</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  is why it is labelled as a"</span></span>
<span id="cb51-164">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" companion and not as an independent check.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  eq. 22's pricing reads"</span></span>
<span id="cb51-165">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the discrete flux; the nu = 0 break row moves it by four orders."</span>)</span>
<span id="cb51-166"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claims.report() runs at the end of the prose cell below, after every number</span></span>
<span id="cb51-167"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the prose quotes has been checked against its claim with claims.says.</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>COVERAGE MAP, GENERATED FROM 53 DEFECT INJECTIONS (56 metrics, move threshold 1e-06 relative):
  A_exponent_implied                  2 row(s); strongest 3.945e-01  &lt;- Table II: A(90) 0.163 -&gt; 0.168
  A_gain_min_at_Tgp_band_ends         2 row(s); strongest 9.271e-01  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  A_linear_in_Tgp2_max_rel            3 row(s); strongest 5.026e+01  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  A_null_gain                         3 row(s); strongest 4.605e+00  &lt;- Table I: T_gp 114 -&gt; 111 degC
  A_null_linear_in_T_max_rel          2 row(s); strongest 9.879e-01  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  A_second_difference                 2 row(s); strongest 2.857e+00  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  Tgp_band_width_C                    1 row(s); strongest 1.727e+00  &lt;- T_gp band computed at +-0.001 in A instead of +-
  Tgp_implied_C                       2 row(s); strongest 1.154e+00  &lt;- Table II: A(90) 0.163 -&gt; 0.168
  bvp_K_spread_rel                    2 row(s); strongest 1.326e+11  &lt;- construct_div with nu = 0 (Cartesian) instead of
  bvp_order                           1 row(s); strongest 5.627e-01  &lt;- BVP refined only to n = 80 instead of n = 640
  bvp_rms_err_finest                  2 row(s); strongest 1.885e+05  &lt;- construct_div with nu = 0 (Cartesian) instead of
  compress_A_max_rel                  3 row(s); strongest 5.026e+01  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  compress_theta_p_max_rel            2 row(s); strongest 1.283e+01  &lt;- Table II: theta_p(70) 250 -&gt; 2500 min, both rows
  compress_theta_t_max_rel            6 row(s); strongest 4.550e-01  &lt;- Table II: theta_t(50, 0.01548) 2.33e3 read as 3.
  concave_onset_margin_min            3 row(s); strongest 3.804e+00  &lt;- concavity recomputed with theta_t doubled
  concave_up_lower_x_max              3 row(s); strongest 9.590e-01  &lt;- concavity recomputed with theta_t doubled
  dE_theta_p_kcal                     2 row(s); strongest 5.915e-02  &lt;- Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min
  dE_theta_p_rel_vs_printed           3 row(s); strongest 1.826e+01  &lt;- stated: printed dE(theta_p) 28 -&gt; 24 kcal/mol
  dE_theta_t_01548_kcal               2 row(s); strongest 5.617e-02  &lt;- Table II: theta_t(50, 0.01548) 2.33e3 read as 3.
  dE_theta_t_0258_kcal                3 row(s); strongest 6.065e-02  &lt;- Table II: theta_t(50, 0.0258) 1.50e3 read as 1.0
  dE_theta_t_rel_vs_printed           3 row(s); strongest 1.192e+00  &lt;- Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min
  eq22_rm_over_rD_max_dev             3 row(s); strongest 5.119e+04  &lt;- construct_div with nu = 0 (Cartesian) instead of
  eq26_symbolic_residual              1 row(s); strongest 5.705e-01  &lt;- eq. 26's 3 D written as 2 D
  i0_dlogkt_max                       2 row(s); strongest 3.436e-01  &lt;- initiator-loading gap with every theta_t(0.01548
  ln10_onset_shift                    1 row(s); strongest 1.776e+01  &lt;- eq. 31/32's printed 2.3 read as 2.35 instead of 
  march_err_finest                    1 row(s); strongest 1.657e+01  &lt;- backward Euler refined only to nt = 200 instead 
  march_order                         1 row(s); strongest 1.227e-01  &lt;- backward Euler refined only to nt = 200 instead 
  moment_identity_broken_max_rel     STRUCTURAL - exactly 2 by construction; see the note in the break-table cell
  moment_identity_ktc_max_rel         1 row(s); strongest 2.000e+00  &lt;- one sign flipped in eq. 13, in eq. 17, and in eq
  moment_identity_max_rel             1 row(s); strongest 2.000e+00  &lt;- one sign flipped in eq. 13, in eq. 17, and in eq
  moment_identity_trunc_max_rel       2 row(s); strongest 5.728e-01  &lt;- one sign flipped in eq. 13, in eq. 17, and in eq
  mw_approx_post_onset_max            1 row(s); strongest 5.007e-01  &lt;- molecular weights read only to half the integrat
  mw_approx_pre_onset_max             1 row(s); strongest 5.757e+01  &lt;- molecular-weight split moved from the onset to h
  mw_reconstruction_x_maxdiff         1 row(s); strongest 5.925e+09  &lt;- MW test contaminated with a 0.1 % change in k_p0
  onset_compressed_shift_max          1 row(s); strongest 4.907e-01  &lt;- compressed A perturbed by 1 % before the onset i
  onset_definition_band_max           2 row(s); strongest 7.310e-01  &lt;- definition band formed without the 3-5 and 4-6 d
  onset_dev_50C                      19 row(s); strongest 2.190e+01  &lt;- Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258
  onset_dev_70C                      19 row(s); strongest 3.113e+01  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  onset_dev_90C                      19 row(s); strongest 2.462e+00  &lt;- Table I: d_p 1.2 -&gt; 1.3 g/cm3
  onset_dev_other_loading_max        17 row(s); strongest 7.772e-01  &lt;- Table I: d_p 1.2 -&gt; 1.3 g/cm3
  onset_i0_shift_max                 17 row(s); strongest 2.310e+00  &lt;- Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258
  onset_max_abs_dev                  20 row(s); strongest 1.047e+01  &lt;- Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258
  onset_per_decade_theta_t            1 row(s); strongest 8.258e-02  &lt;- theta_t leverage measured at 90 degC instead of 
  onset_resample_floor_max_rel        1 row(s); strongest 3.755e-01  &lt;- resampling floor measured over nx = 2001/4001/80
  onset_two_route_max_rel             1 row(s); strongest 1.735e+07  &lt;- second route run at rtol 1e-6 on 801 points
  onset_x_50C                        20 row(s); strongest 4.153e-01  &lt;- Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258
  onset_x_70C                        20 row(s); strongest 1.450e-01  &lt;- Table II: A(70) 0.152 -&gt; 0.142
  onset_x_90C                        11 row(s); strongest 5.402e-02  &lt;- Table I: d_p 1.2 -&gt; 1.3 g/cm3
  qss_start_max_rel                   1 row(s); strongest 3.956e+03  &lt;- start-up check run against a lambda_0 that is 3 
  qssa_conv_max_dev_50C               3 row(s); strongest 6.472e-01  &lt;- QSSA comparison rebuilt with theta_t doubled
  qssa_lam0_ratio_50C                 2 row(s); strongest 7.714e-01  &lt;- QSSA comparison rebuilt with theta_t doubled
  qssa_lam0_ratio_other_max           3 row(s); strongest 6.604e-01  &lt;- QSSA comparison rebuilt with theta_t doubled
  switch_d2x_max_pre                  1 row(s); strongest 1.818e-01  &lt;- the counterfactual switched at x_c = 0.45 instea
  switch_logkt_jump                   1 row(s); strongest 1.834e+00  &lt;- the counterfactual switched at x_c = 0.45 instea
  xlim_50C                            1 row(s); strongest 7.051e-02  &lt;- limiting-conversion threshold 1e-3 -&gt; 1e-2 of th
  xlim_monotone_margin                1 row(s); strongest 1.677e+00  &lt;- limiting-conversion threshold 1e-3 -&gt; 1e-2 of th

53 of 53 rows move a reported metric; 249 measured row-metric links.
  the rows split 19 / 34 between MIS-TRANSCRIBING ONE PRINTED CELL and
  CHANGING A METHOD or a resolution, and the notebook computes that split rather than
  asserting it.

weakest cover among the value claims: 5.4023% on onset_x_90C
value claims whose strongest mover is below check_agreement.py's 5 %: 0

56 metrics registered as claims: 47 values, 9 bounds, 0 exact.  The bounds:
  onset_two_route_max_rel          &lt;= 1e-10       [tolerance]  here 9.08e-12
  moment_identity_max_rel          &lt;= 1e-14       [identity]  here 2.1e-16
  moment_identity_ktc_max_rel      &lt;= 1e-14       [identity]  here 1.59e-16
  moment_identity_broken_max_rel   [1.99, 2.01]   [identity]  here 2
  eq26_symbolic_residual           &lt;= 0           [identity]  here 0
  bvp_order                        [1.5, 2.5]     [theory]  here 1.86
  bvp_K_spread_rel                 &lt;= 1e-08       [identity]  here 1.51e-10
  march_order                      [0.9, 1.1]     [theory]  here 1.01
  mw_reconstruction_x_maxdiff      &lt;= 1e-10       [tolerance]  here 1.34e-12

7 quantities computed a second way - 6 of them by an INDEPENDENT route:
  below 1e-10 (here 9.1e-12)   the constitutive curve, t-parametrised vs x-parametrised integration (an ATTRACTOR test, not an accuracy one - see the note in that cell)
  7.362e-06                    the shared start state, marched lambda_0 vs the algebraic QSS root
  exactly 0                    eq. 26, the paper's chain vs sympy's integration of eq. 21
  1.858e-05                    eq. 22's error, the pymrm BVP's own DISCRETE FLUX vs the symbolic r_m/r_D (at n = 6400, converging at order 1.9)
  below 1e-14 (here 1.6e-16)   eq. 12-17, moment equations vs the chain-length equations summed
  3.125e-02                    the same identity with the convolution truncation violated
  2.120e-05                    x through the gel region, pymrm backward Euler vs BDF

  ONE OF THE SEVEN IS THE FIRST ROUTE DELIBERATELY BROKEN (the truncation companion), which
  is why it is labelled as a companion and not as an independent check.
  eq. 22's pricing reads the discrete flux; the nu = 0 break row moves it by four orders.</code></pre>
</div>
</div>
<div id="c8a8c945" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:17:29.489225Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:17:29.489048Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:17:29.513201Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:17:29.512400Z&quot;}}" data-execution_count="26">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb53-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- every number in the prose, checked against the live computation --------</span></span>
<span id="cb53-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The notebook FAILS TO EXECUTE if any value written in its markdown, in</span></span>
<span id="cb53-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># meta.yaml, in README.md or in models.yaml has drifted from what the</span></span>
<span id="cb53-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># computation now produces.  Counts are pinned here as well as numbers, because</span></span>
<span id="cb53-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a count in a YAML file is a hand-typed integer no computation can rewrite.</span></span>
<span id="cb53-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A number that is a registered claim is checked by claims.says, as written:</span></span>
<span id="cb53-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># within one unit of its last written place, or, for a bound phrase such as</span></span>
<span id="cb53-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "below 1e-10", at least as loose as the claim's declared bound.  Round-off</span></span>
<span id="cb53-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># quantities are quoted ONLY as their bound, because their digits differ</span></span>
<span id="cb53-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># between BLAS kernels.  The onsets are quoted to five decimals because</span></span>
<span id="cb53-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># onset_resample_floor_max_rel says the resampling grid moves them in the</span></span>
<span id="cb53-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sixth; a sixth digit would assert a precision the refinement study has</span></span>
<span id="cb53-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># already shown does not exist.</span></span>
<span id="cb53-14">SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb53-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_x_50C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.25516"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_x_70C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.34838"</span>],</span>
<span id="cb53-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_x_90C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.44034"</span>],</span>
<span id="cb53-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_50C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.00484"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_70C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.00162"</span>],</span>
<span id="cb53-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_90C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.00966"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.00966"</span>],</span>
<span id="cb53-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_other_loading_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.03126"</span>],</span>
<span id="cb53-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_definition_band_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.09009"</span>],</span>
<span id="cb53-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_two_route_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-10"</span>],</span>
<span id="cb53-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_resample_floor_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.311e-05"</span>],</span>
<span id="cb53-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_compressed_shift_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.01633"</span>],</span>
<span id="cb53-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_per_decade_theta_t"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.21735"</span>],</span>
<span id="cb53-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qss_start_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.36e-06"</span>],</span>
<span id="cb53-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_0258_kcal"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34.908161"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_t_01548_kcal"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34.516600"</span>],</span>
<span id="cb53-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE_theta_p_kcal"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"27.771564"</span>],</span>
<span id="cb53-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_linear_in_Tgp2_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.819e-04"</span>],</span>
<span id="cb53-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_null_linear_in_T_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.535e-02"</span>],</span>
<span id="cb53-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_null_gain"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"17.4057"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_gain_min_at_Tgp_band_ends"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.5347"</span>],</span>
<span id="cb53-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_second_difference"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.007000"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tgp_implied_C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"111.42857"</span>],</span>
<span id="cb53-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_exponent_implied"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0659"</span>],</span>
<span id="cb53-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_lam0_ratio_50C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.5176"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_conv_max_dev_50C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.038611"</span>],</span>
<span id="cb53-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_up_lower_x_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.30643"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concave_onset_margin_min"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.129"</span>],</span>
<span id="cb53-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"switch_d2x_max_pre"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1.391e-06"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"switch_logkt_jump"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.760194"</span>],</span>
<span id="cb53-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_t_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.188281"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18.8281 %"</span>],</span>
<span id="cb53-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_theta_p_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.083695"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compress_A_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.000882"</span>],</span>
<span id="cb53-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-14"</span>],</span>
<span id="cb53-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_ktc_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-14"</span>],</span>
<span id="cb53-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moment_identity_trunc_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.13e-02"</span>],</span>
<span id="cb53-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_rm_over_rD_max_dev"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.858e-05"</span>],</span>
<span id="cb53-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_K_spread_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"less than 1e-8"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bvp_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.8618"</span>],</span>
<span id="cb53-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.0094"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_err_finest"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.12e-05"</span>],</span>
<span id="cb53-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_reconstruction_x_maxdiff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"less than 1e-10"</span>],</span>
<span id="cb53-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xlim_50C"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.95535"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xlim_monotone_margin"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.011165"</span>],</span>
<span id="cb53-46">}</span>
<span id="cb53-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.items():</span>
<span id="cb53-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lits:</span>
<span id="cb53-49">        claims.says(lit, k_)</span>
<span id="cb53-50">N_SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.values())</span>
<span id="cb53-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># quoted numbers that are NOT metrics: ratios, the other readings, and</span></span>
<span id="cb53-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># table-derived constants.  Each is checked to half</span></span>
<span id="cb53-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a unit of its last written place, as before.</span></span>
<span id="cb53-54">OTHER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb53-55">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"other-loading miss over the headline miss"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.24</span>,</span>
<span id="cb53-56">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_dev_other_loading_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb53-57">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band over the largest miss"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.33</span>,</span>
<span id="cb53-58">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_definition_band_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb53-59">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4-6-decade window reading, 50 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.29957</span>,</span>
<span id="cb53-60">     ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_4_6"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-61">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4-6-decade window reading, 90 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.49516</span>,</span>
<span id="cb53-62">     ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_4_6"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-63">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest-slope reading, 50 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.44783</span>,</span>
<span id="cb53-64">     ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_steepest"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-65">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steepest-slope reading, 90 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.51866</span>,</span>
<span id="cb53-66">     ONSET[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, I0_HEADLINE)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_steepest"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-67">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compressed-shift ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.691</span>,</span>
<span id="cb53-68">     METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_compressed_shift_max"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_max_abs_dev"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb53-69">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decades of theta_t per unit onset"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.601</span>,</span>
<span id="cb53-70">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>METRICS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_per_decade_theta_t"</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb53-71">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dE(theta_t), mean of the two"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">34.712380</span>, E_T_MEAN, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb53-72">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weakest cover among the value claims"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.4023</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>WEAKEST_COVER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>),</span>
<span id="cb53-73">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 90 degC leverage row's move"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.258</span>,</span>
<span id="cb53-74">     <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset_per_decade_theta_t"</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb53-75">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null gain at the lower end of the T_gp band"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6124</span>, A_GAIN_BAND_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-76">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null gain at the upper end of the T_gp band"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5347</span>, A_GAIN_BAND_HI, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-77">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gain of A against 1/T"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.5926</span>, A_ALT_GAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A against 1/T (degC)"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-78">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gain of A against (T-130)^2"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2607</span>,</span>
<span id="cb53-79">     A_ALT_GAIN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"A against (T - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_ALT_CENTRE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)^2"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-80">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_gp band lower"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">102.2222</span>, T_GP_BAND_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-81">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T_gp band upper"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">128.0000</span>, T_GP_BAND_HI, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-82">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA factor, smallest of the six"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4889</span>,</span>
<span id="cb53-83">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QSSA.values()), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-84">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA factor, largest of the six"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.8466</span>,</span>
<span id="cb53-85">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QSSA.values()), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-86">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fitted numbers per condition"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1667</span>, N_DISTINCT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>N_COND, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-87">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 22 pricing, observed order"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8953</span>, EQ22_ORDER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-88">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MW doubled, mu_1"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.499939</span>, MW_MU1_MAXREL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>),</span>
<span id="cb53-89">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_lim, 70 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98173</span>, XLIM[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-90">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_lim, 90 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99289</span>, XLIM[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-91">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote, 50 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.97897</span>, X_ASYMPTOTE[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-92">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote, 70 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99850</span>, X_ASYMPTOTE[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-93">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote, 90 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99998</span>, X_ASYMPTOTE[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-6</span>),</span>
<span id="cb53-94">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k_t0 at 50 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.2952</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].kt0)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-95">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k_t0 at 70 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.3229</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].kt0)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-96">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k_t0 at 90 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.3475</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].kt0)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-97">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k_p0 at 50 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5256</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].kp0)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-98">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k_p0 at 70 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6972</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].kp0)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-99">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10 k_p0 at 90 degC"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.8499</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(MODELS[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)].kp0)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>),</span>
<span id="cb53-100">]</span>
<span id="cb53-101">_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(n, w, g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w, g, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OTHER <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> t]</span>
<span id="cb53-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the one round-off quantity quoted that is not a metric: lambda_0 under a</span></span>
<span id="cb53-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># doubled MW, solver noise at BDF rtol 1e-11, quoted as "less than 1e-9"</span></span>
<span id="cb53-104"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> MW_L0_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>:</span>
<span id="cb53-105">    _bad.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MW doubled, lambda_0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"less than 1e-9"</span>, MW_L0_MAXREL))</span>
<span id="cb53-106"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _bad, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prose values that have drifted from the computation: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb53-107">N_PROSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(OTHER) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb53-108">_counts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conditions"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, N_COND), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"distinct fitted numbers"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, N_DISTINCT),</span>
<span id="cb53-109">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compressed parameters"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, N_COMPRESSED),</span>
<span id="cb53-110">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"named parameters"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, N_NAMED), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">56</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS)),</span>
<span id="cb53-111">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break rows"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">53</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell rows"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, N_CELL_ROWS),</span>
<span id="cb53-112">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"method rows"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>, N_METHOD_ROWS), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"links"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">249</span>, N_LINKS),</span>
<span id="cb53-113">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second routes"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES)),</span>
<span id="cb53-114">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"weak metrics"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK)),</span>
<span id="cb53-115">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"onset readings in the band"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONSET_READINGS)),</span>
<span id="cb53-116">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conditions where the 4-6 decade window's fit mask stays inside"</span></span>
<span id="cb53-117">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the window edge"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, N_W46_INTERIOR),</span>
<span id="cb53-118">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conditions where the steepest tangent sits at the window edge"</span>:</span>
<span id="cb53-119">               (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, N_STEEPEST_AT_EDGE),</span>
<span id="cb53-120">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BVP faces"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1281</span>, BVP_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb53-121">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. 22 shell, finest n"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, EQ22_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb53-122">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA conditions above 2"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, QSSA_N_ABOVE)}</span>
<span id="cb53-123">_badc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _counts.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]}</span>
<span id="cb53-124"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _badc, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"counts stated in prose that the computation contradicts: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_badc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb53-125"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SAYS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose literals of registered claims checked by claims.says,"</span></span>
<span id="cb53-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_PROSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_SAYS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> other prose values and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_counts)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose counts"</span></span>
<span id="cb53-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pinned against the live computation; all agree.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb53-128"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every claim except the structural sign-flip identity has a break row that</span></span>
<span id="cb53-129"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fails its own check, so report() requires it.</span></span>
<span id="cb53-130">claims.report()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>45 prose literals of registered claims checked by claims.says, 34 other prose values and 17 prose counts pinned against the live computation; all agree.

Claims for J5.3-chiu-gel-effect:
  onset_x_50C                    = 0.25516          value  rtol 0.05
  onset_x_70C                    = 0.34838          value  rtol 0.05
  onset_x_90C                    = 0.44034          value  rtol 0.05
  onset_dev_50C                  = -0.0048389       value  rtol 0.05
  onset_dev_70C                  = -0.0016225       value  rtol 0.05
  onset_dev_90C                  = -0.0096615       value  rtol 0.05
  onset_max_abs_dev              = 0.0096615        value  rtol 0.05
  onset_dev_other_loading_max    = 0.031261         value  rtol 0.05
  onset_definition_band_max      = 0.090094         value  rtol 0.05
  onset_two_route_max_rel        = (here 9.1e-12)   bound  bound &lt;= 1e-10 [tolerance]
  onset_resample_floor_max_rel   = 1.3111e-05       value  rtol 0.05
  onset_i0_shift_max             = 0.026706         value  rtol 0.05
  onset_compressed_shift_max     = 0.016334         value  rtol 0.05
  onset_per_decade_theta_t       = -0.21735         value  rtol 0.05
  qss_start_max_rel              = 7.3617e-06       value  rtol 0.05
  dE_theta_t_0258_kcal           = 34.908           value  rtol 0.05
  dE_theta_t_01548_kcal          = 34.517           value  rtol 0.05
  dE_theta_p_kcal                = 27.772           value  rtol 0.05
  dE_theta_t_rel_vs_printed      = 0.026711         value  rtol 0.05
  dE_theta_p_rel_vs_printed      = 0.0081584        value  rtol 0.05
  A_linear_in_Tgp2_max_rel       = 0.00088194       value  rtol 0.05
  A_null_linear_in_T_max_rel     = 0.015351         value  rtol 0.05
  A_null_gain                    = 17.406           value  rtol 0.05
  Tgp_implied_C                  = 111.43           value  rtol 0.05
  Tgp_band_width_C               = 25.778           value  rtol 0.05
  A_exponent_implied             = 2.0659           value  rtol 0.05
  A_gain_min_at_Tgp_band_ends    = 3.5347           value  rtol 0.05
  A_second_difference            = -0.007           value  rtol 0.05
  qssa_lam0_ratio_50C            = 3.5176           value  rtol 0.05
  qssa_lam0_ratio_other_max      = 2.5481           value  rtol 0.05
  qssa_conv_max_dev_50C          = 0.038611         value  rtol 0.05
  concave_up_lower_x_max         = 0.30643          value  rtol 0.05
  concave_onset_margin_min       = 0.12933          value  rtol 0.05
  switch_d2x_max_pre             = -1.3915e-06      value  rtol 0.05
  switch_logkt_jump              = 0.76019          value  rtol 0.05
  compress_theta_t_max_rel       = 0.18828          value  rtol 0.05
  compress_theta_p_max_rel       = 0.083695         value  rtol 0.05
  compress_A_max_rel             = 0.00088194       value  rtol 0.05
  moment_identity_max_rel        = (here 2.1e-16)   bound  bound &lt;= 1e-14 [identity]
  moment_identity_ktc_max_rel    = (here 1.6e-16)   bound  bound &lt;= 1e-14 [identity]
  moment_identity_broken_max_rel = (here 2.0e+00)   bound  bound [1.99, 2.01] [identity]
  moment_identity_trunc_max_rel  = 0.031251         value  rtol 0.05
  eq26_symbolic_residual         = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  eq22_rm_over_rD_max_dev        = 1.8583e-05       value  rtol 0.05
  bvp_rms_err_finest             = 1.61e-06         value  rtol 0.05
  bvp_order                      = (here 1.9e+00)   bound  bound [1.5, 2.5] [theory]
  bvp_K_spread_rel               = (here 1.5e-10)   bound  bound &lt;= 1e-08 [identity]
  march_order                    = (here 1.0e+00)   bound  bound [0.9, 1.1] [theory]
  march_err_finest               = 2.1196e-05       value  rtol 0.05
  mw_approx_pre_onset_max        = 0.00082118       value  rtol 0.05
  mw_approx_post_onset_max       = 0.52403          value  rtol 0.05
  xlim_50C                       = 0.95535          value  rtol 0.05
  xlim_monotone_margin           = 0.011165         value  rtol 0.05
  i0_dlogkt_max                  = 0.21997          value  rtol 0.05
  ln10_onset_shift               = 0.0011583        value  rtol 0.05
  mw_reconstruction_x_maxdiff    = (here 1.3e-12)   bound  bound &lt;= 1e-10 [tolerance]</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="26">
<pre><code>{'page': 'J5.3-chiu-gel-effect',
 'format': 2,
 'env': {'pymrm': '3.2.0',
  'numpy': '2.5.4',
  'scipy': '1.18.1',
  'openblas_coretype': 'Haswell',
  'threads': '1'},
 'metrics': {'onset_x_50C': {'kind': 'value',
   'value': 0.2551611032826165,
   'rtol': 0.05},
  'onset_x_70C': {'kind': 'value', 'value': 0.348377541516603, 'rtol': 0.05},
  'onset_x_90C': {'kind': 'value', 'value': 0.44033851118276357, 'rtol': 0.05},
  'onset_dev_50C': {'kind': 'value',
   'value': -0.004838896717383523,
   'rtol': 0.05},
  'onset_dev_70C': {'kind': 'value',
   'value': -0.0016224584833969824,
   'rtol': 0.05},
  'onset_dev_90C': {'kind': 'value',
   'value': -0.009661488817236441,
   'rtol': 0.05},
  'onset_max_abs_dev': {'kind': 'value',
   'value': 0.009661488817236441,
   'rtol': 0.05},
  'onset_dev_other_loading_max': {'kind': 'value',
   'value': 0.03126060739643266,
   'rtol': 0.05},
  'onset_definition_band_max': {'kind': 'value',
   'value': 0.0900940093319495,
   'rtol': 0.05},
  'onset_two_route_max_rel': {'kind': 'bound',
   'value': 9.07673936012543e-12,
   'max': 1e-10,
   'basis': 'tolerance',
   'note': 'relative to the onset; x-route Radau at rtol 1e-10 against the t-route BDF at rtol 1e-11; measured 8.9e-12 to 9.2e-12 across BLAS kernels, the bound is about 11x that'},
  'onset_resample_floor_max_rel': {'kind': 'value',
   'value': 1.3111239727309784e-05,
   'rtol': 0.05,
   'note': 'a discretisation result: the onset against the resampling grid'},
  'onset_i0_shift_max': {'kind': 'value',
   'value': 0.026705667920466192,
   'rtol': 0.05},
  'onset_compressed_shift_max': {'kind': 'value',
   'value': 0.016334236164113447,
   'rtol': 0.05},
  'onset_per_decade_theta_t': {'kind': 'value',
   'value': -0.21734734069200448,
   'rtol': 0.05},
  'qss_start_max_rel': {'kind': 'value',
   'value': 7.361703121988583e-06,
   'rtol': 0.05,
   'note': 'the quasi-steady-state error of lambda_0 at the start state, set by the kinetics, not by a solver tolerance (BDF at rtol 1e-11)'},
  'dE_theta_t_0258_kcal': {'kind': 'value',
   'value': 34.90816069782293,
   'rtol': 0.05},
  'dE_theta_t_01548_kcal': {'kind': 'value',
   'value': 34.5166002583941,
   'rtol': 0.05},
  'dE_theta_p_kcal': {'kind': 'value',
   'value': 27.77156411155074,
   'rtol': 0.05},
  'dE_theta_t_rel_vs_printed': {'kind': 'value',
   'value': 0.026710608759497934,
   'rtol': 0.05},
  'dE_theta_p_rel_vs_printed': {'kind': 'value',
   'value': 0.008158424587473512,
   'rtol': 0.05},
  'A_linear_in_Tgp2_max_rel': {'kind': 'value',
   'value': 0.0008819441969856734,
   'rtol': 0.05},
  'A_null_linear_in_T_max_rel': {'kind': 'value',
   'value': 0.015350877192982408,
   'rtol': 0.05},
  'A_null_gain': {'kind': 'value', 'value': 17.405723905717554, 'rtol': 0.05},
  'Tgp_implied_C': {'kind': 'value',
   'value': 111.42857142857153,
   'rtol': 0.05},
  'Tgp_band_width_C': {'kind': 'value',
   'value': 25.777777777777715,
   'rtol': 0.05},
  'A_exponent_implied': {'kind': 'value',
   'value': 2.0658640708524194,
   'rtol': 0.05},
  'A_gain_min_at_Tgp_band_ends': {'kind': 'value',
   'value': 3.5346809353952424,
   'rtol': 0.05},
  'A_second_difference': {'kind': 'value',
   'value': -0.0069999999999999785,
   'rtol': 0.05},
  'qssa_lam0_ratio_50C': {'kind': 'value',
   'value': 3.5175513584224323,
   'rtol': 0.05},
  'qssa_lam0_ratio_other_max': {'kind': 'value',
   'value': 2.5480910060511723,
   'rtol': 0.05},
  'qssa_conv_max_dev_50C': {'kind': 'value',
   'value': 0.03861088696764359,
   'rtol': 0.05},
  'concave_up_lower_x_max': {'kind': 'value',
   'value': 0.3064307458903581,
   'rtol': 0.05},
  'concave_onset_margin_min': {'kind': 'value',
   'value': 0.12933477911579228,
   'rtol': 0.05,
   'note': 'spreads 1e-5 absolute across BLAS kernels; quoted to three decimals'},
  'switch_d2x_max_pre': {'kind': 'value',
   'value': -1.3914687586303442e-06,
   'rtol': 0.05},
  'switch_logkt_jump': {'kind': 'value',
   'value': 0.7601937773740151,
   'rtol': 0.05},
  'compress_theta_t_max_rel': {'kind': 'value',
   'value': 0.18828079660301422,
   'rtol': 0.05},
  'compress_theta_p_max_rel': {'kind': 'value',
   'value': 0.08369541467002906,
   'rtol': 0.05},
  'compress_A_max_rel': {'kind': 'value',
   'value': 0.0008819441969857289,
   'rtol': 0.05},
  'moment_identity_max_rel': {'kind': 'bound',
   'value': 2.0950177865767862e-16,
   'max': 1e-14,
   'basis': 'identity',
   'note': "relative to each moment's chain-length sum; measured 2.1e-16"},
  'moment_identity_ktc_max_rel': {'kind': 'bound',
   'value': 1.594165641583458e-16,
   'max': 1e-14,
   'basis': 'identity',
   'note': "relative to each moment's chain-length sum; measured 1.6e-16"},
  'moment_identity_broken_max_rel': {'kind': 'bound',
   'value': 2.0,
   'min': 1.99,
   'max': 2.01,
   'basis': 'identity',
   'structural': True,
   'note': 'a sign flip on an exactly matching term gives |-2c|/|c| = 2 on any population, so no break row can move it'},
  'moment_identity_trunc_max_rel': {'kind': 'value',
   'value': 0.031251083720956446,
   'rtol': 0.05},
  'eq26_symbolic_residual': {'kind': 'bound',
   'value': 0.0,
   'max': 0.0,
   'basis': 'identity',
   'note': 'sympy simplifies eq. 26 minus its own integration of eq. 21 to 0'},
  'eq22_rm_over_rD_max_dev': {'kind': 'value',
   'value': 1.8582692051469576e-05,
   'rtol': 0.05},
  'bvp_rms_err_finest': {'kind': 'value',
   'value': 1.6099989218232278e-06,
   'rtol': 0.05},
  'bvp_order': {'kind': 'bound',
   'value': 1.8617771981908688,
   'min': 1.5,
   'max': 2.5,
   'basis': 'theory',
   'note': 'second-order finite volumes on the spherical shell; 1.86 at n = 1280'},
  'bvp_K_spread_rel': {'kind': 'bound',
   'value': 1.5050369607186877e-10,
   'max': 1e-08,
   'basis': 'identity',
   'note': 'relative to K_exact; the flux of a conservative finite-volume scheme with no source is the same at every face to round-off of the solve; measured 1.5e-10, the bound is about 66x that'},
  'march_order': {'kind': 'bound',
   'value': 1.0094352088716685,
   'min': 0.9,
   'max': 1.1,
   'basis': 'theory',
   'note': 'backward Euler is first order in dt; 1.0094 over a 16x refinement'},
  'march_err_finest': {'kind': 'value',
   'value': 2.1196163680681224e-05,
   'rtol': 0.05},
  'mw_approx_pre_onset_max': {'kind': 'value',
   'value': 0.000821179544655215,
   'rtol': 0.05},
  'mw_approx_post_onset_max': {'kind': 'value',
   'value': 0.5240333097475882,
   'rtol': 0.05},
  'xlim_50C': {'kind': 'value', 'value': 0.9553484443358589, 'rtol': 0.05},
  'xlim_monotone_margin': {'kind': 'value',
   'value': 0.011165332809713435,
   'rtol': 0.05},
  'i0_dlogkt_max': {'kind': 'value',
   'value': 0.21996846543298254,
   'rtol': 0.05},
  'ln10_onset_shift': {'kind': 'value',
   'value': 0.001158288625712267,
   'rtol': 0.05},
  'mw_reconstruction_x_maxdiff': {'kind': 'bound',
   'value': 1.3419265698644267e-12,
   'max': 1e-10,
   'basis': 'tolerance',
   'note': 'conversion, absolute; x contains no M_0, so the gap is BDF at rtol 1e-11; measured 1.0e-12 to 1.7e-12 across BLAS kernels, the bound is about 60x that'}},
 'quoted': {'onset_x_50C': ['0.25516'],
  'onset_x_70C': ['0.34838'],
  'onset_x_90C': ['0.44034'],
  'onset_dev_50C': ['-0.00484'],
  'onset_dev_70C': ['-0.00162'],
  'onset_dev_90C': ['-0.00966'],
  'onset_max_abs_dev': ['0.00966'],
  'onset_dev_other_loading_max': ['0.03126'],
  'onset_definition_band_max': ['0.09009'],
  'onset_two_route_max_rel': ['below 1e-10'],
  'onset_resample_floor_max_rel': ['1.311e-05'],
  'onset_compressed_shift_max': ['0.01633'],
  'onset_per_decade_theta_t': ['-0.21735'],
  'qss_start_max_rel': ['7.36e-06'],
  'dE_theta_t_0258_kcal': ['34.908161'],
  'dE_theta_t_01548_kcal': ['34.516600'],
  'dE_theta_p_kcal': ['27.771564'],
  'A_linear_in_Tgp2_max_rel': ['8.819e-04'],
  'A_null_linear_in_T_max_rel': ['1.535e-02'],
  'A_null_gain': ['17.4057'],
  'A_gain_min_at_Tgp_band_ends': ['3.5347'],
  'A_second_difference': ['-0.007000'],
  'Tgp_implied_C': ['111.42857'],
  'A_exponent_implied': ['2.0659'],
  'qssa_lam0_ratio_50C': ['3.5176'],
  'qssa_conv_max_dev_50C': ['0.038611'],
  'concave_up_lower_x_max': ['0.30643'],
  'concave_onset_margin_min': ['0.129'],
  'switch_d2x_max_pre': ['-1.391e-06'],
  'switch_logkt_jump': ['0.760194'],
  'compress_theta_t_max_rel': ['0.188281', '18.8281 %'],
  'compress_theta_p_max_rel': ['0.083695'],
  'compress_A_max_rel': ['0.000882'],
  'moment_identity_max_rel': ['below 1e-14'],
  'moment_identity_ktc_max_rel': ['below 1e-14'],
  'moment_identity_trunc_max_rel': ['3.13e-02'],
  'eq22_rm_over_rD_max_dev': ['1.858e-05'],
  'bvp_K_spread_rel': ['less than 1e-8'],
  'bvp_order': ['1.8618'],
  'march_order': ['1.0094'],
  'march_err_finest': ['2.12e-05'],
  'mw_reconstruction_x_maxdiff': ['less than 1e-10'],
  'xlim_50C': ['0.95535'],
  'xlim_monotone_margin': ['0.011165']},
 'breaks': {'dE_theta_t_0258_kcal': ['Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)'],
  'dE_theta_t_01548_kcal': ['Table II: theta_t(50, 0.01548) 2.33e3 read as 3.23e3'],
  'dE_theta_p_kcal': ['Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min'],
  'dE_theta_t_rel_vs_printed': ['Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min',
   'Table II: theta_t(90, 0.0258) 3.80 -&gt; 3.30 min',
   'Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)'],
  'dE_theta_p_rel_vs_printed': ['Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min',
   'Table II: theta_p(70) 250 -&gt; 2500 min, both rows',
   'stated: printed dE(theta_p) 28 -&gt; 24 kcal/mol'],
  'A_linear_in_Tgp2_max_rel': ['Table I: T_gp 114 -&gt; 111 degC',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'A_null_linear_in_T_max_rel': ['Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'A_null_gain': ['Table I: T_gp 114 -&gt; 111 degC',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'Tgp_implied_C': ['Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'A_exponent_implied': ['Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'A_gain_min_at_Tgp_band_ends': ['Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'A_second_difference': ['Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'compress_theta_t_max_rel': ['Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min',
   'Table II: theta_t(90, 0.0258) 3.80 -&gt; 3.30 min',
   'Table II: theta_t(50, 0.01548) 2.33e3 read as 3.23e3',
   'Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)'],
  'compress_theta_p_max_rel': ['Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min',
   'Table II: theta_p(70) 250 -&gt; 2500 min, both rows'],
  'compress_A_max_rel': ['Table I: T_gp 114 -&gt; 111 degC',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168'],
  'onset_x_50C': ['Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min',
   'Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)',
   'Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4',
   "eq. 31/32's printed 2.3 read as 2.35 instead of ln(10)"],
  'onset_x_70C': ['Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4',
   "eq. 31/32's printed 2.3 read as 2.35 instead of ln(10)"],
  'onset_x_90C': ['Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4'],
  'onset_dev_50C': ['Table I: k_t0 pre-exponential 5.88e9 -&gt; 5.68e9',
   'Table I: k_p0 activation energy 4353 -&gt; 4553 cal/mol',
   'Table I: k_d exponent 15430 -&gt; 15480 K',
   'Table I: d_m intercept 0.973 -&gt; 0.978',
   'Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min',
   'Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)',
   'Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258',
   'onset read at the flattest point of the sloped branch, not by the window fit',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4'],
  'onset_dev_70C': ['Table I: k_t0 pre-exponential 5.88e9 -&gt; 5.68e9',
   'Table I: k_p0 activation energy 4353 -&gt; 4553 cal/mol',
   'Table I: k_d exponent 15430 -&gt; 15480 K',
   'Table I: d_m intercept 0.973 -&gt; 0.978',
   'Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: theta_p(70) 250 -&gt; 2500 min, both rows',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'stated: printed onset at 70 degC 0.35 -&gt; 0.30',
   'onset read at the flattest point of the sloped branch, not by the window fit',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4'],
  'onset_dev_90C': ['Table I: k_t0 pre-exponential 5.88e9 -&gt; 5.68e9',
   'Table I: k_p0 activation energy 4353 -&gt; 4553 cal/mol',
   'Table I: k_d exponent 15430 -&gt; 15480 K',
   'Table I: d_m intercept 0.973 -&gt; 0.978',
   'Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: theta_t(90, 0.0258) 3.80 -&gt; 3.30 min',
   'Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min',
   'Table II: A(90) 0.163 -&gt; 0.168',
   'onset read at the flattest point of the sloped branch, not by the window fit',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4'],
  'onset_max_abs_dev': ['Table I: k_t0 pre-exponential 5.88e9 -&gt; 5.68e9',
   'Table I: k_p0 activation energy 4353 -&gt; 4553 cal/mol',
   'Table I: k_d exponent 15430 -&gt; 15480 K',
   'Table I: d_m intercept 0.973 -&gt; 0.978',
   'Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: theta_t(50, 0.0258) 1500 -&gt; 1800 min',
   'Table II: theta_t(90, 0.0258) 3.80 -&gt; 3.30 min',
   'Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)',
   'Table II: theta_p(90) 3.0e1 -&gt; 4.0e1 min',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: A(90) 0.163 -&gt; 0.168',
   'Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258',
   'stated: printed onset at 70 degC 0.35 -&gt; 0.30',
   'onset read at the flattest point of the sloped branch, not by the window fit',
   'onset from the L0-1 .. L0-3 decade window instead of L0-2 .. L0-4',
   "eq. 31/32's printed 2.3 read as 2.35 instead of ln(10)"],
  'onset_dev_other_loading_max': ['Table I: k_p0 activation energy 4353 -&gt; 4553 cal/mol',
   'Table I: k_d exponent 15430 -&gt; 15480 K',
   'Table I: d_m intercept 0.973 -&gt; 0.978',
   'Table I: d_p 1.2 -&gt; 1.3 g/cm3',
   'Table II: theta_t(70, 0.01548) 83.0 -&gt; 88.0 min',
   'Table II: theta_t(50, 0.01548) 2.33e3 read as 3.23e3'],
  'onset_i0_shift_max': ['Table II: theta_t(90, 0.0258) 3.80 -&gt; 3.30 min',
   'Table II: theta_t(70, 0.01548) 83.0 -&gt; 88.0 min',
   'Table II: theta_t(50, 0.01548) 2.33e3 read as 3.23e3',
   'Table II: theta_t(50, 0.0258) 1.50e3 read as 1.05e3 (digits transposed)',
   'Table II: theta_p(70) 250 -&gt; 2500 min, both rows',
   'Table II: A(70) 0.152 -&gt; 0.142',
   'Table II: B 0.03 -&gt; 0.05 at 50 degC / 0.0258'],
  'ln10_onset_shift': ["eq. 31/32's printed 2.3 read as 2.35 instead of ln(10)"],
  'onset_two_route_max_rel': ['second route run at rtol 1e-6 on 801 points'],
  'qss_start_max_rel': ['start-up check run against a lambda_0 that is 3 % wrong'],
  'qssa_lam0_ratio_50C': ['QSSA comparison rebuilt with theta_t doubled'],
  'qssa_conv_max_dev_50C': ['QSSA comparison rebuilt with theta_t doubled'],
  'switch_d2x_max_pre': ['the counterfactual switched at x_c = 0.45 instead of 0.30'],
  'switch_logkt_jump': ['the counterfactual switched at x_c = 0.45 instead of 0.30'],
  'concave_up_lower_x_max': ['concavity recomputed with theta_t doubled'],
  'concave_onset_margin_min': ['concavity recomputed with theta_t doubled'],
  'moment_identity_max_rel': ['one sign flipped in eq. 13, in eq. 17, and in eq. 12'],
  'moment_identity_ktc_max_rel': ['one sign flipped in eq. 13, in eq. 17, and in eq. 12'],
  'moment_identity_trunc_max_rel': ['one sign flipped in eq. 13, in eq. 17, and in eq. 12',
   'moment identity on a different seeded population, N = 24'],
  'bvp_rms_err_finest': ['BVP refined only to n = 80 instead of n = 640',
   'construct_div with nu = 0 (Cartesian) instead of nu = 2'],
  'bvp_order': ['BVP refined only to n = 80 instead of n = 640'],
  'bvp_K_spread_rel': ['construct_div with nu = 0 (Cartesian) instead of nu = 2'],
  'eq22_rm_over_rD_max_dev': ['construct_div with nu = 0 (Cartesian) instead of nu = 2',
   'eq. 22 compared against a K_approx 10 % off',
   'eq. 22 priced on a shell refined only to n = 40'],
  'eq26_symbolic_residual': ["eq. 26's 3 D written as 2 D"],
  'march_err_finest': ['backward Euler refined only to nt = 200 instead of nt = 3200'],
  'march_order': ['backward Euler refined only to nt = 200 instead of nt = 3200'],
  'mw_approx_pre_onset_max': ['molecular-weight split moved from the onset to halfway to x = 1'],
  'mw_approx_post_onset_max': ['molecular weights read only to half the integration horizon'],
  'xlim_50C': ['limiting-conversion threshold 1e-3 -&gt; 1e-2 of the peak rate'],
  'xlim_monotone_margin': ['limiting-conversion threshold 1e-3 -&gt; 1e-2 of the peak rate'],
  'i0_dlogkt_max': ['initiator-loading gap with every theta_t(0.01548) 40 % smaller'],
  'mw_reconstruction_x_maxdiff': ['MW test contaminated with a 0.1 % change in k_p0'],
  'onset_per_decade_theta_t': ['theta_t leverage measured at 90 degC instead of 50 degC'],
  'onset_compressed_shift_max': ['compressed A perturbed by 1 % before the onset is recomputed'],
  'Tgp_band_width_C': ['T_gp band computed at +-0.001 in A instead of +-0.0005'],
  'qssa_lam0_ratio_other_max': ['QSSA comparison rebuilt with theta_t doubled'],
  'onset_definition_band_max': ['definition band formed without the 3-5 and 4-6 decade windows',
   'definition band formed without the 4-6 decade window'],
  'onset_resample_floor_max_rel': ['resampling floor measured over nx = 2001/4001/8001 only']}}</code></pre>
</div>
</div>
<div id="3a0b55a8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:17:29.515407Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:17:29.515228Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:17:29.570704Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:17:29.569939Z&quot;}}" data-execution_count="27">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb56" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb56-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- mechanical sweep of the metadata files AND this notebook's markdown ----</span></span>
<span id="cb56-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># TWO token classes, following pages/J4.4-luedeking-piret:</span></span>
<span id="cb56-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   DECIMALS of five or more places, which excludes the DOI without a list;</span></span>
<span id="cb56-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   INTEGERS of two or more digits, because every COUNT on this page is one and</span></span>
<span id="cb56-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   the decimal sweep cannot see a single count.</span></span>
<span id="cb56-6">LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> METRICS.values())</span>
<span id="cb56-7">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BVP_ERR] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BVP_ORDERS])</span>
<span id="cb56-8">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ERR] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_ORDERS])</span>
<span id="cb56-9">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARCH_X])</span>
<span id="cb56-10">LIVE.update([T_GP_IMPLIED, T_GP_BAND_LO, T_GP_BAND_HI, Q_IMPLIED, E_T_MEAN,</span>
<span id="cb56-11">             E_T_SHARED, TH_T_SHARED_MAXREL, TH_P_MAXREL, A_MAXREL,</span>
<span id="cb56-12">             ONSET_MAX_BAND, ONSET_I0_MAX, ONSET_MAX_ABS_DEV, QSSA_OTHER_MAX,</span>
<span id="cb56-13">             MW_GAIN, MW_X_MAXDIFF, MW_L0_MAXREL, MW_MU1_MAXREL, LN10,</span>
<span id="cb56-14">             LN10_LT_MAX, X_REF, D_ONSET_D_DECADE, SWITCH_FRAC_CONCAVE_DOWN,</span>
<span id="cb56-15">             SWITCH_D2_MIN_POST, CONCAVE_LOW_MAX, CONCAVE_ONSET_MARGIN,</span>
<span id="cb56-16">             XLIM_50, XLIM_70, XLIM_90, XLIM_MARGIN, I0_DLT_MAX, I0_DLP_MAX,</span>
<span id="cb56-17">             MW_PRE_MAX, MW_POST_MAX, QSS_START_MAX, EQ22_MAXDEV,</span>
<span id="cb56-18">             MOMENT_ID_TRUNC, MOMENT_ID_BROKEN, E_T_PRINTED, E_P_PRINTED,</span>
<span id="cb56-19">             BVP_K_SPREAD_REL, WEAKEST_COVER, MARCH_ORDER, BVP_ORDER])</span>
<span id="cb56-20">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dLt"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I0_EFFECT.values()])</span>
<span id="cb56-21">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dLp"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I0_EFFECT.values()])</span>
<span id="cb56-22">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_ratio"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I0_EFFECT.values()])</span>
<span id="cb56-23">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-24">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_flattest"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-25">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_decade3"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-26">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_1_3"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-27">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_3_5"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-28">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_window_4_6"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-29">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_steepest"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-30">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alt_plateau_L0"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-31">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> vv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_NX_VALS.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> vv])</span>
<span id="cb56-32">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_DEV_OTHER.values()])</span>
<span id="cb56-33">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EQ22_DEV] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EQ22_ORDERS])</span>
<span id="cb56-34">LIVE.update([A_GAIN_BAND_LO, A_GAIN_BAND_HI, A_SECOND_DIFF]</span>
<span id="cb56-35">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A_ALT_GAIN.values()])</span>
<span id="cb56-36">LIVE.update([ONSET_MAX_BAND<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET_MAX_ABS_DEV,</span>
<span id="cb56-37">             ONSET_DEV_OTHER_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ONSET_MAX_ABS_DEV,</span>
<span id="cb56-38">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_ONSET_D_DECADE)])</span>
<span id="cb56-39">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-40">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values()])</span>
<span id="cb56-41">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_X_ROUTE.values()])</span>
<span id="cb56-42">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET_COMPRESSED.values()])</span>
<span id="cb56-43">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QSSA.values()])</span>
<span id="cb56-44">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_dx"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QSSA.values()])</span>
<span id="cb56-45">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(q[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_end_exact"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> QSSA.values()])</span>
<span id="cb56-46">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pre_Mn"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MW_TAB.values()])</span>
<span id="cb56-47">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post_Mn"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MW_TAB.values()])</span>
<span id="cb56-48">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mn_end"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MW_TAB.values()])</span>
<span id="cb56-49">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> XLIM.values()])</span>
<span id="cb56-50">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kt0)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.values()]</span>
<span id="cb56-51">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(m.kp0)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.values()]</span>
<span id="cb56-52">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.eps) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.values()]</span>
<span id="cb56-53">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.M0) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.values()]</span>
<span id="cb56-54">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(m.kd) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MODELS.values()])</span>
<span id="cb56-55">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_T[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_T] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_T[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_T]</span>
<span id="cb56-56">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_T[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_T]</span>
<span id="cb56-57">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])])</span>
<span id="cb56-58">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EQ22_MEASURED] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EQ22_ORDER)])</span>
<span id="cb56-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># EVERY PRINTED CELL OF THE THREE TABLES, because the sidecars quote them.</span></span>
<span id="cb56-60"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _df <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (T1[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>]], T2, TS[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]]):</span>
<span id="cb56-61">    LIVE.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.asarray(_df.to_numpy(), dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).ravel()</span>
<span id="cb56-62">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(v))</span>
<span id="cb56-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># AND THE ONE PRINTED VALUE THIS PAGE REPORTS AS A DEFECT AND DOES NOT COMPUTE:</span></span>
<span id="cb56-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Figure 3's legend prints the lower initiator loading as 0.01584 where Table II</span></span>
<span id="cb56-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and Figures 4, 5, 6 and 8 print 0.01548.  It is quoted in the sidecar and in</span></span>
<span id="cb56-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the prose so that the discrepancy is recorded, and it is pinned here so that</span></span>
<span id="cb56-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># naming it cannot be confused with claiming it.</span></span>
<span id="cb56-68">PRINTED_DEFECT_VALUES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01584</span>}</span>
<span id="cb56-69">LIVE.update(PRINTED_DEFECT_VALUES)</span>
<span id="cb56-70">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X_ASYMPTOTE.values()])</span>
<span id="cb56-71">LIVE.update([mv <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rows <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, mv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows])</span>
<span id="cb56-72">LIVE.update([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(LIVE)])</span>
<span id="cb56-73">LIVE.update([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(LIVE)])</span>
<span id="cb56-74">LIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(x)}</span>
<span id="cb56-75"></span>
<span id="cb56-76">LIVE_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T2), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(METRICS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS), N_LINKS,</span>
<span id="cb56-77">            N_MOVING_ROWS, N_CELL_ROWS, N_METHOD_ROWS, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WEAK),</span>
<span id="cb56-78">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SECOND_ROUTES), N_PROSE, N_SAYS, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CONDITIONS),</span>
<span id="cb56-79">            N_DISTINCT, N_COMPRESSED, N_COND, N_NAMED, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BVP_N), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MARCH_NT),</span>
<span id="cb56-80">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CI_REL_TOL)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(RATIOS), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_counts)}</span>
<span id="cb56-81">LIVE_INT.update(BVP_N)</span>
<span id="cb56-82">LIVE_INT.update(MARCH_NT)</span>
<span id="cb56-83">LIVE_INT.update(EQ22_N)</span>
<span id="cb56-84">LIVE_INT.update(ONSET_NX)</span>
<span id="cb56-85">LIVE_INT.update({<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONSET_READINGS), N_STEEPEST_AT_EDGE, N_W46_INTERIOR,</span>
<span id="cb56-86">                 <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(A_ALT_CENTRE)})</span>
<span id="cb56-87">LIVE_INT.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_window"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ONSET.values())</span>
<span id="cb56-88">LIVE_INT.update({BVP_N[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, SEED})</span>
<span id="cb56-89">LIVE_INT.update(QSSA_N_ABOVE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,))</span>
<span id="cb56-90">LIVE_INT.update(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rows <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVERAGE.values()</span>
<span id="cb56-91">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, mv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mv)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb56-92"></span>
<span id="cb56-93">TABLE_INTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>()</span>
<span id="cb56-94"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _df <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (T1[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>]], T2, TS[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]]):</span>
<span id="cb56-95">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.asarray(_df.to_numpy(), dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).ravel():</span>
<span id="cb56-96">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(_v):</span>
<span id="cb56-97">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb56-98">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (_v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_v, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_v, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_v):</span>
<span id="cb56-99">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> _s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e8</span>:</span>
<span id="cb56-100">                TABLE_INTS.add(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_s)))</span>
<span id="cb56-101"></span>
<span id="cb56-102">SOURCE_INTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb56-103">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1983</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">348</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">357</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">349</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">350</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">351</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">352</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">353</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">354</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">355</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">356</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">359</span>,   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># book pages</span></span>
<span id="cb56-104">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>,                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># volume</span></span>
<span id="cb56-105">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">22</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>,</span>
<span id="cb56-106">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">94720</span>,      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the authors' postal address, quoted in the container string</span></span>
<span id="cb56-107">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">29</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>,</span>
<span id="cb56-108">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">117</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">62</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1979</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1981</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1960</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1964</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1977</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1947</span>,          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MW, registry, refs</span></span>
<span id="cb56-109">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2026</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">273</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1987</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2584</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1624</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1636</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2566</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2590</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3340</span>,</span>
<span id="cb56-110">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">43</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">104</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1401</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">56</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">424</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1548</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1584</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">258</span>,</span>
<span id="cb56-111">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8103632</span>,                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the NSF grant number</span></span>
<span id="cb56-112">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">114</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">111</span>,</span>
<span id="cb56-113">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1982</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "Received July 1, 1982" on the title block</span></span>
<span id="cb56-114">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">190</span>,         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># runtime_seconds declared in meta.yaml, a wall-clock measurement</span></span>
<span id="cb56-115">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">93</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span>,      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># where Figures 11 and 12 stop, read on 300 ppi crops</span></span>
<span id="cb56-116">}</span>
<span id="cb56-117"></span>
<span id="cb56-118"></span>
<span id="cb56-119"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _int_tokens(text):</span>
<span id="cb56-120">    out, skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb56-121">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INT_TOKEN.findall(text):</span>
<span id="cb56-122">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>):</span>
<span id="cb56-123">            skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb56-124">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb56-125">        out.append(t)</span>
<span id="cb56-126">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out, skipped</span>
<span id="cb56-127"></span>
<span id="cb56-128"></span>
<span id="cb56-129">TOKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\.</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{5,}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb56-130">INT_TOKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{2,}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb56-131">FILES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"meta.yaml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"README.md"</span>,</span>
<span id="cb56-132">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/chiu1983-table1-rate-constants.meta.yaml"</span>,</span>
<span id="cb56-133">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/chiu1983-table2-model-parameters.meta.yaml"</span>,</span>
<span id="cb56-134">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/chiu1983-stated-results.meta.yaml"</span>,</span>
<span id="cb56-135">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../models_entry.yaml"</span>,</span>
<span id="cb56-136">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index.ipynb"</span>]</span>
<span id="cb56-137"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># SHAPE-DEPENDENT AND BOTH SHAPES PINNED.  integrate_case.py copies page/ only</span></span>
<span id="cb56-138"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and splices models_entry.yaml into models.yaml, so that file is swept HERE, in</span></span>
<span id="cb56-139"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the queue tree, and is ABSENT - and counted as absent - in the published page.</span></span>
<span id="cb56-140">SWEEP_TOKENS_BY_SHAPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">177</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">128</span>}        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 5+-decimal tokens</span></span>
<span id="cb56-141">SWEEP_INTS_BY_SHAPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">516</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">436</span>}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2+-digit integer tokens</span></span>
<span id="cb56-142"></span>
<span id="cb56-143"></span>
<span id="cb56-144"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _read_swept(fn):</span>
<span id="cb56-145">    txt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path(fn).read_text(encoding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utf-8"</span>)</span>
<span id="cb56-146">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> fn.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".ipynb"</span>):</span>
<span id="cb56-147">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"source"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> json.loads(txt)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells"</span>]</span>
<span id="cb56-148">                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell_type"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"markdown"</span>)</span>
<span id="cb56-149">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> txt</span>
<span id="cb56-150"></span>
<span id="cb56-151"></span>
<span id="cb56-152"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _half_ulp(tok):</span>
<span id="cb56-153">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tok.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb56-154"></span>
<span id="cb56-155"></span>
<span id="cb56-156"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _matches(tok):</span>
<span id="cb56-157">    v, h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tok), _half_ulp(tok)</span>
<span id="cb56-158">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE)</span>
<span id="cb56-159"></span>
<span id="cb56-160"></span>
<span id="cb56-161"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _int_matches(tok):</span>
<span id="cb56-162">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(tok)</span>
<span id="cb56-163">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE_INT <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLE_INTS <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SOURCE_INTS</span>
<span id="cb56-164"></span>
<span id="cb56-165"></span>
<span id="cb56-166">tokens, unmatched, rejected, corrupted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb56-167">ints, int_unmatched, int_rejected, int_live, int_skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb56-168"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES:</span>
<span id="cb56-169">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> Path(fn).is_file():</span>
<span id="cb56-170">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (skipped, not present next to the notebook: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb56-171">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb56-172">    text <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _read_swept(fn)</span>
<span id="cb56-173">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TOKEN.findall(text):</span>
<span id="cb56-174">        tokens.append((fn, t))</span>
<span id="cb56-175">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matches(t):</span>
<span id="cb56-176">            unmatched.append((fn, t))</span>
<span id="cb56-177">        corrupted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb56-178">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matches(t[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)):</span>
<span id="cb56-179">            rejected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb56-180">    got, skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _int_tokens(text)</span>
<span id="cb56-181">    int_skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> skipped</span>
<span id="cb56-182">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> got:</span>
<span id="cb56-183">        ints.append((fn, t))</span>
<span id="cb56-184">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _int_matches(t):</span>
<span id="cb56-185">            int_unmatched.append((fn, t))</span>
<span id="cb56-186">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LIVE_INT <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLE_INTS:</span>
<span id="cb56-187">            int_live <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb56-188">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _int_matches(t[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)):</span>
<span id="cb56-189">            int_rejected <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb56-190">found, found_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tokens), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ints)</span>
<span id="cb56-191">n_files <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>([f <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Path(f).is_file()])</span>
<span id="cb56-192"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> unmatched, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prose numbers with no live counterpart: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>unmatched<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb56-193"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> int_unmatched, (</span>
<span id="cb56-194">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"integer counts with no live and no pinned-source counterpart:"</span></span>
<span id="cb56-195">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(t <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> int_unmatched))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in"</span></span>
<span id="cb56-196">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(f <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> int_unmatched))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb56-197">_pin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SWEEP_TOKENS_BY_SHAPE.get(n_files)</span>
<span id="cb56-198">_pin_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SWEEP_INTS_BY_SHAPE.get(n_files)</span>
<span id="cb56-199"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _pin <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, found), (</span>
<span id="cb56-200">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sweep found </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decimal tokens in the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape, not"</span></span>
<span id="cb56-201">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pin<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pinned for it"</span>)</span>
<span id="cb56-202"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _pin_int <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, found_int), (</span>
<span id="cb56-203">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the sweep found </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> integer tokens in the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape,"</span></span>
<span id="cb56-204">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" not the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pin_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pinned for it"</span>)</span>
<span id="cb56-205"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _pin <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb56-206">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the counts are shape-dependent and BOTH shapes are pinned:"</span></span>
<span id="cb56-207">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decimal and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_INTS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb56-208">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" integer tokens</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  across the seven files in the queue tree,"</span></span>
<span id="cb56-209">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_TOKENS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SWEEP_INTS_BY_SHAPE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the"</span></span>
<span id="cb56-210">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" published page, where</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  ../models_entry.yaml has been spliced into"</span></span>
<span id="cb56-211">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" models.yaml; the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-file shape is the one</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  executing here"</span></span>
<span id="cb56-212">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and it is the pair asserted."</span>)</span>
<span id="cb56-213"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mechanical sweep of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_files<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FILES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> files"</span></span>
<span id="cb56-214">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (metadata + this notebook's markdown):"</span>)</span>
<span id="cb56-215"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> numbers written to 5+ decimals, all matching a live value to"</span></span>
<span id="cb56-216">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" half an ulp.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Teeth: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rejected<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>corrupted<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb56-217">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(corrupted, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) of last-digit corruptions rejected."</span>)</span>
<span id="cb56-218"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> integers of 2+ digits (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_skipped<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> leading-zero tokens"</span></span>
<span id="cb56-219">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" skipped):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_live<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> match a COUNT the computation produced or a"</span></span>
<span id="cb56-220">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" printed table cell; the other </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> int_live<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sit in the pinned"</span></span>
<span id="cb56-221">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  source set - book pages, equation numbers, the year, reference"</span></span>
<span id="cb56-222">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" volumes - which no</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  computation here can check."</span>)</span>
<span id="cb56-223"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ACHIEVED DETECTION RATE, NOT COMPLETENESS: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_rejected<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found_int<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb56-224">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>int_rejected<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(found_int, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) of last-digit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  corruptions of"</span></span>
<span id="cb56-225">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" those integers are rejected.  The rest land on another allowed value."</span>)</span>
<span id="cb56-226"></span>
<span id="cb56-227">WORD_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">-]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">zero</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">one</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">two</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">three</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">four</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">five</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">six</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">seven</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eight"</span></span>
<span id="cb56-228">                      <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">nine</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ten</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eleven</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">twelve</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">thirteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fourteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fifteen"</span></span>
<span id="cb56-229">                      <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">sixteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">seventeen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eighteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">nineteen</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">twenty</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">-]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb56-230">                      re.IGNORECASE)</span>
<span id="cb56-231">ONE_DIGIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.,]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.,]</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb56-232">n_word <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_one <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb56-233"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FILES:</span>
<span id="cb56-234">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> Path(fn).is_file():</span>
<span id="cb56-235">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb56-236">    _t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _read_swept(fn)</span>
<span id="cb56-237">    n_word <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(WORD_INT.findall(_t))</span>
<span id="cb56-238">    n_one <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ONE_DIGIT.findall(_t))</span>
<span id="cb56-239"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  OUTSIDE THE SWEEP ENTIRELY, counted so that it is not mistaken for"</span></span>
<span id="cb56-240">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" covered:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_word<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> word-spelled small integers and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_one<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb56-241">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" single-digit numbers stand in the swept</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  prose.  NEITHER CLASS IS"</span></span>
<span id="cb56-242">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" CHECKED against anything; the counts that matter are pinned</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  one by"</span></span>
<span id="cb56-243">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" one in _counts above instead."</span>)</span>
<span id="cb56-244"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  A count written as a word or a single digit anywhere in these files is"</span></span>
<span id="cb56-245">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" unprotected; the fix is to pin it in"</span></span>
<span id="cb56-246">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  _counts or to write it as a numeral of two or more digits, not to"</span></span>
<span id="cb56-247">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" trust the sweep."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  (skipped, not present next to the notebook: ../models_entry.yaml)
  the counts are shape-dependent and BOTH shapes are pinned: 177 decimal and 516 integer tokens
  across the seven files in the queue tree, 128 and 436 in the published page, where
  ../models_entry.yaml has been spliced into models.yaml; the 6-file shape is the one
  executing here and it is the pair asserted.
mechanical sweep of 6 of the 7 files (metadata + this notebook's markdown):
  128 numbers written to 5+ decimals, all matching a live value to half an ulp.
  Teeth: 128/128 (100.0%) of last-digit corruptions rejected.
  436 integers of 2+ digits (38 leading-zero tokens skipped):
  155 match a COUNT the computation produced or a printed table cell; the other 281 sit in the pinned
  source set - book pages, equation numbers, the year, reference volumes - which no
  computation here can check.
  ACHIEVED DETECTION RATE, NOT COMPLETENESS: 155/436 (35.6%) of last-digit
  corruptions of those integers are rejected.  The rest land on another allowed value.
  OUTSIDE THE SWEEP ENTIRELY, counted so that it is not mistaken for covered:
  316 word-spelled small integers and 277 single-digit numbers stand in the swept
  prose.  NEITHER CLASS IS CHECKED against anything; the counts that matter are pinned
  one by one in _counts above instead.
  A count written as a word or a single digit anywhere in these files is unprotected; the fix is to pin it in
  _counts or to write it as a numeral of two or more digits, not to trust the sweep.</code></pre>
</div>
</div>
<div id="a6be48aa" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T13:17:29.572991Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T13:17:29.572823Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T13:17:29.577595Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T13:17:29.576831Z&quot;}}" data-execution_count="28">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb58" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb58-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- structural assertions, asserted rather than asserted-by-eye -----------</span></span>
<span id="cb58-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ONSET_MAX_ABS_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed onsets are no longer reproduced"</span></span>
<span id="cb58-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> MARCH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler is no longer first order"</span></span>
<span id="cb58-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> BVP_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the spherical BVP is no longer near second order"</span></span>
<span id="cb58-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> A_LIN_MAXREL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> A_NULL_T_MAXREL, (</span>
<span id="cb58-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A is no longer far more nearly linear in (T-T_gp)^2 than in T"</span>)</span>
<span id="cb58-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> QSSA[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0258</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, (</span>
<span id="cb58-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the QSSA no longer overestimates lambda_0 by more than a factor of 2"</span>)</span>
<span id="cb58-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> SWITCH_D2_MAX_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, (</span>
<span id="cb58-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the switched counterfactual is no longer concave down before the switch"</span>)</span>
<span id="cb58-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> MOMENT_ID_KTC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> MOMENT_ID_BROKEN</span>
<span id="cb58-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two-route residual is a NUMBER, not a proof, and it is NOT the arithmetic</span></span>
<span id="cb58-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># floor: it prices the attractor.  The floor is the resampling, and BOTH are</span></span>
<span id="cb58-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># compared against the scale that matters, which is the definitional band.</span></span>
<span id="cb58-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ONSET_TWO_ROUTE_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb58-16">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ONSET_MAX_BAND, (</span>
<span id="cb58-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two integration routes now differ by a tenth of the definitional band"</span></span>
<span id="cb58-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" of the onset construction, which is where the residual stops being"</span></span>
<span id="cb58-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" negligible"</span>)</span>
<span id="cb58-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ONSET_RESAMPLE_FLOOR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ONSET[c][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_onset"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONDITIONS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb58-21">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ONSET_MAX_BAND, (</span>
<span id="cb58-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the resampling floor - the ACTUAL arithmetic limit on the onset - is no"</span></span>
<span id="cb58-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" longer negligible against the definitional band"</span>)</span>
<span id="cb58-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> ONSET_DEV_OTHER_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ONSET_MAX_BAND, (</span>
<span id="cb58-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the other initiator loading's miss is no longer inside the definitional"</span></span>
<span id="cb58-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" band, so the headline's choice of loading has become load-bearing"</span>)</span>
<span id="cb58-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> EQ22_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> EQ22_MAXDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, (</span>
<span id="cb58-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the eq. 22 pricing no longer converges onto r_m/r_D through the solve"</span>)</span>
<span id="cb58-29"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> A_SECOND_DIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A is no longer concave in T"</span></span>
<span id="cb58-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural assertions: all pass."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>structural assertions: all pass.</code></pre>
</div>
</div>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Honestly, to the physics: very little, and the page says so.</strong> This is a zero-dimensional batch model. Its eight equations are an ODE initial-value problem that <code>scipy.integrate.solve_ivp</code> handles on its own, and every headline number above - the three onsets, the two activation energies, the straight line through <code>A</code>, the QSSA factors - is arithmetic on printed cells or an ODE solution, with pymrm nowhere in the causal chain.</p>
<p><strong>What pymrm does buy, in two places, and both are measured.</strong></p>
<ul>
<li><strong>A residual-and-Jacobian form for the eight-field source term.</strong> <code>NumJac((1, 8))</code> plus <code>newton</code> turns eq. 10-17 into a backward-Euler step that is first order (observed 1.0094 over a 16x refinement, converging to 2.12e-05 against the BDF reference) and, more to the point, into the same object a spatially resolved reactor model would need. The paper’s own conclusion asks for exactly that - <em>“Results of nonisothermal experiments with known temperature histories will be highly useful in the further scrutiny of the present model”</em> - and a temperature history is a source term with a time-dependent coefficient, which this form takes without modification. <strong>No such extension is computed here, because nothing in this paper would test it.</strong></li>
<li><strong>The paper’s own eq. 21, solved instead of approximated.</strong> <code>construct_grad</code> and <code>construct_div(nu=2)</code> on the shell <code>r_m &lt;= r &lt;= r_D</code> reproduce the exact first integral - <code>4 pi r^2 D dC/dr</code> is the same at every one of 1281 faces to less than 1e-8 relative, which is <em>structural</em> for a conservative finite-volume scheme with no source and is named as such - and converge on the profile at observed order 1.8618. What is <strong>not</strong> structural is the <em>value</em> of that constant flux, and that is what prices the approximation the paper’s derivation leaves unpriced: <strong>eq. 22 understates <code>K</code> by exactly <code>r_m/r_D</code></strong>, and the flux the operators compute agrees with that to <strong>1.858e-05</strong> over five ratios spanning 0.01 to 0.5 at <code>n = 6400</code>, converging onto it at order <strong>1.8953</strong>. Setting the geometry to Cartesian moves that number by four orders. <strong>The paper prints no number for <code>r_m</code> or <code>r_D</code> anywhere</strong>, so the size of the correction for PMMA cannot be evaluated from this paper, and the page reports the exact form rather than inventing a radius.</li>
</ul>
<p><strong>And what pymrm does not add.</strong> No extension to conditions the paper did not compute, no spatial resolution, no comparison with any measurement, and no resolution of the half of the case that lives in Figures 3-9.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>The structure to copy is <code>S1</code>: a stiff batch ODE whose rate constants depend on the state through an algebraic constitutive law.</strong> Three things on this page generalise well beyond free-radical polymerisation.</p>
<p><strong>1. A resistance-in-series constitutive law instead of a switch.</strong> Eq. 26 - <code>1/k_apparent = 1/k_intrinsic + (mass-transfer resistance)</code> - is the same algebra as a Thiele-modulus effectiveness factor (<code>B1.1</code>), a gas-film-plus- liquid-film resistance (<code>A3.1</code>), or an external mass-transfer-limited surface rate. Whenever the temptation arises to make a rate constant switch at a critical value of something, this is the alternative: write the two resistances in series and let the transition emerge. It costs one parameter with dimensions of time and it removes a discontinuity. <strong>The measurement that justifies it is on this page</strong>: the switched counterfactual has a <code>0.760194</code>-decade jump in <code>log k_t</code> and a concave-down conversion curve before its switch; the series form has neither.</p>
<p><strong>2. Read a graphical construction the way its author described it, then price the description - and count the readings honestly.</strong> The three onset conversions here are not a formula in the paper; they are a line drawn by eye. Reconstructing them mechanically gets within <code>0.00966</code>, but seven defensible readings of the same sentence spread the answer by <code>0.09009</code>, and an eighth - the most literal one - falls outside even that. <strong>Report the band, not the digits; say which readings are in it, and say what the band does not cover.</strong> Leaving out a reading of the same family narrows the band and flatters the result. A definitional band is only worth quoting if the rule for what enters it is a measurement rather than a judgement; here the rule is that a reading is excluded only when it is shown to be set by where the curve was truncated rather than by the curve, and it excludes exactly one reading. The same discipline applies to any “onset”, “breakthrough” or “critical point” read off a plotted curve in a source.</p>
<p><strong>3. Check a paper’s parameter economy by exercising its own compression.</strong> A model that fits N numbers and then draws a correlation through them is claiming the correlation can replace the numbers. Running the model from the correlation instead of the table prices that claim - here, <code>0.01633</code> in onset conversion, <code>1.691</code> times the page’s own reconstruction error. That test needs nothing but the paper.</p>
<p><strong>4. A residual that does not move under a perturbation may be measuring something other than what you think.</strong> The two-route onset residual, below <code>1e-10</code>, is unchanged across three solver families and four tolerances but moves by <code>1.311e-05</code> with the <em>resampling</em> grid - so it prices the attracting manifold, not the integration, and the arithmetic floor is five orders of magnitude larger than it looks. And a quantity formed from two closed-form scalars, such as eq. 22’s <code>1 - K_22/K_exact</code>, is an algebraic identity in floating point, bit identical with the geometry set wrong. <strong>Before quoting a small residual, break something it should depend on and check that it moves</strong> - a coverage map generated from measured moves finds both of these, if the metric is wired to the quantity you claim it came from.</p>
<p><strong>What not to reuse.</strong> Table II’s parameters belong to PMMA with AIBN at three temperatures and two initiator loadings, and they were fitted to conversion and molecular-weight curves this page never sees. They are not transferable to another monomer, another initiator, or another temperature range without refitting, and the <code>18.8281 %</code> scatter of <code>theta_t</code> about its own Arrhenius line is the honest measure of how well even the paper’s own interpolation holds. <strong>And do not carry away “17.4057x, non-nested, so the direction is evidence” as support for the Fujita form specifically</strong>: that ratio is the gain at one admissible <code>T_gp</code>, it is 3.5347x at the other end of the interval the same three cells allow, and two other non-nested regressors beat linear-in-<code>T</code> as well. What three points with one residual degree of freedom can establish is curvature, and that is what this page claims.</p>
<p><strong>Related pages.</strong> <code>B1.1</code> (Thiele/Weisz-Hicks: the same reaction-plus-diffusion resistance, in a pellet), <code>A3.1</code> and <code>A3.2</code> (two-film and penetration: the same question of which resistance is rate-controlling), <code>J4.4</code> and <code>J4.2</code> (batch <code>S1</code> models fitted to a source’s own printed tables, with the fit-versus-test distinction made the same way), <code>C1.1</code> (kinetics fitted from printed data).</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J5.3-chiu-gel-effect/</guid>
  <pubDate>Fri, 14 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The random pore model, 1980: eight figures, no table, and what the printed numbers still decide</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/</link>
  <description><![CDATA[ 




<section id="the-random-pore-model-1980-eight-figures-no-table-and-what-the-printed-numbers-still-decide" class="level1">
<h1>The random pore model, 1980: eight figures, no table, and what the printed numbers still decide</h1>
<p><strong>Catalog ID:</strong> <code>B3.3</code> · <strong>Structures:</strong> <code>S1</code> (pointwise algebra), <code>S3</code> (nested-scale structure-reaction coupling) · <strong>Tier:</strong> T0</p>
<p>Every gas-solid reaction model before this one had to <em>choose</em> whether the reaction rate falls monotonically. Grain models and order-of-reaction models say it must; the char-gasification literature kept reporting that it does not. Bhatia and Perlmutter stop describing the solid and describe its <strong>pores</strong>: a set of cylindrical surfaces of arbitrary size distribution <img src="https://latex.codecogs.com/png.latex?f(r)"> that grow at the chemical rate and <strong>overlap each other</strong> as they grow. Growth adds surface; overlap destroys it. One dimensionless group decides which wins,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cpsi%20%5C;=%5C;%20%5Cfrac%7B4%5Cpi%20L_o%20(1-%5Cepsilon_o)%7D%7BS_o%5E%7B2%7D%7D,"></p>
<p>and under kinetic control the whole model is two closed forms in it, eqs. (31) and (32) below. A rate maximum exists if and only if <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20%5Cge%202">, and where it sits is eq. (33).</p>
<p><strong>What this page can and cannot check.</strong> The paper carries eight figures and no table (the data section gives the search). Its only comparison with experiment is Figure 8, the char data of Hashimoto et al.&nbsp;(1979), which is not on disk here. That figure is <strong>not digitised</strong>: no curve, point or axis coordinate is read from it or from any other figure, so <strong>this page does not establish that the random pore model describes any real system.</strong> It establishes what the model <em>is</em>, and holds the paper to the numbers it prints in prose and in figure-frame captions:</p>
<ol type="1">
<li><strong>The derivation chain, symbolically</strong>, from eqs. (17)-(30) to (31)-(37), with <code>sympy</code>.</li>
<li><strong>The printed structural claims, as numbers</strong>: the best-fit grain shape factor of Figure 6, the bound on <img src="https://latex.codecogs.com/png.latex?X_M">, the particle-size claims of Figure 2.</li>
<li><strong>The two special-case reductions the abstract claims</strong>: eq. (40) against the published <code>B3.1</code>, and the approach to Petersen (1957) behind the printed “good agreement up to about 75 % conversion”.</li>
<li><strong>Three printed defects</strong>, reported and not repaired, and one thing the paper’s own numbers say that it does not: Figure 7’s curve C asks for a Petersen structure that cannot exist.</li>
</ol>
<p><strong>Nothing on this page is a fit to data and nothing on it is experimental.</strong> The one least-squares operation is the paper’s own integral <img src="https://latex.codecogs.com/png.latex?I">, fitted between two <em>models</em>.</p>
<div id="7d7d9be5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:43.770846Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:43.770616Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:43.785847Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:43.784961Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B3.3-random-pore-model"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="5f6f6a0e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:43.788085Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:43.787846Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:44.729293Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:44.728396Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Imports. sympy and mpmath come with the Colab defaults; the page's model.py</span></span>
<span id="cb2-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is put on sys.path by setup().</span></span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> mpmath</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> NewtonBreakdown</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm.checks <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> find_roots, observed_orders</span>
<span id="cb2-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> minimize_scalar</span>
<span id="cb2-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, cite_data, load_claims, load_data, load_meta</span>
<span id="cb2-13"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (Fig7, G_of_eps, I_closed, I_energy, I_gl, I_nrms, S_of_eps_o, SS0_of_X,</span>
<span id="cb2-14">                   SS0_pet_via_eq6, SS0_petersen, X_grain, X_of_tau, X_pet_via_eps, X_petersen,</span>
<span id="cb2-15">                   XM_eq33, cubic7_roots, curve_D_length, dI_dm, dSS0_dX, eps_o_opt_block,</span>
<span id="cb2-16">                   eta_sphere, m_star, m_star_brent, march37, overlap_gap, overlap_gap_slope,</span>
<span id="cb2-17">                   pet_S, pet_eps, petersen_audit, psi_m_star_zero, psi_of, stat35,</span>
<span id="cb2-18">                   tau_at_X_block, u_of_eps, unique_root, yagi_kunii_eq6)</span>
<span id="cb2-19"></span>
<span id="cb2-20">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-21">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb2-22">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (injected defect, claim, clean value, broken value, caught)</span></span>
<span id="cb2-23"></span>
<span id="cb2-24"></span>
<span id="cb2-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(row, metric, broken):</span>
<span id="cb2-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One injected defect: ``broken`` is what claim ``metric`` becomes with it."""</span></span>
<span id="cb2-27">    caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.breaks(row, metric, broken)</span>
<span id="cb2-28">    BREAK.append((row, metric, claims[metric], broken, caught))</span>
<span id="cb2-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> caught</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<section id="the-problem-in-1980" class="level3">
<h3 class="anchored" data-anchor-id="the-problem-in-1980">The problem in 1980</h3>
<p>A non-catalytic gas-solid reaction <img src="https://latex.codecogs.com/png.latex?aA(g)%20+%20bB(s)%20%5Cto%20pP(g)%20+%20qQ(s)"> (eq. 1) runs on internal surface, so a model must say how much surface there is at each conversion. The paper splits the field in two: models that put the reaction on the surfaces of non-porous <strong>grains</strong>, and models that put it on <strong>pore</strong> surfaces.</p>
<p>The grain family reduces to one rate law,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdX%7D%7Bdt%7D%20=%20%5Cfrac%7Bk_s%20C%5En%20S_o%7D%7B1-%5Cepsilon_o%7D(1-X)%5Em%20%5Ctag%7B2%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?m"> “a shape factor that depends on the geometry of the grains: for spheres <img src="https://latex.codecogs.com/png.latex?m%20=%202/3">, for cylinders <img src="https://latex.codecogs.com/png.latex?m%20=%201/2"> and for flat plates <img src="https://latex.codecogs.com/png.latex?m%20=%200">”, and <img src="https://latex.codecogs.com/png.latex?m%20=%201"> the volume-reaction model of Lacey et al.&nbsp;(1965) and Ishida and Wen (1971). It “predicts a monotonically decreasing reaction rate because the reacting surface of each grain is receding”, while gasification reactions (Dutta et al.&nbsp;1977; Dutta and Wen 1977) “exhibit a maximum in the reaction rate”.</p>
<p>The pore family’s representative is <strong>Petersen (1957)</strong>, whose results the paper reprints as its eqs. (3)-(5): uniform cylindrical pores of radius <img src="https://latex.codecogs.com/png.latex?r_p"> and total length <img src="https://latex.codecogs.com/png.latex?L">, with an intersection correction,</p>
<p><img src="https://latex.codecogs.com/png.latex?S%20=%202%5Cpi%20r_p%20L%5Cleft(1%20-%20r_p%5Csqrt%7B%5Cpi%20L/3%7D%5Cright)%20%5Ctag%7B3%7D"> <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%20%5Cpi%20r_p%5E2%20L%5Cleft(1%20-%20%5Ctfrac%7B2%20r_p%7D%7B3%7D%5Csqrt%7B%5Cpi%20L/3%7D%5Cright)%20%5Ctag%7B4%7D"> <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7Bdr_p%7D%7Bdt%7D%20=%20k_s%20C%5En%20%5Ctag%7B5%7D"></p>
<p>and, through Szekely et al.&nbsp;(1976), a conversion-time relation (6) with a cubic (7) for its constant <img src="https://latex.codecogs.com/png.latex?G">,</p>
<p><img src="https://latex.codecogs.com/png.latex?X%20=%20%5Cfrac%7B%5Cepsilon_o%7D%7B1-%5Cepsilon_o%7D%5Cleft%5B%5Cfrac%7B(1+s)%5E2(G-1-s)%7D%7BG-1%7D%20-%201%5Cright%5D,%0A%5Cqquad%20%5Cfrac%7B4%7D%7B27%7D%5Cepsilon_o%20G%5E3%20-%20G%20+%201%20=%200,%20%5Ctag%7B6,%207%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?s%20=%20k_sC%5Ent/r_%7Bpo%7D">. Petersen “makes no provision for further pore wall intersections and neglects the distribution of pore sizes”, the two things this paper puts back.</p>
</section>
<section id="the-move" class="level3">
<h3 class="anchored" data-anchor-id="the-move">The move</h3>
<p>Reaction surfaces are a set of cylindrical surfaces that <strong>overlap at random as they grow</strong>, with Avrami’s (1940) book-keeping. The <em>non-overlapped</em> system <img src="https://latex.codecogs.com/png.latex?(L_E,%20S_E,%20V_E)"> obeys a population balance and grows at the chemical rate; the <em>actual</em> one <img src="https://latex.codecogs.com/png.latex?(L,%20S,%20V)"> follows from Avrami’s statistical result <img src="https://latex.codecogs.com/png.latex?dV%20=%20(1-V)%5C,dV_E"> (19). Integrating it gives</p>
<p><img src="https://latex.codecogs.com/png.latex?V%20=%201%20-%20%5Cexp(-V_E),%20%5Cqquad%20S%20=%20S_E(1-V),%20%5Cqquad%20L%20=%20L_E(1-V)%0A%5Ctag%7B20,%2023,%2026%7D"></p>
<p>and no assumption about pore shape is needed anywhere.</p>
</section>
<section id="where-this-pages-siblings-sit" class="level3">
<h3 class="anchored" data-anchor-id="where-this-pages-siblings-sit">Where this page’s siblings sit</h3>
<p><code>B3.1</code> is Yagi and Kunii’s shrinking core; the validation shows that Bhatia’s eq. (40) <em>is</em> that equation in its reaction-control limit. <code>B3.2</code> is Szekely and Evans’ grain model with intergrain diffusion, whose local law is eq. (2) here at <img src="https://latex.codecogs.com/png.latex?m%20=%202/3">, embedded in a diffusion field that this paper’s kinetic-control assumption removes. Neither has a dataset, so no cross-page CSV is loaded; the one number borrowed is <code>B3.1</code>’s committed claim for the reaction-control limit, loaded with <code>load_claims</code> and reconciled in the validation. Part II of this paper (non-isothermal operation and diffusion control) is <strong>not on disk</strong>, is not consulted, and nothing here depends on it.</p>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>All equation numbers are the paper’s, read from crops of a 300 ppi native render. <code>pdfimages -list</code> reports all eight pages as CCITT-G4 bilevel at 300 × 300 ppi; the text layer was used only as a search index.</p>
<section id="the-two-systems-and-avramis-bridge-eqs.-8-28" class="level3">
<h3 class="anchored" data-anchor-id="the-two-systems-and-avramis-bridge-eqs.-8-28">The two systems and Avrami’s bridge (eqs. 8-28)</h3>
<p>With <img src="https://latex.codecogs.com/png.latex?f(r)%5C,dr"> the length per unit volume of cylindrical surfaces of radius between <img src="https://latex.codecogs.com/png.latex?r"> and <img src="https://latex.codecogs.com/png.latex?r+dr">, <img src="https://latex.codecogs.com/png.latex?L_E%20=%20%5Cint%20f%5C,dr">, <img src="https://latex.codecogs.com/png.latex?S_E%20=%202%5Cpi%5Cint%20r%20f%5C,dr">, <img src="https://latex.codecogs.com/png.latex?V_E%20=%20%5Cpi%5Cint%20r%5E2%20f%5C,dr"> (8-10), and with every surface element growing at <img src="https://latex.codecogs.com/png.latex?dr/dt%20=%20k_sC%5En"> (12) the population balance (11) gives <img src="https://latex.codecogs.com/png.latex?dL_E/dt%20=%200"> (14), <img src="https://latex.codecogs.com/png.latex?dS_E/dt%20=%202%5Cpi%20k_sC%5En%20L_E"> (15), <img src="https://latex.codecogs.com/png.latex?dV_E/dt%20=%20k_sC%5En%20S_E"> (16), hence</p>
<p><img src="https://latex.codecogs.com/png.latex?S_E%20=%20%5Csqrt%7BS_%7BEo%7D%5E2%20+%204%5Cpi%20L_%7BEo%7D(V_E%20-%20V_%7BEo%7D)%7D,%20%5Cqquad%0AV_E%20=%20V_%7BEo%7D%20+%20S_%7BEo%7Dk_sC%5Ent%20+%20%5Cpi%20L_%7BEo%7D(k_sC%5Ent)%5E2.%20%5Ctag%7B17,%2018%7D"></p>
<p>Avrami’s (19) and the surface and length arguments (21)-(25) give (20), (23), (26), and combining everything:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BS%7D%7BS_o%7D%20=%20%5Cleft(%5Cfrac%7B1-V%7D%7B1-V_o%7D%5Cright)%0A%5Csqrt%7B1%20-%20%5Cfrac%7B4%5Cpi%20L_o(1-V_o)%7D%7BS_o%5E2%7D%5Cln%5C!%5Cleft(%5Cfrac%7B1-V%7D%7B1-V_o%7D%5Cright)%7D%0A%5Ctag%7B27%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?V%20=%201%20-%20(1-V_o)%5Cexp%5C!%5Cleft%5B-%5Cfrac%7Bk_sC%5Ent%7D%7B1-V_o%7D%5Cleft(S_o%20+%20%5Cpi%20L_o%20k_sC%5Ent%5Cright)%5Cright%5D%0A%5Ctag%7B28%7D"></p>
</section>
<section id="the-dimensionless-model-eqs.-29-33-37" class="level3">
<h3 class="anchored" data-anchor-id="the-dimensionless-model-eqs.-29-33-37">The dimensionless model (eqs. 29-33, 37)</h3>
<p>For a spherical particle under reaction control the external surface recedes independently, <img src="https://latex.codecogs.com/png.latex?1%20-%20X%20=%20%5Cfrac%7B1-V%7D%7B1-V_o%7D%5Cleft(1%20-%20%5Cfrac%7Bk_sC%5Ent%7D%7BR_o%7D%5Cright)%5E3"> with <img src="https://latex.codecogs.com/png.latex?V_o%20=%20%5Cepsilon_o"> (29, 30), and with the groups of the NOTATION list (p.&nbsp;386),</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%20%5Cfrac%7B4%5Cpi%20L_o(1-%5Cepsilon_o)%7D%7BS_o%5E2%7D,%20%5Cqquad%0A%5Csigma%20=%20%5Cfrac%7BR_o%20S_o%7D%7B1-%5Cepsilon_o%7D,%20%5Cqquad%0A%5Ctau%20=%20%5Cfrac%7Bk_s%20C%5En%20S_o%20t%7D%7B1-%5Cepsilon_o%7D,"></p>
<p>the model is two closed forms,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BS%7D%7BS_o%7D%20=%20%5Cfrac%7B1-X%7D%7B%5Cleft(1-%5Cfrac%7B%5Ctau%7D%7B%5Csigma%7D%5Cright)%5E3%7D%0A%5Csqrt%7B1%20-%20%5Cpsi%5Cln%5C!%5Cleft%5B%5Cfrac%7B1-X%7D%7B%5Cleft(1-%5Cfrac%7B%5Ctau%7D%7B%5Csigma%7D%5Cright)%5E3%7D%5Cright%5D%7D%0A%5Ctag%7B31%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?X%20=%201%20-%20%5Cleft(1-%5Cfrac%7B%5Ctau%7D%7B%5Csigma%7D%5Cright)%5E3%0A%5Cexp%5C!%5Cleft%5B-%5Ctau%5Cleft(1+%5Cfrac%7B%5Cpsi%5Ctau%7D%7B4%7D%5Cright)%5Cright%5D%20%5Ctag%7B32%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?X_M%20=%201%20-%20%5Cexp%5B(2-%5Cpsi)/2%5Cpsi%5D%20%5Ctag%7B33%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdX%7D%7Bd%5Ctau%7D%20=%20(1-X)%5Csqrt%7B1-%5Cpsi%5Cln(1-X)%7D%20%5Cqquad%20(%5Csigma%5Cto%5Cinfty)%20%5Ctag%7B37%7D"></p>
<p>Eq. (33) is <img src="https://latex.codecogs.com/png.latex?dS/dX%20=%200">; the paper states it “exists over the range <img src="https://latex.codecogs.com/png.latex?2%20%5Cle%20%5Cpsi%20%3C%20%5Cinfty"> and gives <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20X_M%20%3C%200.393">”. Eq. (37) reduces “exactly to the volume reaction model if <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%200">”, which is eq. (39), <img src="https://latex.codecogs.com/png.latex?dX/d%5Ctau%20=%20(1-X)%5Em">, at <img src="https://latex.codecogs.com/png.latex?m%20=%201">; at <img src="https://latex.codecogs.com/png.latex?m%20=%202/3"> eq. (39) integrates to <img src="https://latex.codecogs.com/png.latex?X%20=%201-(1-%5Ctau/3)%5E3"> (40).</p>
</section>
<section id="the-comparisons-the-paper-draws" class="level3">
<h3 class="anchored" data-anchor-id="the-comparisons-the-paper-draws">The comparisons the paper draws</h3>
<p><strong>Against the grain model.</strong> A best <img src="https://latex.codecogs.com/png.latex?m"> minimises the printed squared-deviation integral</p>
<p><img src="https://latex.codecogs.com/png.latex?I%20=%20%5Cint_0%5E1%5Cleft%5B(1-X)%5Csqrt%7B1-%5Cpsi%5Cln(1-X)%7D%20-%20(1-X)%5Em%5Cright%5D%5E2%20dX"></p>
<p>and the result is Figure 6, summarised in prose: “For <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20%5Cpsi%20%5Cle%202">, the best fit gives <img src="https://latex.codecogs.com/png.latex?0.49%20%5Cle%20m%20%5Cle%201">. For <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%201">, the best <img src="https://latex.codecogs.com/png.latex?m"> is very close to two-thirds.”</p>
<p><strong>Against Petersen.</strong> For a rate maximum Petersen’s eqs. (3)-(7) give <img src="https://latex.codecogs.com/png.latex?X_M%20=%20(1-2%5Cepsilon_o)/%5B2(1-%5Cepsilon_o)%5D"> (34), “a rate maximum requires <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20%5Cepsilon_o%20%5Cle%200.5"> and can vary between <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20X_M%20%5Cle%200.5">”.</p>
<p><strong>Optimal structure.</strong> Maximising eq. (27)’s surface over <img src="https://latex.codecogs.com/png.latex?V_o"> at fixed <img src="https://latex.codecogs.com/png.latex?S_o">, <img src="https://latex.codecogs.com/png.latex?L_o"> and final <img src="https://latex.codecogs.com/png.latex?%5Cepsilon"> gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BS_o%5E2%7D%7B2%5Cpi%20L_o(1-%5Cepsilon_o)%7D%20=%201%20+%20%5Cln%5C!%5Cleft(%5Cfrac%7B1-%5Cepsilon%7D%7B1-%5Cepsilon_o%7D%5Cright),%0A%5Cqquad%20%5B1+%5Cln(1-%5Cepsilon)%5D%20%5Cle%20%5Cfrac%7BS_o%5E2%7D%7B2%5Cpi%20L_o%7D%20%5Cle%20%5B1-%5Cepsilon%5D,%20%5Ctag%7B35,%2036%7D"></p>
<p>with a worked example: for <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%200.3"> and <img src="https://latex.codecogs.com/png.latex?S_o%5E2/2%5Cpi%20L_o%20=%200.67">, “the initial <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o"> should be 0.1”; at or below 0.64 inequality (36) is violated.</p>
<p><strong>Against experiment.</strong> As <img src="https://latex.codecogs.com/png.latex?%5Csigma%5Cto%5Cinfty"> eq. (31) predicts that <img src="https://latex.codecogs.com/png.latex?%5BS/(1-X)%5D%5E2"> is linear in <img src="https://latex.codecogs.com/png.latex?%5Cln%5B1/(1-X)%5D">: Figure 8, whose intercept and two slopes give the numbers quoted in the data section.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>symbol</th>
<th>code</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Cpsi">, <img src="https://latex.codecogs.com/png.latex?%5Ctau">, <img src="https://latex.codecogs.com/png.latex?%5Csigma">, <img src="https://latex.codecogs.com/png.latex?X"></td>
<td><code>psi_of</code>, <code>tau</code>, <code>sigma</code>, <code>X_of_tau</code> (eq. 32)</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?S/S_o">, <img src="https://latex.codecogs.com/png.latex?X_M">, eq. (37)</td>
<td><code>SS0_of_X</code> (eq. 31), <code>XM_eq33</code>, <code>rate37</code></td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?m">, <img src="https://latex.codecogs.com/png.latex?I"></td>
<td><code>m_star</code>, <code>I_closed</code>, <code>I_nrms</code></td>
</tr>
<tr class="even">
<td>Petersen <img src="https://latex.codecogs.com/png.latex?r_p">, <img src="https://latex.codecogs.com/png.latex?L">, <img src="https://latex.codecogs.com/png.latex?G">, <img src="https://latex.codecogs.com/png.latex?s"></td>
<td><code>pet_S</code>, <code>pet_eps</code>, <code>G_of_eps</code>, <code>X_petersen</code></td>
</tr>
</tbody>
</table>
</section>
<section id="the-derivation-chain-verified-symbolically" class="level3">
<h3 class="anchored" data-anchor-id="the-derivation-chain-verified-symbolically">The derivation chain, verified symbolically</h3>
<p>Each identity is an equation the paper prints or a step it claims, and each <code>assert</code> fails the notebook if the algebra does not close. These are <strong>structural</strong> checks: they verify the paper’s algebra and this page’s closed forms, and no numerical defect can move them. Two are worth naming. Eq. (37)’s radical is a <em>perfect square</em>, <img src="https://latex.codecogs.com/png.latex?1-%5Cpsi%5Cln(1-X)%20=%20(1+%5Cpsi%5Ctau/2)%5E2">, so the paper’s <img src="https://latex.codecogs.com/png.latex?S/S_o"> <strong>is</strong> <img src="https://latex.codecogs.com/png.latex?dX/d%5Ctau">: surface and rate are the same curve. And Petersen’s surface maximum sits at <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%201/2"> for every <img src="https://latex.codecogs.com/png.latex?L"> and <img src="https://latex.codecogs.com/png.latex?r_p">, which is the whole content of eq. (34).</p>
<div id="be2d29f7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:44.732005Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:44.731684Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:45.152670Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:45.151736Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">So, Lo, tau, psi, r, L, u, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_o L_o tau psi r L u m"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb3-2">v, vo, eps, epso, ww, Ghat, p3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v v_o epsilon epsilon_o w Ghat p"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb3-3">ZERO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (name, expression that must simplify to zero); v = 1 - V, w = 1 - X</span></span>
<span id="cb3-4"></span>
<span id="cb3-5">SEo, LEo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> So <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> vo, Lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> vo                                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (23), (26) at t = 0</span></span>
<span id="cb3-6">SE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.sqrt(SEo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LEo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>sp.log(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.log(vo)))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (17) + (20)</span></span>
<span id="cb3-7">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(17)+(20)+(23)+(26) -&gt; (27)"</span>,</span>
<span id="cb3-8">             sp.expand((SE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> So)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> vo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> vo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> So<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.log(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> vo)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb3-9">kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> So                                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k_s C^n t from tau</span></span>
<span id="cb3-10">psi_def <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> So<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb3-11">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(28)+(30) -&gt; (32)"</span>, sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (So <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kt))</span>
<span id="cb3-12">             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> psi_def <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))))</span>
<span id="cb3-13">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(27) coefficient is psi"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> So<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> psi_def))</span>
<span id="cb3-14">SS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ww <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.log(ww))                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># S/S_o, sigma -&gt; infinity</span></span>
<span id="cb3-15">wM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve(sp.Eq(sp.diff(SS, ww), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), ww)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb3-16">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(31) -&gt; (33) X_M"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> wM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> psi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> psi)))))</span>
<span id="cb3-17">Xe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb3-18">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d(32)/dtau = (1-X)(1+psi tau/2)"</span>, sp.diff(Xe, tau) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xe) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb3-19">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(37) radical is the square (1+psi tau/2)^2"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xe)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb3-20">q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"q"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb3-21">X39 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m))</span>
<span id="cb3-22">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(39) general m closed form"</span>,</span>
<span id="cb3-23">             sp.diff(X39.subs(q, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau), tau) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m))))</span>
<span id="cb3-24">X40 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb3-25">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(39) at m = 2/3 -&gt; (40)"</span>, sp.diff(X40.subs(p3, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), tau) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (p3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).subs(p3, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)))</span>
<span id="cb3-26">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(39) m -&gt; 1 branch is 1-exp(-tau)"</span>,</span>
<span id="cb3-27">             sp.limit(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m)), m, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>tau))))</span>
<span id="cb3-28">bb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.sqrt(sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb3-29">Spet, epet <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> bb), sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> bb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb3-30">rstar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve(sp.Eq(sp.diff(Spet, r), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), r)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb3-31">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Petersen (3),(4): S is maximal at eps = 1/2"</span>, epet.subs(r, rstar) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb3-32">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-&gt; (34) X_M = (1-2 eps_o)/(2(1-eps_o))"</span>,</span>
<span id="cb3-33">             (sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso))))</span>
<span id="cb3-34">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(7) &lt;=&gt; G = 3/(2 u_o)"</span>, sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb3-35">st35 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ghat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.log((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eps) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> epso))</span>
<span id="cb3-36">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(35) at eps_o -&gt; 0 is (36)'s lower bound"</span>, sp.solve(st35.subs(epso, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), Ghat)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eps))))</span>
<span id="cb3-37">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(35) at eps_o -&gt; eps is (36)'s upper bound"</span>, sp.solve(st35.subs(epso, eps), Ghat)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eps)))</span>
<span id="cb3-38">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(31) -&gt; [S/(1-X)]^2 = S_o^2 (1 + psi ln[1/(1-X)])"</span>,</span>
<span id="cb3-39">             (So <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ww)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> So<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ww))))</span>
<span id="cb3-40"></span>
<span id="cb3-41"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, expr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZERO:</span>
<span id="cb3-42">    res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(expr)</span>
<span id="cb3-43">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  0 == </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>res<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span>)</span>
<span id="cb3-44">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, name</span>
<span id="cb3-45">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_zero_identity_count"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ZERO), structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb3-46">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a count of sympy identities; it verifies the paper's algebra, and no numerical defect can move it"</span>)</span>
<span id="cb3-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ZERO)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> symbolic identities, all exactly zero."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  0 == 0   [(17)+(20)+(23)+(26) -&gt; (27)]
  0 == 0   [(28)+(30) -&gt; (32)]
  0 == 0   [(27) coefficient is psi]
  0 == 0   [(31) -&gt; (33) X_M]
  0 == 0   [d(32)/dtau = (1-X)(1+psi tau/2)]
  0 == 0   [(37) radical is the square (1+psi tau/2)^2]
  0 == 0   [(39) general m closed form]
  0 == 0   [(39) at m = 2/3 -&gt; (40)]
  0 == 0   [(39) m -&gt; 1 branch is 1-exp(-tau)]
  0 == 0   [Petersen (3),(4): S is maximal at eps = 1/2]
  0 == 0   [-&gt; (34) X_M = (1-2 eps_o)/(2(1-eps_o))]
  0 == 0   [(7) &lt;=&gt; G = 3/(2 u_o)]
  0 == 0   [(35) at eps_o -&gt; 0 is (36)'s lower bound]
  0 == 0   [(35) at eps_o -&gt; eps is (36)'s upper bound]
  0 == 0   [(31) -&gt; [S/(1-X)]^2 = S_o^2 (1 + psi ln[1/(1-X)])]

15 symbolic identities, all exactly zero.</code></pre>
</div>
</div>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>The paper’s assumptions, inherited unchanged.</strong></p>
<ul>
<li><strong>Kinetic control.</strong> “If all diffusional resistances are assumed negligible, no distinction need be made between macro and micropores (the kinetic regime).” Part II lifts it and is not on disk. The paper’s own justification is an effectiveness-factor sentence whose inputs it does not print; the Hashimoto section says what can be checked of it.</li>
<li><strong>No closed pore volume</strong> in the reactant; the paper uses this to exclude Kawahata and Walker’s anthracite (“a large closed pore volume, over 60 % of the open pore volume”).</li>
<li><strong>Reaction rate proportional to the actual surface</strong>, <img src="https://latex.codecogs.com/png.latex?dr/dt%20=%20k_sC%5En"> on every non-overlapped element (12).</li>
<li><strong>Avrami’s <img src="https://latex.codecogs.com/png.latex?dV%20=%20(1-V)dV_E"></strong> (19), “a statistical average”, flagged by the paper as possibly inaccurate “in the initial stages of a solid phase reaction when the number of nuclei is small”.</li>
<li><strong>Spherical particle, receding external surface</strong> for finite <img src="https://latex.codecogs.com/png.latex?%5Csigma"> (eq. 29). The paper works at <img src="https://latex.codecogs.com/png.latex?%5Csigma%5Cto%5Cinfty"> for Figures 3, 4, 6, 7 and 8.</li>
</ul>
<p><strong>Parameter values.</strong> Every number this page consumes comes from <code>bhatia-1980-printed-scalars.csv</code> and is read from it, never retyped. The three parameter sets that carry the Petersen comparison, as printed:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>set</th>
<th><img src="https://latex.codecogs.com/png.latex?S_o"> (cm²/cm³)</th>
<th><img src="https://latex.codecogs.com/png.latex?L_o"> (cm/cm³)</th>
<th><img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o"></th>
<th>where</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Petersen-consistent</td>
<td>2 425</td>
<td><img src="https://latex.codecogs.com/png.latex?3.14%5Ctimes10%5E6"></td>
<td>0.26</td>
<td>Fig. 4 caption and p.&nbsp;384 text</td>
</tr>
<tr class="even">
<td>Fig. 7 curves A, B</td>
<td>2 500</td>
<td><img src="https://latex.codecogs.com/png.latex?3.14%5Ctimes10%5E6"></td>
<td>0.30</td>
<td>Fig. 7 caption</td>
</tr>
<tr class="odd">
<td>Fig. 7 curve C</td>
<td>12 500</td>
<td><img src="https://latex.codecogs.com/png.latex?3.14%5Ctimes10%5E6"></td>
<td>0.30</td>
<td>Fig. 7 caption and p.&nbsp;384 text</td>
</tr>
</tbody>
</table>
<p><strong>Units.</strong> Lengths in cm, so <img src="https://latex.codecogs.com/png.latex?S_o"> in cm²/cm³ and <img src="https://latex.codecogs.com/png.latex?L_o"> in cm/cm³ as printed; <img src="https://latex.codecogs.com/png.latex?%5Cpsi">, <img src="https://latex.codecogs.com/png.latex?%5Csigma">, <img src="https://latex.codecogs.com/png.latex?%5Ctau">, <img src="https://latex.codecogs.com/png.latex?X"> and <img src="https://latex.codecogs.com/png.latex?S/S_o"> are dimensionless. The Hashimoto surface area is printed in m²/cm³ and converted once, in code.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p><strong>There are no measurements, and that is this page’s central scope fact.</strong> All eight pages were rendered at their native 300 ppi and read column-block by column-block; the text layer was used as a search index only.</p>
<ul>
<li><strong>The paper contains no table.</strong> It carries eight figures (Fig. 1 overlapping cylinders; Fig. 2 <img src="https://latex.codecogs.com/png.latex?%5Ctau_%7B1/2%7D"> against <img src="https://latex.codecogs.com/png.latex?%5Csigma">; Fig. 3 <img src="https://latex.codecogs.com/png.latex?X"> against <img src="https://latex.codecogs.com/png.latex?%5Ctau">; Fig. 4 <img src="https://latex.codecogs.com/png.latex?S/S_o"> against <img src="https://latex.codecogs.com/png.latex?X">; Fig. 5 optimal <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o">; Fig. 6 best-fit <img src="https://latex.codecogs.com/png.latex?m"> against <img src="https://latex.codecogs.com/png.latex?%5Cpsi">; Fig. 7 the Petersen comparison; Fig. 8 the Hashimoto correlation), a NOTATION list and a LITERATURE CITED list. Second, independent search: the text layer grepped for <code>table</code> returns two lines, inside “suitable” (p.&nbsp;385) and a scan-garbled “surfaces” (p.&nbsp;380), never a caption or a cross-reference.</li>
<li><strong>The one comparison with experiment is Figure 8</strong>, the CS and VC char data of Hashimoto et al.&nbsp;(1979), a paper not on disk here. It is <strong>not digitised</strong>: no point, curve or axis coordinate is taken from it or from any other figure.</li>
<li><strong>The paper prints its Figure 8 fit results in prose</strong> (p.&nbsp;385): “Estimates of initial BET surface areas obtained from the intercept of Figure 8 give 520 m²/cm³ for both VC and CS chars. The two slopes give <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%206.9"> and <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%2013.7"> for the VC and CS chars, respectively.” Those three numbers are transcribed from the sentence; nothing else from Figure 8 is used.</li>
<li><strong>Figure-frame captions are used for parameter sets only</strong> (Fig. 4’s and Fig. 7’s inputs, typeset text stating what was computed), and both sets are also printed in the p.&nbsp;384 running text.</li>
</ul>
<p>The second file, <code>random-pore-reference.csv</code>, is this page’s own evaluation of eqs. (31)-(33) and of <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar"> on a grid of <img src="https://latex.codecogs.com/png.latex?(%5Cpsi,%20%5Ctau)">, kept for regression; the validation recomputes every row.</p>
<div id="0967d95c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:45.154961Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:45.154772Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:45.164584Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:45.163752Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1">scal <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bhatia-1980-printed-scalars.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb5-2">P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(scal.key, pd.to_numeric(scal.printed)))</span>
<span id="cb5-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bhatia-1980-printed-scalars.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb5-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(scal)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed scalars transcribed; the paper prints "</span></span>
<span id="cb5-5">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_figures'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> figures and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_tables'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tables.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-6"></span>
<span id="cb5-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the paper's own numbers, cross-checked against each other</span></span>
<span id="cb5-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_Lo"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_Lo"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the three sets share L_o"</span></span>
<span id="cb5-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_agreement_X"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conclusions_agreement_X"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 75 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% c</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">laim is printed twice"</span></span>
<span id="cb5-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_range_hi"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_volume"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the upper end of the printed m range is m = 1"</span></span>
<span id="cb5-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_psi_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_ratemax"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the psi = 2 threshold is printed twice"</span></span>
<span id="cb5-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed-value cross-checks: the three sets share L_o; the 75 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% c</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">laim (p. 384 and p. 379)"</span>)</span>
<span id="cb5-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and the psi = 2 threshold (pp. 382 and 384) each agree with their second printing."</span>)</span>
<span id="cb5-14"></span>
<span id="cb5-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">PRINTED DEFECT 1 (bibliographic). P. 380: 'A variation of the spherical grain model has also"</span>)</span>
<span id="cb5-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"been suggested by Park and Levenspiel (1976)' [sic]. The LITERATURE CITED reads: 'Park, J. Y., and"</span>)</span>
<span id="cb5-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O. Levenspiel, </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The Crackling Core Model for the Reaction of Solid Particles,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> Chem. Eng. Sci., 30,"</span>)</span>
<span id="cb5-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1207 (1975).' It is the paper's only Park reference; which year is right cannot be settled here."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Bhatia, S. K.; Perlmutter, D. D. (1980) — AIChE Journal 26(3) 379-386 (May 1980) — doi:10.1002/aic.690260308 — transcription
47 printed scalars transcribed; the paper prints 8 figures and 0 tables.

printed-value cross-checks: the three sets share L_o; the 75 % claim (p. 384 and p. 379)
and the psi = 2 threshold (pp. 382 and 384) each agree with their second printing.

PRINTED DEFECT 1 (bibliographic). P. 380: 'A variation of the spherical grain model has also
been suggested by Park and Levenspiel (1976)' [sic]. The LITERATURE CITED reads: 'Park, J. Y., and
O. Levenspiel, "The Crackling Core Model for the Reaction of Solid Particles," Chem. Eng. Sci., 30,
1207 (1975).' It is the paper's only Park reference; which year is right cannot be settled here.</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>The random pore model is closed-form algebra, so what needs solving is a <strong>family of scalar problems</strong>: inversions of eqs. (32), (35), (3) and (4), roots of <img src="https://latex.codecogs.com/png.latex?dI/dm"> and of the derivative of a comparison, and one initial-value march. The code is in <code>model.py</code>.</p>
<ul>
<li><strong>Blocks of independent scalars</strong> (eq. 32 for <img src="https://latex.codecogs.com/png.latex?%5Ctau"> over a block of <img src="https://latex.codecogs.com/png.latex?(%5Cpsi,%20%5Csigma)">; eq. 35 for <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o">; one implicit step of eq. 37 for all <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> at once) are one <code>newton</code> solve with <code>NumJac((K, 1))</code>: one field axis, so the Jacobian is diagonal, never the dense <img src="https://latex.codecogs.com/png.latex?K%20%5Ctimes%20K"> of a bare <code>(K,)</code>. Each solve raises when <code>newton</code> reports no convergence.</li>
<li><strong>Eq. (32) is inverted in log form</strong>, <img src="https://latex.codecogs.com/png.latex?3%5Cln(1-%5Ctau/%5Csigma)%20-%20%5Ctau(1+%5Cpsi%5Ctau/4)%20-%20%5Cln(1-X%5E%5Cstar)%20=%200">, with <img src="https://latex.codecogs.com/png.latex?%5Ctau%20=%20%5Csigma/(1+e%5E%7B-w%7D)"> so the iterate cannot leave <img src="https://latex.codecogs.com/png.latex?(0,%5Csigma)">. The direct residual <img src="https://latex.codecogs.com/png.latex?X(%5Ctau)%20-%20X%5E%5Cstar"> from the same start is measured in the validation.</li>
<li><strong>Every root and every extremum is located as a root</strong>, never read off a sweep: <code>pymrm.checks.find_roots</code> scans an interval for every sign change and refines each, and <code>unique_root</code> raises unless it finds exactly one. Where a bracket was once chosen by hand (the two crossings of curves A and B, the two roots of eq. 35, the minimiser of <img src="https://latex.codecogs.com/png.latex?I">), the scan shows how many roots there are.</li>
<li><strong>No Jacobian is assembled by hand</strong>; the diagonal blocks come from <code>NumJac</code>, so <code>pymrm.checks.check_jacobian</code> has nothing to check here.</li>
</ul>
<div id="a13e7148" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:45.166569Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:45.166243Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:46.359442Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:46.358612Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">demo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)</span>
<span id="cb7-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_1/2 at sigma = 100 for psi = 0, 1, 2, 10, 100 (the psi labels of Fig. 2's curves):"</span>)</span>
<span id="cb7-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> demo))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>tau_1/2 at sigma = 100 for psi = 0, 1, 2, 10, 100 (the psi labels of Fig. 2's curves):
  0.672892  0.588770  0.534324  0.359409  0.147180</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-model-conversion-surface-and-the-rate-maximum" class="level3">
<h3 class="anchored" data-anchor-id="the-model-conversion-surface-and-the-rate-maximum">The model: conversion, surface and the rate maximum</h3>
<p>The <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> values shown are the labels printed on Figure 4’s curves; no coordinate is read from any figure.</p>
<div id="df714bd6" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:46.361588Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:46.361444Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:46.728518Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:46.727831Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">PSI_SHOW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>]   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the labels printed on Figure 4's curves</span></span>
<span id="cb9-2">tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">601</span>)</span>
<span id="cb9-3">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>))</span>
<span id="cb9-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_SHOW:</span>
<span id="cb9-5">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(tg, X_of_tau(tg, pv), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fr"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb9-6">tg40 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">301</span>)</span>
<span id="cb9-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(tg40, X_grain(tg40, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain model, m = 2/3 (eq. 40)"</span>)</span>
<span id="cb9-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(tg, X_grain(tg, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k:"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volume model, m = 1"</span>)</span>
<span id="cb9-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"dimensionless time </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion $X$"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb9-10">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">32</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">o</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">infty</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb9-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)</span>
<span id="cb9-12">Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>)</span>
<span id="cb9-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_SHOW:</span>
<span id="cb9-14">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(Xg, SS0_of_X(Xg, pv), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fr"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb9-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:</span>
<span id="cb9-16">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot([XM_eq33(pv)], [SS0_of_X(XM_eq33(pv), pv)], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb9-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(Xg, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain model, m = 2/3"</span>)</span>
<span id="cb9-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion $X$"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S/S_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">dX/d</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.65</span>),</span>
<span id="cb9-19">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (31); dots are eq. (33)"</span>)</span>
<span id="cb9-20">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb9-21">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb9-22"></span>
<span id="cb9-23"></span>
<span id="cb9-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> xm_sup(denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb9-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Supremum of eq. (33) as psi -&gt; infinity."""</span></span>
<span id="cb9-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> denom)</span>
<span id="cb9-27"></span>
<span id="cb9-28"></span>
<span id="cb9-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> psi_xm_reaches(level, denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb9-30">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""psi at which eq. (33) reaches ``level``."""</span></span>
<span id="cb9-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pv: XM_eq33(pv, denom) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> level, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, log<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb9-32"></span>
<span id="cb9-33"></span>
<span id="cb9-34">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup_vs_printed_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(xm_sup() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb9-35">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_exceeds_printed_psi"</span>, psi_xm_reaches(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup"</span>]), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb9-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (33) as (2-psi)/psi (XM_eq33(..., denom=1))"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),):</span>
<span id="cb9-37">    brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup_vs_printed_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(xm_sup(d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup"</span>])</span>
<span id="cb9-38">    brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_exceeds_printed_psi"</span>, psi_xm_reaches(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_sup"</span>], d))</span>
<span id="cb9-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (33) as psi -&gt; infinity: X_M -&gt; 1 - exp(-1/2) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>xm_sup()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (printed: X_M &lt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_sup'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb9-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   so the printed bound is a truncation: X_M exceeds </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_sup'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for psi above "</span></span>
<span id="cb9-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_exceeds_printed_psi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb9-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (33) at the printed threshold psi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_psi_min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: X_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XM_eq33(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_psi_min'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb9-43">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"so the maximum is born at the particle's start."</span>)</span>
<span id="cb9-44"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]):</span>
<span id="cb9-45">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Petersen's eq. (34) at eps_o = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: X_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> e_))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-7-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (33) as psi -&gt; infinity: X_M -&gt; 1 - exp(-1/2) = 0.3934693   (printed: X_M &lt; 0.393)
   so the printed bound is a truncation: X_M exceeds 0.393 for psi above 1293.
eq. (33) at the printed threshold psi = 2: X_M = 0.0e+00, so the maximum is born at the particle's start.
Petersen's eq. (34) at eps_o = 0.26: X_M = 0.324324
Petersen's eq. (34) at eps_o = 0.3: X_M = 0.285714</code></pre>
</div>
</div>
</section>
<section id="the-petersen-reduction-and-a-parameter-set-that-is-not-merely-over-determined" class="level3">
<h3 class="anchored" data-anchor-id="the-petersen-reduction-and-a-parameter-set-that-is-not-merely-over-determined">The Petersen reduction, and a parameter set that is not merely over-determined</h3>
<p>The paper claims the Fig. 4 set “satisf[ies] Equations (3) and (4)” and “give[s] <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%205">”, and that curve C’s set is “no longer consistent with the requirements of Petersen’s model”, whose “corresponding Petersen choices are not, in this case, uniquely defined”. Both are checkable arithmetic, and the second is stronger than the paper says: eq. (3) has a <strong>maximum</strong> over <img src="https://latex.codecogs.com/png.latex?r_p"> at <img src="https://latex.codecogs.com/png.latex?r_p%5Csqrt%7B%5Cpi%20L/3%7D%20=%201/2"> (the stationary point of the symbolic section), so for a given <img src="https://latex.codecogs.com/png.latex?L"> no Petersen structure has a surface above <img src="https://latex.codecogs.com/png.latex?S_%7B%5Cmax%7D(L)">.</p>
<p><strong>Which root of eq. (7)?</strong> The paper says “<img src="https://latex.codecogs.com/png.latex?G"> is the solution to the cubic equation”, singular. It has three real roots. The symbolic section showed eq. (7) is exactly <img src="https://latex.codecogs.com/png.latex?G%20=%203/(2u_o)"> with <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o%20=%203u_o%5E2-2u_o%5E3">, which selects one of them.</p>
<div id="3377d5db" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:46.731544Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:46.731327Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:46.748906Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:46.748060Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">SETS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 4 / p. 384 Petersen set"</span>: petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>]),</span>
<span id="cb11-2">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 7 curves A, B"</span>: petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]),</span>
<span id="cb11-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 7 curve C"</span>: petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])}</span>
<span id="cb11-4">aud <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(SETS).T[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"So"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Smax"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feasible"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_pred"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_pred"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>]]</span>
<span id="cb11-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> pd.option_context(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.float_format"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>):</span>
<span id="cb11-6">    display(aud)</span>
<span id="cb11-7">F4, AB, CC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SETS.values()</span>
<span id="cb11-8"></span>
<span id="cb11-9">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_fig4_vs_printed_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_psi"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_psi"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb11-10">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_eps_rel_fig4set"</span>, F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_rel"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb11-11">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_S_rel_fig4set"</span>, F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_rel"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb11-12">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_eps_rel_fig7AB"</span>, AB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_rel"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb11-13">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curveC_So_over_Smax"</span>, CC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"So"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Smax"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb11-14">L_D, rp_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve_D_length(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])</span>
<span id="cb11-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curveD_L_over_LAB"</span>, L_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb11-16"></span>
<span id="cb11-17"></span>
<span id="cb11-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> roundtrip(L):</span>
<span id="cb11-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Largest relative miss of eqs. (3) and (4) at curve D's (r_p, L)."""</span></span>
<span id="cb11-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pet_S(rp_D, L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>],</span>
<span id="cb11-21">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pet_eps(rp_D, L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])</span>
<span id="cb11-22"></span>
<span id="cb11-23"></span>
<span id="cb11-24">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curveD_roundtrip_rel"</span>, roundtrip(L_D), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb11-25">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eqs. (3) and (4) evaluated at the (r_p, L) solved from them; round-off only"</span>)</span>
<span id="cb11-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kw, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(keep_porosity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))"</span>),</span>
<span id="cb11-27">                (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(coef<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi with 2 pi for 4 pi (psi_of(..., coef=2*pi))"</span>)):</span>
<span id="cb11-28">    brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_fig4_vs_printed_rel"</span>,</span>
<span id="cb11-29">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(psi_of(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>], <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_psi"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_psi"</span>])</span>
<span id="cb11-30">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3): the root above the surface maximum (petersen_audit(..., root='upper'))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_eps_rel_fig4set"</span>,</span>
<span id="cb11-31">    petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>], root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_rel"</span>])</span>
<span id="cb11-32">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (3): the root above the surface maximum (petersen_audit(..., root='upper'))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_eps_rel_fig7AB"</span>,</span>
<span id="cb11-33">    petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>], root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_rel"</span>])</span>
<span id="cb11-34">_bad4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>], c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb11-35">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (petersen_audit(..., c=1/3))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_eps_rel_fig4set"</span>, _bad4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_rel"</span>])</span>
<span id="cb11-36">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (petersen_audit(..., c=1/3))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_S_rel_fig4set"</span>, _bad4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_rel"</span>])</span>
<span id="cb11-37">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curve C's L_o read as 3.14e7 (one decade out)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curveC_So_over_Smax"</span>,</span>
<span id="cb11-38">    P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> petersen_audit(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Smax"</span>])</span>
<span id="cb11-39">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curve D's S_o read as curves A and B's"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curveD_L_over_LAB"</span>,</span>
<span id="cb11-40">    curve_D_length(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>])</span>
<span id="cb11-41">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curve D's length perturbed 1 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"curveD_roundtrip_rel"</span>, roundtrip(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L_D))</span>
<span id="cb11-42"></span>
<span id="cb11-43">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb11-44"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Both claims about the Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 4 set hold</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> then eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> returns</span></span>
<span id="cb11-45"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_pred'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig4_eps_o'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb11-46"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> then eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> returns </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'S_pred'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span></span>
<span id="cb11-47"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig4_So'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'S_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'psi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> against</span></span>
<span id="cb11-48"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the printed 5 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'psi_fig4_vs_printed_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Curves A and B's triple closes to</span></span>
<span id="cb11-49"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % in porosity</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-50"></span>
<span id="cb11-51"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Curve C is infeasible, not merely over-determined</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The largest surface any</span></span>
<span id="cb11-52"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Petersen structure of length </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_C_Lo'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/cm³ can have is</span></span>
<span id="cb11-53"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Smax'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm²/cm³, and curve C asks for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_C_So'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, a factor</span></span>
<span id="cb11-54"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'curveC_So_over_Smax'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> beyond it: eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> has no root for that pair,</span></span>
<span id="cb11-55"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">which is why a parameter had to be freed</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The same arithmetic reconstructs the</span></span>
<span id="cb11-56"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">length of curve D, which the paper says "is internally calculated via Equations</span></span>
<span id="cb11-57"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" and never prints: fixing </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_eps_o'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span></span>
<span id="cb11-58"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_C_So'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> gives </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_D<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/cm³, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'curveD_L_over_LAB'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span></span>
<span id="cb11-59"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">times curves A and B's </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">searched: the Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 7 caption, both columns of p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 384, and</span></span>
<span id="cb11-60"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 383-385 running text; the only lengths printed are </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">7</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 381 and</span></span>
<span id="cb11-61"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the shared </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">14</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">imes10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-62"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span>
<span id="cb11-63"></span>
<span id="cb11-64"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]):</span>
<span id="cb11-65">    rts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cubic7_roots(e_)</span>
<span id="cb11-66">    Gsel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> G_of_eps(e_)</span>
<span id="cb11-67">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (7) at eps_o = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: real roots </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>array2string(rts, precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb11-68">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eqs. (3),(4),(6) select G = 3/(2 u_o) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Gsel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-69">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rts[(rts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Gsel) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)]:</span>
<span id="cb11-70">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   the other root G = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> puts complete gasification at s = 2G/3 - 1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>g<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt; 0"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">So</th>
<th data-quarto-table-cell-role="th">eps</th>
<th data-quarto-table-cell-role="th">Smax</th>
<th data-quarto-table-cell-role="th">feasible</th>
<th data-quarto-table-cell-role="th">eps_pred</th>
<th data-quarto-table-cell-role="th">eps_rel</th>
<th data-quarto-table-cell-role="th">S_pred</th>
<th data-quarto-table-cell-role="th">S_rel</th>
<th data-quarto-table-cell-role="th">psi</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">Fig. 4 / p. 384 Petersen set</th>
<td>2425</td>
<td>0.26</td>
<td>2720.01</td>
<td>True</td>
<td>0.261931</td>
<td>0.00742862</td>
<td>2419.8</td>
<td>0.00214569</td>
<td>4.96533</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">Fig. 7 curves A, B</th>
<td>2500</td>
<td>0.3</td>
<td>2720.01</td>
<td>True</td>
<td>0.292448</td>
<td>0.0251726</td>
<td>2516.57</td>
<td>0.00662752</td>
<td>4.41934</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">Fig. 7 curve C</th>
<td>12500</td>
<td>0.3</td>
<td>2720.01</td>
<td>False</td>
<td>NaN</td>
<td>NaN</td>
<td>2516.57</td>
<td>0.798674</td>
<td>0.176774</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Both claims about the Fig. 4 set hold.</strong> Eq. (3) then eq. (4) returns <img src="https://latex.codecogs.com/png.latex?%5Cepsilon"> = 0.261931 against the printed 0.26 (0.74 %); eq. (4) then eq. (3) returns <img src="https://latex.codecogs.com/png.latex?S_o"> = 2419.8 against 2425 (0.21 %); and <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 4.9653 against the printed 5 (0.69 %). Curves A and B’s triple closes to 2.52 % in porosity.</p>
<p><strong>Curve C is infeasible, not merely over-determined.</strong> The largest surface any Petersen structure of length 3.14e+06 cm/cm³ can have is 2720.0 cm²/cm³, and curve C asks for 12500, a factor 4.596 beyond it: eq. (3) has no root for that pair, which is why a parameter had to be freed. The same arithmetic reconstructs the length of curve D, which the paper says “is internally calculated via Equations (3) and (4)” and never prints: fixing <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o"> = 0.3 and <img src="https://latex.codecogs.com/png.latex?S_o"> = 12500 gives <img src="https://latex.codecogs.com/png.latex?L"> = 7.7470e+07 cm/cm³, 24.672 times curves A and B’s (searched: the Fig. 7 caption, both columns of p.&nbsp;384, and the p.&nbsp;383-385 running text; the only lengths printed are <img src="https://latex.codecogs.com/png.latex?10%5E7"> on p.&nbsp;381 and the shared <img src="https://latex.codecogs.com/png.latex?3.14%5Ctimes10%5E6">).</p>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (7) at eps_o = 0.26: real roots [-5.536321  1.043805  4.492516]; eqs. (3),(4),(6) select G = 3/(2 u_o) = 4.492516
   the other root G = 1.043805 puts complete gasification at s = 2G/3 - 1 = -0.304130 &lt; 0
eq. (7) at eps_o = 0.3: real roots [-5.181003  1.0517    4.129302]; eqs. (3),(4),(6) select G = 3/(2 u_o) = 4.129302
   the other root G = 1.051700 puts complete gasification at s = 2G/3 - 1 = -0.298866 &lt; 0</code></pre>
</div>
</div>
</section>
<section id="the-75-claim-to-three-digits" class="level3">
<h3 class="anchored" data-anchor-id="the-75-claim-to-three-digits">The 75 % claim, to three digits</h3>
<p>“Curves A and B are in good agreement up to about 75 % conversion and diverge thereafter” (p.&nbsp;384), and in the CONCLUSIONS, “some deviation … is found at high conversions (above about 75 %)”. Both models are closed forms of printed parameters, so the claim is a number.</p>
<p><strong>Which Petersen structure is curve B?</strong> A Petersen solid has two degrees of freedom <img src="https://latex.codecogs.com/png.latex?(r_p,%20L)">, and the caption prints three numbers, so a convention has to be chosen. The paper prints it, on p.&nbsp;384:</p>
<blockquote class="blockquote">
<p>The corresponding Petersen choices are not, in this case, uniquely defined. If <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o%20=%200.3"> and <img src="https://latex.codecogs.com/png.latex?L_o%20=%203.14%20%5Ctimes%2010%5E6"> are chosen, the results are the same as the prior curve B. If, on the other hand, <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o%20=%200.3"> and <img src="https://latex.codecogs.com/png.latex?S_o%20=%2012%7B,%7D500"> cm²/cm³ are fixed, curve D is obtained.</p>
</blockquote>
<p>So curve B is the Petersen structure fixed by <img src="https://latex.codecogs.com/png.latex?(%5Cepsilon_o,%20L_o)">. An over-determined triple has three pairings, so the other two, <img src="https://latex.codecogs.com/png.latex?(%5Cepsilon_o,%0AS_o)"> and <img src="https://latex.codecogs.com/png.latex?(S_o,%20L_o)">, are computed beside it. Every location below is a root: the crossings of <img src="https://latex.codecogs.com/png.latex?X_A%20-%20X_B">, its extrema (roots of its analytic derivative), and the parting conversion (the first root of <img src="https://latex.codecogs.com/png.latex?%7CX_A%20-%20X_B%7C%20-%200.02">), each by <code>find_roots</code> on a logarithmic scan of time.</p>
<div id="aab7d48f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:46.751179Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:46.751049Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:47.368789Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:47.367934Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">FIG7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {pr: Fig7(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>], pairing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pr) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_S"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_L"</span>)}</span>
<span id="cb13-2">CMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {pr: f.compare(X_upto<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_agreement_X"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pr, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FIG7.items()}</span>
<span id="cb13-3">FA, CA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FIG7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_L"</span>], CMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_L"</span>]</span>
<span id="cb13-4">_scan_counts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FA.compare(n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossings"</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FA.compare(n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrema"</span>])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)}</span>
<span id="cb13-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"crossings and extrema found on 100, 400 and 1600 scan points: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_scan_counts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb13-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'crossings'</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'extrema'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_scan_counts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _scan_counts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> _scan_counts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossings"</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrema"</span>]))</span>
<span id="cb13-8">X_cross <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FA.XA(k)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossings"</span>]]</span>
<span id="cb13-9">X_ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FA.XA(k)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrema"</span>]]</span>
<span id="cb13-10">d_ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FA.dAB(k)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrema"</span>]]</span>
<span id="cb13-11">RATE0_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dX_A/d(k_s C^n t) at t = 0</span></span>
<span id="cb13-12">RATE0_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RATE0_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FA.ddAB(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))                                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d(eq. 6)/ds over r_po at s = 0</span></span>
<span id="cb13-13"></span>
<span id="cb13-14"></span>
<span id="cb13-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fig7_claims(f, c):</span>
<span id="cb13-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The numbers of the comparison, for one Fig7 and its compare()."""</span></span>
<span id="cb13-17">    xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f.XA(k)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"crossings"</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [np.nan, np.nan]</span>
<span id="cb13-18">    de <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f.dAB(k)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrema"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> f.XA(k) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [np.nan, np.nan]</span>
<span id="cb13-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(max_upto<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_upto"</span>], X_part<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>], early<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], second<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb13-20">                lead<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>de[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], trail<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>de[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb13-21"></span>
<span id="cb13-22"></span>
<span id="cb13-23">V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fig7_claims(FA, CA)</span>
<span id="cb13-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_upto"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FA.dAB(CA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kt_upto"</span>])), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the largest gap up to X = 0.75 is at X = 0.75 itself"</span></span>
<span id="cb13-25">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_max_dX_upto_75"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_upto"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_X_at_two_points"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb13-27">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_early_cross_X"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"early"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-28">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_second_cross_X"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_lead_max"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lead"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-30">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_trail_max"</span>, V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"trail"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-31">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_rate0_excess"</span>, RATE0_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RATE0_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-32"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pr, tag <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_S"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_S"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_L"</span>)):</span>
<span id="cb13-33">    claims.value(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fig7_X_part_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, CMP[pr][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb13-34">    claims.value(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fig7_max_dX_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, CMP[pr][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_upto"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-35"></span>
<span id="cb13-36">G_WRONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cubic7_roots(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb13-37"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the middle root of eq. (7), G = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_WRONG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Fig7(..., G=...))"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(G<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>G_WRONG)),</span>
<span id="cb13-38">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))):</span>
<span id="cb13-39">    fb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Fig7(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>], <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb13-40">    cb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fb.compare(X_upto<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_agreement_X"</span>])</span>
<span id="cb13-41">    Vb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fig7_claims(fb, cb)</span>
<span id="cb13-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_upto"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_max_dX_upto_75"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_X_at_two_points"</span>),</span>
<span id="cb13-43">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"early"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_early_cross_X"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_second_cross_X"</span>),</span>
<span id="cb13-44">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lead"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_lead_max"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"trail"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_trail_max"</span>)):</span>
<span id="cb13-45">        brk(lab, name, Vb[k])</span>
<span id="cb13-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kw:</span>
<span id="cb13-47">        brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_rate0_excess"</span>, (RATE0_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> fb.ddAB(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RATE0_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb13-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pr, tag <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_S"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_S"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_L"</span>)):</span>
<span id="cb13-49">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kw:</span>
<span id="cb13-50">            cq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Fig7(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>], pairing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pr, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw).compare(</span>
<span id="cb13-51">                X_upto<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_agreement_X"</span>])</span>
<span id="cb13-52">            brk(lab, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fig7_X_part_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, cq[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>])</span>
<span id="cb13-53">            brk(lab, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fig7_max_dX_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, cq[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_upto"</span>])</span>
<span id="cb13-54"></span>
<span id="cb13-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the surfaces, on both printed parameter sets</span></span>
<span id="cb13-56"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> surf_dev(X, So_, Lo_, e_, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb13-57">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Relative gap of the random pore surface to Petersen's at conversion X."""</span></span>
<span id="cb13-58">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SS0_of_X(X, psi_of(So_, Lo_, e_, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SS0_petersen(np.array([X]), e_)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb13-59"></span>
<span id="cb13-60"></span>
<span id="cb13-61">SURF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb13-62"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, (So_, Lo_, e_) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"f4"</span>, (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>])),</span>
<span id="cb13-63">                            (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AB"</span>, (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_AB_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]))):</span>
<span id="cb13-64">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Xv, xt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"25"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"75"</span>)):</span>
<span id="cb13-65">        name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"surf_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>xt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb13-66">        SURF[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> surf_dev(Xv, So_, Lo_, e_)</span>
<span id="cb13-67">        claims.value(name, SURF[name], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-68">        brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))"</span>, name,</span>
<span id="cb13-69">            surf_dev(Xv, So_, Lo_, e_, keep_porosity<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb13-70"></span>
<span id="cb13-71">ktp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, FA.kt_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">900</span>)</span>
<span id="cb13-72">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.1</span>))</span>
<span id="cb13-73">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(ktp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, FA.XA(ktp), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"A: random pore, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">psi$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>psi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-74">kB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ktp[ktp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> FA.kt_end]</span>
<span id="cb13-75">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(kB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, FA.XB(kB), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B: Petersen, eqs. (6), (7)"</span>)</span>
<span id="cb13-76">psi_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> psi_of(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_Lo"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>])</span>
<span id="cb13-77">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(ktp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, X_of_tau(ktp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_C_So"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]), psi_C), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb13-78">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"C: random pore, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">psi$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>psi_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-79">rpoD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> u_of_eps(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb13-80">kD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ktp[ktp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> rpoD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> G_of_eps(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb13-81">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(kD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, X_petersen(kD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rpoD, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D: Petersen, L reconstructed"</span>)</span>
<span id="cb13-82">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_agreement_X"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>)</span>
<span id="cb13-83">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"time parameter </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k_s C</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n t</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">imes 10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{4}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cm</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion $X$"</span>, ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span>),</span>
<span id="cb13-84">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the construction of Fig. 7, from printed parameters"</span>)</span>
<span id="cb13-85">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)</span>
<span id="cb13-86">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(FA.XA(kB), FA.dAB(kB), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3"</span>)</span>
<span id="cb13-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>):</span>
<span id="cb13-88">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axhline(y, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb13-89">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axvline(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_agreement_X"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>)</span>
<span id="cb13-90">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot([V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>]], [FA.dAB(FA.kt_at_XA(V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_part"</span>]))], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ko"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb13-91">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion $X$ (curve A)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$X_A - X_B$"</span>, title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed '75 %' claim, measured"</span>)</span>
<span id="cb13-92">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb13-93"></span>
<span id="cb13-94">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb13-95"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Curve A has </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>psi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so it has a rate maximum </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X_M</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XM_eq33(FA.psi)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb13-96"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Up to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_agreement_X'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the two curves differ by at most</span></span>
<span id="cb13-97"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_max_dX_upto_75'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in conversion</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">75 itself, where the</span></span>
<span id="cb13-98"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gap is still growing</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">they first part by 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">02 at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'X_part'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: the</span></span>
<span id="cb13-99"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed "about 75 %", to three digits</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The two curves cross twice</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Petersen's</span></span>
<span id="cb13-100"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">initial rate is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_rate0_excess'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % the faster, so curve A trails</span></span>
<span id="cb13-101"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">curve B up to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'early'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">by at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d_ext[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> before</span></span>
<span id="cb13-102"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">overtaking; the second crossing is at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'second'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Curve A leads by at most</span></span>
<span id="cb13-103"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lead'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> before it and trails by at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'trail'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> after it, at</span></span>
<span id="cb13-104"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X_ext[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb13-105"></span>
<span id="cb13-106"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The third digit is the paper's convention</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Fixing curve B by </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o, S_o</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb13-107"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">instead </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the pairing p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 384 assigns to curve D; it implies </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> =</span></span>
<span id="cb13-108"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_S'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>L_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/cm³</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> gives a largest gap of</span></span>
<span id="cb13-109"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_max_dX_eps_S'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and a parting conversion of</span></span>
<span id="cb13-110"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_X_part_eps_S'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; fixing it by </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S_o, L_o</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, which keeps both printed</span></span>
<span id="cb13-111"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">measurements and takes the porosity </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FIG7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'S_L'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>eps_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the previous section,</span></span>
<span id="cb13-112"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_max_dX_S_L'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig7_X_part_S_L'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The parting</span></span>
<span id="cb13-113"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">conversion therefore moves in the second digit across the three readings; all</span></span>
<span id="cb13-114"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">round to "about 75 %", and only the paper's own convention earns the three-digit</span></span>
<span id="cb13-115"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">statement</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb13-116"></span>
<span id="cb13-117"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The surfaces part far earlier than the conversions</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> On the Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 4 set the</span></span>
<span id="cb13-118"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">random pore surface is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>SURF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'surf_dev_f4_25'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % against Petersen's at</span></span>
<span id="cb13-119"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">25 and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>SURF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'surf_dev_f4_75'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">75; on curves A and B's set</span></span>
<span id="cb13-120"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>SURF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'surf_dev_AB_25'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>SURF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'surf_dev_AB_75'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb13-121"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>crossings and extrema found on 100, 400 and 1600 scan points: (2, 3), (2, 3), (2, 3)</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-9-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Curve A has <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 4.4193, so it has a rate maximum (at <img src="https://latex.codecogs.com/png.latex?X_M"> = 0.2395). <strong>Up to <img src="https://latex.codecogs.com/png.latex?X"> = 0.75 the two curves differ by at most 0.0218 in conversion</strong> (at <img src="https://latex.codecogs.com/png.latex?X"> = 0.75 itself, where the gap is still growing), and <strong>they first part by 0.02 at <img src="https://latex.codecogs.com/png.latex?X"> = 0.7423</strong>: the printed “about 75 %”, to three digits. The two curves cross twice. Petersen’s initial rate is 0.66 % the faster, so curve A trails curve B up to <img src="https://latex.codecogs.com/png.latex?X"> = 0.0232 (by at most 3.7e-05 in <img src="https://latex.codecogs.com/png.latex?X">) before overtaking; the second crossing is at <img src="https://latex.codecogs.com/png.latex?X"> = 0.6257. Curve A leads by at most 0.0114 before it and trails by at most 0.0627 after it, at <img src="https://latex.codecogs.com/png.latex?X"> = 0.9164.</p>
<p><strong>The third digit is the paper’s convention.</strong> Fixing curve B by <img src="https://latex.codecogs.com/png.latex?(%5Cepsilon_o,%20S_o)"> instead (the pairing p.&nbsp;384 assigns to curve D; it implies <img src="https://latex.codecogs.com/png.latex?L"> = 3.0988e+06 cm/cm³) gives a largest gap of 0.0177 and a parting conversion of 0.7599; fixing it by <img src="https://latex.codecogs.com/png.latex?(S_o,%20L_o)">, which keeps both printed measurements and takes the porosity 0.2924 of the previous section, gives 0.0165 and 0.7687. The parting conversion therefore moves in the second digit across the three readings; all round to “about 75 %”, and only the paper’s own convention earns the three-digit statement.</p>
<p><strong>The surfaces part far earlier than the conversions.</strong> On the Fig. 4 set the random pore surface is +4.54 % against Petersen’s at <img src="https://latex.codecogs.com/png.latex?X"> = 0.25 and -21.66 % at <img src="https://latex.codecogs.com/png.latex?X"> = 0.75; on curves A and B’s set +4.70 % and -21.00 %.</p>
</div>
</div>
</section>
<section id="why-they-part-two-different-overlap-laws" class="level3">
<h3 class="anchored" data-anchor-id="why-they-part-two-different-overlap-laws">Why they part: two different overlap laws</h3>
<p>The abstract says the models “approach” each other at zero pore-size variance, not that they coincide, and the paper’s explanation is “the neglect of new intersections of reaction surfaces in the Petersen approach”. Both models write the porosity as a function of the non-overlapped volume <img src="https://latex.codecogs.com/png.latex?V_E">: Avrami’s eq. (20) gives <img src="https://latex.codecogs.com/png.latex?V%20=%201-e%5E%7B-V_E%7D">, while Petersen’s eqs. (3)-(4) in <img src="https://latex.codecogs.com/png.latex?u%20=%20r%5Csqrt%7B%5Cpi%20L/3%7D"> give <img src="https://latex.codecogs.com/png.latex?V_E%20=%203u%5E2"> and <img src="https://latex.codecogs.com/png.latex?V%20=%203u%5E2-2u%5E3">. Expanded,</p>
<p><img src="https://latex.codecogs.com/png.latex?V_%7B%5Ctext%7BAvrami%7D%7D%20=%20V_E%20-%20%5Ctfrac12%20V_E%5E2%20+%20%5Cldots,%20%5Cqquad%0AV_%7B%5Ctext%7BPetersen%7D%7D%20=%20V_E%20-%202%5Cleft(%5Ctfrac%7BV_E%7D%7B3%7D%5Cright)%5E%7B3/2%7D,"></p>
<p>so they differ already at order <img src="https://latex.codecogs.com/png.latex?V_E%5E%7B3/2%7D">, and no parameter choice makes the two models identical. Petersen’s law reaches <img src="https://latex.codecogs.com/png.latex?V%20=%201"> at finite <img src="https://latex.codecogs.com/png.latex?u%20=%201"> while Avrami’s only approaches it, which is where the high-conversion divergence comes from. The crossing is a root of the gap, the largest gap a root of its derivative, <img src="https://latex.codecogs.com/png.latex?6u%5C,(e%5E%7B-3u%5E2%7D%20-%201%20+%20u)">.</p>
<div id="199b691e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:47.371368Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:47.371190Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:47.560794Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:47.559946Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> overlap_numbers(c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb15-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Crossing (u), largest gap and the leading-term check at V_E = 0.01."""</span></span>
<span id="cb15-3">    cross <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: overlap_gap(z, c), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>)</span>
<span id="cb15-4">    top <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [z <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: overlap_gap_slope(z, c), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, cross, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]]</span>
<span id="cb15-5">    VE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span></span>
<span id="cb15-6">    lead <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>VE)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (VE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (VE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (VE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> VE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb15-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> cross, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(overlap_gap(top[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], c)), top[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], lead</span>
<span id="cb15-8"></span>
<span id="cb15-9"></span>
<span id="cb15-10">U_CROSS, GAP_MAX, U_GAP, LEAD_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> overlap_numbers()</span>
<span id="cb15-11">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overlap_cross_u"</span>, U_CROSS, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb15-12">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overlap_max_gap"</span>, GAP_MAX, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb15-13">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overlap_lead_rel"</span>, LEAD_REL, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb15-14">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the leading term 2(V_E/3)^(3/2) - V_E^2/2 against the gap at V_E = 0.01; the next term is O(V_E)"</span>)</span>
<span id="cb15-15">_c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> overlap_numbers(c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb15-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overlap_cross_u"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overlap_max_gap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"overlap_lead_rel"</span>), _c1):</span>
<span id="cb15-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name:</span>
<span id="cb15-18">        brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (overlap_gap(..., c=1))"</span>, name, val)</span>
<span id="cb15-19"></span>
<span id="cb15-20">ug <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1201</span>)</span>
<span id="cb15-21">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.7</span>))</span>
<span id="cb15-22">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Avrami, eq. (20): $1-e^{-V_E}$"</span>)</span>
<span id="cb15-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Petersen, eqs. (3), (4): $3u^2-2u^3$"</span>)</span>
<span id="cb15-24">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$V_E$ (non-overlapped volume)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$V$ (porosity)"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span>))</span>
<span id="cb15-25">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb15-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, overlap_gap(ug), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axhline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb15-27">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U_GAP<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], [GAP_MAX], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ko"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb15-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$V_E$"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Avrami $-$ Petersen"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb15-29">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb15-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two overlap laws cross once, at u = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_CROSS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (V_E = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>U_CROSS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); "</span></span>
<span id="cb15-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"largest gap </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAP_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in porosity, at u = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_GAP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb15-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at V_E = 0.01 the leading term 2(V_E/3)^(3/2) - V_E^2/2 accounts for the gap to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEAD_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-10-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>the two overlap laws cross once, at u = 0.6508058 (V_E = 1.270645); largest gap 0.030118 in porosity, at u = 0.438849.
at V_E = 0.01 the leading term 2(V_E/3)^(3/2) - V_E^2/2 accounts for the gap to 5.0e-04 relative.</code></pre>
</div>
</div>
</section>
<section id="the-grain-shape-factor-the-papers-own-least-squares-re-run" class="level3">
<h3 class="anchored" data-anchor-id="the-grain-shape-factor-the-papers-own-least-squares-re-run">The grain shape factor: the paper’s own least squares, re-run</h3>
<p>The paper defines <img src="https://latex.codecogs.com/png.latex?m"> by minimising <img src="https://latex.codecogs.com/png.latex?I"> and reports the result as Figure 6 and two sentences. <img src="https://latex.codecogs.com/png.latex?I"> has a closed form: with <img src="https://latex.codecogs.com/png.latex?w%20=%201-X%20=%20e%5E%7B-v%7D"> every term is an incomplete gamma function,</p>
<p><img src="https://latex.codecogs.com/png.latex?J(b)%20=%20%5Cint_0%5E1%20w%5E%7Bb%7D%5Csqrt%7B1-%5Cpsi%5Cln%20w%7D%5C,dw%0A=%20%5Cfrac%7Be%5E%7Bc%7D%7D%7B%5Cpsi%7D%5Cleft(%5Cfrac%7B%5Cpsi%7D%7Bb+1%7D%5Cright)%5E%7B3/2%7D%5CGamma(3/2,%20c),%0A%5Cqquad%20c%20=%20%5Cfrac%7Bb+1%7D%7B%5Cpsi%7D,"></p>
<p>so <img src="https://latex.codecogs.com/png.latex?I%20=%20%5Cleft(%5Ctfrac13+%5Ctfrac%7B%5Cpsi%7D%7B9%7D%5Cright)%20-%202J(m%7B+%7D1)%20+%20%5Ctfrac%7B1%7D%7B2m+1%7D">. The best <img src="https://latex.codecogs.com/png.latex?m"> is the root of <img src="https://latex.codecogs.com/png.latex?dI/dm"> (its <img src="https://latex.codecogs.com/png.latex?J"> derivative by 600-point Gauss-Legendre quadrature), the only one on a scan of <img src="https://latex.codecogs.com/png.latex?-0.45%20%3C%20m%20%3C%203">; the second route is the root of the same derivative at 40 digits (<code>mpmath</code>). A bounded minimiser of the closed-form <img src="https://latex.codecogs.com/png.latex?I"> is printed as an illustration of what its cancellation noise does to the location of the minimum. Reported alongside is a normalised misfit, <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7BI/(%5Ctfrac13+%5Ctfrac%7B%5Cpsi%7D%7B9%7D)%7D">, the denominator being the same integral with the grain term removed. It is what makes “grossly inadequate” a number.</p>
<div id="fff49705" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:47.563117Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:47.562953Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:50.102712Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:50.101877Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">M0, M1, M2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), m_star(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_psi_window_hi"</span>])</span>
<span id="cb17-2">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi0"</span>, M0, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb17-3">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi1"</span>, M1, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb17-4">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi2"</span>, M2, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb17-5">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi1_vs_two_thirds_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_sphere"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_sphere"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb17-6">PSI_TWO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb17-7">mpmath.mp.dps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span></span>
<span id="cb17-8"></span>
<span id="cb17-9"></span>
<span id="cb17-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> m_star_mp(pv):</span>
<span id="cb17-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Root of dI/dm at 40 digits: dI/dm = 2 int_0^inf v exp(-(m+2) v) sqrt(1 + psi v) dv - 2/(2m+1)^2."""</span></span>
<span id="cb17-12">    p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mpmath.mpf(pv)</span>
<span id="cb17-13"></span>
<span id="cb17-14">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> d(z):</span>
<span id="cb17-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> mpmath.quad(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> mpmath.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> mpmath.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v),</span>
<span id="cb17-16">                               [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, mpmath.inf]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb17-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(mpmath.findroot(d, mpmath.mpf(m_star(pv))))</span>
<span id="cb17-18"></span>
<span id="cb17-19"></span>
<span id="cb17-20">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_two_routes"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_star(pv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m_star_mp(pv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_TWO), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>,</span>
<span id="cb17-21">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 600-point quadrature of dI/dm at round-off, 1e-13 in m, against a 40-digit root"</span>)</span>
<span id="cb17-22">MSTAR_BRENT_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {pv: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_star(pv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m_star_brent(pv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_TWO}</span>
<span id="cb17-23">psi_fine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_psi_window_hi"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>)</span>
<span id="cb17-24">m_fine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([m_star(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> psi_fine])</span>
<span id="cb17-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(m_fine) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m*(psi) is monotone on the printed window"</span></span>
<span id="cb17-26">NRMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {pv: I_nrms(pv, m_star(pv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)}</span>
<span id="cb17-27">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_best_psi2"</span>, NRMS[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-28"></span>
<span id="cb17-29"></span>
<span id="cb17-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> psi_nrms_reaches(level, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb17-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""psi at which the best-m misfit reaches ``level``, bracketed on [0.1, 4]."""</span></span>
<span id="cb17-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pv: I_nrms(pv, m_star(pv, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p), p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> level, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb17-33"></span>
<span id="cb17-34"></span>
<span id="cb17-35">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_8pct_psi"</span>, psi_nrms_reaches(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb17-36">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_best_psi5"</span>, NRMS[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb17-37">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_best_psi10"</span>, NRMS[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb17-38">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_m0_psi2"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_flatplate"</span>]), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb17-39">PSI_M0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> psi_m_star_zero()</span>
<span id="cb17-40">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_m_star_zero"</span>, PSI_M0, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb17-41">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_at_psi_m_star_zero"</span>, I_nrms(PSI_M0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb17-42">BRANCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_grain(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_grain(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>))</span>
<span id="cb17-43">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_branch_gap_at_m1"</span>, BRANCH, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb17-44">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the general form of eq. (39) at m = 1 - 1e-9 against its m = 1 branch; the gap is O(1 - m)"</span>)</span>
<span id="cb17-45"></span>
<span id="cb17-46">lab_p0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I with the (1-X)^1 factor dropped (m_star(..., p=0))"</span></span>
<span id="cb17-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi0"</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi1"</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb17-48">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi2"</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb17-49">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_psi1_vs_two_thirds_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)),</span>
<span id="cb17-50">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star_two_routes"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_star(pv, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m_star_mp(pv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_TWO)),</span>
<span id="cb17-51">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_best_psi2"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb17-52">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_best_psi5"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb17-53">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_best_psi10"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb17-54">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_m0_psi2"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))):</span>
<span id="cb17-55">    brk(lab_p0, name, val)</span>
<span id="cb17-56">brk(lab_p0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_8pct_psi"</span>, psi_nrms_reaches(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb17-57">PSI_M0_HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> psi_m_star_zero(X_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb17-58">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I truncated to X &lt;= 0.5 (psi_m_star_zero(X_max=0.5))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_m_star_zero"</span>, PSI_M0_HALF)</span>
<span id="cb17-59">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I truncated to X &lt;= 0.5 (psi_m_star_zero(X_max=0.5))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_at_psi_m_star_zero"</span>, I_nrms(PSI_M0_HALF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))</span>
<span id="cb17-60">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (39)'s general form taken at m = 0.999 for the m = 1 branch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_branch_gap_at_m1"</span>,</span>
<span id="cb17-61">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_grain(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_grain(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999</span>)))</span>
<span id="cb17-62"></span>
<span id="cb17-63">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.9</span>))</span>
<span id="cb17-64">psi_wide <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">61</span>)</span>
<span id="cb17-65">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(psi_wide, [m_star(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pv)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> psi_wide], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb17-66">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axvspan(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_psi_window_hi"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>)</span>
<span id="cb17-67">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_range_lo"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb17-68">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_sphere"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)</span>
<span id="cb17-69">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>], [M1], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ko"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb17-70">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"pore structure parameter </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best-fit $m$"</span>,</span>
<span id="cb17-71">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the construction of Fig. 6 (shaded: the printed window)"</span>, ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>))</span>
<span id="cb17-72">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(psi_wide, [I_nrms(pv, m_star(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pv))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> psi_wide], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best $m$"</span>)</span>
<span id="cb17-73"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m_, st, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_flatplate"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$m$ = 0 (flat plates)"</span>),</span>
<span id="cb17-74">                    (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_sphere"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$m$ = 2/3 (spheres)"</span>),</span>
<span id="cb17-75">                    (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_volume"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-."</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$m$ = 1 (volume model)"</span>)):</span>
<span id="cb17-76">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(psi_wide, [I_nrms(pv, m_) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> psi_wide], st, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab)</span>
<span id="cb17-77">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axvspan(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_psi_window_hi"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>)</span>
<span id="cb17-78">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"normalised rms misfit"</span>, ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span>),</span>
<span id="cb17-79">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"how well any order-of-reaction model can do"</span>)</span>
<span id="cb17-80">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb17-81">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb17-82"></span>
<span id="cb17-83">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb17-84"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Printed: "For </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0 </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le 2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, the best fit gives </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">49 </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le m </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span></span>
<span id="cb17-85"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Computed over the same window </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">monotone, 41 points checked</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tar</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> =</span></span>
<span id="cb17-86"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, the volume model, and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tar</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Printed: "For </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi = 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, the</span></span>
<span id="cb17-87"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">best </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is very close to two-thirds</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Computed: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tar</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb17-88"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_star_psi1_vs_two_thirds_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % below 2/3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The two routes to</span></span>
<span id="cb17-89"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tar</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the root of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">dI/dm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by quadrature and at 40 digits</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> agree to below 1e-11 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here</span></span>
<span id="cb17-90"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_star_two_routes'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> A bounded minimiser of the closed-form </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">I</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is</span></span>
<span id="cb17-91"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not a second route of that quality: it differs from the root by</span></span>
<span id="cb17-92"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(MSTAR_BRENT_GAP.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at worst over the same </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, because </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">I</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> carries about</span></span>
<span id="cb17-93"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1e-15 of cancellation noise at its minimum and the minimiser resolves </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> only to</span></span>
<span id="cb17-94"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">about the square root of that</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb17-95"></span>
<span id="cb17-96"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">How good is the best </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Its normalised misfit is</span></span>
<span id="cb17-97"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NRMS[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 2, reaching 8 % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nrms_8pct_psi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and rises with </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NRMS[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at</span></span>
<span id="cb17-98"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 5 and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NRMS[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 10, because no order-of-reaction model</span></span>
<span id="cb17-99"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">can produce a rate maximum</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The abstract's "not consistent with the assumption of</span></span>
<span id="cb17-100"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">flat plate grains </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> for any pore structure" holds as a claim about fit</span></span>
<span id="cb17-101"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">quality: at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 2, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0 misfits by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nrms_m0_psi2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The</span></span>
<span id="cb17-102"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">unconstrained optimum does pass through </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0, at exactly one value,</span></span>
<span id="cb17-103"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PSI_M0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, outside the printed window, and there its misfit is</span></span>
<span id="cb17-104"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nrms_at_psi_m_star_zero'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The paper never evaluates </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tar</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb17-105"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">outside </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0 </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le 2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">searched: abstract, CONCLUSIONS, the Figure 6</span></span>
<span id="cb17-106"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">discussion and caption</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so this statement is the page's, not the paper's</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb17-107"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span>
<span id="cb17-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every printed m (eq. 39's closed form has a branch at m = 1):"</span>)</span>
<span id="cb17-109"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m_, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_flatplate"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flat plates"</span>), (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_cylinder"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cylinders"</span>),</span>
<span id="cb17-110">                (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_sphere"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spheres"</span>), (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_volume"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volume model"</span>)):</span>
<span id="cb17-111">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) X(tau = 0.4) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(X_grain(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, m_))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   misfit at psi = 1: "</span></span>
<span id="cb17-112">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, m_)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb17-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   the m -&gt; 1 branch is continuous: |X(m = 1) - X(m = 1 - 1e-9)| below 1e-7 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRANCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-11-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Printed: “For <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20%5Cpsi%20%5Cle%202">, the best fit gives <img src="https://latex.codecogs.com/png.latex?0.49%20%5Cle%20m%20%5Cle%201">.”</strong> Computed over the same window (monotone, 41 points checked): <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar(0)"> = 1.0000000000, the volume model, and <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar(2)"> = 0.4905224. <strong>Printed: “For <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%201">, the best <img src="https://latex.codecogs.com/png.latex?m"> is very close to two-thirds.”</strong> Computed: <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar(1)"> = 0.6638850, 0.417 % below 2/3. The two routes to <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar"> (the root of <img src="https://latex.codecogs.com/png.latex?dI/dm"> by quadrature and at 40 digits) agree to below 1e-11 (here 3.2e-13). A bounded minimiser of the closed-form <img src="https://latex.codecogs.com/png.latex?I"> is not a second route of that quality: it differs from the root by 1.2e-07 at worst over the same <img src="https://latex.codecogs.com/png.latex?%5Cpsi">, because <img src="https://latex.codecogs.com/png.latex?I"> carries about 1e-15 of cancellation noise at its minimum and the minimiser resolves <img src="https://latex.codecogs.com/png.latex?m"> only to about the square root of that.</p>
<p><strong>How good is the best <img src="https://latex.codecogs.com/png.latex?m">?</strong> Its normalised misfit is 7.99 % at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 2, reaching 8 % at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 2.0013, and rises with <img src="https://latex.codecogs.com/png.latex?%5Cpsi">, to 19.9 % at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 5 and 32.3 % at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 10, because no order-of-reaction model can produce a rate maximum. The abstract’s “not consistent with the assumption of flat plate grains (<img src="https://latex.codecogs.com/png.latex?m%20=%200">) for any pore structure” holds as a claim about fit quality: at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 2, <img src="https://latex.codecogs.com/png.latex?m"> = 0 misfits by 56.4 %. The unconstrained optimum does pass through <img src="https://latex.codecogs.com/png.latex?m"> = 0, at exactly one value, <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 16.8046, outside the printed window, and there its misfit is 42.1 %. The paper never evaluates <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar"> outside <img src="https://latex.codecogs.com/png.latex?0%20%5Cle%20%5Cpsi%20%5Cle%202"> (searched: abstract, CONCLUSIONS, the Figure 6 discussion and caption), so this statement is the page’s, not the paper’s.</p>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>every printed m (eq. 39's closed form has a branch at m = 1):
   m = 0.000000 (flat plates ) X(tau = 0.4) = 0.4000000000   misfit at psi = 1: 72.5231 %
   m = 0.500000 (cylinders   ) X(tau = 0.4) = 0.3600000000   misfit at psi = 1: 11.6012 %
   m = 0.666667 (spheres     ) X(tau = 0.4) = 0.3490370370   misfit at psi = 1: 3.2214 %
   m = 1.000000 (volume model) X(tau = 0.4) = 0.3296799540   misfit at psi = 1: 17.1660 %
   the m -&gt; 1 branch is continuous: |X(m = 1) - X(m = 1 - 1e-9)| below 1e-7 (here 3.0e-08)</code></pre>
</div>
</div>
</section>
<section id="the-printed-defects" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-defects">The printed defects</h3>
<p>Three, each proved from the paper’s own content and none repaired. Defect 1 (Park and Levenspiel, 1976 in the text against 1975 in the reference list) is in the data section.</p>
<p><strong>Defect 2: “This match at <img src="https://latex.codecogs.com/png.latex?m%20=%201">” (p.&nbsp;383).</strong> Verbatim, with the sentence before it: <em>“In either figure, it is clear that the grain model predictions match the <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%201"> results within the limits of the usual experimental error. This match at <img src="https://latex.codecogs.com/png.latex?m%20=%201"> combined with the above-mentioned correspondence as <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20%5Cto%200"> suggests that…”</em> [<em>sic</em>]. The dashed line in Figures 3 and 4 is labelled “GRAIN MODEL, <img src="https://latex.codecogs.com/png.latex?m%20=%202/3">”; the “correspondence as <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20%5Cto%200">” is already the <img src="https://latex.codecogs.com/png.latex?m%20=%201"> case; and Figure 6 puts <img src="https://latex.codecogs.com/png.latex?m%20%5Capprox%202/3"> at <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%201">. Whether the slip is “<img src="https://latex.codecogs.com/png.latex?m%20=%201">” for “<img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%201">” or for “<img src="https://latex.codecogs.com/png.latex?m%20=%202/3">” cannot be decided from the document, so neither repair is asserted.</p>
<p><strong>Defect 3: the optimal-porosity worked example (p.&nbsp;383).</strong> <em>“If, for example, a final <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%200.3"> is sought for a solid where <img src="https://latex.codecogs.com/png.latex?(S_o%5E2/2%5Cpi%20L_o)%20=%200.67">, the initial <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o"> should be 0.1 to maximize the final surface area.”</em> The printed 0.1 is not a root of the paper’s own eq. (35). The optimum is flat, so the surface it costs is small, which is presumably where a one-figure answer came from; it is reported because eq. (35) is an equation. Two typographical slips are recorded without comment: “not clearly indentified” [<em>sic</em>, p.&nbsp;382] and “This research was support by” [<em>sic</em>, p.&nbsp;385]; the NOTATION list spells “stoichimetric” [<em>sic</em>] for <img src="https://latex.codecogs.com/png.latex?p,%20q">.</p>
<div id="ce6335be" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:50.105202Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:50.105059Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:50.231817Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:50.230958Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_m1_at_psi1"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_volume"</span>]), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb19-2">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m1_penalty_at_psi1"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grain_m_volume"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, M1), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb19-3">brk(lab_p0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nrms_m1_at_psi1"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb19-4">brk(lab_p0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m1_penalty_at_psi1"</span>, I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I_nrms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb19-5"></span>
<span id="cb19-6">EPS_F, GHAT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_eps_final"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_group"</span>]</span>
<span id="cb19-7"></span>
<span id="cb19-8"></span>
<span id="cb19-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq35_numbers(Ghat_root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>GHAT, Ghat_direct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>GHAT):</span>
<span id="cb19-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Root of eq. (35) (pymrm block), the maximiser of eq. (27), the residual and the cost at 0.1."""</span></span>
<span id="cb19-11">    root <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(eps_o_opt_block(EPS_F, Ghat_root)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb19-12">    direct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>S_of_eps_o(z, EPS_F, Ghat_direct), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, EPS_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>),</span>
<span id="cb19-13">                             method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)).x</span>
<span id="cb19-14">    all_roots <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: stat35(z, EPS_F, Ghat_root), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]</span>
<span id="cb19-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>root, two_routes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(root <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> direct), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>all_roots,</span>
<span id="cb19-16">                resid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(stat35(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_eps_o"</span>], EPS_F, Ghat_root)),</span>
<span id="cb19-17">                deficit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_of_eps_o(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_eps_o"</span>], EPS_F, Ghat_root) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> S_of_eps_o(root, EPS_F, Ghat_root))</span>
<span id="cb19-18"></span>
<span id="cb19-19"></span>
<span id="cb19-20">E35 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq35_numbers()</span>
<span id="cb19-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span></span>
<span id="cb19-22">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_root_eps_o"</span>, E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb19-23">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_residual_at_printed"</span>, E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resid"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb19-24">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_two_routes"</span>, E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_routes"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb19-25">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded maximisation of eq. (27) locates its maximiser to about the square root of eps"</span>)</span>
<span id="cb19-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_S_deficit_at_printed"</span>, E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deficit"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb19-27">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_second_root"</span>, E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb19-28"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> G_bad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.68</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.66</span>):</span>
<span id="cb19-29">    Eb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq35_numbers(G_bad, G_bad)</span>
<span id="cb19-30">    lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the printed group 0.67 read as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (eps_o_opt_block(..., </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">))"</span></span>
<span id="cb19-31">    brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_root_eps_o"</span>, Eb[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>])</span>
<span id="cb19-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> G_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.68</span>:</span>
<span id="cb19-33">        brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_residual_at_printed"</span>, Eb[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resid"</span>])</span>
<span id="cb19-34">        brk(lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_second_root"</span>, Eb[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb19-35">        brk(lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" in the root route only"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_two_routes"</span>, eq35_numbers(G_bad, GHAT)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_routes"</span>])</span>
<span id="cb19-36">        brk(lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" in the root only"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq35_S_deficit_at_printed"</span>,</span>
<span id="cb19-37">            <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_of_eps_o(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_eps_o"</span>], EPS_F, GHAT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> S_of_eps_o(Eb[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>], EPS_F, GHAT))</span>
<span id="cb19-38"></span>
<span id="cb19-39">e0g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, EPS_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb19-40">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>))</span>
<span id="cb19-41">ax.plot(e0g, S_of_eps_o(e0g, EPS_F, GHAT), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb19-42">ax.plot([E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>]], [S_of_eps_o(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>], EPS_F, GHAT)], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ko"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (35) root </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'root'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-43">ax.plot([P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_eps_o"</span>]], [S_of_eps_o(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opt_eps_o"</span>], EPS_F, GHAT)], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rs"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'opt_eps_o'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-44">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"initial porosity </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S/S_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3"</span>)</span>
<span id="cb19-45">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb19-46"></span>
<span id="cb19-47">S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_of_eps_o(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], EPS_F, GHAT)</span>
<span id="cb19-48">_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span></span>
<span id="cb19-49"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> S_of_eps_o(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _h, EPS_F, GHAT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> S_of_eps_o(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _h, EPS_F, GHAT)</span>
<span id="cb19-50">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb19-51"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Defect 2 in numbers</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> At </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1 the best </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; the printed </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1</span></span>
<span id="cb19-52"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">misfits by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nrms_m1_at_psi1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, a factor</span></span>
<span id="cb19-53"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m1_penalty_at_psi1'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> worse than the optimum</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1 is the exact optimum,</span></span>
<span id="cb19-54"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">but at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb19-55"></span>
<span id="cb19-56"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Defect 3 in numbers</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">35</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EPS_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2/2</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pi L_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GHAT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb19-57"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">has its root at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'root'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by the pymrm block solve, and the direct</span></span>
<span id="cb19-58"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">maximisation of eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">27</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> agrees to below 1e-7 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_routes'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> At the</span></span>
<span id="cb19-59"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1 the residual is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq35_residual_at_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the surface is</span></span>
<span id="cb19-60"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq35_S_deficit_at_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the maximum below it</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Inequality </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">36</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'s</span></span>
<span id="cb19-61"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">window at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3 is </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>EPS_F)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>EPS_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so the printed</span></span>
<span id="cb19-62"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">64 violates </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">36</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" is the rounded-down lower bound, consistent</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">35</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> has a</span></span>
<span id="cb19-63"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">second root, at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'all'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: a minimum of the surface</span></span>
<span id="cb19-64"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_of_eps_o(E35[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'root'</span>], EPS_F, GHAT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and unphysical for a</span></span>
<span id="cb19-65"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">reaction that opens porosity</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb19-66"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-12-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Defect 2 in numbers.</strong> At <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 1 the best <img src="https://latex.codecogs.com/png.latex?m"> is 0.6639; the printed <img src="https://latex.codecogs.com/png.latex?m"> = 1 misfits by 17.17 %, a factor 5.34 worse than the optimum. <img src="https://latex.codecogs.com/png.latex?m"> = 1 is the exact optimum, but at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 0.</p>
<p><strong>Defect 3 in numbers.</strong> Eq. (35) at <img src="https://latex.codecogs.com/png.latex?%5Cepsilon"> = 0.3 and <img src="https://latex.codecogs.com/png.latex?S_o%5E2/2%5Cpi%20L_o"> = 0.67 has its root at <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o"> = 0.0852877 by the pymrm block solve, and the direct maximisation of eq. (27) agrees to below 1e-7 (here 2.5e-08). At the printed 0.1 the residual is 4.241e-03, and the surface is 2.76e-05 of the maximum below it. Inequality (36)’s window at <img src="https://latex.codecogs.com/png.latex?%5Cepsilon"> = 0.3 is [0.6433, 0.7], so the printed “<img src="https://latex.codecogs.com/png.latex?%5Cle"> 0.64 violates (36)” is the rounded-down lower bound, consistent. Eq. (35) has a second root, at <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o"> = 0.494674 &gt; <img src="https://latex.codecogs.com/png.latex?%5Cepsilon">: a minimum of the surface (0.987744 against 1.006694), and unphysical for a reaction that opens porosity.</p>
</div>
</div>
</section>
<section id="the-hashimoto-chars-what-the-prose-alone-supports" class="level3">
<h3 class="anchored" data-anchor-id="the-hashimoto-chars-what-the-prose-alone-supports">The Hashimoto chars: what the prose alone supports</h3>
<p>The three numbers printed in prose on p.&nbsp;385 are enough to state what the model predicts for those chars, without touching Figure 8. The linearisation of the symbolic section, <img src="https://latex.codecogs.com/png.latex?%5BS/(1-X)%5D%5E2%20=%20S_o%5E2(1%20+%20%5Cpsi%5Cln%5B1/(1-X)%5D)">, has intercept <img src="https://latex.codecogs.com/png.latex?S_o%5E2"> and slope <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20S_o%5E2">; and a length-averaged pore radius follows from the definition of <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> alone, <img src="https://latex.codecogs.com/png.latex?%5Cbar%20r%20%5Cequiv%20S_o/2%5Cpi%20L_o%20=%202(1-%5Cepsilon_o)/%5Cpsi%20S_o">.</p>
<p><strong>The effectiveness-factor claim cannot be checked here.</strong> “Thiele moduli based on the initial surface areas are small enough to assure effectiveness factors over 0.98 in all cases” needs a particle size, a diffusivity and a rate constant, and the paper prints none of them. What is computable is what the claim demands of the modulus, stated below as a bound and nothing more.</p>
<div id="4602f705" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:50.233719Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:50.233537Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:50.375422Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:50.374642Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> char_numbers(So_m2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_So"</span>], to_cm2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb20-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Intercept, X_M and mean pore radius (nm per (1 - eps_o)) of the two chars."""</span></span>
<span id="cb20-3">    So_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> So_m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> to_cm2</span>
<span id="cb20-4">    pVC, pCS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_CS"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_VC"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> swap <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_VC"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_CS"</span>])</span>
<span id="cb20-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(intercept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>So_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, XM_VC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XM_eq33(pVC), XM_CS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XM_eq33(pCS),</span>
<span id="cb20-6">                rbar_VC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (pVC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> So_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span>, rbar_CS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (pCS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> So_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span>)</span>
<span id="cb20-7"></span>
<span id="cb20-8"></span>
<span id="cb20-9">CH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> char_numbers()</span>
<span id="cb20-10">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_XM_VC"</span>, CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_VC"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb20-11">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_XM_CS"</span>, CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_CS"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb20-12">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_rbar_VC_nm"</span>, CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rbar_VC"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb20-13">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_intercept_e12"</span>, CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"intercept"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb20-14">PHI_098 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: eta_sphere(z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_min"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>)</span>
<span id="cb20-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta098_thiele_sphere"</span>, PHI_098, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb20-16">_sw, _nc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> char_numbers(swap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), char_numbers(to_cm2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb20-17">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two chars' psi swapped (char_numbers(swap=True))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_XM_VC"</span>, _sw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_VC"</span>])</span>
<span id="cb20-18">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two chars' psi swapped (char_numbers(swap=True))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_XM_CS"</span>, _sw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_CS"</span>])</span>
<span id="cb20-19">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the m2 -&gt; cm2 conversion dropped (char_numbers(to_cm2=1))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_rbar_VC_nm"</span>, _nc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rbar_VC"</span>])</span>
<span id="cb20-20">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the m2 -&gt; cm2 conversion dropped (char_numbers(to_cm2=1))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_intercept_e12"</span>, _nc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"intercept"</span>])</span>
<span id="cb20-21">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta read as 0.90 instead of 0.98"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta098_thiele_sphere"</span>,</span>
<span id="cb20-22">    unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: eta_sphere(z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.90</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>))</span>
<span id="cb20-23"></span>
<span id="cb20-24">xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.45</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb20-25">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>))</span>
<span id="cb20-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, psi_, st <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VC"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_VC"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CS"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_CS"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)):</span>
<span id="cb20-27">    ax.plot(xx, CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"intercept"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> psi_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xx), st, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fr"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> char, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>psi_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-28">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[1/(1-X)]</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[S/(1-X)]</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2 </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">imes 10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-12}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-2}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb20-29">       title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two printed correlations: no data points (Fig. 8 is not digitised)"</span>)</span>
<span id="cb20-30">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb20-31"></span>
<span id="cb20-32">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb20-33"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">S_o</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hashimoto_So'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> m²/cm³ for both chars is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hashimoto_So'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm²/cm³, so the</span></span>
<span id="cb20-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">shared intercept is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'intercept'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> × 10¹² cm⁻² and the slopes are</span></span>
<span id="cb20-35"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hashimoto_psi_VC'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'intercept'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hashimoto_psi_CS'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'intercept'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> × 10¹² cm⁻²</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb20-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Both </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> exceed 2, so eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">33</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> predicts surface maxima at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X_M</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_VC'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">VC</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span></span>
<span id="cb20-37"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_CS'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">CS</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; the paper says a maximum "was, in fact, reported in the reference</span></span>
<span id="cb20-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">work for the CS char but did not show up for the VC char, obscured by the particle</span></span>
<span id="cb20-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">attrition"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The length-averaged pore radius is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rbar_VC'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1-</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> nm </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">VC</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb20-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rbar_CS'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1-</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> nm </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">CS</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: micropores at any porosity</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> These are</span></span>
<span id="cb20-41"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">predictions of the model at the printed parameters, not a validation of it</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb20-42"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The effectiveness-factor sentence demands a sphere Thiele modulus below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_098<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb20-43"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">whether the chars met it cannot be checked from this paper</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb20-44"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-13-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><img src="https://latex.codecogs.com/png.latex?S_o"> = 520 m²/cm³ for both chars is 5.20e+06 cm²/cm³, so the shared intercept is 27.04 × 10¹² cm⁻² and the slopes are 186.6 and 370.4 × 10¹² cm⁻². Both <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> exceed 2, so eq. (33) predicts surface maxima at <img src="https://latex.codecogs.com/png.latex?X_M"> = 0.2989 (VC) and 0.3475 (CS); the paper says a maximum “was, in fact, reported in the reference work for the CS char but did not show up for the VC char, obscured by the particle attrition”. The length-averaged pore radius is 0.5574<img src="https://latex.codecogs.com/png.latex?(1-%5Cepsilon_o)"> nm (VC) and 0.2807<img src="https://latex.codecogs.com/png.latex?(1-%5Cepsilon_o)"> nm (CS): micropores at any porosity. These are predictions of the model at the printed parameters, not a validation of it. The effectiveness-factor sentence demands a sphere Thiele modulus below 0.5557; whether the chars met it cannot be checked from this paper.</p>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Nothing here is validated against data: there is none. What is validated is that the page computes the paper’s equations correctly, by routes that share no code, and that every number it reports moves when a defect is injected.</p>
<section id="the-rate-law-marched-against-the-closed-form-it-never-sees" class="level3">
<h3 class="anchored" data-anchor-id="the-rate-law-marched-against-the-closed-form-it-never-sees">The rate law marched, against the closed form it never sees</h3>
<p>Eq. (37) is the paper’s <em>rate</em> law and eq. (32) its <em>integral</em>. Marching (37) with Crank-Nicolson (a pymrm <code>newton</code> solve per step for all <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> at once) and comparing with (32) checks the printed pair against each other through code that shares nothing with either. The step is refined and the observed order taken from successive differences (<code>pymrm.checks.observed_orders</code>), which needs no reference solution.</p>
<div id="e04789c4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:50.377580Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:50.377432Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:53.838429Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:53.837518Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">PSI_MARCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> TAU_END <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span></span>
<span id="cb21-2">NS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb21-3"></span>
<span id="cb21-4"></span>
<span id="cb21-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> march_study(tau_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TAU_END, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>):</span>
<span id="cb21-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Ladder of marches: observed orders, the finest error against eq. (32), finest difference over round-off."""</span></span>
<span id="cb21-7">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb21-8">    st <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: vals.setdefault(n, march37(PSI_MARCH, tau_end, n, theta)), NS)</span>
<span id="cb21-9">    err <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_of_tau(tau_end, PSI_MARCH, quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>quarter))))</span>
<span id="cb21-10">    findiff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vals[NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]])))</span>
<span id="cb21-11">    floor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.finfo(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).eps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]])))</span>
<span id="cb21-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(orders<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.asarray(st[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>err, findiff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>findiff, over_floor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>findiff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> floor,</span>
<span id="cb21-13">                errs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_of_tau(tau_end, PSI_MARCH)))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NS})</span>
<span id="cb21-14"></span>
<span id="cb21-15"></span>
<span id="cb21-16">MS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> march_study()</span>
<span id="cb21-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'steps'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'d_tau'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max |X_CN - eq. (32)|'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NS:</span>
<span id="cb21-19">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}{</span>TAU_END<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.6f}{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'errs'</span>][n]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:24.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed orders from successive differences: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>array2string(MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>], precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-21">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_cn_vs_eq32_max"</span>, MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb21-22">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_observed_order"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.95</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-23">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson is second order"</span>)</span>
<span id="cb21-24">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_finest_over_roundoff"</span>, MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over_floor"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-25">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finest successive difference over (steps x eps x max X), so the order is not fitted to noise"</span>)</span>
<span id="cb21-26">ME <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> march_study(theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb21-27">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_euler_vs_eq32_max"</span>, ME[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)</span>
<span id="cb21-28">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"implicit Euler instead of Crank-Nicolson (march37(..., theta=1))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_cn_vs_eq32_max"</span>, ME[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"err"</span>])</span>
<span id="cb21-29">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"implicit Euler instead of Crank-Nicolson (march37(..., theta=1))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_observed_order"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ME[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb21-30">_q2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(march37(PSI_MARCH, TAU_END, NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_of_tau(TAU_END, PSI_MARCH, quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))))</span>
<span id="cb21-31">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (32) with psi tau/2 for psi tau/4 (X_of_tau(..., quarter=2))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_cn_vs_eq32_max"</span>, _q2)</span>
<span id="cb21-32">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (32) with psi tau/2 for psi tau/4 (X_of_tau(..., quarter=2))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_euler_vs_eq32_max"</span>,</span>
<span id="cb21-33">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(march37(PSI_MARCH, TAU_END, NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb21-34">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_of_tau(TAU_END, PSI_MARCH, quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))))</span>
<span id="cb21-35">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder ended at tau = 1e-4, where the differences reach round-off (march37(..., tau_end=1e-4))"</span>,</span>
<span id="cb21-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march_finest_over_roundoff"</span>, march_study(tau_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over_floor"</span>])</span>
<span id="cb21-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Crank-Nicolson: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'err'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> steps; implicit Euler at the same steps "</span></span>
<span id="cb21-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ME[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'err'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ME[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'err'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'err'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times worse."</span>)</span>
<span id="cb21-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"finest successive difference over the round-off floor: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'over_floor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (at least 1e3 required)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> steps     d_tau   max |X_CN - eq. (32)|
   100  0.015000              6.2757e-06
   200  0.007500              1.5689e-06
   400  0.003750              3.9222e-07
   800  0.001875              9.8055e-08
observed orders from successive differences: [2. 2.]
Crank-Nicolson: 9.81e-08 at 800 steps; implicit Euler at the same steps 3.14e-04, 3198 times worse.
finest successive difference over the round-off floor: 1.7e+06 (at least 1e3 required)</code></pre>
</div>
</div>
</section>
<section id="everything-else-two-ways" class="level3">
<h3 class="anchored" data-anchor-id="everything-else-two-ways">Everything else, two ways</h3>
<p>Each quantity below is computed by two routes that share no code: (a) <img src="https://latex.codecogs.com/png.latex?X_M">, eq. (33) against the root of the hand-written derivative of eq. (31); (b) <img src="https://latex.codecogs.com/png.latex?%5Ctau_%7B1/2%7D">, the pymrm block against a scalar root on eq. (32), and at <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%2010%5E9"> against the <img src="https://latex.codecogs.com/png.latex?%5Csigma%5Cto%5Cinfty"> closed form <img src="https://latex.codecogs.com/png.latex?%5Cpsi%5Ctau%5E2/4%20+%20%5Ctau%20=%20%5Cln%202">; (c) Petersen’s <img src="https://latex.codecogs.com/png.latex?S/S_o"> from eq. (3) against the derivative of eq. (6); (d) Petersen’s <img src="https://latex.codecogs.com/png.latex?X"> from eq. (6) against the porosity route; (e) <img src="https://latex.codecogs.com/png.latex?I"> in closed form against Gauss-Legendre quadrature and against a 40-digit quadrature (<code>mpmath</code>).</p>
<p><strong>(c) and (d) share algebra, and the page says which.</strong> Substituting <img src="https://latex.codecogs.com/png.latex?G%20=%203/(2u_o)"> and <img src="https://latex.codecogs.com/png.latex?%5Cepsilon%20=%203u_o%5E2-2u_o%5E3"> into eq. (6) turns it into the porosity route with <img src="https://latex.codecogs.com/png.latex?u%20=%20u_o(1+s)">, and its <img src="https://latex.codecogs.com/png.latex?s">-derivative into <img src="https://latex.codecogs.com/png.latex?6u_o%5C,u(1-u)">. So (c) and (d) are round-off on an identity: what they can detect is the root of eq. (7) and the transcription of eq. (4), not eq. (6)’s own coefficients. And <img src="https://latex.codecogs.com/png.latex?X(s%20=%202G/3-1)%20=%201"> holds for <strong>every</strong> root of eq. (7): with <img src="https://latex.codecogs.com/png.latex?(1+s)%20=%202G/3"> and <img src="https://latex.codecogs.com/png.latex?(G-1-s)%20=%20G/3"> the bracket of eq. (6) is <img src="https://latex.codecogs.com/png.latex?(4G%5E3/27)/(G-1)%20-%201">, which eq. (7) turns into <img src="https://latex.codecogs.com/png.latex?1/%5Cepsilon%20-%201">. That check tests the joint transcription of (6) and (7), not the root; its break row misreads eq. (7) itself.</p>
<div id="18f551cf" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:53.840191Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:53.840059Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.188344Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.187299Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1">PSI_XM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_VC"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hashimoto_psi_CS"</span>])</span>
<span id="cb23-2"></span>
<span id="cb23-3"></span>
<span id="cb23-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> xm_two_routes(psi_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb23-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(a): eq. (33) against the root of dS/dX on (31)."""</span></span>
<span id="cb23-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> X: dSS0_dX(X, pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> psi_scale), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XM_eq33(pv, denom))</span>
<span id="cb23-7">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> XM_eq33(pv, denom) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_XM)</span>
<span id="cb23-8"></span>
<span id="cb23-9"></span>
<span id="cb23-10">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_two_routes_rel"</span>, xm_two_routes(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb23-11">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root tolerance 1e-15 on X_M"</span>)</span>
<span id="cb23-12">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (33) as (2-psi)/psi (XM_eq33(..., denom=1))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_two_routes_rel"</span>, xm_two_routes(denom<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb23-13">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi 1 % adrift in the root route only"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XM_two_routes_rel"</span>, xm_two_routes(psi_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>))</span>
<span id="cb23-14"></span>
<span id="cb23-15">PSI_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> SIG_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)</span>
<span id="cb23-16"></span>
<span id="cb23-17"></span>
<span id="cb23-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> tau_half_scalar(pv, sg, how<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>):</span>
<span id="cb23-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""tau_1/2 from eq. (32) by one scalar root, or read off a 200-point sweep (a defect)."""</span></span>
<span id="cb23-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> how <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root"</span>:</span>
<span id="cb23-21">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: X_of_tau(z, pv, sg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>), n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-17</span>)</span>
<span id="cb23-22">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb23-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> g[np.argmin(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_of_tau(g, pv, sg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>))]</span>
<span id="cb23-24"></span>
<span id="cb23-25"></span>
<span id="cb23-26">TB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {(pv, sg): <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, [pv], sg)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_B <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_B}</span>
<span id="cb23-27">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_block_vs_scipy_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TB[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau_half_scalar(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>k)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TB), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>,</span>
<span id="cb23-28">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton tol 1e-13 on w and root tolerance 1e-17 on tau"</span>)</span>
<span id="cb23-29">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_1/2 read off a 200-point sweep (tau_half_scalar(..., how='sweep'))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_block_vs_scipy_rel"</span>,</span>
<span id="cb23-30">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TB[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau_half_scalar(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>k, how<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep"</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TB))</span>
<span id="cb23-31"></span>
<span id="cb23-32"></span>
<span id="cb23-33"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> tau_half_closed(pv, ln2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)):</span>
<span id="cb23-34">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""sigma -&gt; infinity: psi tau^2/4 + tau = ln 2."""</span></span>
<span id="cb23-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ln2 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ln2)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pv</span>
<span id="cb23-36"></span>
<span id="cb23-37"></span>
<span id="cb23-38">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_closed_vs_block_rel"</span>,</span>
<span id="cb23-39">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, [pv], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau_half_closed(pv)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tau_half_closed(pv) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_B),</span>
<span id="cb23-40">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the block runs at sigma = 1e9; the gap is about 3 tau/sigma"</span>)</span>
<span id="cb23-41">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the closed form with 2 ln 2 for ln 2 (tau_half_closed(..., ln2=2*log(2)))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_closed_vs_block_rel"</span>,</span>
<span id="cb23-42">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, [pv], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau_half_closed(pv, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tau_half_closed(pv)</span>
<span id="cb23-43">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_B))</span>
<span id="cb23-44"></span>
<span id="cb23-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the direct residual X(tau) - X* from the same start</span></span>
<span id="cb23-46">_fail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb23-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_B:</span>
<span id="cb23-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_B:</span>
<span id="cb23-49">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb23-50">            tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, [pv], sg, residual<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"direct"</span>)</span>
<span id="cb23-51">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> NewtonBreakdown:   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># newton raises it on an exactly singular Jacobian (status 5)</span></span>
<span id="cb23-52">            _fail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb23-53">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"direct_residual_failures"</span>, _fail,</span>
<span id="cb23-54">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton on X(tau) - 1/2 from tau = sigma/2 over the 20 (psi, sigma) states"</span>)</span>
<span id="cb23-55">_fail_log <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_B <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_B <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(TB[(pv, sg)]))</span>
<span id="cb23-56">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the log residual in place of the direct one (tau_at_X_block(..., residual='log'))"</span>,</span>
<span id="cb23-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"direct_residual_failures"</span>, _fail_log)</span>
<span id="cb23-58">_flat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb23-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"direct residual: newton stops on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_fail<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TB)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (psi, sigma) states. From tau = sigma/2 at"</span>)</span>
<span id="cb23-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sigma = 100 the term (1 - tau/sigma)^3 exp(-tau(1 + psi tau/4)) is below the round-off of 1 even at"</span>)</span>
<span id="cb23-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"psi = 0 (the residual is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_flat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.17g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, flat to the last bit) and underflows to 0 at psi = 100, so the"</span>)</span>
<span id="cb23-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"differenced Jacobian is exactly singular; the log form has no exponential to lose."</span>)</span>
<span id="cb23-63"></span>
<span id="cb23-64">E_F4, E_F7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig4_eps_o"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig7_eps_o"</span>]</span>
<span id="cb23-65">X_SS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>)</span>
<span id="cb23-66">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_SS_two_routes"</span>,</span>
<span id="cb23-67">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SS0_pet_via_eq6(x, E_F4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SS0_petersen(np.array([x]), E_F4)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X_SS),</span>
<span id="cb23-68">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (6) differentiated is u(1 - u) once G = 3/(2 u_o)"</span>)</span>
<span id="cb23-69">G_WRONG_F4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cubic7_roots(E_F4)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-70">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the middle root of eq. (7) in the d(eq. 6)/ds route (SS0_pet_via_eq6(..., G=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_WRONG_F4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">))"</span>,</span>
<span id="cb23-71">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_SS_two_routes"</span>,</span>
<span id="cb23-72">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SS0_pet_via_eq6(x, E_F4, G_WRONG_F4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SS0_petersen(np.array([x]), E_F4)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X_SS))</span>
<span id="cb23-73">G_F7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> G_of_eps(E_F7)</span>
<span id="cb23-74">sgrid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> G_F7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">97</span>)</span>
<span id="cb23-75">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_X_two_routes"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_petersen(sgrid, E_F7) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_pet_via_eps(sgrid, E_F7)))),</span>
<span id="cb23-76">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (6) is the porosity route once G = 3/(2 u_o)"</span>)</span>
<span id="cb23-77">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the middle root of eq. (7) (X_petersen(..., G=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_WRONG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_X_two_routes"</span>,</span>
<span id="cb23-78">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_petersen(sgrid, E_F7, G_WRONG) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_pet_via_eps(sgrid, E_F7)))))</span>
<span id="cb23-79"></span>
<span id="cb23-80"></span>
<span id="cb23-81"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> endpoint_dev(coef<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>):</span>
<span id="cb23-82">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""|X(s = 2G/3 - 1) - 1| with G the largest root of eq. (7) read with ``coef``."""</span></span>
<span id="cb23-83">    G <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cubic7_roots(E_F7, coef)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-84">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_petersen(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> G <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, E_F7, G) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb23-85"></span>
<span id="cb23-86"></span>
<span id="cb23-87">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_X_endpoint_dev"</span>, endpoint_dev(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb23-88">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X = 1 at s = 2G/3 - 1 for every root of eq. (7)"</span>)</span>
<span id="cb23-89">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (7)'s 4/27 read as 2/27 (cubic7_roots(..., coef=2/27))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"petersen_X_endpoint_dev"</span>, endpoint_dev(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27</span>))</span>
<span id="cb23-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   the middle root leaves the endpoint at round-off: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X_petersen(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G_WRONG<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, E_F7, G_WRONG)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-91">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (not a break row; it is the identity)"</span>)</span>
<span id="cb23-92"></span>
<span id="cb23-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (e) the integral I</span></span>
<span id="cb23-94">CASES_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.49</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>))</span>
<span id="cb23-95">mpmath.mp.dps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span></span>
<span id="cb23-96"></span>
<span id="cb23-97"></span>
<span id="cb23-98"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> I_40digit(pv, m_):</span>
<span id="cb23-99">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""I by mpmath quadrature at 40 digits, as a float."""</span></span>
<span id="cb23-100">    p_, m__ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mpmath.mpf(pv), mpmath.mpf(m_)</span>
<span id="cb23-101">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: (w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> mpmath.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> mpmath.log(w)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>m__)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb23-102">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> mpmath.quad(f, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, mpmath.mpf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1e-6"</span>), mpmath.mpf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.01"</span>), mpmath.mpf(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-103"></span>
<span id="cb23-104"></span>
<span id="cb23-105">I40 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: I_40digit(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_I}</span>
<span id="cb23-106"></span>
<span id="cb23-107"></span>
<span id="cb23-108"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rel_to_40(fun):</span>
<span id="cb23-109">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mpmath.mpf(fun(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> I40[c]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I40[c]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_I)</span>
<span id="cb23-110"></span>
<span id="cb23-111"></span>
<span id="cb23-112">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_two_routes_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I_gl(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_I), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>,</span>
<span id="cb23-113">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"set by the cancellation in the closed form, see I_closed_vs_40digit_rel"</span>)</span>
<span id="cb23-114">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_closed_vs_40digit_rel"</span>, rel_to_40(I_closed), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb23-115">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I is 1e-4 to 1e-1 of its terms, so the closed form loses that many digits to cancellation"</span>)</span>
<span id="cb23-116">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_gl400_vs_40digit_rel"</span>, rel_to_40(I_gl), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb23-117">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"400-point Gauss-Legendre on a smooth integrand, at round-off"</span>)</span>
<span id="cb23-118">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the (1-X)^1 factor dropped in the quadrature (I_gl(..., p=0))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_two_routes_rel"</span>,</span>
<span id="cb23-119">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I_gl(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_I))</span>
<span id="cb23-120">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature reduced to 25 nodes (I_gl(..., n=25))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_two_routes_rel"</span>,</span>
<span id="cb23-121">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I_gl(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_I))</span>
<span id="cb23-122">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the (1-X)^1 factor dropped in the closed form (I_closed(..., p=0))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_closed_vs_40digit_rel"</span>,</span>
<span id="cb23-123">    rel_to_40(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pv, m_: I_closed(pv, m_, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)))</span>
<span id="cb23-124">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature reduced to 25 nodes (I_gl(..., n=25))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"I_gl400_vs_40digit_rel"</span>,</span>
<span id="cb23-125">    rel_to_40(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pv, m_: I_gl(pv, m_, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>)))</span>
<span id="cb23-126"></span>
<span id="cb23-127"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(a) X_M, eq. (33) against the root of dS/dX:                 below 1e-12 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'XM_two_routes_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-128"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(b) tau_1/2, pymrm block against a scalar root, 20 states:  below 1e-12 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tau_block_vs_scipy_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-129"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    tau_1/2, block at sigma = 1e9 against the closed form:  below 1e-8 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tau_closed_vs_block_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-130"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(c) Petersen S/S_o, eq. (3) against d(eq. 6)/ds:            below 1e-14 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'petersen_SS_two_routes'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-131"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(d) Petersen X, eq. (6) against the porosity route:         below 1e-14 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'petersen_X_two_routes'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-132"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    eq. (6) at s = 2G/3 - 1 against X = 1:                  below 1e-14 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'petersen_X_endpoint_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-133"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(e) I, closed form against Gauss-Legendre (400 points):     below 1e-10 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I_two_routes_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-134"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    closed form against 40 digits:                          below 1e-10 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I_closed_vs_40digit_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-135"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    Gauss-Legendre (400 points) against 40 digits:          below 1e-13 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'I_gl400_vs_40digit_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>direct residual: newton stops on 13 of the 20 (psi, sigma) states. From tau = sigma/2 at
sigma = 100 the term (1 - tau/sigma)^3 exp(-tau(1 + psi tau/4)) is below the round-off of 1 even at
psi = 0 (the residual is 0.5, flat to the last bit) and underflows to 0 at psi = 100, so the
differenced Jacobian is exactly singular; the log form has no exponential to lose.
   the middle root leaves the endpoint at round-off: 1.6e-15 (not a break row; it is the identity)
(a) X_M, eq. (33) against the root of dS/dX:                 below 1e-12 (here 1.3e-15)
(b) tau_1/2, pymrm block against a scalar root, 20 states:  below 1e-12 (here 5.8e-16)
    tau_1/2, block at sigma = 1e9 against the closed form:  below 1e-8 (here 3.0e-09)
(c) Petersen S/S_o, eq. (3) against d(eq. 6)/ds:            below 1e-14 (here 4.4e-16)
(d) Petersen X, eq. (6) against the porosity route:         below 1e-14 (here 1.7e-15)
    eq. (6) at s = 2G/3 - 1 against X = 1:                  below 1e-14 (here 2.2e-16)
(e) I, closed form against Gauss-Legendre (400 points):     below 1e-10 (here 7.6e-12)
    closed form against 40 digits:                          below 1e-10 (here 7.6e-12)
    Gauss-Legendre (400 points) against 40 digits:          below 1e-13 (here 8.5e-15)</code></pre>
</div>
</div>
</section>
<section id="the-quadrature-axis-refined" class="level3">
<h3 class="anchored" data-anchor-id="the-quadrature-axis-refined">The quadrature axis, refined</h3>
<p><img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar"> is a root of a quadrature-based derivative, so the node count is an axis that would otherwise be invisible. Gauss-Legendre on this smooth integrand converges exponentially, not at an algebraic order, and the table shows where it stops: against the 40-digit <img src="https://latex.codecogs.com/png.latex?I"> it reaches round-off, while against the closed form it stops at the closed form’s own cancellation error.</p>
<div id="981e455b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:54.190457Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:54.190295Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.212376Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.211949Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nodes'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max rel err vs 40 digits'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;27}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'vs closed form'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;17}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m*(1) - m*(1; 600 nodes)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;27}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>):</span>
<span id="cb25-3">    e40 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rel_to_40(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pv, m_: I_gl(pv, m_, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n))</span>
<span id="cb25-4">    ecl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I_gl(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> I_closed(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_I)</span>
<span id="cb25-5">    dm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(n, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M1 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan</span>
<span id="cb25-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}{</span>e40<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:27.3e}{</span>ecl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:17.3e}{</span>dm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:27.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-7">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mstar_node_sensitivity"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M1), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb25-8">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m*(1) with 50 quadrature nodes in dI/dm against 600"</span>)</span>
<span id="cb25-9">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature reduced to 25 nodes in dI/dm (m_star(..., n=25))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mstar_node_sensitivity"</span>,</span>
<span id="cb25-10">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_star(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M1))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> nodes   max rel err vs 40 digits   vs closed form   m*(1) - m*(1; 600 nodes)
    25                  1.062e-03        1.062e-03                        nan
    50                  8.663e-08        8.663e-08                  1.394e-09
   100                  3.018e-14        7.571e-12                  2.477e-13
   200                  1.060e-14        7.604e-12                  2.568e-13
   400                  8.536e-15        7.605e-12                  1.713e-13</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="15">
<pre><code>True</code></pre>
</div>
</div>
</section>
<section id="the-printed-claims-about-particle-size-measured" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-claims-about-particle-size-measured">The printed claims about particle size, measured</h3>
<p>Two prose claims about Figure 2, each on the <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> labels of Figure 2’s curves and each from the pymrm block inversion. At fixed <img src="https://latex.codecogs.com/png.latex?%5Ctau">, eq. (32)’s <img src="https://latex.codecogs.com/png.latex?X"> rises with <img src="https://latex.codecogs.com/png.latex?%5Cpsi">, so <img src="https://latex.codecogs.com/png.latex?%5Ctau_%7B1/2%7D"> falls with <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> and the spread across a <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> window sits on its endpoints.</p>
<div id="dd535ce7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:54.215154Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:54.215025Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.521159Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.520485Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1">PSI_FIG2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_small_psi_max"</span>]])</span>
<span id="cb28-2">sig_grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">61</span>)</span>
<span id="cb28-3">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6</span>))</span>
<span id="cb28-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_FIG2:</span>
<span id="cb28-5">    ax.semilogx(sig_grid, tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, np.full(sig_grid.size, pv), sig_grid), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fr"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-6">ax.axvline(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_plateau"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb28-7">ax.axvline(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_small"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb28-8">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"particle size parameter </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma = R_o S_o/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1-</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">epsilon_o</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"time to 50 % conversion, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au_{1/2}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb28-9">       title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the construction of Fig. 2 (dotted: the two printed thresholds)"</span>)</span>
<span id="cb28-10">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb28-11"></span>
<span id="cb28-12"></span>
<span id="cb28-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread(sg):</span>
<span id="cb28-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Relative spread of tau_1/2 across the Fig. 2 psi labels at sigma = sg."""</span></span>
<span id="cb28-15">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, PSI_FIG2, sg)</span>
<span id="cb28-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb28-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb28-18"></span>
<span id="cb28-19"></span>
<span id="cb28-20">t100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, PSI_FIG2, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_plateau"</span>])</span>
<span id="cb28-21">tinf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([tau_half_closed(pv) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PSI_FIG2])</span>
<span id="cb28-22">rel100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tinf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tinf</span>
<span id="cb28-23">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma100_max_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rel100.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb28-24">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma025_psi_spread"</span>, spread(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_small"</span>]), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb28-25">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma1_psi_spread"</span>, spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb28-26">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the (1 - tau/sigma)^3 factor dropped at sigma = 100 (tau_at_X_block(..., 1e12))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma100_max_rel"</span>,</span>
<span id="cb28-27">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(tau_at_X_block(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, PSI_FIG2, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tinf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tinf)))</span>
<span id="cb28-28">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma read as 1 instead of 0.25"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma025_psi_spread"</span>, spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb28-29">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma read as 0.25 instead of 1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma1_psi_spread"</span>, spread(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_small"</span>]))</span>
<span id="cb28-30">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb28-31"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Printed: "no further significant change occurs for </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ge 100</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> At </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 100,</span></span>
<span id="cb28-32"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> differs from its </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">o</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">infty</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> value by at most</span></span>
<span id="cb28-33"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sigma100_max_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % over these </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PSI_FIG2[rel100.argmax()]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; only</span></span>
<span id="cb28-34"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rel100[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 100</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb28-35"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Printed: "For small enough particles </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma &lt; 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">25</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, the reaction time is</span></span>
<span id="cb28-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">independent of internal structure for </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le 100</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> At </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">25 it spreads</span></span>
<span id="cb28-37"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sigma025_psi_spread'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % across that window, against</span></span>
<span id="cb28-38"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sigma1_psi_spread'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1: the printed threshold is doing</span></span>
<span id="cb28-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">real work</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb28-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-17-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Printed: “no further significant change occurs for <img src="https://latex.codecogs.com/png.latex?%5Csigma%20%5Cge%20100">.”</strong> At <img src="https://latex.codecogs.com/png.latex?%5Csigma"> = 100, <img src="https://latex.codecogs.com/png.latex?%5Ctau_%7B1/2%7D"> differs from its <img src="https://latex.codecogs.com/png.latex?%5Csigma%5Cto%5Cinfty"> value by at most 2.92 % over these <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> (at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 0; only 0.36 % at <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> = 100). <strong>Printed: “For small enough particles (<img src="https://latex.codecogs.com/png.latex?%5Csigma%20%3C%200.25">), the reaction time is independent of internal structure for <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20%5Cle%20100">.”</strong> At <img src="https://latex.codecogs.com/png.latex?%5Csigma"> = 0.25 it spreads 7.16 % across that window, against 57.7 % at <img src="https://latex.codecogs.com/png.latex?%5Csigma"> = 1: the printed threshold is doing real work.</p>
</div>
</div>
</section>
<section id="the-reduction-to-the-published-b3.1" class="level3">
<h3 class="anchored" data-anchor-id="the-reduction-to-the-published-b3.1">The reduction to the published <code>B3.1</code></h3>
<p>The abstract’s first special case is the grain model, and its integrated form at <img src="https://latex.codecogs.com/png.latex?m%20=%202/3"> is eq. (40), <img src="https://latex.codecogs.com/png.latex?X%20=%201-(1-%5Ctau/3)%5E3">: the reaction-control shrinking core, the published <code>B3.1</code>’s Yagi-Kunii eq. (6) in its <img src="https://latex.codecogs.com/png.latex?%5Comega%5Cto0"> limit, transcribed there from a 1955 Combustion Symposium scan.</p>
<p><strong>Reading <code>B3.1</code> before using it</strong> (it has no <code>data/</code> directory, so what travels is its findings):</p>
<ul>
<li><code>B3.1</code> verifies its eq. (6) against an independent integration of eq. (5)’s three resistances, so the transcription used here is established there.</li>
<li><code>B3.1</code> states its reaction-control limit at <img src="https://latex.codecogs.com/png.latex?%5Comega%20=%2010%5E%7B-9%7D">, not at <img src="https://latex.codecogs.com/png.latex?%5Comega%20=%200">. Its committed claim <code>eq6_to_reaction_limit</code> is loaded below and reproduced on <code>B3.1</code>’s own grid (<img src="https://latex.codecogs.com/png.latex?x%20=%20r/R"> at 400 points) before the exact limit is taken.</li>
<li><strong>What this identity cannot see.</strong> At <img src="https://latex.codecogs.com/png.latex?%5Comega%20=%200"> every <img src="https://latex.codecogs.com/png.latex?%5Comega"> term of eq. (6) drops out, so it is blind to all three <img src="https://latex.codecogs.com/png.latex?%5Comega"> coefficients; the numerator is <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20x"> and the denominator <img src="https://latex.codecogs.com/png.latex?%5Cgamma">, so <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> cancels and its value is invisible too; and because <img src="https://latex.codecogs.com/png.latex?x%20=%20(1-X)%5E%7B1/3%7D"> and eq. (40)’s inversion are the same expression, a consistent slip in that exponent would cancel as well. What the identity sees is the ratio of the two <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> coefficients and the exponent on <img src="https://latex.codecogs.com/png.latex?x">, and each has a break row.</li>
<li><code>B3.1</code>’s caveat that its absolute burnout times cannot be reconstructed does not touch this page: everything here is in <img src="https://latex.codecogs.com/png.latex?%5Ctau">.</li>
</ul>
<div id="ec173167" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:54.523709Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:54.523523Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.641297Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.640515Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1">Xid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb29-2">tau_over_3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xid)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (40), inverted</span></span>
<span id="cb29-3">GAMMAS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>)</span>
<span id="cb29-4"></span>
<span id="cb29-5"></span>
<span id="cb29-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> b31_identity(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb29-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max |eq. (6) at omega = 0 - eq. (40)| over the gamma values (gamma cancels)."""</span></span>
<span id="cb29-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(yagi_kunii_eq6((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xid)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, g, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tau_over_3))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GAMMAS)</span>
<span id="cb29-9"></span>
<span id="cb29-10"></span>
<span id="cb29-11">x_b31 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># B3.1's grid of r/R</span></span>
<span id="cb29-12"></span>
<span id="cb29-13"></span>
<span id="cb29-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> b31_reaction_limit(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb29-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""B3.1's eq6_to_reaction_limit, recomputed: max |eq. (6)(omega = 1e-9, gamma = 1) - (1 - x)|."""</span></span>
<span id="cb29-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(yagi_kunii_eq6(x_b31, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x_b31))))</span>
<span id="cb29-17"></span>
<span id="cb29-18"></span>
<span id="cb29-19">B31_COMMITTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B3.1-shrinking-core"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_to_reaction_limit"</span>]</span>
<span id="cb29-20">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b31_eq40_identity"</span>, b31_identity(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb29-21">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (6) at omega = 0 is 1 - x for every gamma"</span>)</span>
<span id="cb29-22">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b31_published_reconcile"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b31_reaction_limit() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> B31_COMMITTED) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> B31_COMMITTED, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>,</span>
<span id="cb29-23">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"round-off of a 4e-10 difference evaluated by two codes, eps/4e-10 = 6e-7"</span>)</span>
<span id="cb29-24">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B3.1's eq. (6) numerator: gamma x read as gamma x^2 (yagi_kunii_eq6(..., x_power=2))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b31_eq40_identity"</span>,</span>
<span id="cb29-25">    b31_identity(x_power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb29-26">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B3.1's eq. (6): the numerator's gamma coefficient doubled (yagi_kunii_eq6(..., gamma_coef=2))"</span>,</span>
<span id="cb29-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b31_eq40_identity"</span>, b31_identity(gamma_coef<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb29-28">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B3.1's eq. (6) numerator: gamma x read as gamma x^2 (yagi_kunii_eq6(..., x_power=2))"</span>,</span>
<span id="cb29-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b31_published_reconcile"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b31_reaction_limit(x_power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> B31_COMMITTED) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> B31_COMMITTED)</span>
<span id="cb29-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bhatia eq. (40) against Yagi-Kunii eq. (6) at omega = 0, over gamma from 1e-6 to 1e12:"</span>)</span>
<span id="cb29-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |diff| below 1e-15 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'b31_eq40_identity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); the gamma range cannot fail, gamma cancels."</span>)</span>
<span id="cb29-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"B3.1's committed eq6_to_reaction_limit = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B31_COMMITTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; recomputed here on B3.1's grid "</span></span>
<span id="cb29-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b31_reaction_limit()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb29-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   relative difference below 1e-5 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'b31_published_reconcile'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): the 3.85e-10 is B3.1's "</span></span>
<span id="cb29-35">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"omega = 1e-9, not a transcription difference."</span>)</span>
<span id="cb29-36"></span>
<span id="cb29-37">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3</span>))</span>
<span id="cb29-38">ax.plot(Xid, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau_over_3, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"Bhatia eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">40</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au = 3</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[1-(1-X)^{1/3}]</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-39">ax.plot(Xid[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> yagi_kunii_eq6((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xid[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"B3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1 eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">omega</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">o0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-40">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion $X$"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb29-41">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Bhatia eq. (40) against Yagi-Kunii eq. (6) at omega = 0, over gamma from 1e-6 to 1e12:
   max |diff| below 1e-15 (here 1.1e-16); the gamma range cannot fail, gamma cancels.
B3.1's committed eq6_to_reaction_limit = 3.848988e-10; recomputed here on B3.1's grid 3.848987e-10,
   relative difference below 1e-5 (here 2.9e-07): the 3.85e-10 is B3.1's omega = 1e-9, not a transcription difference.</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/index_files/figure-html/cell-18-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-reference-table" class="level3">
<h3 class="anchored" data-anchor-id="the-reference-table">The reference table</h3>
<p><code>random-pore-reference.csv</code> holds the page’s evaluation of eqs. (31)-(33), <img src="https://latex.codecogs.com/png.latex?m%5E%5Cstar"> and <img src="https://latex.codecogs.com/png.latex?%5Ctau_%7B1/2%7D"> on a grid of <img src="https://latex.codecogs.com/png.latex?(%5Cpsi,%20%5Ctau)">, printed to 12 significant figures, so that an independent implementation can be tested against it. These are model evaluations, not data. Every row is recomputed here.</p>
<div id="62a775b7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:54.643202Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:54.643024Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.652152Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.651374Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1">ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"random-pore-reference.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb31-2"></span>
<span id="cb31-3"></span>
<span id="cb31-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ref_rows(quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>):</span>
<span id="cb31-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The reference table's columns, recomputed."""</span></span>
<span id="cb31-6">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb31-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pv, tv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(ref.psi, ref.tau):</span>
<span id="cb31-8">        Xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(X_of_tau(tv, pv, quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>quarter))</span>
<span id="cb31-9">        out.append([Xv, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SS0_of_X(Xv, pv)), XM_eq33(pv) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan, m_star(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pv)),</span>
<span id="cb31-10">                    tau_half_closed(pv)])</span>
<span id="cb31-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array(out)</span>
<span id="cb31-12"></span>
<span id="cb31-13"></span>
<span id="cb31-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ref_dev(arr):</span>
<span id="cb31-15">    tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ref[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_over_So"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_M"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_star"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau_half_sigma_inf"</span>]].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb31-16">    ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.isfinite(tab)</span>
<span id="cb31-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.array_equal(ok, np.isfinite(arr))</span>
<span id="cb31-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(arr[ok] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tab[ok]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.maximum(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(tab[ok]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)))</span>
<span id="cb31-19"></span>
<span id="cb31-20"></span>
<span id="cb31-21">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reference_csv_max_rel"</span>, ref_dev(ref_rows()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb31-22">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the table is printed to 12 significant figures"</span>)</span>
<span id="cb31-23">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (32) with psi tau/2 for psi tau/4 (X_of_tau(..., quarter=2))"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reference_csv_max_rel"</span>,</span>
<span id="cb31-24">    ref_dev(ref_rows(quarter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))</span>
<span id="cb31-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ref)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ref<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> columns; largest relative deviation below 1e-11 "</span></span>
<span id="cb31-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reference_csv_max_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>25 rows of 7 columns; largest relative deviation below 1e-11 (here 4.6e-12)</code></pre>
</div>
</div>
</section>
<section id="the-break-table" class="level3">
<h3 class="anchored" data-anchor-id="the-break-table">The break table</h3>
<p>Every number above is registered as a claim; each row injects one defect through an argument or a parameter and reports what the claim becomes, and whether the claim’s own check catches it. Three candidate defects were tried and cannot be rows, each for a measured reason printed under the table.</p>
<div id="d15b7898" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:54.654194Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:54.654066Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.662230Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.661441Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb33-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'injected defect'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;96}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'claim'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;30}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'clean'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'broken'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  caught"</span>)</span>
<span id="cb33-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> row, metric, clean, broken, caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb33-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.metrics[metric][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>:</span>
<span id="cb33-4">        shown <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>clean<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb33-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb33-6">        shown <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(clean)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.5g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb33-7">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>row[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;96}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>metric[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;30}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>shown<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(broken)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.5g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'yes'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> caught <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'NO'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-8">_caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, m, _, _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c}</span>
<span id="cb33-9">_open <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> claims.metrics[k].get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb33-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_caught)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims are failed by at least one row; "</span></span>
<span id="cb33-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.metrics[k].get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'structural'</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb33-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"open: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_open) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that do not fail their claim: "</span></span>
<span id="cb33-14">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, m, _, _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> c) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>))</span>
<span id="cb33-15"></span>
<span id="cb33-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># candidate rows that cannot exist, each with its measured witness</span></span>
<span id="cb33-17">_flip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w_, pv: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> f: (f(w_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(w_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-9</span>)(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(z)))</span>
<span id="cb33-18">FLIP_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)</span>
<span id="cb33-19">_inv35 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> e0: GHAT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> e0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> e0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> EPS_F))</span>
<span id="cb33-20">_half20 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: overlap_gap(z, avrami<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]</span>
<span id="cb33-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Candidate rows that cannot exist:"</span>)</span>
<span id="cb33-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 1. eq. (31)'s radical sign flipped: (1-X) sqrt(1 + psi ln(1-X)) is real only for w &gt; exp(-1/psi) = "</span></span>
<span id="cb33-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FLIP_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at psi = 5,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    and increasing there (dS/dw = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_flip(FLIP_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and "</span></span>
<span id="cb33-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_flip(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at its ends): no maximum, so XM_two_routes_rel has nothing to compare."</span>)</span>
<span id="cb33-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 2. eq. (35)'s log argument inverted: the residual is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_inv35(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at eps_o -&gt; 0 and "</span></span>
<span id="cb33-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_inv35(EPS_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at eps_o -&gt; eps,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    the same sign: no root in (0, eps)."</span>)</span>
<span id="cb33-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 3. eq. (20)'s exponent halved: Avrami's law then stays below Petersen's for every u &gt; 0 "</span></span>
<span id="cb33-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_half20)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sign changes on (0, 1];</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    the gap is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(overlap_gap(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, avrami<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at u = 1), "</span></span>
<span id="cb33-29">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"so overlap_cross_u has no crossing."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>injected defect                                                                                  claim                                clean      broken  caught
eq. (33) as (2-psi)/psi (XM_eq33(..., denom=1))                                                  XM_sup_vs_printed_rel            0.0011943     0.60845  yes
eq. (33) as (2-psi)/psi (XM_eq33(..., denom=1))                                                  XM_exceeds_printed_psi              1292.8      3.9938  yes
psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))                                  psi_fig4_vs_printed_rel          0.0069348     0.34198  yes
psi with 2 pi for 4 pi (psi_of(..., coef=2*pi))                                                  psi_fig4_vs_printed_rel          0.0069348     0.50347  yes
eq. (3): the root above the surface maximum (petersen_audit(..., root='upper'))                  petersen_eps_rel_fig4set         0.0074286      1.8387  yes
eq. (3): the root above the surface maximum (petersen_audit(..., root='upper'))                  petersen_eps_rel_fig7AB           0.025173      1.3585  yes
eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (petersen_audit(..., c=1/3))                            petersen_eps_rel_fig4set         0.0074286     0.15246  yes
eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (petersen_audit(..., c=1/3))                            petersen_S_rel_fig4set           0.0021457    0.038702  yes
curve C's L_o read as 3.14e7 (one decade out)                                                    curveC_So_over_Smax                 4.5956      1.4532  yes
curve D's S_o read as curves A and B's                                                           curveD_L_over_LAB                   24.672     0.98688  yes
curve D's length perturbed 1 %                                                                   curveD_roundtrip_rel           (here 1.1e-15)   0.0083902  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_max_dX_upto_75               0.021759      36.375  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_X_at_two_points               0.74232   0.0017494  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_early_cross_X                 0.02318         nan  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_second_cross_X                0.62574         nan  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_lead_max                     0.011357         nan  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_trail_max                    0.062665         nan  yes
the middle root of eq. (7), G = 1.0517 (Fig7(..., G=...))                                        fig7_rate0_excess                0.0066275     -11.388  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_max_dX_upto_75               0.021759     0.12155  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_X_at_two_points               0.74232     0.15934  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_early_cross_X                 0.02318   0.0047735  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_second_cross_X                0.62574     0.97847  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_lead_max                     0.011357     0.12155  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_trail_max                    0.062665   0.0097459  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_X_part_eps_S                  0.75988     0.15479  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_max_dX_eps_S                 0.017652     0.12522  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_X_part_S_L                    0.76874     0.14913  yes
eq. (32) with psi tau/2 for psi tau/4 (Fig7(..., quarter=2))                                     fig7_max_dX_S_L                   0.016507     0.12781  yes
psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))                                  surf_dev_f4_25                    0.045402     0.14836  yes
psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))                                  surf_dev_f4_75                    -0.21656    -0.10441  yes
psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))                                  surf_dev_AB_25                    0.046951     0.16578  yes
psi with (1 - eps_o) dropped (psi_of(..., keep_porosity=False))                                  surf_dev_AB_75                    -0.20996   -0.075815  yes
eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (overlap_gap(..., c=1))                                 overlap_cross_u                    0.65081     0.23462  yes
eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (overlap_gap(..., c=1))                                 overlap_max_gap                   0.030118   0.0012653  yes
eq. (4) read as (1 - (r/3) sqrt(pi L/3)) (overlap_gap(..., c=1))                                 overlap_lead_rel               (here 0.0005)     0.57415  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             m_star_psi0                              1 -8.8331e-15  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             m_star_psi1                        0.66389    -0.20587  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             m_star_psi2                        0.49052    -0.26421  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             m_star_psi1_vs_two_thirds_rel    0.0041724      1.3088  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             m_star_two_routes              (here 3.2e-13)     0.94415  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             nrms_best_psi2                     0.07994     0.23012  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             nrms_best_psi5                     0.19946     0.39978  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             nrms_best_psi10                    0.32309     0.52541  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             nrms_m0_psi2                       0.56384     0.47911  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             nrms_8pct_psi                       2.0013     0.66709  yes
I truncated to X &lt;= 0.5 (psi_m_star_zero(X_max=0.5))                                             psi_m_star_zero                     16.805      3.3439  yes
I truncated to X &lt;= 0.5 (psi_m_star_zero(X_max=0.5))                                             nrms_at_psi_m_star_zero             0.4211     0.43548  yes
eq. (39)'s general form taken at m = 0.999 for the m = 1 branch                                  grain_branch_gap_at_m1         (here 3e-08)  5.3638e-05  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             nrms_m1_at_psi1                    0.17166     0.74922  yes
I with the (1-X)^1 factor dropped (m_star(..., p=0))                                             m1_penalty_at_psi1                  5.3361      6.0002  yes
the printed group 0.67 read as 0.68 (eps_o_opt_block(..., 0.68))                                 eq35_root_eps_o                   0.085288     0.12613  yes
the printed group 0.67 read as 0.68 (eps_o_opt_block(..., 0.68))                                 eq35_residual_at_printed         0.0042411     0.00687  yes
the printed group 0.67 read as 0.68 (eps_o_opt_block(..., 0.68))                                 eq35_second_root                   0.49467     0.46052  yes
the printed group 0.67 read as 0.68 (eps_o_opt_block(..., 0.68)) in the root route only          eq35_two_routes                (here 2.5e-08)    0.040839  yes
the printed group 0.67 read as 0.68 (eps_o_opt_block(..., 0.68)) in the root only                eq35_S_deficit_at_printed       2.7631e-05  -0.0001898  yes
the printed group 0.67 read as 0.66 (eps_o_opt_block(..., 0.66))                                 eq35_root_eps_o                   0.085288    0.050369  yes
the two chars' psi swapped (char_numbers(swap=True))                                             hashimoto_XM_VC                    0.29888     0.34754  yes
the two chars' psi swapped (char_numbers(swap=True))                                             hashimoto_XM_CS                    0.34754     0.29888  yes
the m2 -&gt; cm2 conversion dropped (char_numbers(to_cm2=1))                                        hashimoto_rbar_VC_nm               0.55741      5574.1  yes
the m2 -&gt; cm2 conversion dropped (char_numbers(to_cm2=1))                                        hashimoto_intercept_e12              27.04   2.704e-07  yes
eta read as 0.90 instead of 0.98                                                                 eta098_thiele_sphere               0.55571       1.322  yes
implicit Euler instead of Crank-Nicolson (march37(..., theta=1))                                 march_cn_vs_eq32_max            9.8055e-08  0.00031361  yes
implicit Euler instead of Crank-Nicolson (march37(..., theta=1))                                 march_observed_order              (here 2)     0.99764  yes
eq. (32) with psi tau/2 for psi tau/4 (X_of_tau(..., quarter=2))                                 march_cn_vs_eq32_max            9.8055e-08    0.054696  yes
eq. (32) with psi tau/2 for psi tau/4 (X_of_tau(..., quarter=2))                                 march_euler_vs_eq32_max         0.00031361    0.055009  yes
ladder ended at tau = 1e-4, where the differences reach round-off (march37(..., tau_end=1e-4))   march_finest_over_roundoff     (here 1.7e+06)     0.30435  yes
eq. (33) as (2-psi)/psi (XM_eq33(..., denom=1))                                                  XM_two_routes_rel              (here 1.3e-15)     0.45843  yes
psi 1 % adrift in the root route only                                                            XM_two_routes_rel              (here 1.3e-15)    0.018168  yes
tau_1/2 read off a 200-point sweep (tau_half_scalar(..., how='sweep'))                           tau_block_vs_scipy_rel         (here 5.8e-16)      2.4143  yes
the closed form with 2 ln 2 for ln 2 (tau_half_closed(..., ln2=2*log(2)))                        tau_closed_vs_block_rel        (here 3e-09)           1  yes
the log residual in place of the direct one (tau_at_X_block(..., residual='log'))                direct_residual_failures                13           0  yes
the middle root of eq. (7) in the d(eq. 6)/ds route (SS0_pet_via_eq6(..., G=1.0438))             petersen_SS_two_routes         (here 4.4e-16)      19.867  yes
the middle root of eq. (7) (X_petersen(..., G=1.0517))                                           petersen_X_two_routes          (here 1.7e-15)       108.3  yes
eq. (7)'s 4/27 read as 2/27 (cubic7_roots(..., coef=2/27))                                       petersen_X_endpoint_dev        (here 2.2e-16)      1.4286  yes
the (1-X)^1 factor dropped in the quadrature (I_gl(..., p=0))                                    I_two_routes_rel               (here 7.6e-12)       13437  yes
quadrature reduced to 25 nodes (I_gl(..., n=25))                                                 I_two_routes_rel               (here 7.6e-12)    0.001062  yes
the (1-X)^1 factor dropped in the closed form (I_closed(..., p=0))                               I_closed_vs_40digit_rel        (here 7.6e-12)       13437  yes
quadrature reduced to 25 nodes (I_gl(..., n=25))                                                 I_gl400_vs_40digit_rel         (here 8.5e-15)    0.001062  yes
quadrature reduced to 25 nodes in dI/dm (m_star(..., n=25))                                      mstar_node_sensitivity         (here 1.4e-09)  0.00085521  yes
the (1 - tau/sigma)^3 factor dropped at sigma = 100 (tau_at_X_block(..., 1e12))                  sigma100_max_rel                  0.029222  2.9998e-12  yes
sigma read as 1 instead of 0.25                                                                  sigma025_psi_spread               0.071578      0.5767  yes
sigma read as 0.25 instead of 1                                                                  sigma1_psi_spread                   0.5767    0.071578  yes
B3.1's eq. (6) numerator: gamma x read as gamma x^2 (yagi_kunii_eq6(..., x_power=2))             b31_eq40_identity              (here 1.1e-16)        0.25  yes
B3.1's eq. (6): the numerator's gamma coefficient doubled (yagi_kunii_eq6(..., gamma_coef=2))    b31_eq40_identity              (here 1.1e-16)           1  yes
B3.1's eq. (6) numerator: gamma x read as gamma x^2 (yagi_kunii_eq6(..., x_power=2))             b31_published_reconcile        (here 2.9e-07)  6.4952e+08  yes
eq. (32) with psi tau/2 for psi tau/4 (X_of_tau(..., quarter=2))                                 reference_csv_max_rel          (here 4.6e-12)     0.99519  yes

86 rows; 73 of 74 claims are failed by at least one row; structural: sym_zero_identity_count; open: none
rows that do not fail their claim: none

Candidate rows that cannot exist:
 1. eq. (31)'s radical sign flipped: (1-X) sqrt(1 + psi ln(1-X)) is real only for w &gt; exp(-1/psi) = 0.8187 at psi = 5,
    and increasing there (dS/dw = +1.012e+03 and +3.500e+00 at its ends): no maximum, so XM_two_routes_rel has nothing to compare.
 2. eq. (35)'s log argument inverted: the residual is -0.6867 at eps_o -&gt; 0 and -0.0429 at eps_o -&gt; eps,
    the same sign: no root in (0, eps).
 3. eq. (20)'s exponent halved: Avrami's law then stays below Petersen's for every u &gt; 0 (0 sign changes on (0, 1];
    the gap is -0.2231 at u = 1), so overlap_cross_u has no crossing.</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Nothing to the model, and the page says so.</strong> The random pore model is two closed forms, and most of this notebook would run without pymrm. What pymrm does here is narrow and real:</p>
<ol type="1">
<li><strong>Families of inversions as one Newton problem.</strong> Eq. (32) inverted for <img src="https://latex.codecogs.com/png.latex?%5Ctau"> across a block of <img src="https://latex.codecogs.com/png.latex?(%5Cpsi,%5Csigma)">, eq. (35) for <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_o">, and each implicit step of eq. (37) for all <img src="https://latex.codecogs.com/png.latex?%5Cpsi">, are one <code>newton</code> solve with <code>NumJac((K, 1))</code>: independent scalars, a diagonal Jacobian.</li>
<li><strong>A residual written so it can be solved.</strong> The direct residual of eq. (32) from the start <img src="https://latex.codecogs.com/png.latex?%5Ctau%20=%20%5Csigma/2"> stops <code>newton</code> on an exactly singular Jacobian (counted in the validation); the log form has no exponential to lose, and the sigmoid keeps <img src="https://latex.codecogs.com/png.latex?%5Ctau"> inside <img src="https://latex.codecogs.com/png.latex?(0,%5Csigma)">.</li>
<li><strong>The rate law marched</strong>, so that eqs. (37) and (32) check each other rather than being asserted equal, with the order from <code>pymrm.checks.observed_orders</code>.</li>
<li><strong>Every location is a root.</strong> <code>pymrm.checks.find_roots</code> scans for every sign change before refining, so the two crossings of Figure 7’s curves, the two roots of eq. (35) and the single minimiser of <img src="https://latex.codecogs.com/png.latex?I"> are counted, not assumed from a hand-chosen bracket.</li>
</ol>
<p>The one output useful beyond reproduction is not pymrm at all: the normalised misfit of the grain-shape-factor section, which turns “which grain shape factor fits this pore structure” into a curve with an error attached, and says what Figure 6 cannot: past <img src="https://latex.codecogs.com/png.latex?%5Cpsi%20=%202"> no order-of-reaction model fits well, because none can produce a rate maximum.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>Use this page for</strong> the random pore model itself: <code>X_of_tau</code> (eq. 32), <code>SS0_of_X</code> (eq. 31), <code>XM_eq33</code> and <code>psi_of</code> are the whole kinetic-control model, and <code>rate37</code> drops into any solid-conversion source term where the surface evolves. <code>m_star(psi)</code> gives the grain shape factor equivalent to a pore structure, and <code>I_nrms(psi, m)</code> says how badly that equivalence misfits: check it before adopting an order-of-reaction model for a porous solid. <code>u_of_eps</code>, <code>G_of_eps</code>, <code>X_petersen</code> and <code>SS0_petersen</code> are Petersen (1957) as this paper reprints it, with the root of eq. (7) selected by construction.</p>
<p><strong>The traps:</strong></p>
<ul>
<li><strong>Eq. (7) has three real roots and the paper does not say which.</strong> Only <img src="https://latex.codecogs.com/png.latex?G%20=%203/(2u_o)">, the largest, is consistent with eqs. (3), (4) and (6). The middle root puts complete gasification at a negative time and wrecks the Figure 7 comparison (the break table). It does <strong>not</strong> move the endpoint identity <img src="https://latex.codecogs.com/png.latex?X(s%20=%202G/3-1)%20=%201">, which holds for every root: that is not the check of a root selection.</li>
<li><strong><img src="https://latex.codecogs.com/png.latex?%5Cpsi"> carries <img src="https://latex.codecogs.com/png.latex?(1-%5Cepsilon_o)"> and eq. (32) carries <img src="https://latex.codecogs.com/png.latex?%5Cpsi%5Ctau/4"></strong>, not <img src="https://latex.codecogs.com/png.latex?%5Cpsi%5Ctau/2">; both have break rows.</li>
<li><strong>Eq. (3) is not monotone in <img src="https://latex.codecogs.com/png.latex?r_p">.</strong> It has two roots for any attainable <img src="https://latex.codecogs.com/png.latex?S"> (the physical one below <img src="https://latex.codecogs.com/png.latex?r_p%5Csqrt%7B%5Cpi%20L/3%7D%20=%201/2">) and none above <img src="https://latex.codecogs.com/png.latex?S_%7B%5Cmax%7D(L)">, which is Figure 7’s curve C.</li>
<li><strong>Eq. (32) cannot be inverted naively</strong>: from a start deep in the conversion the exponential vanishes against 1. Use the log residual.</li>
<li><strong><img src="https://latex.codecogs.com/png.latex?I"> in closed form loses digits to cancellation</strong> when the misfit is small; for a small misfit integrate it directly.</li>
</ul>
<p><strong>Do not use this page as evidence about any real solid.</strong> Its only experimental content is a figure it deliberately does not touch. The three char numbers are transcribed prose, and everything derived from them is a prediction of the model at those parameters. Anyone with the Hashimoto et al. (1979) tables can build the comparison this page leaves open. <strong>Do not extrapolate past kinetic control</strong>: Part II (not on disk) lifts it, and <code>B3.2</code> is the neighbouring page where intergrain diffusion matters.</p>
<p><strong>Related pages.</strong> <code>B3.1</code> (shrinking core), <code>B3.2</code> (grain model), <code>B3.4</code>, <code>B1.1</code> (porous catalyst pellet).</p>
<p><strong>Cite the source, not this page:</strong> Bhatia, S. K. and Perlmutter, D. D. (1980). A random pore model for fluid-solid reactions: I. Isothermal, kinetic control. <em>AIChE Journal</em> <strong>26</strong>(3), 379-386, <a href="https://doi.org/10.1002/aic.690260308">doi:10.1002/aic.690260308</a>. Petersen (1957), Szekely, Evans and Sohn (1976), Avrami (1940) and Hashimoto et al.&nbsp;(1979) are cited by the paper and were not consulted; every statement about “Petersen’s model” here is about the paper’s reprint of it.</p>
<div id="42f8f741" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T17:02:54.663854Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T17:02:54.663727Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T17:02:54.671215Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T17:02:54.670442Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb35-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb35-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for B3.3:
  sym_zero_identity_count       = 15               exact  exact
  XM_sup_vs_printed_rel         = 0.0011943        value  rtol 0.001
  XM_exceeds_printed_psi        = 1292.8           value  rtol 0.0001
  psi_fig4_vs_printed_rel       = 0.0069348        value  rtol 0.001
  petersen_eps_rel_fig4set      = 0.0074286        value  rtol 0.001
  petersen_S_rel_fig4set        = 0.0021457        value  rtol 0.001
  petersen_eps_rel_fig7AB       = 0.025173         value  rtol 0.001
  curveC_So_over_Smax           = 4.5956           value  rtol 0.0001
  curveD_L_over_LAB             = 24.672           value  rtol 0.0001
  curveD_roundtrip_rel          = (here 1.1e-15)   bound  bound &lt;= 1e-14 [identity]
  fig7_max_dX_upto_75           = 0.021759         value  rtol 0.001
  fig7_X_at_two_points          = 0.74232          value  rtol 0.0001
  fig7_early_cross_X            = 0.02318          value  rtol 0.001
  fig7_second_cross_X           = 0.62574          value  rtol 0.001
  fig7_lead_max                 = 0.011357         value  rtol 0.001
  fig7_trail_max                = 0.062665         value  rtol 0.001
  fig7_rate0_excess             = 0.0066275        value  rtol 0.001
  fig7_X_part_eps_S             = 0.75988          value  rtol 0.0001
  fig7_max_dX_eps_S             = 0.017652         value  rtol 0.001
  fig7_X_part_S_L               = 0.76874          value  rtol 0.0001
  fig7_max_dX_S_L               = 0.016507         value  rtol 0.001
  surf_dev_f4_25                = 0.045402         value  rtol 0.001
  surf_dev_f4_75                = -0.21656         value  rtol 0.001
  surf_dev_AB_25                = 0.046951         value  rtol 0.001
  surf_dev_AB_75                = -0.20996         value  rtol 0.001
  overlap_cross_u               = 0.65081          value  rtol 1e-06
  overlap_max_gap               = 0.030118         value  rtol 1e-06
  overlap_lead_rel              = (here 5.0e-04)   bound  bound &lt;= 0.001 [theory]
  m_star_psi0                   = 1                value  rtol 1e-09
  m_star_psi1                   = 0.66389          value  rtol 1e-06
  m_star_psi2                   = 0.49052          value  rtol 1e-06
  m_star_psi1_vs_two_thirds_rel = 0.0041724        value  rtol 0.001
  m_star_two_routes             = (here 3.2e-13)   bound  bound &lt;= 1e-11 [tolerance]
  nrms_best_psi2                = 0.07994          value  rtol 0.0001
  nrms_8pct_psi                 = 2.0013           value  rtol 1e-05
  nrms_best_psi5                = 0.19946          value  rtol 0.001
  nrms_best_psi10               = 0.32309          value  rtol 0.001
  nrms_m0_psi2                  = 0.56384          value  rtol 0.001
  psi_m_star_zero               = 16.805           value  rtol 1e-06
  nrms_at_psi_m_star_zero       = 0.4211           value  rtol 0.001
  grain_branch_gap_at_m1        = (here 3.0e-08)   bound  bound &lt;= 1e-07 [theory]
  nrms_m1_at_psi1               = 0.17166          value  rtol 0.0001
  m1_penalty_at_psi1            = 5.3361           value  rtol 0.0001
  eq35_root_eps_o               = 0.085288         value  rtol 1e-06
  eq35_residual_at_printed      = 0.0042411        value  rtol 0.0001
  eq35_two_routes               = (here 2.5e-08)   bound  bound &lt;= 1e-07 [tolerance]
  eq35_S_deficit_at_printed     = 2.7631e-05       value  rtol 0.001
  eq35_second_root              = 0.49467          value  rtol 1e-06
  hashimoto_XM_VC               = 0.29888          value  rtol 1e-06
  hashimoto_XM_CS               = 0.34754          value  rtol 1e-06
  hashimoto_rbar_VC_nm          = 0.55741          value  rtol 1e-06
  hashimoto_intercept_e12       = 27.04            value  rtol 1e-06
  eta098_thiele_sphere          = 0.55571          value  rtol 1e-06
  march_cn_vs_eq32_max          = 9.8055e-08       value  rtol 0.05
  march_observed_order          = (here 2.0e+00)   bound  bound [1.95, 2.05] [theory]
  march_finest_over_roundoff    = (here 1.7e+06)   bound  bound &gt;= 1000 [theory]
  march_euler_vs_eq32_max       = 0.00031361       value  rtol 0.05
  XM_two_routes_rel             = (here 1.3e-15)   bound  bound &lt;= 1e-12 [tolerance]
  tau_block_vs_scipy_rel        = (here 5.8e-16)   bound  bound &lt;= 1e-12 [tolerance]
  tau_closed_vs_block_rel       = (here 3.0e-09)   bound  bound &lt;= 1e-08 [theory]
  direct_residual_failures      = 13               exact  exact
  petersen_SS_two_routes        = (here 4.4e-16)   bound  bound &lt;= 1e-14 [identity]
  petersen_X_two_routes         = (here 1.7e-15)   bound  bound &lt;= 1e-14 [identity]
  petersen_X_endpoint_dev       = (here 2.2e-16)   bound  bound &lt;= 1e-14 [identity]
  I_two_routes_rel              = (here 7.6e-12)   bound  bound &lt;= 1e-10 [tolerance]
  I_closed_vs_40digit_rel       = (here 7.6e-12)   bound  bound &lt;= 1e-10 [tolerance]
  I_gl400_vs_40digit_rel        = (here 8.5e-15)   bound  bound &lt;= 1e-13 [tolerance]
  mstar_node_sensitivity        = (here 1.4e-09)   bound  bound &lt;= 1e-08 [tolerance]
  sigma100_max_rel              = 0.029222         value  rtol 0.001
  sigma025_psi_spread           = 0.071578         value  rtol 0.001
  sigma1_psi_spread             = 0.5767           value  rtol 0.001
  b31_eq40_identity             = (here 1.1e-16)   bound  bound &lt;= 1e-15 [identity]
  b31_published_reconcile       = (here 2.9e-07)   bound  bound &lt;= 1e-05 [tolerance]
  reference_csv_max_rel         = (here 4.6e-12)   bound  bound &lt;= 1e-11 [tolerance]</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:B</category>
  <category>struct:S1</category>
  <category>struct:S3</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B3.3-random-pore-model/</guid>
  <pubDate>Thu, 13 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Monod: what a growth curve can and cannot pick out of the family</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.1-monod/</link>
  <description><![CDATA[ 




<section id="monod-what-a-growth-curve-can-and-cannot-pick-out-of-the-family" class="level1">
<h1>Monod: what a growth curve can and cannot pick out of the family</h1>
<p><strong>Catalog ID:</strong> <code>J4.1</code> · <strong>Structures:</strong> <code>S1</code> · <strong>Tier:</strong> T0</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p><strong>The origin of this case was not consulted.</strong> Monod, J., <em>The growth of bacterial cultures</em>, <strong>Annu. Rev.&nbsp;Microbiol. 3</strong>, 371-394 (1949) is not on disk and could not be obtained. This page is built under the gallery’s textbook-canonical-source rule from a monograph that states the model, attributes it, and carries it:</p>
<blockquote class="blockquote">
<p><strong>Froment, G. F., De Wilde, J. &amp; Bischoff, K. B.</strong>, <em>Chemical Reactor Analysis and Design</em>, 3rd edn, John Wiley &amp; Sons (2011), ISBN 978-0-470-56541-4, <strong>section 1.5.2 “Microbial Kinetics”, book pp.&nbsp;26-29</strong> (PDF 68-71).</p>
</blockquote>
<p>Section 1.5.2 prints the rate law as eq. (1.5.2-1), names <img src="https://latex.codecogs.com/png.latex?K_S"> <em>“the Monod- or saturation constant”</em>, records that <em>“in the original Monod equation, <img src="https://latex.codecogs.com/png.latex?r"> is represented by <img src="https://latex.codecogs.com/png.latex?%5Cmu">, <img src="https://latex.codecogs.com/png.latex?r_m"> by <img src="https://latex.codecogs.com/png.latex?%5Cmu_%7Bmax%7D"> and <img src="https://latex.codecogs.com/png.latex?C_A"> by <img src="https://latex.codecogs.com/png.latex?S">”</em>, and couples it to the biomass balance eq. (1.5.2-2) and the yield relation eq. (1.5.2-3). Its Chapter 1 reference list, on book p.&nbsp;58, carries</p>
<blockquote class="blockquote">
<p>Monod, J., <em>Annu. Rev.&nbsp;Microbiol.</em>, <strong>3</strong>, 371 (1949).</p>
</blockquote>
<ul>
<li>the exact citation this case catalogues, read at digit scale on a 300 ppi crop. So the origin is <strong>identified</strong> by the book rather than implied, which is what the gallery’s E1.1 test asks for. <strong>Everything this page says about Monod is bounded by what Froment prints about him.</strong> There is no sentence of the form “Monod showed”, “Monod assumed” or “Monod found” anywhere on this page, in <code>meta.yaml</code> or in <code>README.md</code>; that sweep was done deliberately, because attribution drift is the defect class that has cost this repository two pages.</li>
</ul>
<p><strong>The question this page is for</strong> comes from a second book. <strong>Rawlings, J. B. &amp; Ekerdt, J. G.</strong>, <em>Chemical Reactor Analysis and Design Fundamentals</em>, 2nd edn (2025 printing), <strong>book p.&nbsp;596</strong>, prints the Monod equation as one of five:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th></th>
<th>as printed on p.&nbsp;596</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Monod</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%20S/(K_s%20+%20S)"></td>
</tr>
<tr class="even">
<td>Blackman</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m"> for <img src="https://latex.codecogs.com/png.latex?S%20%5Cge%202K_s">; <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%20S/(2K_s)"> for <img src="https://latex.codecogs.com/png.latex?S%20%3C%202K_s"></td>
</tr>
<tr class="odd">
<td>Tessier</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m(1%20-%20e%5E%7B-K_s%20S%7D)"></td>
</tr>
<tr class="even">
<td>Moser</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%20S%5En/(K_s%20+%20S%5En)"></td>
</tr>
<tr class="odd">
<td>Contois</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%20S/(K_%7Bsx%7D%20X%20+%20S)"></td>
</tr>
</tbody>
</table>
<p>and adds: <em>“We recognize the Monod equation [12] for cell growth rate as the simplest form of the Langmuir adsorption isotherm and the resulting Hougen-Watson kinetics for reaction rates on catalyst surfaces discussed in Chapter 5.”</em> Its reference [12] is the same 1949 paper, with the page range. Rawlings &amp; Ekerdt is used here as a <strong>model catalogue and for its chemostat balances</strong>, not as a second source for the rate law - the E1.1 target was pinned to Froment before this page was started, and nothing is adjudicated between the books.</p>
<p><strong>So: can data pick Monod out of that family?</strong> The answer below is in four parts - two of the four alternatives are not separable by a batch experiment at all and this is exact; the other two are separable and the page prices them; the apparent answer on the one real dataset available is set by the <em>data reduction</em> rather than by the data; and the experiment that would settle the remaining question is a different one.</p>
<p><strong>The data.</strong> Levenspiel, O., <em>Chemical Reaction Engineering</em>, 3rd edn (1999), <strong>Problem 29.18, book p.&nbsp;644</strong>, prints seven time intervals of a batch run and introduces them as <em>“the reported data for one of his runs”</em>, attributing them to <strong>“Monod, 1958, p.&nbsp;74”</strong> - the second edition of <em>Recherches sur la Croissance des Cultures Bacteriennes</em>, <strong>not</strong> the 1949 paper this case catalogues. That book is not on disk either and was not consulted. Levenspiel’s own account, quoted as his, is that Monod proposed the equation <em>“in 1939, as part of his thesis”</em>, that <em>“the thesis was published as a book in 1948”</em>, and that it <em>“was later condensed and translated into English in 1949”</em>. <strong>Which of those documents actually prints this table is not established here.</strong></p>
<p><strong>Scope.</strong> Substrate inhibition - Froment’s eq. (1.5.2-4), attributed there to Graef and Andrews [1973], and Rawlings’ <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%20S/(K_s%20+%20S%20+%20K_1S%5E2)"> - is <strong>case J4.2</strong> and gets no quantitative treatment on this page. Williams’ structured model, eqs. (1.5.2-5) to (1.5.2-8) in the same section, is J4.9’s.</p>
<div id="0f734a23" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:24.618874Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:24.618584Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:25.072722Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:25.071882Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Colab bootstrap</span></span>
<span id="cb1-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-3">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb1-5">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm</span>
<span id="cb1-6">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm"</span>, pymrm.__version__)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm 3.2.0</code></pre>
</div>
</div>
<div id="d3dc43d2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:25.075259Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:25.074842Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:25.978194Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:25.977060Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys, json</span>
<span id="cb3-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb3-3"></span>
<span id="cb3-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb3-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb3-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb3-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb3-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_ivp, quad</span>
<span id="cb3-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> least_squares, brentq, minimize, minimize_scalar</span>
<span id="cb3-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.stats <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> f <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> f_dist, chi2</span>
<span id="cb3-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> identity <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> speye</span>
<span id="cb3-12"></span>
<span id="cb3-13"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (construct_convflux_upwind, construct_div, NumJac, newton,</span>
<span id="cb3-14">                   compute_boundary_values)</span>
<span id="cb3-15"></span>
<span id="cb3-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gallery_utils: from the checkout when there is one, from raw GitHub on Colab</span></span>
<span id="cb3-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb3-18">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb3-19">    urllib.request.urlretrieve(</span>
<span id="cb3-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb3-21">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb3-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb3-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents):</span>
<span id="cb3-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb3-25">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))</span>
<span id="cb3-26">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb3-27"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, load_data, load_meta, cite_data, parse_literal</span>
<span id="cb3-28"></span>
<span id="cb3-29">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1-monod"</span></span>
<span id="cb3-30">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb3-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, assigned in fixed order and never cycled</span></span>
<span id="cb3-32">C_BLUE, C_ORANGE, C_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span></span>
<span id="cb3-33">C_PURPLE, C_YELLOW, C_GREY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span></span>
<span id="cb3-34">COL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>: C_BLUE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>: C_ORANGE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>: C_GREEN,</span>
<span id="cb3-35">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>: C_PURPLE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>: C_YELLOW}</span>
<span id="cb3-36">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb3-37"></span>
<span id="cb3-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: two consecutive executions must give identical content, so</span></span>
<span id="cb3-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (i) every stochastic step is seeded from SEED below and (ii) the whole of a</span></span>
<span id="cb3-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># long cell's output is batched into one message rather than flushed on a timer.</span></span>
<span id="cb3-41">SEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20260813</span></span>
<span id="cb3-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb3-43">    sys.stdout.flush_interval <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span></span>
<span id="cb3-44"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>:</span>
<span id="cb3-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb3-46"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> HTML, display</span>
<span id="cb3-47"></span>
<span id="cb3-48"></span>
<span id="cb3-49"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> show(styler):</span>
<span id="cb3-50">    display(HTML(styler.to_html()))</span>
<span id="cb3-51"></span>
<span id="cb3-52"></span>
<span id="cb3-53">M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -&gt; agreement.json</span></span>
<span id="cb3-54">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect-injection table</span></span>
<span id="cb3-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"setup done"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>setup done</code></pre>
</div>
</div>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Froment eq. (1.5.2-1), verbatim, is</p>
<p><img src="https://latex.codecogs.com/png.latex?r%20=%20%5Cfrac%7Br_m%20C_A%7D%7BK_S%20+%20C_A%7D%20%5Ctag%7B1.5.2-1%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?r"> <em>“a fractional or specific growth rate of biomass”</em>, <img src="https://latex.codecogs.com/png.latex?r_m"> <em>“the maximum specific rate of biomass growth, i.e., the rate when the substrate concentration is not limiting (<img src="https://latex.codecogs.com/png.latex?C_A"> much larger than <img src="https://latex.codecogs.com/png.latex?K_S">)”</em>, and <img src="https://latex.codecogs.com/png.latex?K_S"> <em>“the concentration of substrate <img src="https://latex.codecogs.com/png.latex?A"> at which the rate equals half of its maximum value, <img src="https://latex.codecogs.com/png.latex?r_m">”</em>. It is then coupled to the biomass balance</p>
<p><img src="https://latex.codecogs.com/png.latex?r_B%20=%20%5Cfrac%7B%7B%5Crm%20d%7DC_B%7D%7B%7B%5Crm%20d%7Dt%7D%20=%20r%5C,C_B%20=%20%5Cfrac%7Br_m%20C_B%20C_A%7D%7BK_S%20+%20C_A%7D%0A%5Ctag%7B1.5.2-2%7D"></p>
<p>and closed by a constant yield,</p>
<p><img src="https://latex.codecogs.com/png.latex?-%5Cfrac%7B%7B%5Crm%20d%7DC_A%7D%7B%7B%5Crm%20d%7Dt%7D%20=%20%5Cfrac%7B1%7D%7By_B%7D%5Cfrac%7B%7B%5Crm%20d%7DC_B%7D%7B%7B%5Crm%20d%7Dt%7D.%0A%5Ctag%7B1.5.2-3%7D"></p>
<p><strong>A note on the text layer, corrected.</strong> This book is born-digital and its words survive extraction, but its equations do not: <strong>every Symbol-font operator in them extracts as an unmappable Private-Use-Area glyph</strong>, <code>U+F02D</code> for the minus, <code>U+F03D</code> for the equals, <code>U+F02B</code> for the plus. On eq. (1.5.2-3) all three modes of <code>pdftotext</code> emit the leading minus as <code>U+F02D</code>, which renders as nothing or as tofu - so the extracted line <em>looks</em> like <code>dC A dC B / dt y B dt</code>, an equation with no operators at all, and a reader who copies what is visible gets a sign error for free. The character is therefore <strong>not dropped and the failure is not specific to the sign</strong>: the <code>=</code> on the same line and the <code>=</code> and <code>+</code> of eq. (1.5.2-1) go the same way. The 300 ppi render carries all of them, and every transcription on this page was read there. This corrects the diagnosis the just-published <code>J4.6</code> page gives for eq. (1.5.1-17) on p.&nbsp;26 of this same book - its <em>“the extractor dropped the leading term”</em> is the same phenomenon read the same wrong way, since <code>-layout</code> returns that line as <code>= C A &lt;U+F02D&gt; E &lt;U+F02B&gt; ...</code> with the leading term present. The <strong>lesson</strong> in both places is right and unchanged: read the render, never the text layer.</p>
<p><strong>Five identities come first, before any data.</strong> Three of them decide what an experiment can possibly do, and all five are proved symbolically below rather than asserted:</p>
<ol type="1">
<li><strong>Monod is the Langmuir isotherm</strong>, which is what Rawlings &amp; Ekerdt say on p.&nbsp;596. <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20KC/(1+KC)%20=%20C/(K%5E%7B-1%7D+C)">, so <img src="https://latex.codecogs.com/png.latex?K_S%20=%201/K"> and nothing else changes. The gallery has that isotherm at <code>J1.1</code> and the enzyme form at <code>J4.6</code>; they are one algebraic family.</li>
<li><strong>Monod and Blackman share <em>both</em> of the properties Froment uses to define <img src="https://latex.codecogs.com/png.latex?r_m"> and <img src="https://latex.codecogs.com/png.latex?K_S">.</strong> Blackman’s law reaches <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> exactly, and at <img src="https://latex.codecogs.com/png.latex?S%20=%20K_S"> it gives exactly <img src="https://latex.codecogs.com/png.latex?%5Cmu_m/2"> - because <img src="https://latex.codecogs.com/png.latex?K_S%20%3C%202K_S"> puts that point on its linear branch, where <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%20S/(2K_S)">. So the asymptote and the half-rate point, the two properties by which the constants are defined, do <strong>not</strong> distinguish the two laws at all. What does: at the branch switch <img src="https://latex.codecogs.com/png.latex?S%20=%202K_S"> the two differ by <strong>exactly <img src="https://latex.codecogs.com/png.latex?%5Cmu_m/3"></strong>, and on the lower branch the largest gap is <img src="https://latex.codecogs.com/png.latex?%5Cmu_m(3-2%5Csqrt2)/2%20=%200.0858%5C,%5Cmu_m"> at <img src="https://latex.codecogs.com/png.latex?S%20=%20(%5Csqrt2-1)K_S">. Both are closed form and both are checked numerically against a root-found maximum.</li>
<li><strong>Moser contains Monod</strong> at <img src="https://latex.codecogs.com/png.latex?n%20=%201">. The two are nested, so no data can <em>reject</em> Moser; the only meaningful question is whether <img src="https://latex.codecogs.com/png.latex?n"> differs from 1, and that is an F test.</li>
<li><strong>Contois <em>is</em> Monod on any constant-yield batch run</strong> - and this is the result that decides most of the page. Constant yield makes the biomass an affine function of the substrate, <img src="https://latex.codecogs.com/png.latex?X%20=%20%5Cvarphi(a%20-%20S)">, so <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cfrac%7B%5Cmu_m%20S%7D%7BK_%7Bsx%7DX%20+%20S%7D%0A%20%20%20%20%20=%20%5Cfrac%7B%5Cmu_m%20S%7D%7BK_%7Bsx%7D%5Cvarphi%20a%20+%20(1-K_%7Bsx%7D%5Cvarphi)S%7D%0A%20%20%20%20%20=%20%5Cfrac%7B(%5Cmu_m/%5Cbeta)%5C,S%7D%7BK_%7Bsx%7D%5Cvarphi%20a/%5Cbeta%20+%20S%7D,%0A%20%20%5Cqquad%20%5Cbeta%20=%201%20-%20K_%7Bsx%7D%5Cvarphi,"> which is Monod with <img src="https://latex.codecogs.com/png.latex?%5Cmu_m'%20=%20%5Cmu_m/%5Cbeta"> and <img src="https://latex.codecogs.com/png.latex?K_S'%20=%20K_%7Bsx%7D%5Cvarphi%20a/%5Cbeta">. The map is a bijection. <strong>No batch experiment, of any length or precision, separates Contois from Monod.</strong> The symbolic residual below is exactly zero, and two independent fits confirm it by landing on the same curve.</li>
<li><strong>Tessier is genuinely different</strong> - it has no reparameterisation into Monod - so it is the one alternative a batch run could in principle settle, and the page prices what that would take.</li>
</ol>
<div id="82a48def" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:25.981490Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:25.981218Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.245297Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.244353Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- five identities, proved not asserted</span></span>
<span id="cb5-2">S_, X_, mum_, Ks_, Ksx_, phi_, a_, n_, K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(</span>
<span id="cb5-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S X mu_m K_s K_sx varphi a n K"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-4"></span>
<span id="cb5-5">monod    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_)</span>
<span id="cb5-6">blackman_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># branch S &lt; 2 K_s</span></span>
<span id="cb5-7">tessier  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>Ks_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_))</span>
<span id="cb5-8">moser    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>n_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>n_)</span>
<span id="cb5-9">contois  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ksx_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_)</span>
<span id="cb5-10">langmuir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_)                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># theta, J1.1's eq. (1)</span></span>
<span id="cb5-11"></span>
<span id="cb5-12">I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb5-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Monod == Langmuir with K_s = 1/K   (mu_m = 1 for the isotherm)</span></span>
<span id="cb5-14">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_is_langmuir"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(langmuir <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> monod.subs({Ks_: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_, mum_: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>}))</span>
<span id="cb5-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2a. Froment's two defining properties, for Monod</span></span>
<span id="cb5-16">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_asymptote"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.limit(monod, S_, sp.oo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_)</span>
<span id="cb5-17">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_half_rate"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(monod.subs(S_, Ks_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb5-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2b. the SAME two properties, for Blackman</span></span>
<span id="cb5-19">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blackman_asymptote"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(mum_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># upper branch IS mu_m</span></span>
<span id="cb5-20">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blackman_half_rate"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(blackman_lo.subs(S_, Ks_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb5-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2c. where they part: the gap at the switch, and the lower-branch extremum</span></span>
<span id="cb5-22">gap_switch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify((mum_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> monod).subs(S_, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_))    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># upper branch minus Monod</span></span>
<span id="cb5-23">S_star     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve(sp.Eq(sp.diff(blackman_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> monod, S_), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), S_)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb5-24">gap_lower  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify((blackman_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> monod).subs(S_, S_star))</span>
<span id="cb5-25">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blackman_gap_at_switch"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(gap_switch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb5-26">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blackman_gap_lower"</span>]     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(gap_lower <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb5-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3. Moser -&gt; Monod at n = 1</span></span>
<span id="cb5-28">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moser_at_n1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(moser.subs(n_, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> monod)</span>
<span id="cb5-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 4. Contois == Monod under a constant yield X = phi (a - S)</span></span>
<span id="cb5-30">beta_    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ksx_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>phi_</span>
<span id="cb5-31">contois_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> contois.subs(X_, phi_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_))</span>
<span id="cb5-32">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_is_monod"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(</span>
<span id="cb5-33">    contois_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (mum_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>beta_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ksx_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>phi_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>a_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>beta_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S_))</span>
<span id="cb5-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 5. Tessier has no such reduction: its curvature ratio is not Monod's anywhere</span></span>
<span id="cb5-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    (a POSITIVE statement, not an absence: the two second derivatives differ by</span></span>
<span id="cb5-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     a factor that depends on S for every choice of the constants)</span></span>
<span id="cb5-37">tess_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(tessier, S_, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sp.diff(tessier, S_))</span>
<span id="cb5-38">mon_ratio  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(monod, S_, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sp.diff(monod, S_))</span>
<span id="cb5-39">I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tessier_not_monod"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(tess_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mon_ratio, S_))</span>
<span id="cb5-40"></span>
<span id="cb5-41"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> I.items():</span>
<span id="cb5-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tessier_not_monod"</span>:</span>
<span id="cb5-43">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb5-44">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, (k, v)</span>
<span id="cb5-45">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_is_langmuir_residual"</span>]    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_is_langmuir"</span>]))</span>
<span id="cb5-46">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_half_rate_residual"</span>]      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monod_half_rate"</span>]))</span>
<span id="cb5-47">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_half_rate_residual"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blackman_half_rate"</span>]))</span>
<span id="cb5-48">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_moser_at_n1_residual"</span>]          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moser_at_n1"</span>]))</span>
<span id="cb5-49">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_contois_is_monod_residual"</span>]     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_is_monod"</span>]))</span>
<span id="cb5-50">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_at_switch_over_mum"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb5-51">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_lower_over_mum"</span>]     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb5-52">S_STAR_OVER_KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(S_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ks_)</span>
<span id="cb5-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all five identities close exactly (sympy residual 0)"</span>)</span>
<span id="cb5-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Monod == Langmuir with K_S = 1/K"</span>)</span>
<span id="cb5-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Monod and Blackman: asymptote mu_m and half-rate at S = K_S, both exact"</span>)</span>
<span id="cb5-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  gap at the switch S = 2K_S            : mu_m *"</span>, sp.nsimplify(sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)),</span>
<span id="cb5-57">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"="</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sym_blackman_gap_at_switch_over_mum'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mu_m"</span>)</span>
<span id="cb5-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  largest gap on the lower branch       : mu_m *"</span>,</span>
<span id="cb5-59">      sp.simplify((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"="</span>,</span>
<span id="cb5-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sym_blackman_gap_lower_over_mum'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mu_m at S/K_S ="</span></span>
<span id="cb5-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_STAR_OVER_KS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Moser(n=1) == Monod;  Contois == Monod under a constant yield"</span>)</span>
<span id="cb5-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Tessier: d/dS of the curvature ratio difference is not identically zero -&gt;"</span>,</span>
<span id="cb5-64">      sp.simplify(I[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tessier_not_monod"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>all five identities close exactly (sympy residual 0)
  Monod == Langmuir with K_S = 1/K
  Monod and Blackman: asymptote mu_m and half-rate at S = K_S, both exact
  gap at the switch S = 2K_S            : mu_m * 1/3 = 0.333333 mu_m
  largest gap on the lower branch       : mu_m * 3/2 - sqrt(2) = 0.085786 mu_m at S/K_S = 0.414214
  Moser(n=1) == Monod;  Contois == Monod under a constant yield
  Tessier: d/dS of the curvature ratio difference is not identically zero -&gt; True</code></pre>
</div>
</div>
<div id="3b42a96d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.247234Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.247085Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.252469Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.251605Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The two Blackman gaps are CLOSED FORM above; here they are checked against a</span></span>
<span id="cb7-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROOT-FOUND extremum on the real line, because a closed form with an algebra</span></span>
<span id="cb7-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># slip in it looks exactly like a correct one.</span></span>
<span id="cb7-4">mum_v, Ks_v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb7-5">f_lo  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S: mum_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># lower branch</span></span>
<span id="cb7-6">d_lo  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S: mum_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb7-7">S_hat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(d_lo, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_v, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb7-8">gap_lo_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f_lo(S_hat))</span>
<span id="cb7-9">gap_sw_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mum_v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mum_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_v))</span>
<span id="cb7-10">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_lower_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb7-11">    gap_lo_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_lower_over_mum"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_lower_over_mum"</span>]</span>
<span id="cb7-12">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_switch_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb7-13">    gap_sw_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_at_switch_over_mum"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_at_switch_over_mum"</span>]</span>
<span id="cb7-14">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_Sstar_over_Ks_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S_hat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S_STAR_OVER_KS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_STAR_OVER_KS</span>
<span id="cb7-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all three are round-off or brentq's xtol, so each is printed against its bound</span></span>
<span id="cb7-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"root-found S*/K_S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_hat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the closed form </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_STAR_OVER_KS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (rel. below 1e-13, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'num_blackman_Sstar_over_Ks_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb7-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"lower-branch gap  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_lo_num<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mu_m   (rel. below 1e-14, here"</span></span>
<span id="cb7-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'num_blackman_gap_lower_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb7-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"gap at the switch </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_sw_num<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mu_m   (rel. below 1e-14, here"</span></span>
<span id="cb7-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'num_blackman_gap_switch_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb7-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">So the two laws agree EXACTLY on both properties Froment defines the"</span>)</span>
<span id="cb7-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constants by, and differ by a third of the maximum rate at S = 2 K_S."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>root-found S*/K_S = 0.414213562373 against the closed form 0.414213562373  (rel. below 1e-13, here 0.0e+00)
lower-branch gap  0.085786437627 mu_m   (rel. below 1e-14, here 1.6e-16)
gap at the switch 0.333333333333 mu_m   (rel. below 1e-14, here 1.7e-16)

So the two laws agree EXACTLY on both properties Froment defines the
constants by, and differ by a third of the maximum rate at S = 2 K_S.</code></pre>
</div>
</div>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Nothing on this page is a literature parameter value.</strong> Section 1.5.2 of Froment prints <strong>no value for <img src="https://latex.codecogs.com/png.latex?r_m">, <img src="https://latex.codecogs.com/png.latex?K_S"> or <img src="https://latex.codecogs.com/png.latex?K_i"> and no worked example for Monod kinetics</strong> - no table, no fitted constant, nothing to reproduce. (It is not numberless: book p.&nbsp;26 prints the selectivity identity <img src="https://latex.codecogs.com/png.latex?y_B%20+%20y_P%20+%20y_D%20=%201">, and the caption of Fig. 1.5.2-1 on book p.&nbsp;29 prints <img src="https://latex.codecogs.com/png.latex?k_1%20=%200.0125%5C,">s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">, <img src="https://latex.codecogs.com/png.latex?k_2%20=%200.025%5C,">s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">, <img src="https://latex.codecogs.com/png.latex?M_0/D_0%20=%201"> - but those belong to <strong>Williams’</strong> structured model, eqs. (1.5.2-5) to (1.5.2-8), which is <code>J4.9</code>’s, and none of them is a Monod constant. Both are transcribed into the printed-laws CSV so the claim is checkable.) Rawlings &amp; Ekerdt’s set (<img src="https://latex.codecogs.com/png.latex?%5Cmu_m%20=%201">, <img src="https://latex.codecogs.com/png.latex?K_s%20=%201">, <img src="https://latex.codecogs.com/png.latex?S_f%20=%205">, <img src="https://latex.codecogs.com/png.latex?y%20=%201">) is printed on their book p.&nbsp;597 as the values <em>“used to prepare”</em> Fig. 10.12 - body text, not a caption - and is used here only to reproduce their eq. (10.19) and nothing else. Every constant that describes the culture is fitted here, on this page, to the seven printed intervals, and is labelled a fit wherever it appears.</p>
<p><strong>Units.</strong> <img src="https://latex.codecogs.com/png.latex?%5CDelta%20t"> is printed in hours, so every growth rate here is in h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"> - which is the dimension Froment prints for <img src="https://latex.codecogs.com/png.latex?%5Cmu"> on p.&nbsp;27, and the one independent unit check available. <strong>The substrate and biomass columns carry no units at all</strong> in the printed table. Every conclusion below is therefore stated either in h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"> or as a ratio; the one quantity that inherits the unprinted scale is <img src="https://latex.codecogs.com/png.latex?K_S"> itself, and it is quoted as <em>“in the units of the printed <img src="https://latex.codecogs.com/png.latex?%5Cbar%20C_A"> column”</em> every time.</p>
<p><strong>The assumptions, and who prints each:</strong></p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>assumption</th>
<th>printed by</th>
<th>where it bites</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>constant biomass yield</td>
<td>Froment eq. (1.5.2-3); Rawlings eq. (10.18); Levenspiel Ch. 29</td>
<td>fixes <img src="https://latex.codecogs.com/png.latex?S"> as an affine function of <img src="https://latex.codecogs.com/png.latex?X"> - this is what makes Contois degenerate</td>
</tr>
<tr class="even">
<td>well mixed, isothermal batch</td>
<td>Froment “a closed volume with uniform composition and temperature”</td>
<td>the whole reduction</td>
</tr>
<tr class="odd">
<td>exponential-phase growth only</td>
<td>Froment: <em>“The rate of biomass production, i.e., the increase in the number of cells during the exponential growth phase, is described by the empirical Monod-kinetics”</em></td>
<td>the seven intervals are taken to be inside it</td>
</tr>
<tr class="even">
<td>no cell death</td>
<td>Froment prints <img src="https://latex.codecogs.com/png.latex?r_d%20=%20k_dC_B"> separately and it is not used here</td>
<td>would add a constant to every <img src="https://latex.codecogs.com/png.latex?%5Cmu"></td>
</tr>
<tr class="odd">
<td>no product inhibition</td>
<td>Rawlings prints the form separately (p.&nbsp;596); Levenspiel gives it a whole chapter (Ch. 30)</td>
<td>out of scope, and named</td>
</tr>
</tbody>
</table>
<p><strong>One reduction, and it is exact.</strong> For any growth law whatever, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D(%5Cln%20C_C)/%5Cmathrm%7Bd%7Dt%20=%20%5Cmu">, so</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu_i%20%5C;=%5C;%20%5Cfrac%7B1%7D%7B%5CDelta%20t_i%7D%5Cln%5Cfrac%7BC_%7BC,i%7D%5E%7B%5Crm%20end%7D%7D%7BC_%7BC,i%7D%5E%7B%5Crm%20start%7D%7D"></p>
<p>is <strong>exactly</strong> the time-average of the specific growth rate over interval <img src="https://latex.codecogs.com/png.latex?i">. No approximation has been made at this point.</p>
<p><strong>The approximation comes next, and it is the one this page is about.</strong> The exercise invites you to compare that <img src="https://latex.codecogs.com/png.latex?%5Cmu_i"> with <img src="https://latex.codecogs.com/png.latex?%5Cmu(%5Cbar%20C_%7BA,i%7D)"> - the rate law evaluated at the interval’s <em>average</em> substrate concentration. Since <img src="https://latex.codecogs.com/png.latex?%5Cmu"> is curved, <img src="https://latex.codecogs.com/png.latex?%5Clangle%5Cmu(C_A)%5Crangle%20%5Cne%20%5Cmu(%5Clangle%20C_A%5Crangle)">, and the two differ at second order in the substrate swing across the interval. That swing is not small here: the last two intervals consume more substrate than their own average. The page calls the first comparison <strong>route A</strong> and the exact one <strong>route B</strong>, and reports both.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Seven intervals, transcribed from a 600 ppi native render of Levenspiel p.&nbsp;644 and used exactly as printed. <code>data/levenspiel-p644-monod-batch.csv</code> carries them and its sidecar carries the provenance chain in full; the essentials are in <em>Background</em> above and are repeated in one line here: <strong>these are attributed by Levenspiel to Monod (1958) p.&nbsp;74, not to the 1949 paper, and neither document was consulted.</strong></p>
<p>Two things the printed table says that the text layer does not:</p>
<ul>
<li>the substrate column header carries an <strong>overbar</strong> - <img src="https://latex.codecogs.com/png.latex?%5Cbar%20C_A">, an interval average. <code>pdftotext</code> drops it in all three modes. It is load-bearing;</li>
<li><strong>no units</strong> are printed for either concentration column.</li>
</ul>
<p><strong>A material balance the table must satisfy.</strong> All three books assume a constant yield, which makes <img src="https://latex.codecogs.com/png.latex?C_A"> an affine function of <img src="https://latex.codecogs.com/png.latex?C_C"> <em>pointwise</em>, hence <img src="https://latex.codecogs.com/png.latex?%5Cbar%0AC_A"> an affine function of <img src="https://latex.codecogs.com/png.latex?%5Cbar%20C_C"> <em>interval by interval</em>. Under exponential growth the exact time-average of <img src="https://latex.codecogs.com/png.latex?C_C"> is its <strong>logarithmic</strong> mean, so that line can be drawn with no fitted kinetics at all - and it is the only internal consistency check the table offers.</p>
<div id="7a4bcaa6" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.254319Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.254179Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.271346Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.270431Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">DATA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-p644-monod-batch.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb9-2">META <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-p644-monod-batch.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb9-3">PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed-growth-laws.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb9-4">P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {r.key: r.as_printed <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PRINTED.itertuples()}</span>
<span id="cb9-5"></span>
<span id="cb9-6">dt   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DATA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dt_hr"</span>].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb9-7">CAb  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DATA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CA_bar"</span>].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb9-8">Cc0  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DATA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CC_start"</span>].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb9-9">Cc1  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DATA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CC_end"</span>].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb9-10">NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(dt)</span>
<span id="cb9-11">LN   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(Cc1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Cc0)</span>
<span id="cb9-12">mu   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> LN<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># EXACT interval-average growth rate</span></span>
<span id="cb9-13">Xlm  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Cc1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>LN                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exact time-average of C_C</span></span>
<span id="cb9-14">Xam  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Cc0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Cc1)                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the other convention (break row)</span></span>
<span id="cb9-15">RES_CA, RES_CC, RES_DT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.005</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed half-ulps</span></span>
<span id="cb9-16"></span>
<span id="cb9-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(META))</span>
<span id="cb9-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(DATA.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb9-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  mu_i = ln(Cc_end/Cc_start)/dt, 1/h :"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(mu, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb9-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  log-mean biomass over the interval :"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(Xlm, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb9-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  elapsed time of the whole run: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.2f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> h in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> intervals"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (dt.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(), NOBS))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Levenspiel, O. (1999) — Chemical Reaction Engineering, 3rd edition, John Wiley &amp; Sons, Chapter 29 'Substrate-Limiting Microbial Fermentation', Problem 29.18, book p. 644 — table
 interval  dt_hr  CA_bar  CC_start  CC_end
        1   0.54     137      15.5    23.0
        2   0.36     114      23.0    30.0
        3   0.33      90      30.0    38.8
        4   0.35      43      38.8    48.5
        5   0.37      29      48.5    58.3
        6   0.38       9      58.3    61.3
        7   0.37       2      61.3    62.5

  mu_i = ln(Cc_end/Cc_start)/dt, 1/h : [0.73084 0.73806 0.77946 0.63755 0.4974  0.13205 0.0524 ]
  log-mean biomass over the interval : [19.004  26.3452 34.2116 43.4698 53.2498 59.7875 61.8981]

  elapsed time of the whole run: 2.70 h in 7 intervals</code></pre>
</div>
</div>
<div id="922e8dfc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.273696Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.273550Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.284174Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.283253Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the constant-yield line, and the one cell that is not on it</span></span>
<span id="cb11-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bal_line(drop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>()):</span>
<span id="cb11-3">    keep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> drop])</span>
<span id="cb11-4">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(keep)), Xlm[keep]]).T</span>
<span id="cb11-5">    c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(A, CAb[keep], rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb11-6">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c</span>
<span id="cb11-7">    R2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAb[keep].mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb11-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R2), r</span>
<span id="cb11-9"></span>
<span id="cb11-10">a7, b7, R2_7, r7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bal_line()</span>
<span id="cb11-11">loo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {i: bal_line(drop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(i,)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS)}</span>
<span id="cb11-12">worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS), key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> i: loo[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the row whose removal helps most</span></span>
<span id="cb11-13"></span>
<span id="cb11-14">A_BAL, B_BAL, R2_BAL, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> loo[worst]</span>
<span id="cb11-15">PHI_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>B_BAL                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># yield: biomass formed per substrate consumed</span></span>
<span id="cb11-16">implied <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Xlm[worst]</span>
<span id="cb11-17">end_of_interval <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[worst]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL</span>
<span id="cb11-18"></span>
<span id="cb11-19">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constant-yield line  CA_bar = a + b * Cc_logmean"</span>,</span>
<span id="cb11-20">         <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NOBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows      : a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a7<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   b = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b7<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   R2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_7<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb11-21">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  leave-one-out R2 (the check that says WHICH row, not merely that one is off):"</span>]</span>
<span id="cb11-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS):</span>
<span id="cb11-23">    lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     without row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: R2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>loo[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-24">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   &lt;-- by far the largest"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> worst <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb11-25">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is the one: dropping it takes R2 from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_7<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span>,</span>
<span id="cb11-26">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  dropping any other row leaves R2 in "</span></span>
<span id="cb11-27">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(loo[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> worst)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb11-28">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(loo[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> worst)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]."</span>,</span>
<span id="cb11-29">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the six-row line predicts CA_bar(row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>implied<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span></span>
<span id="cb11-30">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the table prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[worst]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>,</span>
<span id="cb11-31">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[worst]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>implied<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, against"</span></span>
<span id="cb11-32">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(loo[worst][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the largest of the other six."</span>,</span>
<span id="cb11-33">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  yield from the six-row line : phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> biomass per substrate"</span>,</span>
<span id="cb11-34">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  substrate intercept         : a   = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (C_A when C_C -&gt; 0)"</span>,</span>
<span id="cb11-35">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  substrate at the run's start: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb11-36">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ; at its end: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb11-37">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_all_rows"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R2_7</span>
<span id="cb11-38">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_six_rows"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R2_BAL</span>
<span id="cb11-39">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_row4_residual"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CAb[worst] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> implied)</span>
<span id="cb11-40">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_worst_other_residual"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(loo[worst][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])))</span>
<span id="cb11-41">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_phi"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PHI_BAL</span>
<span id="cb11-42">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_a"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_BAL</span>
<span id="cb11-43">BAD_ROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst</span>
<span id="cb11-44"></span>
<span id="cb11-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A candidate explanation, LABELLED AN INFERENCE and then tested and refused</span></span>
<span id="cb11-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># as a systematic: 43 is close to the </span><span class="re">END</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-of-interval substrate concentration.</span></span>
<span id="cb11-47">alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {i: A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS)}</span>
<span id="cb11-48">lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  CANDIDATE EXPLANATION (an inference, not a repair): the printed"</span></span>
<span id="cb11-49">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[worst]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is within"</span></span>
<span id="cb11-50">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CAb[worst]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>end_of_interval)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb[worst]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of that"</span></span>
<span id="cb11-51">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" interval's END substrate concentration, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>end_of_interval<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>,</span>
<span id="cb11-52">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Tested as a systematic on the neighbouring rows and REFUSED:"</span>]</span>
<span id="cb11-53"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb11-54">    lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: end-of-interval </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>alt[i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the printed"</span></span>
<span id="cb11-55">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(alt[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>CAb[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb[i]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % off)"</span>)</span>
<span id="cb11-56">lines.append(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  so the table is NOT systematically printing end values, and the"</span></span>
<span id="cb11-57">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" cell is reported, not repaired."</span>)</span>
<span id="cb11-58">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row4_end_of_interval_relgap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CAb[worst]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>end_of_interval)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb[worst])</span>
<span id="cb11-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(lines))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>constant-yield line  CA_bar = a + b * Cc_logmean
  all 7 rows      : a =   195.0607   b = -3.15951   R2 = 0.98504707
  leave-one-out R2 (the check that says WHICH row, not merely that one is off):
     without row 1: R2 = 0.97573792
     without row 2: R2 = 0.98188968
     without row 3: R2 = 0.98480617
     without row 4: R2 = 0.99995709   &lt;-- by far the largest
     without row 5: R2 = 0.98432836
     without row 6: R2 = 0.98255334
     without row 7: R2 = 0.98119273

  row 4 is the one: dropping it takes R2 from 0.985047 to 0.99995709;
  dropping any other row leaves R2 in [0.975738, 0.984806].

  the six-row line predicts CA_bar(row 4) = 60.1804; the table prints 43.
  residual -17.1804, against 0.6541 for the largest of the other six.

  yield from the six-row line : phi = 0.317437 biomass per substrate
  substrate intercept         : a   = 197.1203 (C_A when C_C -&gt; 0)
  substrate at the run's start: 148.2917 ; at its end: 0.2308

  CANDIDATE EXPLANATION (an inference, not a repair): the printed 43 is within 3.1 % of that interval's END substrate concentration, 44.33.
  Tested as a systematic on the neighbouring rows and REFUSED:
     row 3: end-of-interval 74.89 against the printed 90  (16.8 % off)
     row 5: end-of-interval 13.46 against the printed 29  (53.6 % off)
  so the table is NOT systematically printing end values, and the cell is reported, not repaired.</code></pre>
</div>
</div>
<div id="f5b7f3df" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.286318Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.286171Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.672949Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.672377Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2</span>))</span>
<span id="cb13-2">xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Xlm.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb13-3">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(xx, A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xx, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb13-4">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"line from the other six rows</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$R^2$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R2_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-5">keep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW]</span>
<span id="cb13-6">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(Xlm[keep], CAb[keep], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed rows"</span>)</span>
<span id="cb13-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(Xlm[BAD_ROW], CAb[BAD_ROW], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,</span>
<span id="cb13-8">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAD_ROW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[BAD_ROW]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">line says </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>implied<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].annotate(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, xy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(Xlm[BAD_ROW], implied), xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(Xlm[BAD_ROW], CAb[BAD_ROW]),</span>
<span id="cb13-10">               arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(arrowstyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-&gt;"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>))</span>
<span id="cb13-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar C_C</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> over the interval </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">log mean</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar C_A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> as printed"</span>)</span>
<span id="cb13-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the constant-yield balance the table</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">must satisfy, and one cell that does not"</span>,</span>
<span id="cb13-14">                fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb13-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper right"</span>)</span>
<span id="cb13-16"></span>
<span id="cb13-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(CAb, mu, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb13-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS):</span>
<span id="cb13-19">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].annotate(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), (CAb[i], mu[i]), textcoords<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"offset points"</span>,</span>
<span id="cb13-20">                   xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY)</span>
<span id="cb13-21">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(implied, mu[BAD_ROW], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>,</span>
<span id="cb13-22">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAD_ROW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the balance-implied $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar C_A$"</span>)</span>
<span id="cb13-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar C_A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> as printed </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">units not printed</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-24">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">u_i = </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_C</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{end}/C_C</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{start}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\D</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,  h</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-25">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the seven intervals"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb13-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)</span>
<span id="cb13-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ax:</span>
<span id="cb13-28">    a.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.25</span>)</span>
<span id="cb13-29">fig.tight_layout()</span>
<span id="cb13-30">plt.show()</span>
<span id="cb13-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Data: Levenspiel (1999) Problem 29.18 p. 644, attributed by him to"</span>)</span>
<span id="cb13-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod (1958) p. 74. Neither Monod publication was consulted."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.1-monod/index_files/figure-html/cell-8-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Data: Levenspiel (1999) Problem 29.18 p. 644, attributed by him to
Monod (1958) p. 74. Neither Monod publication was consulted.</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Four pieces, in increasing order of how much pymrm does:</p>
<ol type="1">
<li><strong>The five growth laws</strong>, each written as <img src="https://latex.codecogs.com/png.latex?%5Cmu%20=%20%5Cmu_m%5C,g(%5Ctheta;%20S,%20X)"> so that on route A <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> can be profiled out in closed form. That is not cosmetic: Blackman’s objective has a kink wherever <img src="https://latex.codecogs.com/png.latex?2K_s"> crosses a data point, and a single local start lands on the wrong minimum - measured, and kept as a break-table row.</li>
<li><strong>Route B’s forward prediction.</strong> Constant yield collapses the batch to one ODE, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DC_C/%5Cmathrm%7Bd%7Dt%20=%20%5Cmu(a%20-%20C_C/%5Cvarphi,%5C,C_C)%5C,C_C">, whose solution over each printed interval gives <img src="https://latex.codecogs.com/png.latex?%5Cmu_i%5E%7B%5Crm%20pred%7D"> with no averaging approximation anywhere. Rescaling <img src="https://latex.codecogs.com/png.latex?%5Ctau%20=%20%5Cmu_m%20t"> removes <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> from that ODE entirely, so one dense-output solve per <img src="https://latex.codecogs.com/png.latex?(%5Ctheta,%5C,">interval<img src="https://latex.codecogs.com/png.latex?)"> prices every <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> - which is what makes a <strong>global</strong> scan over <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> affordable rather than a local start from a guess.</li>
<li><strong>A pymrm backward-Euler batch marcher</strong>, <code>NumJac((1, 2))</code> + <code>newton</code> on the two fields <img src="https://latex.codecogs.com/png.latex?(S,%20X)">, used as the <strong>second, independent computation</strong> of route B’s fit: different discretisation, different Jacobian, different linear algebra, and it integrates <img src="https://latex.codecogs.com/png.latex?S"> as an unknown rather than substituting the yield relation - so the yield line is <em>tested</em> rather than assumed, through <img src="https://latex.codecogs.com/png.latex?S%20+%20X/%5Cvarphi%20=%20%7B%5Crm%20const%7D">.</li>
<li><strong>A plug-flow fermenter and a chemostat.</strong> Levenspiel’s Fig. 29.1 is captioned <em>“Behavior of batch <strong>or plug flow</strong> reactors for Monod type microbial fermentation”</em>, and that equivalence is what makes the plug-flow solve testable: its outlet at residence time <img src="https://latex.codecogs.com/png.latex?%5Ctau"> must equal the batch at <img src="https://latex.codecogs.com/png.latex?t%20=%20%5Ctau">, to the discretisation error and no further. <code>construct_convflux_upwind</code> + <code>construct_div</code> (<code>nu=0</code>, Cartesian) assemble <img src="https://latex.codecogs.com/png.latex?v%5C,%5Cpartial%20c/%5Cpartial%20z"> once; <code>NumJac((n, 2))</code> couples the two fields pointwise, which is what a growth law is; <code>newton</code> solves. The chemostat is Rawlings’ eq. (10.18) with the same source term.</li>
</ol>
<p><strong>Boundary conditions use the outward normal.</strong> At the inlet <img src="https://latex.codecogs.com/png.latex?z=0"> the outward normal points in <img src="https://latex.codecogs.com/png.latex?-z">, so the feed is <code>{"a": 0, "b": 1, "d": (S_f, X_f)}</code>; at the outlet it points in <img src="https://latex.codecogs.com/png.latex?+z">, so pure outflow is <code>{"a": 1, "b": 0, "d": 0}</code>. Outlet values come from <code>compute_boundary_values</code>, not off the last cell centre; the break table prices reading them there.</p>
<div id="f18db386" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.675404Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.675233Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.691449Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.690785Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---------------------------------------------------- the five printed laws</span></span>
<span id="cb15-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mu = mu_m * g(theta; S, X).  theta is what is NOT linear.</span></span>
<span id="cb15-3">G <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb15-4"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>:    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S),</span>
<span id="cb15-5"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: np.minimum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])),</span>
<span id="cb15-6"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>:  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S),</span>
<span id="cb15-7"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>:    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb15-8"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>:  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S),</span>
<span id="cb15-9"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one-parameter nulls, each best-fitted in its own right</span></span>
<span id="cb15-10"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero order"</span>:  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: np.ones_like(S),</span>
<span id="cb15-11"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order"</span>: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, S, X: S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(CAb),</span>
<span id="cb15-12">}</span>
<span id="cb15-13">NTH  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb15-14">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero order"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>}</span>
<span id="cb15-15">LAWS  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>]</span>
<span id="cb15-16">NULLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero order"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order"</span>]</span>
<span id="cb15-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># GLOBAL scan grids.  A local start is not safe here - see the break table.</span></span>
<span id="cb15-18">RANGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>:    np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>),</span>
<span id="cb15-19">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>: np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>),</span>
<span id="cb15-20">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>:  np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>),</span>
<span id="cb15-21">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>:  np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">240</span>)}</span>
<span id="cb15-22">MOSER_KS, MOSER_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>), np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>)</span>
<span id="cb15-23">MUM_LO, MUM_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span></span>
<span id="cb15-24"></span>
<span id="cb15-25"></span>
<span id="cb15-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> thetas(name):</span>
<span id="cb15-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> NTH[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb15-28">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [[]]</span>
<span id="cb15-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> NTH[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb15-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [[t] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RANGE[name]]</span>
<span id="cb15-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [[k, n] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MOSER_N <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MOSER_KS]</span>
<span id="cb15-32"></span>
<span id="cb15-33"></span>
<span id="cb15-34"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> Sof(Cc, a, phi):</span>
<span id="cb15-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>phi</span>
<span id="cb15-36"></span>
<span id="cb15-37"></span>
<span id="cb15-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> profile_mum(gvec, y):</span>
<span id="cb15-39">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""route A: mu_m enters linearly, so minimise ||mu_m g - y||^2 in closed form"""</span></span>
<span id="cb15-40">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>gvec)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(gvec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb15-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>gvec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb15-42"></span>
<span id="cb15-43"></span>
<span id="cb15-44"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_A(name, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mu, X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb15-45">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Xlm <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> X <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> X</span>
<span id="cb15-46">    th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> thetas(name)</span>
<span id="cb15-47">    sse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([profile_mum(G[name](t, CAb, X), y)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> th])</span>
<span id="cb15-48">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(th[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(sse))])</span>
<span id="cb15-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># refine inside the winning cell</span></span>
<span id="cb15-50">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: profile_mum(G[name]([v], CAb, X), y)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb15-51">                            bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb15-52">                            options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>})</span>
<span id="cb15-53">        t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.x)]</span>
<span id="cb15-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:</span>
<span id="cb15-55">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: profile_mum(G[name]([np.exp(v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], CAb, X), y)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb15-56">                     [np.log(t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nelder-Mead"</span>,</span>
<span id="cb15-57">                     options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>,</span>
<span id="cb15-58">                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxiter"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20000</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxfev"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20000</span>})</span>
<span id="cb15-59">        t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(r.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])]</span>
<span id="cb15-60">    mum, sse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> profile_mum(G[name](t, CAb, X), y)</span>
<span id="cb15-61">    pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[name](t, CAb, X)</span>
<span id="cb15-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[mum] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t, sse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sse, rms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(sse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(y))),</span>
<span id="cb15-63">                npar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NTH[name], pred<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pred, resid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y)</span>
<span id="cb15-64"></span>
<span id="cb15-65"></span>
<span id="cb15-66"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> psi(name, th, a, phi, tau_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MUM_HI, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>):</span>
<span id="cb15-67">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""mu_m-FREE trajectories: dCc/dtau = g(S(Cc)) Cc with tau = mu_m t.</span></span>
<span id="cb15-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    One dense-output solve per interval prices every mu_m at once."""</span></span>
<span id="cb15-69">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb15-70">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS):</span>
<span id="cb15-71">        rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: [G[name](th, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(Sof(y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], a, phi), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>), y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb15-72">        out.append(solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tau_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dt[i]], [Cc0[i]], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol,</span>
<span id="cb15-73">                             atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>, dense_output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>).sol)</span>
<span id="cb15-74">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb15-75"></span>
<span id="cb15-76"></span>
<span id="cb15-77"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mu_pred_ode(name, mum, th, a, phi, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>):</span>
<span id="cb15-78">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""route B's forward prediction: integrate to the PRINTED dt, adaptively."""</span></span>
<span id="cb15-79">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty(NOBS)</span>
<span id="cb15-80">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS):</span>
<span id="cb15-81">        rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: [mum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[name](th, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(Sof(y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], a, phi), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>), y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb15-82">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, dt[i]], [Cc0[i]], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,</span>
<span id="cb15-83">                      method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>method)</span>
<span id="cb15-84">        out[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Cc0[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt[i]</span>
<span id="cb15-85">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb15-86"></span>
<span id="cb15-87"></span>
<span id="cb15-88"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_B(name, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mu, a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb15-89">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""global scan on route B's OWN objective, then an adaptive-ODE refinement."""</span></span>
<span id="cb15-90">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_BAL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> a</span>
<span id="cb15-91">    phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PHI_BAL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> phi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> phi</span>
<span id="cb15-92">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb15-93">        best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.inf, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb15-94">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> th <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> thetas(name):</span>
<span id="cb15-95">            sols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> psi(name, th, a, phi)</span>
<span id="cb15-96">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(</span>
<span id="cb15-97">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((np.array(</span>
<span id="cb15-98">                    [np.log(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sols[i](m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>dt[i])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Cc0[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt[i]</span>
<span id="cb15-99">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS)]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb15-100">                bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(MUM_LO, MUM_HI), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>})</span>
<span id="cb15-101">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r.fun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> best[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]:</span>
<span id="cb15-102">                best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.fun), [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.x)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(th))</span>
<span id="cb15-103">        p0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> best[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb15-104">    p0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(p0, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb15-105">    lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(p0)</span>
<span id="cb15-106">    hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NTH[name] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>])</span>
<span id="cb15-107">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: mu_pred_ode(name, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], a, phi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y, p0,</span>
<span id="cb15-108">                      bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo, hi), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb15-109">    sse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r.fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb15-110">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(r.x), sse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sse, rms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(sse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(y))),</span>
<span id="cb15-111">                npar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NTH[name], pred<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r.fun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y, resid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r.fun)</span>
<span id="cb15-112"></span>
<span id="cb15-113"></span>
<span id="cb15-114"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growth laws:"</span>, LAWS, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"| nulls:"</span>, NULLS)</span>
<span id="cb15-115"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"global scan:"</span>, {k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RANGE.items()},</span>
<span id="cb15-116">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"| Moser:"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MOSER_KS), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MOSER_N))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>growth laws: ['Monod', 'Blackman', 'Tessier', 'Moser', 'Contois'] | nulls: ['zero order', 'first order']
global scan: {'Monod': 240, 'Blackman': 240, 'Tessier': 240, 'Contois': 240} | Moser: 60 x 36</code></pre>
</div>
</div>
<div id="29abbd91" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.692863Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.692699Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.704803Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.704038Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> BatchMarch:</span>
<span id="cb17-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""backward Euler on (S, X) with pymrm's newton + NumJac.  Shape (1, 2):</span></span>
<span id="cb17-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    a well-mixed batch is 0-D in space and 2 fields wide, and the growth law is</span></span>
<span id="cb17-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    pointwise in those 2 fields - which is exactly NumJac's default stencil."""</span></span>
<span id="cb17-5"></span>
<span id="cb17-6">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, growth, phi, nstep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>):</span>
<span id="cb17-7">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.phi, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.nstep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> growth, phi, nstep</span>
<span id="cb17-8">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># never a bare (2,)</span></span>
<span id="cb17-9">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># last axis coupled in full</span></span>
<span id="cb17-10"></span>
<span id="cb17-11">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb17-12">        S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb17-13">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g(S, c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb17-14">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.concatenate([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.phi, m], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-15"></span>
<span id="cb17-16">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> step(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c_old, h):</span>
<span id="cb17-17">        eye <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> speye(c_old.size, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)</span>
<span id="cb17-18"></span>
<span id="cb17-19">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(c):</span>
<span id="cb17-20">            s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb17-21">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_old.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb17-22">                    eye<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js)</span>
<span id="cb17-23">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(res, c_old, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb17-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> out.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch step did not converge"</span></span>
<span id="cb17-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out.x.reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb17-26"></span>
<span id="cb17-27">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> march(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c0, T):</span>
<span id="cb17-28">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(c0, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb17-29">        h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.nstep</span>
<span id="cb17-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.nstep):</span>
<span id="cb17-31">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.step(c, h)</span>
<span id="cb17-32">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> c</span>
<span id="cb17-33"></span>
<span id="cb17-34"></span>
<span id="cb17-35"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mu_pred_pymrm(name, mum, th, a, phi, nstep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>):</span>
<span id="cb17-36">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: mum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[name](th, np.maximum(S, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>), X)</span>
<span id="cb17-37">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty(NOBS)</span>
<span id="cb17-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS):</span>
<span id="cb17-39">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BatchMarch(g, phi, nstep).march([[Sof(Cc0[i], a, phi), Cc0[i]]], dt[i])</span>
<span id="cb17-40">        out[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Cc0[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt[i]</span>
<span id="cb17-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb17-42"></span>
<span id="cb17-43"></span>
<span id="cb17-44"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> PlugFlowFermenter:</span>
<span id="cb17-45">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Steady 1-D plug flow, fields (S, X), constant yield.  pymrm operators."""</span></span>
<span id="cb17-46"></span>
<span id="cb17-47">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, growth, phi, Sf, Xf, tau, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>):</span>
<span id="cb17-48">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.phi, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.v, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> growth, phi, v, tau</span>
<span id="cb17-49">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ncell, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># never a bare (ncell,)</span></span>
<span id="cb17-50">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>tau, ncell <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-51">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb17-52">        d0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[Sf, Xf]])</span>
<span id="cb17-53">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># OUTWARD normal, so both dicts read  a dc/dn + b c = d.</span></span>
<span id="cb17-54">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = 0  inlet, outward normal is -z -&gt; Dirichlet feed  a=0, b=1, d=(Sf,Xf)</span></span>
<span id="cb17-55">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = L  outlet, outward normal is +z -&gt; pure outflow   a=1, b=0, d=0</span></span>
<span id="cb17-56">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: d0},</span>
<span id="cb17-57">                   {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>})</span>
<span id="cb17-58">        conv, conv_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_convflux_upwind(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c,</span>
<span id="cb17-59">                                                 <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb17-60">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nu=0 Cartesian</span></span>
<span id="cb17-61">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> conv, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> conv_bc</span>
<span id="cb17-62">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pointwise in the 2 fields</span></span>
<span id="cb17-63">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.tile(d0, (ncell, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb17-64">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb17-65"></span>
<span id="cb17-66">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb17-67">        S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.clip(c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb17-68">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g(S, c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb17-69">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.concatenate([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.flip<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.phi, m], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb17-70"></span>
<span id="cb17-71">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> residual(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb17-72">        s, js <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb17-73">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s.reshape((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb17-74">                <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> js)</span>
<span id="cb17-75"></span>
<span id="cb17-76">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, strict<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb17-77">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.residual, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c0, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb17-78">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> strict:</span>
<span id="cb17-79">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow solve did not converge"</span></span>
<span id="cb17-80">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(r.success)</span>
<span id="cb17-81">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.x.reshape(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.shape)</span>
<span id="cb17-82">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span></span>
<span id="cb17-83"></span>
<span id="cb17-84">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> outlet(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>):</span>
<span id="cb17-85">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""outlet from compute_boundary_values, NOT the last cell centre"""</span></span>
<span id="cb17-86">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.asarray(compute_boundary_values(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.c, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.z_c,</span>
<span id="cb17-87">                                                  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb17-88"></span>
<span id="cb17-89"></span>
<span id="cb17-90"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> batch_reference(growth, phi, S0, X0, tau, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>):</span>
<span id="cb17-91">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the same problem as an initial-value problem - Levenspiel Fig. 29.1"""</span></span>
<span id="cb17-92">    rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, y: [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>growth(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>phi,</span>
<span id="cb17-93">                        growth(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb17-94">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tau], [S0, X0], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb17-95">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s.y[:, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb17-96"></span>
<span id="cb17-97"></span>
<span id="cb17-98"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Chemostat:</span>
<span id="cb17-99">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Rawlings eq. (10.18), marched to steady state; growth law is a callable."""</span></span>
<span id="cb17-100"></span>
<span id="cb17-101">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, growth, y_yield, Sf, D):</span>
<span id="cb17-102">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.y, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Sf, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> growth, y_yield, Sf, D</span>
<span id="cb17-103"></span>
<span id="cb17-104">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rhs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, t, c):</span>
<span id="cb17-105">        S, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb17-106">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.g(S, X)</span>
<span id="cb17-107">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.y, (m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.D)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X]</span>
<span id="cb17-108"></span>
<span id="cb17-109">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> steady(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, tend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40000.0</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>):</span>
<span id="cb17-110">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.rhs, [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, tend], [<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Sf, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.Sf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.y],</span>
<span id="cb17-111">                      rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>)</span>
<span id="cb17-112">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s.y[:, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb17-113"></span>
<span id="cb17-114"></span>
<span id="cb17-115"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BatchMarch        : NumJac((1,2)) + newton, backward Euler on (S, X)"</span>)</span>
<span id="cb17-116"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PlugFlowFermenter : construct_convflux_upwind + construct_div(nu=0) + NumJac((n,2)) + newton"</span>)</span>
<span id="cb17-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Chemostat         : Rawlings eq. (10.18), same source term, marched to steady state"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>BatchMarch        : NumJac((1,2)) + newton, backward Euler on (S, X)
PlugFlowFermenter : construct_convflux_upwind + construct_div(nu=0) + NumJac((n,2)) + newton
Chemostat         : Rawlings eq. (10.18), same source term, marched to steady state</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="route-a---the-comparison-the-exercise-invites" class="level3">
<h3 class="anchored" data-anchor-id="route-a---the-comparison-the-exercise-invites">Route A - the comparison the exercise invites</h3>
<p>Fit each law’s <img src="https://latex.codecogs.com/png.latex?%5Cmu(%5Cbar%20C_A)"> to the seven <img src="https://latex.codecogs.com/png.latex?%5Cmu_i">, with <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> profiled out analytically and the remaining parameter found on a global scan and then refined. Contois needs a biomass too; the exact time average under exponential growth is the <strong>logarithmic</strong> mean of <img src="https://latex.codecogs.com/png.latex?C_C">, which is what is used (the arithmetic mean is a declared convention and a break row).</p>
<div id="13731538" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.706273Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.706050Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:26.870052Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:26.869339Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">RA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: fit_A(k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NULLS}</span>
<span id="cb19-2">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb19-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NULLS:</span>
<span id="cb19-4">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RA[k]</span>
<span id="cb19-5">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(law<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k, npar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"npar"</span>], mu_m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb19-6">                     theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> NTH[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb19-7">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])),</span>
<span id="cb19-8">                     RMS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>], SSE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>]))</span>
<span id="cb19-9">TA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb19-10">show(TA.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_m"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RMS"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SSE"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb19-11">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA"</span>))</span>
<span id="cb19-12"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NULLS:</span>
<span id="cb19-13">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmsA_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' '</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]</span>
<span id="cb19-14">FA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)))</span>
<span id="cb19-15">FA_crit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f_dist.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb19-16">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FA)</span>
<span id="cb19-17">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_n_moser"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb19-18">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_crit_95"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FA_crit</span>
<span id="cb19-19">TWO_PAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>]</span>
<span id="cb19-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Monod is LAST of the four two-parameter laws on this reduction:"</span></span>
<span id="cb19-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" RMS </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h against Contois </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Contois'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb19-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Tessier </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Tessier'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and Blackman </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Blackman'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Blackman'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> between the ends."</span>)</span>
<span id="cb19-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Moser's exponent comes out n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Moser'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and adding it to"</span></span>
<span id="cb19-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Monod gives</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">F = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against F(1,</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA_crit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at 95 % -"</span></span>
<span id="cb19-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" SIGNIFICANT on this reduction."</span>)</span>
<span id="cb19-27"></span>
<span id="cb19-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- but that significance verdict is CO-CAUSED by the one flagged cell, and</span></span>
<span id="cb19-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      this is where a reader meets the claim, so it is priced HERE and not only</span></span>
<span id="cb19-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      in meta.yaml.  The imputed value is a labelled INFERENCE, not a repair.</span></span>
<span id="cb19-31">worstA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(TWO_PAR, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> k: RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])</span>
<span id="cb19-32">CAB_IMPUTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Xlm[BAD_ROW]</span>
<span id="cb19-33">_saveCAb0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb.copy()</span>
<span id="cb19-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb19-35">    CAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _saveCAb0.copy()</span>
<span id="cb19-36">    CAb[BAD_ROW] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAB_IMPUTED</span>
<span id="cb19-37">    RA_IMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: fit_A(k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS}</span>
<span id="cb19-38"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">finally</span>:</span>
<span id="cb19-39">    CAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _saveCAb0</span>
<span id="cb19-40">FA_IMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>])</span>
<span id="cb19-41">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)))</span>
<span id="cb19-42">worstA_imp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(TWO_PAR, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> k: RA_IMP[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])</span>
<span id="cb19-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">IT IS NOT THE REDUCTION ALONE THAT CLEARS THAT TEST. Put row"</span></span>
<span id="cb19-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAD_ROW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'s CA_bar at the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">value its own material balance implies,"</span></span>
<span id="cb19-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAB_IMPUTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[BAD_ROW]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - an"</span></span>
<span id="cb19-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">INFERENCE, not a repair, and nothing in the CSV is edited - and route A"</span></span>
<span id="cb19-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" gives</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">F = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA_IMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the same </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA_crit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: NOT significant."</span></span>
<span id="cb19-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" One printed cell,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which the page flags as off the table's own balance"</span></span>
<span id="cb19-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" line, carries that verdict</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">over the threshold on its own."</span>)</span>
<span id="cb19-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The RANKING claim is unaffected: Blackman still beats Monod with the cell"</span></span>
<span id="cb19-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">imputed (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Blackman'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against"</span></span>
<span id="cb19-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, a factor"</span></span>
<span id="cb19-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Blackman'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">where the printed"</span></span>
<span id="cb19-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" cell gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Blackman'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), and the"</span></span>
<span id="cb19-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" route-A-to-route-B reversal below is the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reduction. What does move is"</span></span>
<span id="cb19-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" which law comes last of the four: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worstA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed cell,"</span></span>
<span id="cb19-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worstA_imp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the imputed one, and they differ by"</span></span>
<span id="cb19-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Contois'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb19-59"></span>
<span id="cb19-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Every law beats both one-parameter nulls: zero order"</span></span>
<span id="cb19-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'zero order'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, first order</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'first order'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - Monod is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'first order'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x better than the"</span></span>
<span id="cb19-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" best of them, and Blackman </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'first order'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Blackman'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_routeA" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_routeA_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">law</th>
<th id="T_routeA_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">npar</th>
<th id="T_routeA_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">mu_m</th>
<th id="T_routeA_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">theta</th>
<th id="T_routeA_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">RMS</th>
<th id="T_routeA_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">SSE</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_routeA_row0_col0" class="data row0 col0">Monod</td>
<td id="T_routeA_row0_col1" class="data row0 col1">2</td>
<td id="T_routeA_row0_col2" class="data row0 col2">0.952745</td>
<td id="T_routeA_row0_col3" class="data row0 col3">28.553</td>
<td id="T_routeA_row0_col4" class="data row0 col4">0.054690</td>
<td id="T_routeA_row0_col5" class="data row0 col5">0.0209372</td>
</tr>
<tr class="even">
<td id="T_routeA_row1_col0" class="data row1 col0">Blackman</td>
<td id="T_routeA_row1_col1" class="data row1 col1">2</td>
<td id="T_routeA_row1_col2" class="data row1 col2">0.749456</td>
<td id="T_routeA_row1_col3" class="data row1 col3">24.109</td>
<td id="T_routeA_row1_col4" class="data row1 col4">0.026772</td>
<td id="T_routeA_row1_col5" class="data row1 col5">0.0050173</td>
</tr>
<tr class="odd">
<td id="T_routeA_row2_col0" class="data row2 col0">Tessier</td>
<td id="T_routeA_row2_col1" class="data row2 col1">2</td>
<td id="T_routeA_row2_col2" class="data row2 col2">0.771052</td>
<td id="T_routeA_row2_col3" class="data row2 col3">0.035009</td>
<td id="T_routeA_row2_col4" class="data row2 col4">0.038710</td>
<td id="T_routeA_row2_col5" class="data row2 col5">0.0104891</td>
</tr>
<tr class="even">
<td id="T_routeA_row3_col0" class="data row3 col0">Moser</td>
<td id="T_routeA_row3_col1" class="data row3 col1">3</td>
<td id="T_routeA_row3_col2" class="data row3 col2">0.778787</td>
<td id="T_routeA_row3_col3" class="data row3 col3">346.4, 1.9317</td>
<td id="T_routeA_row3_col4" class="data row3 col4">0.027117</td>
<td id="T_routeA_row3_col5" class="data row3 col5">0.0051475</td>
</tr>
<tr class="odd">
<td id="T_routeA_row4_col0" class="data row4 col0">Contois</td>
<td id="T_routeA_row4_col1" class="data row4 col1">2</td>
<td id="T_routeA_row4_col2" class="data row4 col2">0.833236</td>
<td id="T_routeA_row4_col3" class="data row4 col3">0.41283</td>
<td id="T_routeA_row4_col4" class="data row4 col4">0.051534</td>
<td id="T_routeA_row4_col5" class="data row4 col5">0.01859</td>
</tr>
<tr class="even">
<td id="T_routeA_row5_col0" class="data row5 col0">zero order</td>
<td id="T_routeA_row5_col1" class="data row5 col1">1</td>
<td id="T_routeA_row5_col2" class="data row5 col2">0.509681</td>
<td id="T_routeA_row5_col3" class="data row5 col3">-</td>
<td id="T_routeA_row5_col4" class="data row5 col4">0.278278</td>
<td id="T_routeA_row5_col5" class="data row5 col5">0.542072</td>
</tr>
<tr class="odd">
<td id="T_routeA_row6_col0" class="data row6 col0">first order</td>
<td id="T_routeA_row6_col1" class="data row6 col1">1</td>
<td id="T_routeA_row6_col2" class="data row6 col2">0.956008</td>
<td id="T_routeA_row6_col3" class="data row6 col3">-</td>
<td id="T_routeA_row6_col4" class="data row6 col4">0.201476</td>
<td id="T_routeA_row6_col5" class="data row6 col5">0.284149</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Monod is LAST of the four two-parameter laws on this reduction: RMS 0.054690 1/h against Contois 0.051534,
Tessier 0.038710 and Blackman 0.026772 - a factor 2.04 between the ends.
Moser's exponent comes out n = 1.9317, and adding it to Monod gives
F = 12.2698 against F(1,4) = 7.7086 at 95 % - SIGNIFICANT on this reduction.

IT IS NOT THE REDUCTION ALONE THAT CLEARS THAT TEST. Put row 4's CA_bar at the
value its own material balance implies, 60.18 instead of the printed 43 - an
INFERENCE, not a repair, and nothing in the CSV is edited - and route A gives
F = 5.4477 against the same 7.7086: NOT significant. One printed cell,
which the page flags as off the table's own balance line, carries that verdict
over the threshold on its own.
The RANKING claim is unaffected: Blackman still beats Monod with the cell
imputed (0.040646 against 0.046870, a factor 1.15
where the printed cell gives 2.04), and the route-A-to-route-B reversal below is the
reduction. What does move is which law comes last of the four: Monod on the
printed cell, Contois on the imputed one, and they differ by 0.14 %.

Every law beats both one-parameter nulls: zero order 0.278278, first order
0.201476 - Monod is 3.68x better than the best of them, and Blackman 7.53x.</code></pre>
</div>
</div>
</section>
<section id="route-b---the-same-seven-growth-rates-averaged-properly" class="level3">
<h3 class="anchored" data-anchor-id="route-b---the-same-seven-growth-rates-averaged-properly">Route B - the same seven growth rates, averaged properly</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu_i"> is <em>exactly</em> the interval average of <img src="https://latex.codecogs.com/png.latex?%5Cmu">, so the honest comparison integrates the law across the interval instead of evaluating it at <img src="https://latex.codecogs.com/png.latex?%5Cbar%20C_A">. Constant yield makes that a single ODE, and the two constants it needs - <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> and <img src="https://latex.codecogs.com/png.latex?a"> - come from the <strong>material-balance line</strong>, which is a property of the printed table and of no growth law. <strong>No parameter is added and the models are the same five.</strong></p>
<p><strong>What each route reads, exactly.</strong> Both fit the same seven <img src="https://latex.codecogs.com/png.latex?%5Cmu_i">, which are the whole of the kinetic information in the table. They differ in where the <em>substrate</em> comes from: route A reads all seven printed <img src="https://latex.codecogs.com/png.latex?%5Cbar%20C_A"> directly, while route B never touches that column at all - it takes the substrate trajectory from <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> and <img src="https://latex.codecogs.com/png.latex?a">, and those come from the <strong>six-row</strong> balance line, the one that excludes the flagged row 4. So the datum route A’s ranking leans on hardest is exactly the one route B’s balance line leaves out. That is a real difference between the routes and not a nuisance: the break table prices it directly, refitting every route-B law - and route B’s own <img src="https://latex.codecogs.com/png.latex?F"> - with the <strong>all-seven</strong> balance line instead.</p>
<div id="c25ff827" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:26.872217Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:26.871911Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:00.374362Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:00.373202Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NO WALL-CLOCK TIMING IS PRINTED ANYWHERE ON THIS PAGE: elapsed seconds differ</span></span>
<span id="cb21-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># between two consecutive executions, and a page whose stream output is not</span></span>
<span id="cb21-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reproducible cannot be diffed, which is how a real drift would be spotted.  The runtime lives in meta.yaml, where it belongs.</span></span>
<span id="cb21-4">RB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: fit_B(k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NULLS}</span>
<span id="cb21-5">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb21-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NULLS:</span>
<span id="cb21-7">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[k]</span>
<span id="cb21-8">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(law<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k, npar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"npar"</span>], mu_m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb21-9">                     theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> NTH[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb21-10">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])),</span>
<span id="cb21-11">                     RMS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>], <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RMS route A"</span>: RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]},</span>
<span id="cb21-12">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B / A"</span>: r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]}))</span>
<span id="cb21-13">TB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb21-14">show(TB.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu_m"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RMS"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RMS route A"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb21-15">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B / A"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB"</span>))</span>
<span id="cb21-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> NULLS:</span>
<span id="cb21-17">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmsB_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' '</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]</span>
<span id="cb21-18">FB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)))</span>
<span id="cb21-19">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_F_moser_vs_monod"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FB)</span>
<span id="cb21-20">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_n_moser"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb21-21">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_mu_m"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-22">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_K_S"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb21-23">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_over_routeB_monod_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]</span>
<span id="cb21-24">worstA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(TWO_PAR, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> k: RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])</span>
<span id="cb21-25">worstB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(TWO_PAR, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> k: RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])</span>
<span id="cb21-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The ranking changes. Monod's residual falls"</span></span>
<span id="cb21-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, from"</span></span>
<span id="cb21-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h;"</span></span>
<span id="cb21-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the worst of the four two-parameter laws goes from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worstA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worstB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb21-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Moser's exponent drops from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Moser'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to"</span></span>
<span id="cb21-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Moser'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and F from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, against the"</span></span>
<span id="cb21-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">same F(1,</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA_crit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: NOT significant."</span>)</span>
<span id="cb21-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Monod, route B, FITTED HERE: mu_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h,"</span></span>
<span id="cb21-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" K_S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">in the units of the printed CA_bar column,"</span></span>
<span id="cb21-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" which the source does not print."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_routeB" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_routeB_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">law</th>
<th id="T_routeB_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">npar</th>
<th id="T_routeB_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">mu_m</th>
<th id="T_routeB_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">theta</th>
<th id="T_routeB_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">RMS</th>
<th id="T_routeB_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">RMS route A</th>
<th id="T_routeB_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">B / A</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_routeB_row0_col0" class="data row0 col0">Monod</td>
<td id="T_routeB_row0_col1" class="data row0 col1">2</td>
<td id="T_routeB_row0_col2" class="data row0 col2">0.880923</td>
<td id="T_routeB_row0_col3" class="data row0 col3">20.454</td>
<td id="T_routeB_row0_col4" class="data row0 col4">0.031466</td>
<td id="T_routeB_row0_col5" class="data row0 col5">0.054690</td>
<td id="T_routeB_row0_col6" class="data row0 col6">0.5753</td>
</tr>
<tr class="even">
<td id="T_routeB_row1_col0" class="data row1 col0">Blackman</td>
<td id="T_routeB_row1_col1" class="data row1 col1">2</td>
<td id="T_routeB_row1_col2" class="data row1 col2">0.721499</td>
<td id="T_routeB_row1_col3" class="data row1 col3">19.008</td>
<td id="T_routeB_row1_col4" class="data row1 col4">0.039554</td>
<td id="T_routeB_row1_col5" class="data row1 col5">0.026772</td>
<td id="T_routeB_row1_col6" class="data row1 col6">1.4774</td>
</tr>
<tr class="odd">
<td id="T_routeB_row2_col0" class="data row2 col0">Tessier</td>
<td id="T_routeB_row2_col1" class="data row2 col1">2</td>
<td id="T_routeB_row2_col2" class="data row2 col2">0.756013</td>
<td id="T_routeB_row2_col3" class="data row2 col3">0.037573</td>
<td id="T_routeB_row2_col4" class="data row2 col4">0.026308</td>
<td id="T_routeB_row2_col5" class="data row2 col5">0.038710</td>
<td id="T_routeB_row2_col6" class="data row2 col6">0.6796</td>
</tr>
<tr class="even">
<td id="T_routeB_row3_col0" class="data row3 col0">Moser</td>
<td id="T_routeB_row3_col1" class="data row3 col1">3</td>
<td id="T_routeB_row3_col2" class="data row3 col2">0.793331</td>
<td id="T_routeB_row3_col3" class="data row3 col3">84.785, 1.5099</td>
<td id="T_routeB_row3_col4" class="data row3 col4">0.026985</td>
<td id="T_routeB_row3_col5" class="data row3 col5">0.027117</td>
<td id="T_routeB_row3_col6" class="data row3 col6">0.9951</td>
</tr>
<tr class="odd">
<td id="T_routeB_row4_col0" class="data row4 col0">Contois</td>
<td id="T_routeB_row4_col1" class="data row4 col1">2</td>
<td id="T_routeB_row4_col2" class="data row4 col2">0.798109</td>
<td id="T_routeB_row4_col3" class="data row4 col3">0.29614</td>
<td id="T_routeB_row4_col4" class="data row4 col4">0.031466</td>
<td id="T_routeB_row4_col5" class="data row4 col5">0.051534</td>
<td id="T_routeB_row4_col6" class="data row4 col6">0.6106</td>
</tr>
<tr class="even">
<td id="T_routeB_row5_col0" class="data row5 col0">zero order</td>
<td id="T_routeB_row5_col1" class="data row5 col1">1</td>
<td id="T_routeB_row5_col2" class="data row5 col2">0.509681</td>
<td id="T_routeB_row5_col3" class="data row5 col3">-</td>
<td id="T_routeB_row5_col4" class="data row5 col4">0.278278</td>
<td id="T_routeB_row5_col5" class="data row5 col5">0.278278</td>
<td id="T_routeB_row5_col6" class="data row5 col6">1.0000</td>
</tr>
<tr class="odd">
<td id="T_routeB_row6_col0" class="data row6 col0">first order</td>
<td id="T_routeB_row6_col1" class="data row6 col1">1</td>
<td id="T_routeB_row6_col2" class="data row6 col2">0.960801</td>
<td id="T_routeB_row6_col3" class="data row6 col3">-</td>
<td id="T_routeB_row6_col4" class="data row6 col4">0.151597</td>
<td id="T_routeB_row6_col5" class="data row6 col5">0.201476</td>
<td id="T_routeB_row6_col6" class="data row6 col6">0.7524</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
The ranking changes. Monod's residual falls 42 %, from 0.054690 to 0.031466 1/h;
the worst of the four two-parameter laws goes from Monod to Blackman.
Moser's exponent drops from 1.9317 to 1.5099 and F from 12.2698 to 1.4389, against the
same F(1,4) = 7.7086: NOT significant.

Monod, route B, FITTED HERE: mu_m = 0.880923 1/h, K_S = 20.45353
in the units of the printed CA_bar column, which the source does not print.</code></pre>
</div>
</div>
<div id="96a7dfc5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:00.377043Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:00.376785Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:00.382954Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:00.382178Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Contois lands on the Monod curve, to the optimiser's own tolerance</span></span>
<span id="cb23-2">mumC, KsxC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>]</span>
<span id="cb23-3">beta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KsxC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PHI_BAL</span>
<span id="cb23-4">map_mum, map_Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mumC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>beta, KsxC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>beta</span>
<span id="cb23-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE RULE, stated once here and applied over the WHOLE class in the claims</span></span>
<span id="cb23-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cell: a quantity this page PROVES is exactly zero is an optimiser or</span></span>
<span id="cb23-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># root-finder exit tolerance, not a measurement, so its digits differ between</span></span>
<span id="cb23-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># machines.  It is registered as a BOUND (docs/claims-design.md), checked on</span></span>
<span id="cb23-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every run against a limit that holds on any machine, and never compared as a</span></span>
<span id="cb23-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># value.  The printed digits below are this run's; the prose quotes the bound.</span></span>
<span id="cb23-11">MAP_BOUND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative: the bound on the two map errors and on S_f/a - 1</span></span>
<span id="cb23-12">RMS_GAP_BOUND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1/h: the bound on the Contois-minus-Monod RMS gap</span></span>
<span id="cb23-13">MAP_MUM_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_mum_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb23-14">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(map_mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb23-15">MAP_KS_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_KS_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb23-16">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(map_Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-17">CONTOIS_MINUS_MONOD_RMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_minus_monod_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb23-18">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]))</span>
<span id="cb23-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The Contois fit, pushed through the identity proved in *The published model*:"</span>)</span>
<span id="cb23-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   mu_m -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>map_mum<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   against the Monod fit's"</span></span>
<span id="cb23-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (rel. below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_MUM_RELERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   K_S  -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>map_Ks<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   against the Monod fit's"</span></span>
<span id="cb23-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (rel. below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_KS_RELERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   residual RMS differs by less than </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_GAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h (here"</span></span>
<span id="cb23-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CONTOIS_MINUS_MONOD_RMS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   All three of those numbers are BOUNDS, not values: the page proves this"</span>)</span>
<span id="cb23-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   is one curve fitted twice, so they are two optimisers' exit tolerances,"</span>)</span>
<span id="cb23-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   and each is checked against a limit that holds on any machine."</span>)</span>
<span id="cb23-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Two optimisers, started from different places on two different"</span>)</span>
<span id="cb23-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parameterisations, landed on the same curve - because it IS the same curve."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The Contois fit, pushed through the identity proved in *The published model*:
   mu_m -&gt; 0.880920642   against the Monod fit's 0.880922570   (rel. below 0.001, here 2.2e-06)
   K_S  -&gt; 20.453271913   against the Monod fit's 20.453534619   (rel. below 0.001, here 1.3e-05)
   residual RMS differs by less than 1e-10 1/h (here 4.2e-12)
   All three of those numbers are BOUNDS, not values: the page proves this
   is one curve fitted twice, so they are two optimisers' exit tolerances,
   and each is checked against a limit that holds on any machine.

Two optimisers, started from different places on two different
parameterisations, landed on the same curve - because it IS the same curve.</code></pre>
</div>
</div>
</section>
<section id="why-the-two-routes-disagree-the-reduction-bias-measured" class="level3">
<h3 class="anchored" data-anchor-id="why-the-two-routes-disagree-the-reduction-bias-measured">Why the two routes disagree: the reduction bias, measured</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu"> is curved, so evaluating it at <img src="https://latex.codecogs.com/png.latex?%5Cbar%20C_A"> is not the same as averaging it across the interval. The gap is second order in the substrate swing - and the swing is not small: <strong>the last two intervals consume more substrate than their own printed average.</strong></p>
<div id="5847c61c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:00.385470Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:00.385149Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:00.398886Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:00.398009Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1">pA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>]</span>
<span id="cb25-2">point_est <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pA[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>](pA[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], CAb, Xlm)</span>
<span id="cb25-3">exact_est <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_ode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pA[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pA[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL)</span>
<span id="cb25-4">bias <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> point_est <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> exact_est</span>
<span id="cb25-5">swing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Cc1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># substrate consumed in the interval</span></span>
<span id="cb25-6">TBias <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"interval"</span>: np.arange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CA_bar printed"</span>: CAb,</span>
<span id="cb25-7">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"substrate consumed"</span>: swing, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"swing / CA_bar"</span>: swing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb,</span>
<span id="cb25-8">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu(CA_bar)"</span>: point_est, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;mu&gt; exact"</span>: exact_est, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias"</span>: bias})</span>
<span id="cb25-9">show(TBias.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CA_bar printed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.0f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"substrate consumed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb25-10">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"swing / CA_bar"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu(CA_bar)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb25-11">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;mu&gt; exact"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:+.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb25-12">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias"</span>))</span>
<span id="cb25-13">i_worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.where(np.arange(NOBS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW, bias, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))))</span>
<span id="cb25-14">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bias)))</span>
<span id="cb25-15">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_max_abs_excl_bad_row"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bias[i_worst]))</span>
<span id="cb25-16">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_over_routeA_rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_max_abs_excl_bad_row"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]</span>
<span id="cb25-17">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_swing_over_CAbar"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(swing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb))</span>
<span id="cb25-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Largest bias away from the flagged row: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bias[i_worst]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h at"</span></span>
<span id="cb25-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" CA_bar = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAb[i_worst]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (interval </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i_worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span></span>
<span id="cb25-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bias_over_routeA_rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the residual scatter route A"</span></span>
<span id="cb25-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ranks the five laws on."</span>)</span>
<span id="cb25-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAD_ROW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'s entry, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bias[BAD_ROW]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, is a different animal: it is"</span></span>
<span id="cb25-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" dominated by that row's</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">departure from the material balance, not by curvature,"</span></span>
<span id="cb25-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and is reported separately."</span>)</span>
<span id="cb25-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Largest substrate swing relative to the printed average:"</span></span>
<span id="cb25-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max_swing_over_CAbar'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (interval </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(swing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb25-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The bias has a SIGN: mu is concave, so mu(mean) exceeds the mean of mu, and"</span>)</span>
<span id="cb25-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the shortcut therefore makes every saturating law look too gradual near"</span>)</span>
<span id="cb25-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exhaustion - which is exactly the direction that inflates Moser's exponent."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_bias" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_bias_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">interval</th>
<th id="T_bias_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">CA_bar printed</th>
<th id="T_bias_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">substrate consumed</th>
<th id="T_bias_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">swing / CA_bar</th>
<th id="T_bias_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">mu(CA_bar)</th>
<th id="T_bias_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th"><mu> exact</mu></th>
<th id="T_bias_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">bias</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_bias_row0_col0" class="data row0 col0">1</td>
<td id="T_bias_row0_col1" class="data row0 col1">137</td>
<td id="T_bias_row0_col2" class="data row0 col2">23.63</td>
<td id="T_bias_row0_col3" class="data row0 col3">0.172</td>
<td id="T_bias_row0_col4" class="data row0 col4">0.78842</td>
<td id="T_bias_row0_col5" class="data row0 col5">0.78728</td>
<td id="T_bias_row0_col6" class="data row0 col6">+0.00114</td>
</tr>
<tr class="even">
<td id="T_bias_row1_col0" class="data row1 col0">2</td>
<td id="T_bias_row1_col1" class="data row1 col1">114</td>
<td id="T_bias_row1_col2" class="data row1 col2">22.05</td>
<td id="T_bias_row1_col3" class="data row1 col3">0.193</td>
<td id="T_bias_row1_col4" class="data row1 col4">0.76191</td>
<td id="T_bias_row1_col5" class="data row1 col5">0.76108</td>
<td id="T_bias_row1_col6" class="data row1 col6">+0.00083</td>
</tr>
<tr class="odd">
<td id="T_bias_row2_col0" class="data row2 col0">3</td>
<td id="T_bias_row2_col1" class="data row2 col1">90</td>
<td id="T_bias_row2_col2" class="data row2 col2">27.72</td>
<td id="T_bias_row2_col3" class="data row2 col3">0.308</td>
<td id="T_bias_row2_col4" class="data row2 col4">0.72328</td>
<td id="T_bias_row2_col5" class="data row2 col5">0.72286</td>
<td id="T_bias_row2_col6" class="data row2 col6">+0.00042</td>
</tr>
<tr class="even">
<td id="T_bias_row3_col0" class="data row3 col0">4</td>
<td id="T_bias_row3_col1" class="data row3 col1">43</td>
<td id="T_bias_row3_col2" class="data row3 col2">30.56</td>
<td id="T_bias_row3_col3" class="data row3 col3">0.711</td>
<td id="T_bias_row3_col4" class="data row3 col4">0.57255</td>
<td id="T_bias_row3_col5" class="data row3 col5">0.64111</td>
<td id="T_bias_row3_col6" class="data row3 col6">-0.06856</td>
</tr>
<tr class="odd">
<td id="T_bias_row4_col0" class="data row4 col0">5</td>
<td id="T_bias_row4_col1" class="data row4 col1">29</td>
<td id="T_bias_row4_col2" class="data row4 col2">30.87</td>
<td id="T_bias_row4_col3" class="data row4 col3">1.065</td>
<td id="T_bias_row4_col4" class="data row4 col4">0.48007</td>
<td id="T_bias_row4_col5" class="data row4 col5">0.46948</td>
<td id="T_bias_row4_col6" class="data row4 col6">+0.01059</td>
</tr>
<tr class="even">
<td id="T_bias_row5_col0" class="data row5 col0">6</td>
<td id="T_bias_row5_col1" class="data row5 col1">9</td>
<td id="T_bias_row5_col2" class="data row5 col2">9.45</td>
<td id="T_bias_row5_col3" class="data row5 col3">1.050</td>
<td id="T_bias_row5_col4" class="data row5 col4">0.22833</td>
<td id="T_bias_row5_col5" class="data row5 col5">0.16202</td>
<td id="T_bias_row5_col6" class="data row5 col6">+0.06631</td>
</tr>
<tr class="odd">
<td id="T_bias_row6_col0" class="data row6 col0">7</td>
<td id="T_bias_row6_col1" class="data row6 col1">2</td>
<td id="T_bias_row6_col2" class="data row6 col2">3.78</td>
<td id="T_bias_row6_col3" class="data row6 col3">1.890</td>
<td id="T_bias_row6_col4" class="data row6 col4">0.06237</td>
<td id="T_bias_row6_col5" class="data row6 col5">0.04997</td>
<td id="T_bias_row6_col6" class="data row6 col6">+0.01239</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Largest bias away from the flagged row: +0.066310 1/h at CA_bar = 9 (interval 6),
which is 1.21 times the residual scatter route A ranks the five laws on.
Row 4's entry, -0.068561, is a different animal: it is dominated by that row's
departure from the material balance, not by curvature, and is reported separately.
Largest substrate swing relative to the printed average: 1.890 (interval 7).

The bias has a SIGN: mu is concave, so mu(mean) exceeds the mean of mu, and
the shortcut therefore makes every saturating law look too gradual near
exhaustion - which is exactly the direction that inflates Moser's exponent.</code></pre>
</div>
</div>
</section>
<section id="what-that-costs-a-seeded-bootstrap-with-a-control" class="level3">
<h3 class="anchored" data-anchor-id="what-that-costs-a-seeded-bootstrap-with-a-control">What that costs: a seeded bootstrap, with a control</h3>
<p>Generate data <strong>from a Monod model</strong>, add Gaussian noise at the observed residual scale, and run route A’s F test on it. Do it twice, changing only what “a Monod model” means:</p>
<ul>
<li><strong>from the forward model</strong> - i.e.&nbsp;from data Monod would actually produce;</li>
<li><strong>from <img src="https://latex.codecogs.com/png.latex?%5Cmu(%5Cbar%20C_A)"></strong> - route A’s <em>own</em> model, for which route A is correctly specified.</li>
</ul>
<p>The second is the control. If route A’s size is inflated in both, the culprit is the small-sample F approximation; if only in the first, it is the reduction.</p>
<p><strong>Every draw is fitted the way route A fits the real data - global scan, then refined.</strong> This is not a detail. The observed <img src="https://latex.codecogs.com/png.latex?F"> the draws are compared against comes from a <em>refined</em> fit, and reading the draws’ fits off the scan grid with no refinement is worth a factor two in the control’s size: an unrefined Moser fit cannot reach its own optimum, so it under-states <img src="https://latex.codecogs.com/png.latex?F"> on every draw and makes the test look conservative when it is not. The refinement is a per-draw zoom on the winning grid cell, its convergence is printed below, and the grid-only numbers are kept as a <strong>break row</strong> because that is exactly the class of defect - a grid-limited extremum - that no perturbation test can see.</p>
<div id="92d67c02" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:00.401090Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:00.400957Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:03.131579Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:03.130664Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> gmat(name, X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb27-2">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Xlm <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> X <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> X</span>
<span id="cb27-3">    th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> thetas(name)</span>
<span id="cb27-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([G[name](t, CAb, X) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> th]), th</span>
<span id="cb27-5"></span>
<span id="cb27-6"></span>
<span id="cb27-7">GA_M, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gmat(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>)</span>
<span id="cb27-8">GA_S, thA_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gmat(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>)</span>
<span id="cb27-9">nlist <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> thA_S])</span>
<span id="cb27-10">DLOG_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(RANGE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RANGE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid node spacings</span></span>
<span id="cb27-11">DLOG_S, DN_S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(MOSER_KS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MOSER_KS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), MOSER_N[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> MOSER_N[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-12">ZOOM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># refinement rounds; convergence printed</span></span>
<span id="cb27-13"></span>
<span id="cb27-14"></span>
<span id="cb27-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sse_M(Y, K):</span>
<span id="cb27-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""profiled SSE of Monod at a per-draw K (broadcasting over the leading axes)"""</span></span>
<span id="cb27-17">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(K[..., <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> CAb)</span>
<span id="cb27-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...i,...i-&gt;..."</span>, Y, Y)</span>
<span id="cb27-19">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...i,...i-&gt;..."</span>, Y, g)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...i,...i-&gt;..."</span>, g, g))</span>
<span id="cb27-20"></span>
<span id="cb27-21"></span>
<span id="cb27-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sse_S(Y, K, n):</span>
<span id="cb27-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""profiled SSE of Moser at a per-draw (K, n)"""</span></span>
<span id="cb27-24">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>n[..., <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb27-25">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(K[..., <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> u)</span>
<span id="cb27-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...i,...i-&gt;..."</span>, Y, Y)</span>
<span id="cb27-27">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...i,...i-&gt;..."</span>, Y, g)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...i,...i-&gt;..."</span>, g, g))</span>
<span id="cb27-28"></span>
<span id="cb27-29"></span>
<span id="cb27-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _zoom1(Y, lk, half, rounds, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>):</span>
<span id="cb27-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""per-draw zoom on log K: m nodes across the bracket, halve, repeat"""</span></span>
<span id="cb27-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(rounds):</span>
<span id="cb27-33">        cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lk[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, m)[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>half[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb27-34">        j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.argmin(_sse_M(Y[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :], np.exp(cand)), axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb27-35">        lk, half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cand[np.arange(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Y)), j], half<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb27-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(lk)</span>
<span id="cb27-37"></span>
<span id="cb27-38"></span>
<span id="cb27-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _zoom2(Y, lk, n, hK, hN, rounds, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>):</span>
<span id="cb27-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""the same in two dimensions, on (log K_s, n)"""</span></span>
<span id="cb27-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(rounds):</span>
<span id="cb27-42">        cK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lk[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, m)[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>hK[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb27-43">        cN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(n[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, m)[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>hN[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb27-44">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _sse_S(Y[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :], np.exp(cK)[:, :, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cN[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :],</span>
<span id="cb27-45">                   cN[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cK[:, :, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>])</span>
<span id="cb27-46">        jk, jn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.unravel_index(np.argmin(s.reshape(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Y), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), (m, m))</span>
<span id="cb27-47">        lk, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cK[np.arange(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Y)), jk], cN[np.arange(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Y)), jn]</span>
<span id="cb27-48">        hK, hN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), hN<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb27-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(lk), n</span>
<span id="cb27-50"></span>
<span id="cb27-51"></span>
<span id="cb27-52"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> boot_stats(Y, rounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb27-53">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""route-A F statistic and n_hat for a whole block of synthetic datasets.</span></span>
<span id="cb27-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Global scan on the SAME grids route A uses, then the SAME refinement:</span></span>
<span id="cb27-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    rounds=0 reproduces a grid-only fit and is kept as a break row.  Also returns</span></span>
<span id="cb27-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    a diagnostic dict whose `nclip` is the refinement's convergence evidence,</span></span>
<span id="cb27-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    counted FROM THE GRID START ALONE - the note under the depth table says why</span></span>
<span id="cb27-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    it cannot be counted from the shipped pair of starts."""</span></span>
<span id="cb27-59">    rounds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ZOOM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rounds <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> rounds</span>
<span id="cb27-60">    nd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Y)</span>
<span id="cb27-61">    y2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb27-62">    q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> GA_M.T)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mi,mi-&gt;m"</span>, GA_M, GA_M)[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :]</span>
<span id="cb27-63">    q2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> GA_S.T)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.einsum(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mi,mi-&gt;m"</span>, GA_S, GA_S)[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :]</span>
<span id="cb27-64">    i1, i2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.argmin(q1, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), np.argmin(q2, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb27-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rounds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb27-66">        s1, s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> q1[np.arange(nd), i1], q2[np.arange(nd), i2]</span>
<span id="cb27-67">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nclip is measured from this row's own grid minima; nclip_pair is a</span></span>
<span id="cb27-68">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># STRUCTURAL 0 - there is no pair of starts at depth 0 - and the sum that</span></span>
<span id="cb27-69">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reports it below excludes this row for exactly that reason.</span></span>
<span id="cb27-70">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((s1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(s2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)), nlist[i2],</span>
<span id="cb27-71">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(nclip<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> s1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))), nclip_pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb27-72">                     ident<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, nest_wins<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, best_gain<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, flips<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb27-73">    K1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _zoom1(Y, np.log(RANGE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][i1]), np.full(nd, DLOG_M), rounds)</span>
<span id="cb27-74">    s1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _sse_M(Y, K1)</span>
<span id="cb27-75">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># TWO starts for the two-dimensional fit: the grid winner, and the NESTING</span></span>
<span id="cb27-76">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># POINT n = 1 at the refined Monod K_S.  The second start is a MONOTONICITY</span></span>
<span id="cb27-77">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># GUARANTEE, not a basin escape: at it the Moser objective IS the Monod</span></span>
<span id="cb27-78">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># objective - the same quantity to the last bit, `ident` below - and _zoom2's</span></span>
<span id="cb27-79">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># candidate set contains its own centre, so a fit started there can never end</span></span>
<span id="cb27-80">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># above the Monod fit it is being tested against.  Measured below: it changes</span></span>
<span id="cb27-81">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># no rejection decision on either arm and its largest SSE gain is a few parts</span></span>
<span id="cb27-82">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># in 1e5.  What it buys is that the projection onto the nesting constraint</span></span>
<span id="cb27-83">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two blocks down is inert - and that is also why the count of draws where</span></span>
<span id="cb27-84">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># that projection binds measures nothing at all.</span></span>
<span id="cb27-85">    ident <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_sse_S(Y, K1, np.ones(nd)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s1)))</span>
<span id="cb27-86">    sols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb27-87">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lk0, n0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((np.log(np.array([thA_S[j][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> i2])),</span>
<span id="cb27-88">                     np.array([thA_S[j][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> i2])),</span>
<span id="cb27-89">                    (np.log(K1), np.ones(nd))):</span>
<span id="cb27-90">        K2, n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _zoom2(Y, lk0, n0, np.full(nd, DLOG_S), np.full(nd, DN_S), rounds)</span>
<span id="cb27-91">        sols.append((_sse_S(Y, K2, n2), n2))</span>
<span id="cb27-92">    take <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-93">    s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(take, sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb27-94">    nhat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(take, sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb27-95">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Moser CONTAINS Monod, so its SSE cannot exceed Monod's, and a fit that ends</span></span>
<span id="cb27-96">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># above it is not converged.  That count is informative for the GRID START</span></span>
<span id="cb27-97">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (nclip) and is identically zero for the shipped pair (nclip_pair), for the</span></span>
<span id="cb27-98">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reason given above; both are returned and both are printed.</span></span>
<span id="cb27-99">    nclip <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> s1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)))</span>
<span id="cb27-100">    nclip_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> s1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)))</span>
<span id="cb27-101">    gain <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>((sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s2))</span>
<span id="cb27-102">    sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.minimum(sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], s1)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the grid start on its own</span></span>
<span id="cb27-103">    F_grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (s1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(sg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb27-104">    s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.minimum(s2, s1)</span>
<span id="cb27-105">    F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (s1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(s2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb27-106">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> F, nhat, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(nclip<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nclip, nclip_pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nclip_pair, ident<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ident,</span>
<span id="cb27-107">                         nest_wins<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> sols[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])),</span>
<span id="cb27-108">                         best_gain<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>gain,</span>
<span id="cb27-109">                         flips<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_crit) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> (F_grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_crit))))</span>
<span id="cb27-110"></span>
<span id="cb27-111"></span>
<span id="cb27-112"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> prop_se(p):</span>
<span id="cb27-113">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""binomial standard error of a bootstrap frequency, at NBOOT draws"""</span></span>
<span id="cb27-114">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NBOOT))</span>
<span id="cb27-115"></span>
<span id="cb27-116"></span>
<span id="cb27-117"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> median_se(v):</span>
<span id="cb27-118">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""distribution-free standard error of a median, from the order statistics:</span></span>
<span id="cb27-119"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    half the width of the interval the binomial sign count puts one standard</span></span>
<span id="cb27-120"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    deviation either side of the middle rank.  No RNG, so it is deterministic."""</span></span>
<span id="cb27-121">    w, N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sort(v), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v)</span>
<span id="cb27-122">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(N)</span>
<span id="cb27-123">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(w[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.ceil(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k)))]</span>
<span id="cb27-124">                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> w[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.floor(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> k)))]))</span>
<span id="cb27-125"></span>
<span id="cb27-126"></span>
<span id="cb27-127"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> boot_arm(yt, sd, seed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, rounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb27-128">    Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> yt[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.random.default_rng(SEED <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> seed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> seed</span>
<span id="cb27-129">                                            ).normal(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, sd, (NBOOT, NOBS))</span>
<span id="cb27-130">    Fb, nb, dg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> boot_stats(Y, rounds)</span>
<span id="cb27-131">    size <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((Fb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_crit).mean())</span>
<span id="cb27-132">    pF, pn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((Fb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA).mean()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((nb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]).mean())</span>
<span id="cb27-133">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># EVERY number below is a Monte-Carlo estimate at NBOOT draws - `size`, `pF`</span></span>
<span id="cb27-134">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and `pn` are frequencies, `med` is a median - so every one of them carries</span></span>
<span id="cb27-135">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a sampling error, printed beside it everywhere it is quoted: prop_se is the</span></span>
<span id="cb27-136">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># binomial one and median_se the order-statistic one</span></span>
<span id="cb27-137">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>size, med<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(nb)), pF<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pF, pn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pn,</span>
<span id="cb27-138">                size_se<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>prop_se(size), pF_se<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>prop_se(pF), pn_se<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>prop_se(pn),</span>
<span id="cb27-139">                med_se<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>median_se(nb), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>dg)</span>
<span id="cb27-140"></span>
<span id="cb27-141"></span>
<span id="cb27-142">sigma, NBOOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span></span>
<span id="cb27-143">y_true <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_ode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:],</span>
<span id="cb27-144">                     A_BAL, PHI_BAL)</span>
<span id="cb27-145">y_ctrl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> point_est                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route A's own model</span></span>
<span id="cb27-146">ARMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>, y_true), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>, y_ctrl))</span>
<span id="cb27-147"></span>
<span id="cb27-148"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- refinement evidence FIRST: the six numbers against the zoom depth</span></span>
<span id="cb27-149"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NBOOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> seeded draws each, sigma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sigma<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h, seed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb27-150">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" nominal size 0.0500"</span>)</span>
<span id="cb27-151"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">refinement of each draw's fit (rounds = 0 is the grid alone; the grid is"</span></span>
<span id="cb27-152">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(RANGE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Monod nodes and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MOSER_KS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(MOSER_N)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-153">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Moser nodes, an n spacing of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DN_S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-154"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rounds'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fwd size'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fwd med n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fwd p'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-155">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ctrl size'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ctrl med n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'unconverged'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-156">CONV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb27-157"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, ZOOM):</span>
<span id="cb27-158">    CONV[r] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {tag: boot_arm(yt, sigma, rounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, yt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ARMS}</span>
<span id="cb27-159">    f_, c_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CONV[r][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>], CONV[r][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>]</span>
<span id="cb27-160">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span>f_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10.4f}{</span>f_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.4f}{</span>f_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pF'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-161">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.4f}{</span>c_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-162">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>f_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nclip'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nclip'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-163">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   &lt;- the grid alone"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb27-164">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   &lt;- converged, used below"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> ZOOM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb27-165"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># summed over the REFINED rows only: the rounds = 0 row is fitted from the grid</span></span>
<span id="cb27-166"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># winner alone, so it has no pair of starts and its entry is a structural 0 the</span></span>
<span id="cb27-167"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># code writes rather than a count it takes - folding that in would have made the</span></span>
<span id="cb27-168"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claim below rest partly on a hard-coded zero.</span></span>
<span id="cb27-169">N_REFINED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONV <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb27-170">N_PAIR_CLIP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(CONV[r][t][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nclip_pair"</span>]</span>
<span id="cb27-171">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONV <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>))</span>
<span id="cb27-172">IDENT_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(CONV[r][t][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ident"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONV <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>))</span>
<span id="cb27-173"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  'unconverged' counts the draws, out of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NBOOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, on which the"</span></span>
<span id="cb27-174">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" two-dimensional fit</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  STARTED FROM THE GRID WINNER ALONE still ends ABOVE"</span></span>
<span id="cb27-175">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the one-dimensional one -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  impossible for a converged fit, since Moser"</span></span>
<span id="cb27-176">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" contains Monod. Read it as the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  convergence evidence for the zoom, and"</span></span>
<span id="cb27-177">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" read the six numbers' own trend beside</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  it: both say the same thing about"</span></span>
<span id="cb27-178">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" where this table settles."</span>)</span>
<span id="cb27-179"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  WHAT IT CANNOT SHOW. The same count for the fit actually shipped - the"</span></span>
<span id="cb27-180">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pair of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  starts - is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_PAIR_CLIP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> summed over the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_REFINED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> REFINED rows"</span></span>
<span id="cb27-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" above (the grid-only row is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  fitted from the grid winner alone, so it has no"</span></span>
<span id="cb27-182">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" pair of starts and no such</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  count), and it cannot be anything else at any"</span></span>
<span id="cb27-183">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" refined depth: the second start IS</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the nesting point, where the Moser"</span></span>
<span id="cb27-184">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" objective and the Monod objective are the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  same number to the last bit"</span></span>
<span id="cb27-185">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (largest difference over all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NBOOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> draws and all</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  depths:"</span></span>
<span id="cb27-186">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>IDENT_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), and the zoom's candidate set contains its"</span></span>
<span id="cb27-187">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  own centre, so that branch is monotone and can never end above it. A"</span></span>
<span id="cb27-188">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" column of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  zeros there would be an identity of the code, not a"</span></span>
<span id="cb27-189">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" measurement, so it is not</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  what is printed. The shipped fit is at least"</span></span>
<span id="cb27-190">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" as converged as the column says."</span>)</span>
<span id="cb27-191">out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CONV[ZOOM]</span>
<span id="cb27-192">GRID_ONLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CONV[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-193">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_forward_truth"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>]</span>
<span id="cb27-194">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_control_truth"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>]</span>
<span id="cb27-195">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_forward_truth"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>]</span>
<span id="cb27-196">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_control_truth"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>]</span>
<span id="cb27-197">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pF"</span>]</span>
<span id="cb27-198">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pn"</span>]</span>
<span id="cb27-199"></span>
<span id="cb27-200">pm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v, s: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-201"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'truth'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;46}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'median n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p(F&gt;obs)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-202"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the forward Monod model (what Monod produces)"</span>),</span>
<span id="cb27-203">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu(CA_bar) - route A's own model [CONTROL]"</span>)):</span>
<span id="cb27-204">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[tag]</span>
<span id="cb27-205">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;46}{</span>pm(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size_se'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-206">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pm(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med'</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med_se'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}{</span>pm(o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pF'</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pF_se'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-207"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and on the forward arm, p for the OBSERVED exponent:"</span></span>
<span id="cb27-208">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pm(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pn'</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pn_se'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-209"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">EVERY NUMBER IN THAT TABLE AND IN THE LINE UNDER IT IS A MONTE-CARLO"</span></span>
<span id="cb27-210">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" ESTIMATE over</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NBOOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> seeded draws, and they are NOT all of one kind: the"</span></span>
<span id="cb27-211">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" sizes and the p values</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">are FREQUENCIES, the two exponents are MEDIANS. So"</span></span>
<span id="cb27-212">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" every one carries a sampling</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">error, printed beside it as +- one standard"</span></span>
<span id="cb27-213">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" error - binomial for the frequencies,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and from the order statistics for the"</span></span>
<span id="cb27-214">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" medians."</span>)</span>
<span id="cb27-215"></span>
<span id="cb27-216"></span>
<span id="cb27-217"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sig_stable(v, s):</span>
<span id="cb27-218">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""how many leading significant figures of v its own standard error s</span></span>
<span id="cb27-219"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    supports: the largest k with s below half a unit in the k-th figure."""</span></span>
<span id="cb27-220">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb27-221">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.floor(np.log10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v)))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> k) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>:</span>
<span id="cb27-222">        k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb27-223">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> k</span>
<span id="cb27-224"></span>
<span id="cb27-225"></span>
<span id="cb27-226">SIX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward size"</span>, out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size_se"</span>]),</span>
<span id="cb27-227">       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control size"</span>, out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size_se"</span>]),</span>
<span id="cb27-228">       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p(F&gt;obs)"</span>, out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pF"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pF_se"</span>]),</span>
<span id="cb27-229">       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p(n&gt;obs)"</span>, out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pn"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pn_se"</span>]),</span>
<span id="cb27-230">       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward median n"</span>, out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med_se"</span>]),</span>
<span id="cb27-231">       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control median n"</span>, out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med_se"</span>])]</span>
<span id="cb27-232">K_FIG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lab: sig_stable(v, s) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, v, s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIX}</span>
<span id="cb27-233">FREQ6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward size"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control size"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p(F&gt;obs)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p(n&gt;obs)"</span>)</span>
<span id="cb27-234">MED6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward median n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control median n"</span>)</span>
<span id="cb27-235"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND HOW MANY FIGURES THAT BUYS, PER STATISTIC rather than in one sentence"</span></span>
<span id="cb27-236">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - for</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the six quoted off this page, the largest k whose k-th significant"</span></span>
<span id="cb27-237">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" figure one</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">standard error does not reach:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-238"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, v, s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIX:</span>
<span id="cb27-239">    half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.floor(np.log10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v)))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K_FIG[lab])</span>
<span id="cb27-240">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;17}{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> one SE is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>half<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x half a unit"</span></span>
<span id="cb27-241">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" in figure </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_FIG[lab] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-242">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>half<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_FIG[lab]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> figure"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> K_FIG[lab] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb27-243"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what meta.yaml, README.md and models_entry.yaml say about these six - "the</span></span>
<span id="cb27-244"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># frequencies to their leading figure only, the medians to at least two" - is</span></span>
<span id="cb27-245"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this table, and it is ASSERTED here rather than trusted to stay true</span></span>
<span id="cb27-246"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(K_FIG[lab] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FREQ6) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, K_FIG</span>
<span id="cb27-247"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(K_FIG[lab] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MED6) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, K_FIG</span>
<span id="cb27-248"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So the FREQUENCIES are seed-independent in their LEADING FIGURE ONLY"</span></span>
<span id="cb27-249">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(K_FIG[lab] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FREQ6)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> figure), and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the MEDIANS in at least"</span></span>
<span id="cb27-250">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(K_FIG[lab] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MED6)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The four-figure values above are exact for"</span></span>
<span id="cb27-251">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" THIS seed and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reproducible, not resolved - read the +-, not the digit count."</span></span>
<span id="cb27-252">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" Every quotation of</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">them on this page carries the same +-."</span>)</span>
<span id="cb27-253"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The control sits AT its nominal size (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +-"</span></span>
<span id="cb27-254">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against 0.0500) and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">recovers the truth's"</span></span>
<span id="cb27-255">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" exponent (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-256">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" against 1). So the small-sample F</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">approximation at n = 7 is essentially EXACT"</span></span>
<span id="cb27-257">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" here - it is not conservative, and it</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is not the problem. Against data Monod"</span></span>
<span id="cb27-258">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" actually produces, the same test rejects</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">it </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +-"</span></span>
<span id="cb27-259">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the time and puts the median exponent at"</span></span>
<span id="cb27-260">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The whole of"</span></span>
<span id="cb27-261">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the distortion is the reduction."</span>)</span>
<span id="cb27-262"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THE SECOND START DOES, measured on the converged row rather than"</span></span>
<span id="cb27-263">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" asserted:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">it strictly wins on"</span></span>
<span id="cb27-264">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nest_wins'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nest_wins'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the"</span></span>
<span id="cb27-265">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NBOOT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> draws, but the largest SSE it ever gains is"</span></span>
<span id="cb27-266">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'best_gain'</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'best_gain'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative,"</span></span>
<span id="cb27-267">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" and it changes"</span></span>
<span id="cb27-268">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'flips'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'flips'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rejection decisions on the"</span></span>
<span id="cb27-269">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" two arms combined.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">It is a monotonicity guarantee - the fit can never end"</span></span>
<span id="cb27-270">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" above the Monod fit it is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">being tested against - and not an escape from a"</span></span>
<span id="cb27-271">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" wrong basin."</span>)</span>
<span id="cb27-272"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Read the first row of the table above the same way: fitted on the grid"</span></span>
<span id="cb27-273">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" alone,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the control reads </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and its median"</span></span>
<span id="cb27-274">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" exponent </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'med'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - a coarse Moser grid</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(n spacing"</span></span>
<span id="cb27-275">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DN_S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) cannot reach its own optimum, so it deflates F on every draw and"</span></span>
<span id="cb27-276">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">manufactures a conservative-looking control. That is a grid-limited"</span></span>
<span id="cb27-277">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" extremum,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and no perturbation of the model would have revealed it."</span>)</span>
<span id="cb27-278"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The OBSERVED route-A verdict, F = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, therefore has p ="</span></span>
<span id="cb27-279">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pF'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pF_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">against a"</span></span>
<span id="cb27-280">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" properly generated Monod null - not significant at all, and not close"</span></span>
<span id="cb27-281">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">enough to 0.05 for the sampling error to matter - and its exponent"</span></span>
<span id="cb27-282">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Moser'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'p'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> has p ="</span></span>
<span id="cb27-283">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pn'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pn_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb27-284"></span>
<span id="cb27-285"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the noise scale is a DECLARED CONVENTION for the forward arm, and is not</span></span>
<span id="cb27-286"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      one for the control.  Both are printed rather than asserted.</span></span>
<span id="cb27-287">SIG_ALT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route B RMS (used above)"</span>: sigma, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route A RMS"</span>: RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]}</span>
<span id="cb27-288">SIG_TABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lab: (boot_arm(y_true, sd)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>], boot_arm(y_ctrl, sd)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>])</span>
<span id="cb27-289">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, sd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_ALT.items()}</span>
<span id="cb27-290"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Which residual scatter supplies sigma is a declared convention, and it"</span></span>
<span id="cb27-291">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" matters</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">for one arm only:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-292"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sigma'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;26}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value, 1/h'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward size'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'control size'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-293"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, sd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_ALT.items():</span>
<span id="cb27-294">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;26}{</span>sd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12.6f}{</span>pm(SIG_TABLE[lab][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], prop_se(SIG_TABLE[lab][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb27-295">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pm(SIG_TABLE[lab][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], prop_se(SIG_TABLE[lab][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-296"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The FORWARD size is a bias-to-noise ratio, so it moves with sigma and the"</span></span>
<span id="cb27-297">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quoted </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'forward'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'size_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is"</span></span>
<span id="cb27-298">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" specific to route B's scatter. The"</span></span>
<span id="cb27-299">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" CONTROL's size is scale-free to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Monte-Carlo error, which is exactly what a"</span></span>
<span id="cb27-300">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" correctly specified test should do,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and is a second reason to read it as"</span></span>
<span id="cb27-301">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the F approximation being exonerated."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>2000 seeded draws each, sigma = 0.031466 1/h, seed 20260813, nominal size 0.0500

refinement of each draw's fit (rounds = 0 is the grid alone; the grid is
240 Monod nodes and 60 x 36 Moser nodes, an n spacing of 0.163):

 rounds  fwd size  fwd med n   fwd p  ctrl size  ctrl med n  unconverged
      0    0.3080     1.6029  0.1835     0.0210      0.9514          994   &lt;- the grid alone
      2    0.3640     1.6029  0.2265     0.0485      1.0000          131
      4    0.3655     1.6119  0.2280     0.0495      1.0097           11
      6    0.3655     1.6116  0.2280     0.0495      1.0088            0
      8    0.3655     1.6117  0.2280     0.0495      1.0089            0   &lt;- converged, used below

  'unconverged' counts the draws, out of 4000, on which the two-dimensional fit
  STARTED FROM THE GRID WINNER ALONE still ends ABOVE the one-dimensional one -
  impossible for a converged fit, since Moser contains Monod. Read it as the
  convergence evidence for the zoom, and read the six numbers' own trend beside
  it: both say the same thing about where this table settles.

  WHAT IT CANNOT SHOW. The same count for the fit actually shipped - the pair of
  starts - is 0 summed over the 4 REFINED rows above (the grid-only row is
  fitted from the grid winner alone, so it has no pair of starts and no such
  count), and it cannot be anything else at any refined depth: the second start IS
  the nesting point, where the Moser objective and the Monod objective are the
  same number to the last bit (largest difference over all 4000 draws and all
  depths: 0.0e+00), and the zoom's candidate set contains its
  own centre, so that branch is monotone and can never end above it. A column of
  zeros there would be an identity of the code, not a measurement, so it is not
  what is printed. The shipped fit is at least as converged as the column says.

truth                                                       size          median n          p(F&gt;obs)
the forward Monod model (what Monod produces)   0.3655 +- 0.0108  1.6117 +- 0.0074  0.2280 +- 0.0094
mu(CA_bar) - route A's own model [CONTROL]      0.0495 +- 0.0049  1.0089 +- 0.0049  0.0240 +- 0.0034

and on the forward arm, p for the OBSERVED exponent: 0.1285 +- 0.0075

EVERY NUMBER IN THAT TABLE AND IN THE LINE UNDER IT IS A MONTE-CARLO ESTIMATE over
2000 seeded draws, and they are NOT all of one kind: the sizes and the p values
are FREQUENCIES, the two exponents are MEDIANS. So every one carries a sampling
error, printed beside it as +- one standard error - binomial for the frequencies,
and from the order statistics for the medians.

AND HOW MANY FIGURES THAT BUYS, PER STATISTIC rather than in one sentence - for
the six quoted off this page, the largest k whose k-th significant figure one
standard error does not reach:

   forward size       0.3655 +- 0.0108  one SE is   2.2x half a unit in figure 2 (0.005) -&gt; 1 figure
   control size       0.0495 +- 0.0049  one SE is   9.7x half a unit in figure 2 (0.0005) -&gt; 1 figure
   p(F&gt;obs)           0.2280 +- 0.0094  one SE is   1.9x half a unit in figure 2 (0.005) -&gt; 1 figure
   p(n&gt;obs)           0.1285 +- 0.0075  one SE is   1.5x half a unit in figure 2 (0.005) -&gt; 1 figure
   forward median n   1.6117 +- 0.0074  one SE is   1.5x half a unit in figure 3 (0.005) -&gt; 2 figures
   control median n   1.0089 +- 0.0049  one SE is   9.7x half a unit in figure 4 (0.0005) -&gt; 3 figures

So the FREQUENCIES are seed-independent in their LEADING FIGURE ONLY (1 figure), and
the MEDIANS in at least 2. The four-figure values above are exact for THIS seed and
reproducible, not resolved - read the +-, not the digit count. Every quotation of
them on this page carries the same +-.

The control sits AT its nominal size (0.0495 +- 0.0049 against 0.0500) and
recovers the truth's exponent (1.0089 +- 0.0049 against 1). So the small-sample F
approximation at n = 7 is essentially EXACT here - it is not conservative, and it
is not the problem. Against data Monod actually produces, the same test rejects
it 36.5% +- 1.1% of the time and puts the median exponent at 1.6117 +- 0.0074.
The whole of the distortion is the reduction.

WHAT THE SECOND START DOES, measured on the converged row rather than asserted:
it strictly wins on 903 of the 4000 draws, but the largest SSE it ever gains is
9.9e-05 relative, and it changes 0 rejection decisions on the two arms combined.
It is a monotonicity guarantee - the fit can never end above the Monod fit it is
being tested against - and not an escape from a wrong basin.

Read the first row of the table above the same way: fitted on the grid alone,
the control reads 0.0210 and its median exponent 0.9514 - a coarse Moser grid
(n spacing 0.163) cannot reach its own optimum, so it deflates F on every draw and
manufactures a conservative-looking control. That is a grid-limited extremum,
and no perturbation of the model would have revealed it.

The OBSERVED route-A verdict, F = 12.2698, therefore has p = 0.2280 +- 0.0094
against a properly generated Monod null - not significant at all, and not close
enough to 0.05 for the sampling error to matter - and its exponent
n = 1.9317 has p = 0.1285 +- 0.0075.

Which residual scatter supplies sigma is a declared convention, and it matters
for one arm only:

sigma                       value, 1/h      forward size      control size
route B RMS (used above)      0.031466  0.3655 +- 0.0108  0.0495 +- 0.0049
route A RMS                   0.054690  0.2355 +- 0.0095  0.0470 +- 0.0047

The FORWARD size is a bias-to-noise ratio, so it moves with sigma and the
quoted 36.5% +- 1.1% is specific to route B's scatter. The CONTROL's size is scale-free to
Monte-Carlo error, which is exactly what a correctly specified test should do,
and is a second reason to read it as the F approximation being exonerated.</code></pre>
</div>
</div>
</section>
<section id="what-this-design-could-separate-if-the-data-were-clean" class="level3">
<h3 class="anchored" data-anchor-id="what-this-design-could-separate-if-the-data-were-clean">What this design <em>could</em> separate, if the data were clean</h3>
<p>Identifiability is a property of the experiment, not of the model. Take Monod as true, at the route-B fit; ask how close each alternative can get to it <strong>at these seven design points</strong>; and compare that distance with the scatter. <img src="https://latex.codecogs.com/png.latex?N%5E*"> is the number of independent repeats of the seven-interval run - Levenspiel’s Problem 29.18, attributed by him to Monod (1958) - at which a <img src="https://latex.codecogs.com/png.latex?%5Cchi%5E2"> separation at 95 % becomes possible.</p>
<p><strong>Read <img src="https://latex.codecogs.com/png.latex?N%5E*"> as a threshold, not as a sample size.</strong> It is the <img src="https://latex.codecogs.com/png.latex?N"> at which the <em>expected</em> excess sum of squares first <strong>reaches</strong> the 95 % critical value. An experiment run at exactly <img src="https://latex.codecogs.com/png.latex?N%5E*"> therefore lands above the critical value about half the time: <img src="https://latex.codecogs.com/png.latex?N%5E*"> is roughly a <strong>50 %-power</strong> point, not a 95 %-detection design. Three further choices in it - the confidence level, the degrees of freedom, and which route supplies the scatter - are declared conventions with break rows, and the separations <img src="https://latex.codecogs.com/png.latex?d"> that go into it are optimiser <em>upper</em> bounds, so <img src="https://latex.codecogs.com/png.latex?N%5E*"> errs low in the direction that matters.</p>
<div id="67e23252" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:03.133772Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:03.133578Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:03.859518Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:03.858536Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1">s_obs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]</span>
<span id="cb29-2">SEP_BOUND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1/h: the bound the two degenerate separations are held to</span></span>
<span id="cb29-3">SEP_SCATTER_BOUND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same, over the route-B scatter</span></span>
<span id="cb29-4">SEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb29-5">sep_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb29-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>]:</span>
<span id="cb29-7">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_B(k, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>y_true, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>])       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># warm start: the manifold is the same</span></span>
<span id="cb29-8">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]</span>
<span id="cb29-9">    SEP[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d</span>
<span id="cb29-10">    Nstar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (chi2.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s_obs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.inf</span>
<span id="cb29-11">    sep_rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(alternative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k, d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d / scatter"</span>: d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_obs},</span>
<span id="cb29-12">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N* repeats"</span>: Nstar},</span>
<span id="cb29-13">                         verdict<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degenerate - see the identities"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb29-14">                                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"within reach of one clean run, at ~50 % power"</span></span>
<span id="cb29-15">                                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Nstar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"needs more data"</span>)))</span>
<span id="cb29-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every separation is a claim; the degenerate two are BOUNDS (the rule stated</span></span>
<span id="cb29-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># where the Contois map is computed), registered as such in the claims cell</span></span>
<span id="cb29-18">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d)</span>
<span id="cb29-19">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_over_scatter_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_obs)</span>
<span id="cb29-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(Nstar):     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only where a separation exists at all: for Moser</span></span>
<span id="cb29-21">        M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Nstar_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Nstar)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and Contois it is not a number</span></span>
<span id="cb29-22"></span>
<span id="cb29-23">TS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(sep_rows)</span>
<span id="cb29-24">show(TS.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d / scatter"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N* repeats"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb29-25">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep"</span>))</span>
<span id="cb29-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Moser and Contois sit at the optimiser's own floor, and that is not an"</span>)</span>
<span id="cb29-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"accident of this dataset - it is the algebra of *The published model*: Moser"</span>)</span>
<span id="cb29-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CONTAINS Monod at n = 1, and Contois IS Monod once a constant yield makes X an"</span>)</span>
<span id="cb29-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"affine function of S. Their symbolic residuals are exactly zero; the numbers"</span>)</span>
<span id="cb29-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"above (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Moser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Contois'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) measure"</span></span>
<span id="cb29-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" least_squares' xtol, not a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">separation, so both are registered as BOUNDS,"</span></span>
<span id="cb29-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/h, and never compared as values."</span>)</span>
<span id="cb29-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Tessier and Blackman are genuinely separable. Blackman needs"</span></span>
<span id="cb29-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nstar_blackman'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> repeats of this"</span>)</span>
<span id="cb29-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"design and Tessier </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nstar_tessier'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. So one clean run of it is"</span></span>
<span id="cb29-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nstar_blackman'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of enough for"</span>)</span>
<span id="cb29-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Blackman - not enough, and at N* the power is only about a half anyway,"</span>)</span>
<span id="cb29-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"so 'one run would do' would be generous twice over."</span>)</span>
<span id="cb29-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Note which way this cuts against route A: Blackman, the law route A liked"</span>)</span>
<span id="cb29-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best, is the ONLY one this design can actually resolve - so route A's ranking"</span>)</span>
<span id="cb29-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is not merely biased, it is confidently ordering laws it cannot tell apart."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_sep" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_sep_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">alternative</th>
<th id="T_sep_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">d</th>
<th id="T_sep_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">d / scatter</th>
<th id="T_sep_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">N* repeats</th>
<th id="T_sep_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">verdict</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_sep_row0_col0" class="data row0 col0">Blackman</td>
<td id="T_sep_row0_col1" class="data row0 col1">3.4659e-02</td>
<td id="T_sep_row0_col2" class="data row0 col2">1.10148</td>
<td id="T_sep_row0_col3" class="data row0 col3">1.304</td>
<td id="T_sep_row0_col4" class="data row0 col4">within reach of one clean run, at ~50 % power</td>
</tr>
<tr class="even">
<td id="T_sep_row1_col0" class="data row1 col0">Tessier</td>
<td id="T_sep_row1_col1" class="data row1 col1">1.2348e-02</td>
<td id="T_sep_row1_col2" class="data row1 col2">0.39242</td>
<td id="T_sep_row1_col3" class="data row1 col3">10.27</td>
<td id="T_sep_row1_col4" class="data row1 col4">needs more data</td>
</tr>
<tr class="odd">
<td id="T_sep_row2_col0" class="data row2 col0">Moser</td>
<td id="T_sep_row2_col1" class="data row2 col1">2.4883e-14</td>
<td id="T_sep_row2_col2" class="data row2 col2">0.00000</td>
<td id="T_sep_row2_col3" class="data row2 col3">inf</td>
<td id="T_sep_row2_col4" class="data row2 col4">degenerate - see the identities</td>
</tr>
<tr class="even">
<td id="T_sep_row3_col0" class="data row3 col0">Contois</td>
<td id="T_sep_row3_col1" class="data row3 col1">6.3274e-14</td>
<td id="T_sep_row3_col2" class="data row3 col2">0.00000</td>
<td id="T_sep_row3_col3" class="data row3 col3">inf</td>
<td id="T_sep_row3_col4" class="data row3 col4">degenerate - see the identities</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Moser and Contois sit at the optimiser's own floor, and that is not an
accident of this dataset - it is the algebra of *The published model*: Moser
CONTAINS Monod at n = 1, and Contois IS Monod once a constant yield makes X an
affine function of S. Their symbolic residuals are exactly zero; the numbers
above (here 2.5e-14 and 6.3e-14) measure least_squares' xtol, not a
separation, so both are registered as BOUNDS, below 1e-09 1/h, and never compared as values.

Tessier and Blackman are genuinely separable. Blackman needs 1.30 repeats of this
design and Tessier 10.3. So one clean run of it is within 30 % of enough for
Blackman - not enough, and at N* the power is only about a half anyway,
so 'one run would do' would be generous twice over.

Note which way this cuts against route A: Blackman, the law route A liked
best, is the ONLY one this design can actually resolve - so route A's ranking
is not merely biased, it is confidently ordering laws it cannot tell apart.</code></pre>
</div>
</div>
</section>
<section id="the-experiment-that-does-separate-contois-from-monod" class="level3">
<h3 class="anchored" data-anchor-id="the-experiment-that-does-separate-contois-from-monod">The experiment that <em>does</em> separate Contois from Monod</h3>
<p>The degeneracy above is a property of a <strong>constant-yield batch run</strong>, which ties <img src="https://latex.codecogs.com/png.latex?X"> to <img src="https://latex.codecogs.com/png.latex?S">. A chemostat does not: the dilution rate moves them independently. Rawlings’ eq. (10.18) with a Monod law washes out at <img src="https://latex.codecogs.com/png.latex?D_c%20=%20%5Cmu_m%20S_f/(K_s%20+%20S_f)">, which <strong>depends on the feed concentration</strong>. With a Contois law the same balance gives <img src="https://latex.codecogs.com/png.latex?%5Cmu%20%5Cto%20%5Cmu_m"> as <img src="https://latex.codecogs.com/png.latex?X%20%5Cto%200">, so <img src="https://latex.codecogs.com/png.latex?D_c%20=%20%5Cmu_m"> <strong>whatever the feed</strong>. The two cross - and the crossing point is not arbitrary.</p>
<div id="1bfd3c15" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:03.861611Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:03.861413Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:04.453519Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:04.452627Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1">mumM, KsM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>]</span>
<span id="cb31-2">Dc_monod <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: mumM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KsM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Sf)</span>
<span id="cb31-3">Dc_contois <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mumC                                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># independent of S_f, exactly</span></span>
<span id="cb31-4">ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: Dc_contois<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dc_monod(Sf)</span>
<span id="cb31-5">Sf_cross <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: ratio(Sf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb31-6">Sf_10pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: ratio(Sf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb31-7">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Sf_cross)</span>
<span id="cb31-8">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_for_10pct_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Sf_10pct)</span>
<span id="cb31-9">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_ratio_at_Sf20"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ratio(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>))</span>
<span id="cb31-10">SF_CLOSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mumC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KsM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(mumM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mumC)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same crossing, in closed form</span></span>
<span id="cb31-11">SF_ROOTFIND_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Sf_cross <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SF_CLOSED)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SF_CLOSED</span>
<span id="cb31-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># brentq's OWN guarantee, from the tolerances declared two lines up rather than</span></span>
<span id="cb31-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from the residual that happened to come out: scipy returns an x0 with</span></span>
<span id="cb31-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># |x0 - x*| &lt;= xtol + rtol|x0|, which is 5.1e-13 relative here.  The observed</span></span>
<span id="cb31-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># residual is three orders inside that, but it is a property of Brent's last</span></span>
<span id="cb31-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># interpolation, not of anything declared - it moves 40x under a change of</span></span>
<span id="cb31-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BRACKET that changes nothing about the mathematics - so the assertion cell</span></span>
<span id="cb31-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tests it against this bound and not against the value below.</span></span>
<span id="cb31-19">SF_XTOL, SF_RTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span></span>
<span id="cb31-20">SF_ROOTFIND_BOUND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (SF_XTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> SF_RTOL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Sf_cross))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SF_CLOSED</span>
<span id="cb31-21">CROSS_VS_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing_vs_a_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Sf_cross <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A_BAL)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A_BAL)</span>
<span id="cb31-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The two exit tolerances of the Contois fit, SIGNED, and the sensitivity of the</span></span>
<span id="cb31-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># closed form to each.  S_f/a = (1+e_mu)/[(1+e_K)(1 - e_mu beta/(1-beta))], so to</span></span>
<span id="cb31-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first order S_f/a - 1 = e_mu/(1-beta) - e_K: the mu_m error is amplified by</span></span>
<span id="cb31-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1/(1-beta) and the K_S error enters with coefficient EXACTLY 1.</span></span>
<span id="cb31-26">E_MUM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (map_mum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mumM)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>mumM</span>
<span id="cb31-27">E_KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (map_Ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KsM)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KsM</span>
<span id="cb31-28">AMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> beta)</span>
<span id="cb31-29">CROSS_DECOMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_MUM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AMP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E_KS</span>
<span id="cb31-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The crossing is EXACT, and it is the batch run's own substrate intercept:"</span>)</span>
<span id="cb31-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  putting mu_m^C = beta mu_m^M and K_S = K_sx phi a / beta into"</span>)</span>
<span id="cb31-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  mu_m^M S_f/(K_S + S_f) = mu_m^C gives S_f = a identically. Numerically:"</span>)</span>
<span id="cb31-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    root-found crossing        S_f = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Sf_cross<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    material-balance intercept a   = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (rel. gap below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_VS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb31-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  That gap is NOT the root-find's. Solving the same equation in closed form,"</span></span>
<span id="cb31-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  S_f = mu_m^C K_S/(mu_m^M - mu_m^C) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SF_CLOSED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and brentq reproduces it"</span></span>
<span id="cb31-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SF_ROOTFIND_RELERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - at round-off, and inside its own"</span></span>
<span id="cb31-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" declared</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  guarantee (xtol + rtol|x| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SF_ROOTFIND_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative here),"</span></span>
<span id="cb31-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" which is what is asserted."</span>)</span>
<span id="cb31-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  What the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_VS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> measures is the Contois fit's own two exit"</span></span>
<span id="cb31-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" tolerances, and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  NOT in equal measure. Differentiating that closed form:"</span></span>
<span id="cb31-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" d ln S_f / d ln mu_m^C =</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  1/(1-beta) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, while d ln S_f / d ln K_S"</span></span>
<span id="cb31-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" = 1 EXACTLY. So it is the mu_m error</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  that is amplified and the K_S error"</span></span>
<span id="cb31-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" that is not:"</span>)</span>
<span id="cb31-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      mu_m error </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_MUM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, amplified x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    contributes"</span></span>
<span id="cb31-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_MUM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      K_S  error </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E_KS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, unamplified, other sign  contributes"</span></span>
<span id="cb31-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>E_KS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                                                        sum"</span></span>
<span id="cb31-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_DECOMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      - which is the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_VS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> above."</span>)</span>
<span id="cb31-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the decomposition is the justification for treating this quantity as a</span></span>
<span id="cb31-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tolerance bound, so it is checked rather than left as prose: the first-order</span></span>
<span id="cb31-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># form is good to 1e-5</span></span>
<span id="cb31-55"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CROSS_DECOMP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CROSS_VS_A) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CROSS_VS_A, (CROSS_DECOMP, CROSS_VS_A)</span>
<span id="cb31-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  The K_S error alone is within"</span></span>
<span id="cb31-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E_KS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CROSS_VS_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CROSS_VS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which is a"</span></span>
<span id="cb31-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" coincidence and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  not an explanation: amplify THAT one by the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" instead and you get </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E_KS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AMP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E_KS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>AMP<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CROSS_VS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the"</span></span>
<span id="cb31-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" number being explained. Either way it is the same exactly-zero</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  quantity as"</span></span>
<span id="cb31-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the two map errors, and it is a BOUND for the same reason: below"</span></span>
<span id="cb31-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  relative, checked on every run."</span>)</span>
<span id="cb31-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Away from it they separate: at S_f = 20 the two critical dilution rates"</span></span>
<span id="cb31-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  differ by a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Dc_ratio_at_Sf20'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the gap exceeds 10 %"</span></span>
<span id="cb31-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" for every S_f</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Sf_10pct<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - in the units of the printed CA_bar"</span></span>
<span id="cb31-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" column, whose scale is set</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  by the run itself (its substrate ran from"</span></span>
<span id="cb31-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb31-68"></span>
<span id="cb31-69">Sf_test, y_yield <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, PHI_BAL</span>
<span id="cb31-70">gM_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: mumM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KsM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)</span>
<span id="cb31-71">gC_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: mumC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KsxC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)</span>
<span id="cb31-72">WASH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb31-73">Dc_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb31-74"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, g_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, gM_), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>, gC_)):</span>
<span id="cb31-75">    Dc_num[tag] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> D: Chemostat(g_, y_yield, Sf_test, D).steady()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb31-76">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> WASH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y_yield<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf_test, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb31-77">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_closed_form"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Dc_monod(Sf_test))</span>
<span id="cb31-78">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_transient_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Dc_num[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Dc_monod(Sf_test))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dc_monod(Sf_test)</span>
<span id="cb31-79">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_contois_transient_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Dc_num[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Dc_contois)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dc_contois</span>
<span id="cb31-80"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  washout root-found on a MARCHED chemostat, S_f = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Sf_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb31-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    Monod   D_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Dc_num[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Monod'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the closed form"</span></span>
<span id="cb31-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Dc_monod(Sf_test)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (rel. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Dc_monod_transient_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb31-83"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    Contois D_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Dc_num[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Contois'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against mu_m ="</span></span>
<span id="cb31-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Dc_contois<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (rel. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Dc_contois_transient_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb31-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Two models that no batch run can tell apart differ by a factor"</span></span>
<span id="cb31-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Dc_ratio_at_Sf20'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  dilution rate at which the culture is"</span></span>
<span id="cb31-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" lost. That is the experiment to run."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The crossing is EXACT, and it is the batch run's own substrate intercept:
  putting mu_m^C = beta mu_m^M and K_S = K_sx phi a / beta into
  mu_m^M S_f/(K_S + S_f) = mu_m^C gives S_f = a identically. Numerically:
    root-found crossing        S_f = 197.118211
    material-balance intercept a   = 197.120267   (rel. gap below 0.001, here 1.04e-05)

  That gap is NOT the root-find's. Solving the same equation in closed form,
  S_f = mu_m^C K_S/(mu_m^M - mu_m^C) = 197.118211, and brentq reproduces it to
  8.7e-16 - at round-off, and inside its own declared
  guarantee (xtol + rtol|x| = 5.1e-13 relative here), which is what is asserted.

  What the 1.04e-05 measures is the Contois fit's own two exit tolerances, and
  NOT in equal measure. Differentiating that closed form: d ln S_f / d ln mu_m^C =
  1/(1-beta) = 10.638, while d ln S_f / d ln K_S = 1 EXACTLY. So it is the mu_m error
  that is amplified and the K_S error that is not:
      mu_m error -2.188e-06, amplified x 10.638    contributes -2.328e-05
      K_S  error -1.284e-05, unamplified, other sign  contributes +1.284e-05
                                                        sum -1.043e-05
      - which is the 1.04e-05 above.

  The K_S error alone is within 23 % of the 1.04e-05, which is a coincidence and
  not an explanation: amplify THAT one by the 10.6 instead and you get 1.37e-04,
  13 times the number being explained. Either way it is the same exactly-zero
  quantity as the two map errors, and it is a BOUND for the same reason: below 0.001
  relative, checked on every run.

  Away from it they separate: at S_f = 20 the two critical dilution rates
  differ by a factor 1.8325, and the gap exceeds 10 % for every S_f
  below 95.52 - in the units of the printed CA_bar column, whose scale is set
  by the run itself (its substrate ran from 148.3 to 0.23).

  washout root-found on a MARCHED chemostat, S_f = 20:
    Monod   D_c = 0.43568852 against the closed form 0.43552316  (rel. 3.80e-04)
    Contois D_c = 0.79830449 against mu_m = 0.79810860  (rel. 2.45e-04)

  Two models that no batch run can tell apart differ by a factor 1.83 in the
  dilution rate at which the culture is lost. That is the experiment to run.</code></pre>
</div>
</div>
<div id="d349944b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:04.456194Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:04.455996Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:04.932198Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:04.931156Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb33-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3</span>))</span>
<span id="cb33-2">Sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, CAb.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.08</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb33-3">Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Sg)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the run's own yield line</span></span>
<span id="cb33-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS:</span>
<span id="cb33-5">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>]</span>
<span id="cb33-6">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(Sg, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[k](p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], Sg, np.interp(Sg, CAb[::<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Xlm[::<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb33-7">               color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>COL[k], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RA[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb33-8">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>]</span>
<span id="cb33-9">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(Sg, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[k](p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], Sg, Xg), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>COL[k], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>,</span>
<span id="cb33-10">               label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb33-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ax[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]:</span>
<span id="cb33-12">    a.plot(CAb, mu, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ko"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb33-13">    a.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"substrate concentration </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">units not printed</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-14">    a.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">u</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,  h</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-15">    a.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)</span>
<span id="cb33-16">    a.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.25</span>)</span>
<span id="cb33-17">    a.set_ylim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span>)</span>
<span id="cb33-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route A: $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">mu$ evaluated at the interval</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">AVERAGE (RMS, h$^{-1}$, in brackets)"</span>,</span>
<span id="cb33-19">                fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb33-20">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route B: the interval average done</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">exactly - same data, same models"</span>,</span>
<span id="cb33-21">                fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb33-22">Sfg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb33-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(Sfg, Dc_monod(Sfg), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>,</span>
<span id="cb33-24">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_m S_f/(K_S+S_f)$"</span>)</span>
<span id="cb33-25">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].axhline(Dc_contois, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_YELLOW, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_m$ (no $S_f$)"</span>)</span>
<span id="cb33-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot([Sf_cross], [Dc_contois], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>,</span>
<span id="cb33-27">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cross at $S_f = a$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Sf_cross<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].axvline(Sf_10pct, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb33-29">              label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&gt; 10 % apart below $S_f$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Sf_10pct<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-30">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_xscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb33-31">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$S_f$ (units of the printed $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">bar C_A$)"</span>)</span>
<span id="cb33-32">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"critical dilution rate,  h$^{-1}$"</span>)</span>
<span id="cb33-33">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the batch degeneracy broken:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">chemostat washout"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb33-34">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)</span>
<span id="cb33-35">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.25</span>)</span>
<span id="cb33-36">fig.tight_layout()</span>
<span id="cb33-37">plt.show()</span>
<span id="cb33-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Left and centre: curves fitted on this page to Levenspiel p. 644's seven"</span>)</span>
<span id="cb33-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"intervals. Right: those curves extrapolated to an experiment nobody ran."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.1-monod/index_files/figure-html/cell-18-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Left and centre: curves fitted on this page to Levenspiel p. 644's seven
intervals. Right: those curves extrapolated to an experiment nobody ran.</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Four kinds, kept apart, and none of them is the fit.</p>
<ol type="1">
<li><strong>A stated numerical result reproduced.</strong> Rawlings &amp; Ekerdt print a closed form for the chemostat steady states, eq. (10.19), and the parameter set of their Fig. 10.12 (<img src="https://latex.codecogs.com/png.latex?%5Cmu_m%20=%201">, <img src="https://latex.codecogs.com/png.latex?K_s%20=%201">, <img src="https://latex.codecogs.com/png.latex?S_f%20=%205">, <img src="https://latex.codecogs.com/png.latex?y%20=%201">). Both are reproduced here by marching eq. (10.18) to steady state - a different computation entirely - and a break row changes one of their printed constants and watches the reproduction fail.</li>
<li><strong>Two independent computations of route B’s fit, and a statement of what that does and does not establish.</strong> The quoted constants come from an adaptive LSODA solve; they are re-derived through a <strong>pymrm backward-Euler marcher</strong> (<code>NumJac((1,2))</code> + <code>newton</code>) with Richardson extrapolation, which shares no line of code, uses a different Jacobian and a different linear solve, and integrates <img src="https://latex.codecogs.com/png.latex?S"> as an unknown rather than substituting the yield relation. What that catches is a bug in <em>either integrator</em>. What it cannot catch is anything the two share: both read <img src="https://latex.codecogs.com/png.latex?a">, <img src="https://latex.codecogs.com/png.latex?%5Cvarphi">, <img src="https://latex.codecogs.com/png.latex?%5CDelta%20t"> and <img src="https://latex.codecogs.com/png.latex?C_C%5E%7B%5Crm%0Astart%7D"> from the same place and integrate the same ODE, so a wrong yield, a wrong intercept or a mis-set interval moves <strong>both</strong> predictions together and leaves their agreement where it was. That is measured below rather than asserted, because the sentence this replaces claimed the opposite. <img src="https://latex.codecogs.com/png.latex?S%20+%20X/%5Cvarphi%20=%20%7B%5Crm%20const%7D"> belongs on the same list: <code>BatchMarch</code> builds its source as <img src="https://latex.codecogs.com/png.latex?(-m/%5Cvarphi,%5C,m)"> from one <img src="https://latex.codecogs.com/png.latex?m">, so backward Euler conserves it identically for <em>any</em> growth law. It is <strong>structural</strong> - the coverage map has always said so - and the measurement below shows it moving by exactly nothing under physics that is grossly wrong.</li>
<li><strong>An exact identity the discretisation must satisfy.</strong> The plug-flow outlet at residence time <img src="https://latex.codecogs.com/png.latex?%5Ctau"> is the batch state at <img src="https://latex.codecogs.com/png.latex?t%20=%20%5Ctau"> - Levenspiel’s Fig. 29.1 caption, and a theorem. Grid refined, order reported, Richardson checked.</li>
<li><strong>A defect-injection table</strong>, rebuilt for this page’s physics.</li>
</ol>
<div id="142bddfe" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:04.934609Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:04.934464Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:26:05.287589Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:26:05.286873Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 1. Rawlings eq. (10.19) and its printed parameter set, reproduced</span></span>
<span id="cb35-2">mum_r, Ks_r, Sf_r, y_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb35-3">g_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: mum_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)</span>
<span id="cb35-4">Dc_r_closed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mum_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Ks_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Sf_r)</span>
<span id="cb35-5">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb35-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> D <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>):</span>
<span id="cb35-7">    Ss_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(mum_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (10.19)</span></span>
<span id="cb35-8">    Xs_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Sf_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ss_c)</span>
<span id="cb35-9">    Ss_n, Xs_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Chemostat(g_r, y_r, Sf_r, D).steady()</span>
<span id="cb35-10">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D, S_closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ss_c, S_marched<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Ss_n, X_closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Xs_c, X_marched<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Xs_n,</span>
<span id="cb35-11">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max rel. err"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Ss_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>Ss_c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ss_c, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xs_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>Xs_c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xs_c)}))</span>
<span id="cb35-12">TR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb35-13">show(TR.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_closed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_marched"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb35-14">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_closed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X_marched"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb35-15">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max rel. err"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}).hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawl"</span>))</span>
<span id="cb35-16">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max rel. err"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb35-17">Dc_r_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> D: Chemostat(g_r, y_r, Sf_r, D).steady()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> WASH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf_r,</span>
<span id="cb35-18">                  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb35-19">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_Dc_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Dc_r_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Dc_r_closed)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dc_r_closed</span>
<span id="cb35-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Rawlings' printed D_c = mu_m S_f/(K_s+S_f) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Dc_r_closed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; root-found"</span></span>
<span id="cb35-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" on the marched</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">model it is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Dc_r_num<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (rel. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rawlings_Dc_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span></span>
<span id="cb35-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Their eq. (10.19) is reproduced</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to below 1e-9 relative (here"</span></span>
<span id="cb35-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rawlings_10_19_max_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) at three dilution rates."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_rawl" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_rawl_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">D</th>
<th id="T_rawl_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">S_closed</th>
<th id="T_rawl_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">S_marched</th>
<th id="T_rawl_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">X_closed</th>
<th id="T_rawl_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">X_marched</th>
<th id="T_rawl_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">max rel. err</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_rawl_row0_col0" class="data row0 col0">0.25</td>
<td id="T_rawl_row0_col1" class="data row0 col1">0.333333333</td>
<td id="T_rawl_row0_col2" class="data row0 col2">0.333333333</td>
<td id="T_rawl_row0_col3" class="data row0 col3">4.666666667</td>
<td id="T_rawl_row0_col4" class="data row0 col4">4.666666667</td>
<td id="T_rawl_row0_col5" class="data row0 col5">0.000e+00</td>
</tr>
<tr class="even">
<td id="T_rawl_row1_col0" class="data row1 col0">0.50</td>
<td id="T_rawl_row1_col1" class="data row1 col1">1.000000000</td>
<td id="T_rawl_row1_col2" class="data row1 col2">1.000000000</td>
<td id="T_rawl_row1_col3" class="data row1 col3">4.000000000</td>
<td id="T_rawl_row1_col4" class="data row1 col4">4.000000000</td>
<td id="T_rawl_row1_col5" class="data row1 col5">0.000e+00</td>
</tr>
<tr class="odd">
<td id="T_rawl_row2_col0" class="data row2 col0">0.75</td>
<td id="T_rawl_row2_col1" class="data row2 col1">3.000000000</td>
<td id="T_rawl_row2_col2" class="data row2 col2">3.000000000</td>
<td id="T_rawl_row2_col3" class="data row2 col3">2.000000000</td>
<td id="T_rawl_row2_col4" class="data row2 col4">2.000000000</td>
<td id="T_rawl_row2_col5" class="data row2 col5">0.000e+00</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Rawlings' printed D_c = mu_m S_f/(K_s+S_f) = 0.8333333333; root-found on the marched
model it is 0.8335119283  (rel. 2.14e-04).  Their eq. (10.19) is reproduced
to below 1e-9 relative (here 0.0e+00) at three dilution rates.</code></pre>
</div>
</div>
<div id="6ec13868" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:26:05.289989Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:26:05.289822Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:16.846086Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:16.845222Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb37-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 2. the SECOND, INDEPENDENT computation of route B's fit</span></span>
<span id="cb37-2">pM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>]</span>
<span id="cb37-3">ref_ode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_ode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL)</span>
<span id="cb37-4">rows, prev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb37-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ns <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>):</span>
<span id="cb37-6">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL, ns)</span>
<span id="cb37-7">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_ode)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ref_ode)))</span>
<span id="cb37-8">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(nstep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ns, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max rel. vs LSODA"</span>: e},</span>
<span id="cb37-9">                     order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(np.nan <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> prev <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.log2(prev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e))))</span>
<span id="cb37-10">    prev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e</span>
<span id="cb37-11">TM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb37-12">show(TM.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max rel. vs LSODA"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb37-13">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march"</span>))</span>
<span id="cb37-14">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_observed_order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>].iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb37-15"></span>
<span id="cb37-16">S0_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Sof(Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], A_BAL, PHI_BAL)</span>
<span id="cb37-17">c_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BatchMarch(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S), PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>).march(</span>
<span id="cb37-18">    [[S0_b, Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]], dt[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb37-19">inv0, inv1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S0_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL, c_end[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_end[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL</span>
<span id="cb37-20">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_conservation_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(inv1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> inv0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>inv0)</span>
<span id="cb37-21"></span>
<span id="cb37-22">pred_rich <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb37-23">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb37-24">rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: pred_rich(p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu, pM, bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>]),</span>
<span id="cb37-25">                   xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb37-26">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_mum_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rr.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb37-27">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_KS_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rr.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb37-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">backward Euler observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_batch_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (first order, as it must be)"</span>)</span>
<span id="cb37-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"S + X/phi over interval 1: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>inv0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.15g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>inv1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.15g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (rel. below 1e-13, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_batch_conservation_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb37-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">route B's Monod fit, re-derived through the pymrm marcher with Richardson"</span>)</span>
<span id="cb37-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"extrapolation:  mu_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  K_S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"          LSODA: mu_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  K_S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"          relative: below 1e-4 for both (here"</span></span>
<span id="cb37-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_refit_mum_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_refit_KS_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span></span>
<span id="cb37-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the two fits' stopping rules"</span>)</span>
<span id="cb37-38"></span>
<span id="cb37-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- WHAT THIS CROSS-CHECK CAN AND CANNOT SEE, measured.  Both routes read the</span></span>
<span id="cb37-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      same a, phi, dt and Cc0 and integrate the same ODE, so every error in</span></span>
<span id="cb37-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      THOSE moves the two together.  Three injections, each a failure mode</span></span>
<span id="cb37-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      such a check might be thought to catch.</span></span>
<span id="cb37-43">base_o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_ode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL)</span>
<span id="cb37-44">blind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb37-45"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, a_, ph_, dt_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi x 1.3   (a wrong yield)"</span>, A_BAL, PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, dt),</span>
<span id="cb37-46">                          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a   x 1.2   (a wrong intercept)"</span>, A_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, PHI_BAL, dt),</span>
<span id="cb37-47">                          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dt  x 1.15  (a mis-set interval)"</span>, A_BAL, PHI_BAL, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>)):</span>
<span id="cb37-48">    _sd, dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dt, dt_                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the marcher reads dt from the global</span></span>
<span id="cb37-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb37-50">        o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_ode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], a_, ph_)</span>
<span id="cb37-51">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], a_, ph_, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb37-52">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">finally</span>:</span>
<span id="cb37-53">        dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _sd</span>
<span id="cb37-54">    blind.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(injection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab,</span>
<span id="cb37-55">                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prediction moves"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base_o)</span>
<span id="cb37-56">                                                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base_o)))},</span>
<span id="cb37-57">                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA vs pymrm"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> o)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o)))}))</span>
<span id="cb37-58">TBL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(injection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline (nothing injected)"</span>,</span>
<span id="cb37-59">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prediction moves"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>},</span>
<span id="cb37-60">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA vs pymrm"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb37-61">                             mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb37-62">                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base_o)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base_o)))})] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> blind)</span>
<span id="cb37-63">show(TBL.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prediction moves"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA vs pymrm"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb37-64">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blind"</span>))</span>
<span id="cb37-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># deliberately NOT metrics: these are the negative-space of the cross-check, and</span></span>
<span id="cb37-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the assertion cell checks the PROPERTY (the gap stays put while the prediction</span></span>
<span id="cb37-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># moves by orders) rather than pinning three tolerance-scale numbers in CI.</span></span>
<span id="cb37-68">BLIND_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TBL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA vs pymrm"</span>]]</span>
<span id="cb37-69">BLIND_MOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TBL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prediction moves"</span>]]</span>
<span id="cb37-70"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The two share no line of code, so a bug in EITHER INTEGRATOR moves them"</span>)</span>
<span id="cb37-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"apart - which is what the order study and the 25-step break row test. They"</span>)</span>
<span id="cb37-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"do NOT share their inputs' correctness: a yield wrong by 30 % moves the"</span>)</span>
<span id="cb37-73"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"common prediction by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TBL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'prediction moves'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative and"</span></span>
<span id="cb37-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" leaves their agreement at"</span></span>
<span id="cb37-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TBL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'LSODA vs pymrm'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">against"</span></span>
<span id="cb37-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TBL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'LSODA vs pymrm'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with nothing injected. This check"</span></span>
<span id="cb37-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" measures the TIME</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">DISCRETISATION and nothing else, and saying so is the"</span></span>
<span id="cb37-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" point of the table."</span>)</span>
<span id="cb37-79"></span>
<span id="cb37-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- and the invariant is STRUCTURAL, which is what the coverage map says</span></span>
<span id="cb37-81">c_end_3x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BatchMarch(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S), PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>).march(</span>
<span id="cb37-82">    [[S0_b, Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]], dt[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb37-83">INV_3X_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((c_end_3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_end_3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> inv0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>inv0)</span>
<span id="cb37-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">S + X/phi is a TAUTOLOGY of the marcher, not a test of it: the source is"</span>)</span>
<span id="cb37-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(-m/phi, m) from one m, so backward Euler conserves it for ANY growth law."</span>)</span>
<span id="cb37-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Tripling mu_m - grossly wrong physics, and it moves the biomass at the end"</span></span>
<span id="cb37-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of interval 1 from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_end[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_end_3x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - takes the"</span></span>
<span id="cb37-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" invariant from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_batch_conservation_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to"</span></span>
<span id="cb37-89">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>INV_3X_RELERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative, both below 1e-13, i.e. nowhere. What DOES break it is using a"</span></span>
<span id="cb37-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" different yield</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">in the source from the one in the invariant, and that is"</span></span>
<span id="cb37-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" the break row."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_march" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_march_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">nstep</th>
<th id="T_march_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">max rel. vs LSODA</th>
<th id="T_march_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">order</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_march_row0_col0" class="data row0 col0">50</td>
<td id="T_march_row0_col1" class="data row0 col1">5.1105e-03</td>
<td id="T_march_row0_col2" class="data row0 col2">nan</td>
</tr>
<tr class="even">
<td id="T_march_row1_col0" class="data row1 col0">100</td>
<td id="T_march_row1_col1" class="data row1 col1">2.5602e-03</td>
<td id="T_march_row1_col2" class="data row1 col2">0.9972</td>
</tr>
<tr class="odd">
<td id="T_march_row2_col0" class="data row2 col0">200</td>
<td id="T_march_row2_col1" class="data row2 col1">1.2813e-03</td>
<td id="T_march_row2_col2" class="data row2 col2">0.9986</td>
</tr>
<tr class="even">
<td id="T_march_row3_col0" class="data row3 col0">400</td>
<td id="T_march_row3_col1" class="data row3 col1">6.4097e-04</td>
<td id="T_march_row3_col2" class="data row3 col2">0.9993</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
backward Euler observed order 0.9993 (first order, as it must be)
S + X/phi over interval 1: 197.120266762184 -&gt; 197.120266762184   (rel. below 1e-13, here 4.3e-16)

route B's Monod fit, re-derived through the pymrm marcher with Richardson
extrapolation:  mu_m = 0.880921650  K_S = 20.4533755
          LSODA: mu_m = 0.880922570  K_S = 20.4535346
          relative: below 1e-4 for both (here 1.0e-06 and 7.8e-06), the two fits' stopping rules</code></pre>
</div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_blind" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_blind_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">injection</th>
<th id="T_blind_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">prediction moves</th>
<th id="T_blind_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">LSODA vs pymrm</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_blind_row0_col0" class="data row0 col0">baseline (nothing injected)</td>
<td id="T_blind_row0_col1" class="data row0 col1">0.000e+00</td>
<td id="T_blind_row0_col2" class="data row0 col2">6.410e-04</td>
</tr>
<tr class="even">
<td id="T_blind_row1_col0" class="data row1 col0">phi x 1.3 (a wrong yield)</td>
<td id="T_blind_row1_col1" class="data row1 col1">8.995e+00</td>
<td id="T_blind_row1_col2" class="data row1 col2">4.997e-04</td>
</tr>
<tr class="odd">
<td id="T_blind_row2_col0" class="data row2 col0">a x 1.2 (a wrong intercept)</td>
<td id="T_blind_row2_col1" class="data row2 col1">7.601e+00</td>
<td id="T_blind_row2_col2" class="data row2 col2">5.088e-04</td>
</tr>
<tr class="even">
<td id="T_blind_row3_col0" class="data row3 col0">dt x 1.15 (a mis-set interval)</td>
<td id="T_blind_row3_col1" class="data row3 col1">1.124e-01</td>
<td id="T_blind_row3_col2" class="data row3 col2">5.599e-04</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
The two share no line of code, so a bug in EITHER INTEGRATOR moves them
apart - which is what the order study and the 25-step break row test. They
do NOT share their inputs' correctness: a yield wrong by 30 % moves the
common prediction by 9.0 relative and leaves their agreement at 5.00e-04,
against 6.41e-04 with nothing injected. This check measures the TIME
DISCRETISATION and nothing else, and saying so is the point of the table.

S + X/phi is a TAUTOLOGY of the marcher, not a test of it: the source is
(-m/phi, m) from one m, so backward Euler conserves it for ANY growth law.
Tripling mu_m - grossly wrong physics, and it moves the biomass at the end
of interval 1 from 23.4449 to 49.9665 - takes the invariant from 4.3e-16
to 1.2e-15 relative, both below 1e-13, i.e. nowhere. What DOES break it is using a different yield
in the source from the one in the invariant, and that is the break row.</code></pre>
</div>
</div>
<div id="0a0d469c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:16.848273Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:16.848086Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:16.951448Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:16.950647Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 3. plug flow == batch, and the grid order of the pymrm solve</span></span>
<span id="cb40-2">S_START, X_START, TAU_VAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Sof(Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], A_BAL, PHI_BAL), Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb40-3">g_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: mumM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KsM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S)</span>
<span id="cb40-4">ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> batch_reference(g_fit, PHI_BAL, S_START, X_START, TAU_VAL)</span>
<span id="cb40-5">rows, prev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb40-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>):</span>
<span id="cb40-7">    out_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugFlowFermenter(g_fit, PHI_BAL, S_START, X_START, TAU_VAL,</span>
<span id="cb40-8">                             ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nc).solve().outlet()</span>
<span id="cb40-9">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(out_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb40-10">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nc, S_outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>out_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. err"</span>: e},</span>
<span id="cb40-11">                     order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(np.nan <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> prev <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.log2(prev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e))))</span>
<span id="cb40-12">    prev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e</span>
<span id="cb40-13">TP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb40-14">show(TP.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_outlet"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.9f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. err"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb40-15">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr"</span>))</span>
<span id="cb40-16">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. err"</span>].iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb40-17">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_observed_order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(TP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order"</span>].iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb40-18">S_rich <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>TP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_outlet"</span>].iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S_outlet"</span>].iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first-order upwind</span></span>
<span id="cb40-19">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_richardson_relerr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S_rich <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb40-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two ways of reading the outlet, and their ORDERS - the handoff warns that a</span></span>
<span id="cb40-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># last-cell read is O(h); with a ZERO-GRADIENT outflow condition that is not what</span></span>
<span id="cb40-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># happens, and the page reports what it measures rather than the general warning.</span></span>
<span id="cb40-23">cen, prevc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb40-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>):</span>
<span id="cb40-25">    p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugFlowFermenter(g_fit, PHI_BAL, S_START, X_START, TAU_VAL, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nc).solve()</span>
<span id="cb40-26">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p_.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb40-27">    cen.append((nc, e, np.nan <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> prevc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.log2(prevc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e)))</span>
<span id="cb40-28">    prevc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e</span>
<span id="cb40-29">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_read_order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cen[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb40-30">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cen[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>])</span>
<span id="cb40-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">batch reference at tau = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TAU_VAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, X = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed order of the upwind plug-flow solve: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfr_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Richardson extrapolation of the two finest grids: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_rich<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span></span>
<span id="cb40-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfr_richardson_relerr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the batch value."</span>)</span>
<span id="cb40-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Both ways of reading the outlet converge at first order - boundary"</span></span>
<span id="cb40-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfr_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">last-cell-centre </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfr_centre_read_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb40-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" - and on THIS problem the last-cell read is the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">closer of the two, by a factor"</span></span>
<span id="cb40-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pfr_centre_over_boundary_read'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at n = 1600. That is not the general"</span></span>
<span id="cb40-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" rule and the page</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">does not state it as one: with a ZERO-GRADIENT outflow"</span></span>
<span id="cb40-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" condition the boundary value</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is a second-order reconstruction OF THE INTERIOR"</span></span>
<span id="cb40-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" SOLUTION, so both reads inherit the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">same O(h) upwind error and merely carry"</span></span>
<span id="cb40-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" different constants. The reason to use</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">compute_boundary_values is that it"</span></span>
<span id="cb40-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" stays right when the outflow condition is not</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">zero-gradient; here it is a"</span></span>
<span id="cb40-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" wash, and saying so is cheaper than being wrong later."</span>)</span>
<span id="cb40-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The grid study IS the check that catches a wrong nu and a flipped source"</span>)</span>
<span id="cb40-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sign - both are in the break table, at 8.2e2 and 2.7e4 relative."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_pfr" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_pfr_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">ncell</th>
<th id="T_pfr_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">S_outlet</th>
<th id="T_pfr_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">rel. err</th>
<th id="T_pfr_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">order</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_pfr_row0_col0" class="data row0 col0">100</td>
<td id="T_pfr_row0_col1" class="data row0 col1">9.856215188</td>
<td id="T_pfr_row0_col2" class="data row0 col2">1.9152e-02</td>
<td id="T_pfr_row0_col3" class="data row0 col3">nan</td>
</tr>
<tr class="even">
<td id="T_pfr_row1_col0" class="data row1 col0">200</td>
<td id="T_pfr_row1_col1" class="data row1 col1">9.951428426</td>
<td id="T_pfr_row1_col2" class="data row1 col2">9.6765e-03</td>
<td id="T_pfr_row1_col3" class="data row1 col3">0.9849</td>
</tr>
<tr class="odd">
<td id="T_pfr_row2_col0" class="data row2 col0">400</td>
<td id="T_pfr_row2_col1" class="data row2 col1">9.999788961</td>
<td id="T_pfr_row2_col2" class="data row2 col2">4.8639e-03</td>
<td id="T_pfr_row2_col3" class="data row2 col3">0.9924</td>
</tr>
<tr class="even">
<td id="T_pfr_row3_col0" class="data row3 col0">800</td>
<td id="T_pfr_row3_col1" class="data row3 col1">10.024161826</td>
<td id="T_pfr_row3_col2" class="data row3 col2">2.4384e-03</td>
<td id="T_pfr_row3_col3" class="data row3 col3">0.9962</td>
</tr>
<tr class="odd">
<td id="T_pfr_row4_col0" class="data row4 col0">1600</td>
<td id="T_pfr_row4_col1" class="data row4 col1">10.036396905</td>
<td id="T_pfr_row4_col2" class="data row4 col2">1.2208e-03</td>
<td id="T_pfr_row4_col3" class="data row4 col3">0.9981</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
batch reference at tau = 2.0: S = 10.0486645994, X = 59.3834364462
observed order of the upwind plug-flow solve: 0.9981
Richardson extrapolation of the two finest grids: 10.0486319835, 3.246e-06 from the batch value.

Both ways of reading the outlet converge at first order - boundary 0.9981,
last-cell-centre 0.9957 - and on THIS problem the last-cell read is the
closer of the two, by a factor 2.59 at n = 1600. That is not the general rule and the page
does not state it as one: with a ZERO-GRADIENT outflow condition the boundary value
is a second-order reconstruction OF THE INTERIOR SOLUTION, so both reads inherit the
same O(h) upwind error and merely carry different constants. The reason to use
compute_boundary_values is that it stays right when the outflow condition is not
zero-gradient; here it is a wash, and saying so is cheaper than being wrong later.

The grid study IS the check that catches a wrong nu and a flipped source
sign - both are in the break table, at 8.2e2 and 2.7e4 relative.</code></pre>
</div>
</div>
<section id="defect-injection" class="level3">
<h3 class="anchored" data-anchor-id="defect-injection">Defect injection</h3>
<p>Every metric that <em>can</em> be moved has a row that moves it. Metrics that cannot are named individually below and labelled structural. The table was rebuilt for this page’s physics - it did not travel from the page whose directory this one was copied from.</p>
<div id="8c872f09" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:16.953761Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:16.953617Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:27.845102Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:27.844329Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb42-1">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative move that counts as coverage</span></span>
<span id="cb42-2"></span>
<span id="cb42-3"></span>
<span id="cb42-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rec(name, metric, value, note):</span>
<span id="cb42-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every row targets a registered claim, and is wired to it in the claims cell</span></span>
<span id="cb42-6">    base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[metric]</span>
<span id="cb42-7">    rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(value <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(base), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb42-8">    BREAK.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>name, metric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>metric, baseline<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>base, broken<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>value,</span>
<span id="cb42-9">                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>: rel}, moves<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> MOVE_TOL, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>note))</span>
<span id="cb42-10"></span>
<span id="cb42-11"></span>
<span id="cb42-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the data reduction and the balance line</span></span>
<span id="cb42-13">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance line on the ARITHMETIC mean of C_C, not the log mean"</span>,</span>
<span id="cb42-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_six_rows"</span>,</span>
<span id="cb42-15">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> keep, A: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> np.linalg.lstsq(A, CAb[keep],</span>
<span id="cb42-16">                                                                rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb42-17">     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAb[keep].mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))(</span>
<span id="cb42-18">        [i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW],</span>
<span id="cb42-19">        np.vstack([np.ones(NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb42-20">                   Xam[[i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW]]]).T),</span>
<span id="cb42-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the exact time average under exponential growth is the LOG mean; declared convention"</span>)</span>
<span id="cb42-22">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the flagged row kept in the balance line"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_six_rows"</span>, R2_7,</span>
<span id="cb42-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this IS the finding: one cell moves R^2 from 0.99996 to 0.98505"</span>)</span>
<span id="cb42-24">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance line drops row 1 instead of the flagged row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_phi"</span>,</span>
<span id="cb42-25">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>loo[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the leave-one-out sweep says WHICH row, and it is not this one"</span>)</span>
<span id="cb42-26">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu from a forward difference of C_C over the ARITHMETIC-mean biomass"</span>,</span>
<span id="cb42-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Monod"</span>, fit_A(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(Cc1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xam)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>],</span>
<span id="cb42-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d(ln C)/dt = mu is exact; a difference quotient over the wrong mean is not"</span>)</span>
<span id="cb42-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- route A / route B</span></span>
<span id="cb42-30">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route B yield phi perturbed by 5 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_n_moser"</span>,</span>
<span id="cb42-31">    fit_B(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>, phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>],</span>
<span id="cb42-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"perturbs the COMPUTATION, not a declared convention - the row that could "</span></span>
<span id="cb42-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"expose a systematically wrong route-B baseline"</span>)</span>
<span id="cb42-34">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois given the ARITHMETIC-mean biomass in route A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Contois"</span>,</span>
<span id="cb42-35">    fit_A(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>, X<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Xam)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"declared convention"</span>)</span>
<span id="cb42-36">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman fitted from a single local start, no global scan"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Blackman"</span>,</span>
<span id="cb42-37">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r.fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NOBS)))(</span>
<span id="cb42-38">        least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.minimum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, CAb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu,</span>
<span id="cb42-39">                      [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>], bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>]),</span>
<span id="cb42-40">                      xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)),</span>
<span id="cb42-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the kinked objective has local minima; this is why the page scans globally"</span>)</span>
<span id="cb42-42">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser's exponent frozen at n = 1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb42-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n = 1 IS Monod, so the F statistic must collapse to zero"</span>)</span>
<span id="cb42-44">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route-A Moser scan restricted to n &lt;= 1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_n_moser"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb42-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reported exponent must be interior to the scan, and it is not if capped"</span>)</span>
<span id="cb42-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the identities and their above-floor companions</span></span>
<span id="cb42-47">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois map evaluated with the wrong yield (phi -&gt; 2 phi)"</span>,</span>
<span id="cb42-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_mum_relerr"</span>,</span>
<span id="cb42-49">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mumC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KsxC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PHI_BAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb42-50">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"companion for the exactly-zero symbolic residual"</span>)</span>
<span id="cb42-51">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman gap read at S = K_S instead of the switch S = 2 K_S"</span>,</span>
<span id="cb42-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_switch_relerr"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb42-53">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at S = K_S the two laws agree exactly; the gap lives at the switch"</span>)</span>
<span id="cb42-54">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois separation measured on the ROUTE-A design"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois"</span>,</span>
<span id="cb42-55">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span>: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> yA: fit_A(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>yA)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])(</span>
<span id="cb42-56">        RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>](RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], CAb, Xlm)))(),</span>
<span id="cb42-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the degeneracy is EXACT for the forward model and only approximate once the "</span></span>
<span id="cb42-58">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reduction replaces phi(a-S) by a log mean - so the reduction manufactures a "</span></span>
<span id="cb42-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"separation that is not there"</span>)</span>
<span id="cb42-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- separations and the bootstrap</span></span>
<span id="cb42-61">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N* computed at 99 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% i</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">nstead of 95 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nstar_blackman"</span>,</span>
<span id="cb42-62">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(chi2.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, NOBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s_obs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_blackman"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb42-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"declared convention"</span>)</span>
<span id="cb42-64">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scatter taken from route A instead of route B"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nstar_tessier"</span>,</span>
<span id="cb42-65">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(chi2.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_tessier"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb42-66">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"declared convention"</span>)</span>
<span id="cb42-67">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bootstrap at half the noise level"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_forward_truth"</span>,</span>
<span id="cb42-68">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((boot_stats(y_true[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.random.default_rng(SEED)</span>
<span id="cb42-69">                      .normal(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, sigma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, (NBOOT, NOBS)))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_crit).mean()),</span>
<span id="cb42-70">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the size distortion is a bias-to-noise ratio, so it must grow as noise falls"</span>)</span>
<span id="cb42-71">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rawlings' printed y = 1 replaced by 2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>,</span>
<span id="cb42-72">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span></span>
<span id="cb42-73">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Chemostat(g_r, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, Sf_r, D).steady(),</span>
<span id="cb42-74">                      (D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(mum_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D), y_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Sf_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(mum_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D))))</span>
<span id="cb42-75">                  ) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> D <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>))),</span>
<span id="cb42-76">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reproducing a printed number must fail when the printed number is changed"</span>)</span>
<span id="cb42-77">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bootstrap truth taken from route A's own model"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_forward_truth"</span>,</span>
<span id="cb42-78">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_control_truth"</span>],</span>
<span id="cb42-79">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"THE CONTROL, recorded here as a row so the contrast is inside the table too"</span>)</span>
<span id="cb42-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- chemostat and plug flow</span></span>
<span id="cb42-81">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"washout threshold loosened 1e-6 -&gt; 1e-3 of y S_f"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_transient_relerr"</span>,</span>
<span id="cb42-82">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> D: Chemostat(gM_, y_yield, Sf_test, D).steady()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb42-83">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y_yield<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf_test, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb42-84">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Dc_monod(Sf_test))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dc_monod(Sf_test),</span>
<span id="cb42-85">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"declared convention, and the convergence evidence for the quoted D_c"</span>)</span>
<span id="cb42-86">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rawlings' printed K_s = 1 replaced by 2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_Dc_relerr"</span>,</span>
<span id="cb42-87">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> D: Chemostat(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: mum_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S), y_r, Sf_r, D)</span>
<span id="cb42-88">               .steady()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> WASH<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf_r, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb42-89">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Dc_r_closed)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dc_r_closed,</span>
<span id="cb42-90">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reproducing a printed number must fail when the printed number is changed"</span>)</span>
<span id="cb42-91">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rawlings' printed S_f = 5 replaced by 8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>,</span>
<span id="cb42-92">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span></span>
<span id="cb42-93">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Chemostat(g_r, y_r, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, D).steady(),</span>
<span id="cb42-94">                      (D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(mum_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D), y_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ks_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(mum_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D)))))</span>
<span id="cb42-95">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> D <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>))),</span>
<span id="cb42-96">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same, for the steady-state pair"</span>)</span>
<span id="cb42-97">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug flow with nu = 1 (cylindrical) instead of nu = 0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>,</span>
<span id="cb42-98">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p.outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])(</span>
<span id="cb42-99">        PlugFlowFermenter(g_fit, PHI_BAL, S_START, X_START, TAU_VAL,</span>
<span id="cb42-100">                          ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).solve(strict<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)),</span>
<span id="cb42-101">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu is geometry, and a wrong one is invisible in a smooth profile"</span>)</span>
<span id="cb42-102">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow outlet read at the last cell CENTRE"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>,</span>
<span id="cb42-103">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])(</span>
<span id="cb42-104">        PlugFlowFermenter(g_fit, PHI_BAL, S_START, X_START, TAU_VAL,</span>
<span id="cb42-105">                          ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>).solve()),</span>
<span id="cb42-106">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"half a cell short of the boundary. It MOVES the metric, which is the point, "</span></span>
<span id="cb42-107">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"but on this problem it moves it DOWN - see the note under the grid study"</span>)</span>
<span id="cb42-108">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug flow with the substrate sign flipped in the source"</span>,</span>
<span id="cb42-109">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>,</span>
<span id="cb42-110">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p.outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])(</span>
<span id="cb42-111">        (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pf: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">setattr</span>(pf, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flip"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), pf.solve(strict<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])(</span>
<span id="cb42-112">            PlugFlowFermenter(g_fit, PHI_BAL, S_START, X_START, TAU_VAL, ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>))),</span>
<span id="cb42-113">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"substrate must be consumed as biomass is made"</span>)</span>
<span id="cb42-114">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm batch marcher at 25 steps instead of the Richardson pair"</span>,</span>
<span id="cb42-115">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_mum_relerr"</span>,</span>
<span id="cb42-116">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])(</span>
<span id="cb42-117">        least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL,</span>
<span id="cb42-118">                                              PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu, pM,</span>
<span id="cb42-119">                      bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>]),</span>
<span id="cb42-120">                      xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)),</span>
<span id="cb42-121">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the second route must be converged before it can confirm the first"</span>)</span>
<span id="cb42-122">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm batch marcher with the yield used only in the source, not the state"</span>,</span>
<span id="cb42-123">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_conservation_relerr"</span>,</span>
<span id="cb42-124">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> c: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>))</span>
<span id="cb42-125">                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (S0_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(S0_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL))(</span>
<span id="cb42-126">        BatchMarch(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> S, X: pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S), PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>).march(</span>
<span id="cb42-127">            [[S0_b, Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]], dt[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])),</span>
<span id="cb42-128">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the conservation check is only structural if BOTH sides use the same yield"</span>)</span>
<span id="cb42-129"></span>
<span id="cb42-130"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- SWEEP ROWS: one injection, recorded against every metric it touches, so that</span></span>
<span id="cb42-131"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     whole families (all five laws, all the separations, all the plug-flow</span></span>
<span id="cb42-132"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     numbers) are covered rather than only the member quoted in prose.</span></span>
<span id="cb42-133"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rec_many(name, note, pairs):</span>
<span id="cb42-134">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> metric, value <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb42-135">        rec(name, metric, value, note)</span>
<span id="cb42-136"></span>
<span id="cb42-137"></span>
<span id="cb42-138">CAb_imp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb.copy()</span>
<span id="cb42-139">CAb_imp[BAD_ROW] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAB_IMPUTED                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the balance-implied value</span></span>
<span id="cb42-140">_saveCAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb.copy()</span>
<span id="cb42-141"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb42-142">    CAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CAb_imp</span>
<span id="cb42-143">    rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every route-A fit with the flagged cell replaced by its "</span></span>
<span id="cb42-144">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance-implied value"</span>,</span>
<span id="cb42-145">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the single flagged cell, propagated through all seven route-A fits "</span></span>
<span id="cb42-146">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AND through route A's F test, which is where it decides a verdict; "</span></span>
<span id="cb42-147">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a labelled INFERENCE, run to show exactly what depends on that cell"</span>,</span>
<span id="cb42-148">             [(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmsA_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' '</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, fit_A(k)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])</span>
<span id="cb42-149">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order"</span>]]      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the zero-order null sees no S</span></span>
<span id="cb42-150">             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_n_moser"</span>, fit_A(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb42-151">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod"</span>, FA_IMP)])</span>
<span id="cb42-152"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">finally</span>:</span>
<span id="cb42-153">    CAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _saveCAb</span>
<span id="cb42-154"></span>
<span id="cb42-155">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the whole bootstrap fitted on the search grid alone, with no per-draw "</span></span>
<span id="cb42-156">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refinement"</span>,</span>
<span id="cb42-157">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: "</span></span>
<span id="cb42-158">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an unrefined Moser fit cannot reach its own optimum, so it deflates F on "</span></span>
<span id="cb42-159">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every draw and makes the control look conservative when it is at nominal "</span></span>
<span id="cb42-160">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size. A grid-limited extremum is invisible to every perturbation test, "</span></span>
<span id="cb42-161">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"which is why the refinement's convergence is printed above"</span>,</span>
<span id="cb42-162">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_forward_truth"</span>, GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>]),</span>
<span id="cb42-163">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_control_truth"</span>, GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>]),</span>
<span id="cb42-164">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_forward_truth"</span>, GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>]),</span>
<span id="cb42-165">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_control_truth"</span>, GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>]),</span>
<span id="cb42-166">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_F"</span>, GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pF"</span>]),</span>
<span id="cb42-167">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_n"</span>, GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pn"</span>])])</span>
<span id="cb42-168"></span>
<span id="cb42-169">_mu_fd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Cc1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Xam            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a forward difference over the wrong mean</span></span>
<span id="cb42-170">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu itself from a forward difference over the ARITHMETIC-mean biomass"</span>,</span>
<span id="cb42-171">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d(ln C)/dt = mu is EXACT; a difference quotient over the wrong mean is "</span></span>
<span id="cb42-172">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"not, and the one-parameter nulls see only mu"</span>,</span>
<span id="cb42-173">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_zero_order"</span>, fit_A(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero order"</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_mu_fd)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]),</span>
<span id="cb42-174">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_zero_order"</span>, fit_B(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero order"</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_mu_fd)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])])</span>
<span id="cb42-175"></span>
<span id="cb42-176">_rb7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: fit_B(k, a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a7, phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b7, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>])</span>
<span id="cb42-177">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order"</span>]}</span>
<span id="cb42-178">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every route-B fit with the ALL-SEVEN balance line"</span>,</span>
<span id="cb42-179">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi and a carry the flagged row into every route-B number at once"</span>,</span>
<span id="cb42-180">         [(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmsB_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' '</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, _rb7[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])</span>
<span id="cb42-181">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LAWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order"</span>]]          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the zero-order null sees no S</span></span>
<span id="cb42-182">         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_mu_m"</span>, _rb7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb42-183">            (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_K_S"</span>, _rb7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb42-184">            (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_F_moser_vs_monod"</span>,</span>
<span id="cb42-185">             (_rb7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _rb7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(_rb7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sse"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)),</span>
<span id="cb42-186">            (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_over_routeB_monod_rms"</span>,</span>
<span id="cb42-187">             RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_rb7[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])])</span>
<span id="cb42-188"></span>
<span id="cb42-189">_idx3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>])</span>
<span id="cb42-190">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every separation measured at 3 of the 7 design points"</span>,</span>
<span id="cb42-191">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identifiability is a property of the DESIGN, so dropping four points "</span></span>
<span id="cb42-192">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"must move every separation and every N*"</span>,</span>
<span id="cb42-193">         <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>([[(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb42-194">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(fit_B(k, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>y_true, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resid"</span>][_idx3]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))),</span>
<span id="cb42-195">               (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_over_scatter_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb42-196">                <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(fit_B(k, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>y_true, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resid"</span>][_idx3]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_obs)]</span>
<span id="cb42-197">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ([(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Nstar_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb42-198">                   <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(chi2.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>s_obs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb42-199">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.mean(fit_B(k, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>y_true, p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RB[k][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resid"</span>][_idx3]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))))]</span>
<span id="cb42-200">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Nstar_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>lower()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [])</span>
<span id="cb42-201">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Tessier"</span>]], []))</span>
<span id="cb42-202"></span>
<span id="cb42-203">_Yh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y_true[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.random.default_rng(SEED).normal(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, sigma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, (NBOOT, NOBS))</span>
<span id="cb42-204">_Fh, _nh, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> boot_stats(_Yh)</span>
<span id="cb42-205">_Yc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y_ctrl[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.random.default_rng(SEED<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).normal(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, sigma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, (NBOOT, NOBS))</span>
<span id="cb42-206">_Fc, _nc, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> boot_stats(_Yc)</span>
<span id="cb42-207">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the whole bootstrap re-drawn at half the noise level"</span>,</span>
<span id="cb42-208">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every bootstrap number is a property of the noise level and the seed, "</span></span>
<span id="cb42-209">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and the page says so - the seed is fixed and printed"</span>,</span>
<span id="cb42-210">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_F"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((_Fh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA).mean())),</span>
<span id="cb42-211">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_n"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((_nh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]).mean())),</span>
<span id="cb42-212">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_control_truth"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((_Fc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_crit).mean())),</span>
<span id="cb42-213">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_control_truth"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(_nc)))])</span>
<span id="cb42-214"></span>
<span id="cb42-215">_bias_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>G[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>](RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], CAb, Xlm)</span>
<span id="cb42-216">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu_pred_ode(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:],</span>
<span id="cb42-217">                         A_BAL, PHI_BAL))</span>
<span id="cb42-218">_bias_imp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _bias_B</span>
<span id="cb42-219">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reduction bias evaluated at the ROUTE-B constants"</span>,</span>
<span id="cb42-220">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the bias is a property of the curve it is evaluated on, so quoting it "</span></span>
<span id="cb42-221">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"from the route-A fit is a declared choice - and the route-A fit is the "</span></span>
<span id="cb42-222">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one the bias is being charged against"</span>,</span>
<span id="cb42-223">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_max_abs"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_bias_imp)))),</span>
<span id="cb42-224">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_max_abs_excl_bad_row"</span>,</span>
<span id="cb42-225">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.where(np.arange(NOBS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW, _bias_imp, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))))),</span>
<span id="cb42-226">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_over_routeA_rms"</span>,</span>
<span id="cb42-227">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.where(np.arange(NOBS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW, _bias_imp, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>))))</span>
<span id="cb42-228">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])])</span>
<span id="cb42-229"></span>
<span id="cb42-230">_a_am, _b_am, _R2_am, _r_am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> keep, A: (</span>
<span id="cb42-231">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> c: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb42-232">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb42-233">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAb[keep].mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb42-234">               CAb[keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c))(np.linalg.lstsq(A, CAb[keep], rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))(</span>
<span id="cb42-235">    [i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW],</span>
<span id="cb42-236">    np.vstack([np.ones(NOBS<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), Xam[[i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW]]]).T)</span>
<span id="cb42-237">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the whole balance test on the ARITHMETIC-mean biomass"</span>,</span>
<span id="cb42-238">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"declared convention: the exact time average under exponential growth "</span></span>
<span id="cb42-239">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is the LOG mean"</span>,</span>
<span id="cb42-240">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_all_rows"</span>,</span>
<span id="cb42-241">           (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> A: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> np.linalg.lstsq(A, CAb, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb42-242">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((CAb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAb.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))(np.vstack([np.ones(NOBS), Xam]).T)),</span>
<span id="cb42-243">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_row4_residual"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CAb[BAD_ROW] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (_a_am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _b_am<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Xam[BAD_ROW]))),</span>
<span id="cb42-244">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_worst_other_residual"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_r_am)))),</span>
<span id="cb42-245">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row4_end_of_interval_relgap"</span>,</span>
<span id="cb42-246">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CAb[BAD_ROW] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (_a_am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[BAD_ROW]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_b_am)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb[BAD_ROW]))])</span>
<span id="cb42-247"></span>
<span id="cb42-248">_DcA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Sf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Sf)</span>
<span id="cb42-249">_ratA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: RA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_DcA(Sf)</span>
<span id="cb42-250">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the chemostat prediction built from the ROUTE-A constants"</span>,</span>
<span id="cb42-251">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the whole point of the page: which reduction you fit with changes what "</span></span>
<span id="cb42-252">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"you predict for an experiment you have not run"</span>,</span>
<span id="cb42-253">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_ratio_at_Sf20"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_ratA(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>))),</span>
<span id="cb42-254">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: _ratA(Sf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>,</span>
<span id="cb42-255">                                       xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>))),</span>
<span id="cb42-256">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_for_10pct_gap"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Sf: _ratA(Sf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>,</span>
<span id="cb42-257">                                            xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>))),</span>
<span id="cb42-258">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_closed_form"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_DcA(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>)))])</span>
<span id="cb42-259"></span>
<span id="cb42-260">_p100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [PlugFlowFermenter(g_fit, PHI_BAL, S_START, X_START, TAU_VAL,</span>
<span id="cb42-261">                           ncell<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nc).solve() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)]</span>
<span id="cb42-262">_e100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p.outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _p100]</span>
<span id="cb42-263">_c100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(p.c[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _p100]</span>
<span id="cb42-264">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every plug-flow number read off the two COARSEST grids"</span>,</span>
<span id="cb42-265">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an order quoted from an unconverged pair is the classic way to publish "</span></span>
<span id="cb42-266">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a wrong one"</span>,</span>
<span id="cb42-267">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_observed_order"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(_e100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_e100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))),</span>
<span id="cb42-268">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_read_order"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(_c100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_c100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))),</span>
<span id="cb42-269">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_c100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_e100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb42-270">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_richardson_relerr"</span>,</span>
<span id="cb42-271">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_p100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _p100[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].outlet()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ref[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))])</span>
<span id="cb42-272"></span>
<span id="cb42-273">_v25 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>)</span>
<span id="cb42-274">_v50 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL, PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb42-275">rec_many(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the pymrm marcher's order read off 25/50 steps, and its refit unconverged"</span>,</span>
<span id="cb42-276">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same reason as the plug-flow row, for the second independent computation"</span>,</span>
<span id="cb42-277">         [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_observed_order"</span>,</span>
<span id="cb42-278">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_v25<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>ref_ode)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ref_ode))</span>
<span id="cb42-279">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_v50<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>ref_ode)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ref_ode))))),</span>
<span id="cb42-280">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_KS_relerr"</span>,</span>
<span id="cb42-281">           (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])(</span>
<span id="cb42-282">               least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: mu_pred_pymrm(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], A_BAL,</span>
<span id="cb42-283">                                                     PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu, pM,</span>
<span id="cb42-284">                             bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e12</span>]),</span>
<span id="cb42-285">                             xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)))])</span>
<span id="cb42-286"></span>
<span id="cb42-287">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois map evaluated with the wrong yield (phi -&gt; 2 phi)"</span>,</span>
<span id="cb42-288">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_KS_relerr"</span>,</span>
<span id="cb42-289">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(KsxC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PHI_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A_BAL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KsxC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PHI_BAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb42-290">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"companion for the exactly-zero symbolic residual"</span>)</span>
<span id="cb42-291"></span>
<span id="cb42-292">TBK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAK)</span>
<span id="cb42-293">show(TBK.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.3e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb42-294">     .hide(axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"index"</span>).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brk"</span>))</span>
<span id="cb42-295">n_move <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(TBK[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb42-296"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TBK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> injections, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_move<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of which move their metric by more than"</span></span>
<span id="cb42-297">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" MOVE_TOL = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOVE_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative."</span>)</span>
<span id="cb42-298"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> n_move <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TBK), TBK[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>TBK[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>]]</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_brk" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th id="T_brk_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">row</th>
<th id="T_brk_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">metric</th>
<th id="T_brk_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">baseline</th>
<th id="T_brk_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">broken</th>
<th id="T_brk_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">rel. move</th>
<th id="T_brk_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">moves</th>
<th id="T_brk_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td id="T_brk_row0_col0" class="data row0 col0">balance line on the ARITHMETIC mean of C_C, not the log mean</td>
<td id="T_brk_row0_col1" class="data row0 col1">balance_R2_six_rows</td>
<td id="T_brk_row0_col2" class="data row0 col2">0.999957</td>
<td id="T_brk_row0_col3" class="data row0 col3">0.999955</td>
<td id="T_brk_row0_col4" class="data row0 col4">1.846e-06</td>
<td id="T_brk_row0_col5" class="data row0 col5">True</td>
<td id="T_brk_row0_col6" class="data row0 col6">the exact time average under exponential growth is the LOG mean; declared convention</td>
</tr>
<tr class="even">
<td id="T_brk_row1_col0" class="data row1 col0">the flagged row kept in the balance line</td>
<td id="T_brk_row1_col1" class="data row1 col1">balance_R2_six_rows</td>
<td id="T_brk_row1_col2" class="data row1 col2">0.999957</td>
<td id="T_brk_row1_col3" class="data row1 col3">0.985047</td>
<td id="T_brk_row1_col4" class="data row1 col4">1.491e-02</td>
<td id="T_brk_row1_col5" class="data row1 col5">True</td>
<td id="T_brk_row1_col6" class="data row1 col6">this IS the finding: one cell moves R^2 from 0.99996 to 0.98505</td>
</tr>
<tr class="odd">
<td id="T_brk_row2_col0" class="data row2 col0">balance line drops row 1 instead of the flagged row</td>
<td id="T_brk_row2_col1" class="data row2 col1">balance_phi</td>
<td id="T_brk_row2_col2" class="data row2 col2">0.317437</td>
<td id="T_brk_row2_col3" class="data row2 col3">0.321919</td>
<td id="T_brk_row2_col4" class="data row2 col4">1.412e-02</td>
<td id="T_brk_row2_col5" class="data row2 col5">True</td>
<td id="T_brk_row2_col6" class="data row2 col6">the leave-one-out sweep says WHICH row, and it is not this one</td>
</tr>
<tr class="even">
<td id="T_brk_row3_col0" class="data row3 col0">mu from a forward difference of C_C over the ARITHMETIC-mean biomass</td>
<td id="T_brk_row3_col1" class="data row3 col1">rmsA_Monod</td>
<td id="T_brk_row3_col2" class="data row3 col2">0.0546903</td>
<td id="T_brk_row3_col3" class="data row3 col3">0.0552494</td>
<td id="T_brk_row3_col4" class="data row3 col4">1.022e-02</td>
<td id="T_brk_row3_col5" class="data row3 col5">True</td>
<td id="T_brk_row3_col6" class="data row3 col6">d(ln C)/dt = mu is exact; a difference quotient over the wrong mean is not</td>
</tr>
<tr class="odd">
<td id="T_brk_row4_col0" class="data row4 col0">route B yield phi perturbed by 5 %</td>
<td id="T_brk_row4_col1" class="data row4 col1">routeB_n_moser</td>
<td id="T_brk_row4_col2" class="data row4 col2">1.50994</td>
<td id="T_brk_row4_col3" class="data row4 col3">2.67695</td>
<td id="T_brk_row4_col4" class="data row4 col4">7.729e-01</td>
<td id="T_brk_row4_col5" class="data row4 col5">True</td>
<td id="T_brk_row4_col6" class="data row4 col6">perturbs the COMPUTATION, not a declared convention - the row that could expose a systematically wrong route-B baseline</td>
</tr>
<tr class="even">
<td id="T_brk_row5_col0" class="data row5 col0">Contois given the ARITHMETIC-mean biomass in route A</td>
<td id="T_brk_row5_col1" class="data row5 col1">rmsA_Contois</td>
<td id="T_brk_row5_col2" class="data row5 col2">0.0515336</td>
<td id="T_brk_row5_col3" class="data row5 col3">0.0516375</td>
<td id="T_brk_row5_col4" class="data row5 col4">2.016e-03</td>
<td id="T_brk_row5_col5" class="data row5 col5">True</td>
<td id="T_brk_row5_col6" class="data row5 col6">declared convention</td>
</tr>
<tr class="odd">
<td id="T_brk_row6_col0" class="data row6 col0">Blackman fitted from a single local start, no global scan</td>
<td id="T_brk_row6_col1" class="data row6 col1">rmsA_Blackman</td>
<td id="T_brk_row6_col2" class="data row6 col2">0.0267723</td>
<td id="T_brk_row6_col3" class="data row6 col3">0.040646</td>
<td id="T_brk_row6_col4" class="data row6 col4">5.182e-01</td>
<td id="T_brk_row6_col5" class="data row6 col5">True</td>
<td id="T_brk_row6_col6" class="data row6 col6">the kinked objective has local minima; this is why the page scans globally</td>
</tr>
<tr class="even">
<td id="T_brk_row7_col0" class="data row7 col0">Moser's exponent frozen at n = 1</td>
<td id="T_brk_row7_col1" class="data row7 col1">routeA_F_moser_vs_monod</td>
<td id="T_brk_row7_col2" class="data row7 col2">12.2698</td>
<td id="T_brk_row7_col3" class="data row7 col3">0</td>
<td id="T_brk_row7_col4" class="data row7 col4">1.000e+00</td>
<td id="T_brk_row7_col5" class="data row7 col5">True</td>
<td id="T_brk_row7_col6" class="data row7 col6">n = 1 IS Monod, so the F statistic must collapse to zero</td>
</tr>
<tr class="odd">
<td id="T_brk_row8_col0" class="data row8 col0">route-A Moser scan restricted to n &lt;= 1.5</td>
<td id="T_brk_row8_col1" class="data row8 col1">routeA_n_moser</td>
<td id="T_brk_row8_col2" class="data row8 col2">1.93166</td>
<td id="T_brk_row8_col3" class="data row8 col3">1.5</td>
<td id="T_brk_row8_col4" class="data row8 col4">2.235e-01</td>
<td id="T_brk_row8_col5" class="data row8 col5">True</td>
<td id="T_brk_row8_col6" class="data row8 col6">the reported exponent must be interior to the scan, and it is not if capped</td>
</tr>
<tr class="even">
<td id="T_brk_row9_col0" class="data row9 col0">Contois map evaluated with the wrong yield (phi -&gt; 2 phi)</td>
<td id="T_brk_row9_col1" class="data row9 col1">contois_map_mum_relerr</td>
<td id="T_brk_row9_col2" class="data row9 col2">2.18806e-06</td>
<td id="T_brk_row9_col3" class="data row9 col3">0.115771</td>
<td id="T_brk_row9_col4" class="data row9 col4">5.291e+04</td>
<td id="T_brk_row9_col5" class="data row9 col5">True</td>
<td id="T_brk_row9_col6" class="data row9 col6">companion for the exactly-zero symbolic residual</td>
</tr>
<tr class="odd">
<td id="T_brk_row10_col0" class="data row10 col0">Blackman gap read at S = K_S instead of the switch S = 2 K_S</td>
<td id="T_brk_row10_col1" class="data row10 col1">num_blackman_gap_switch_relerr</td>
<td id="T_brk_row10_col2" class="data row10 col2">1.66533e-16</td>
<td id="T_brk_row10_col3" class="data row10 col3">0.5</td>
<td id="T_brk_row10_col4" class="data row10 col4">3.002e+15</td>
<td id="T_brk_row10_col5" class="data row10 col5">True</td>
<td id="T_brk_row10_col6" class="data row10 col6">at S = K_S the two laws agree exactly; the gap lives at the switch</td>
</tr>
<tr class="even">
<td id="T_brk_row11_col0" class="data row11 col0">Contois separation measured on the ROUTE-A design</td>
<td id="T_brk_row11_col1" class="data row11 col1">sep_contois</td>
<td id="T_brk_row11_col2" class="data row11 col2">6.32742e-14</td>
<td id="T_brk_row11_col3" class="data row11 col3">0.00673476</td>
<td id="T_brk_row11_col4" class="data row11 col4">1.064e+11</td>
<td id="T_brk_row11_col5" class="data row11 col5">True</td>
<td id="T_brk_row11_col6" class="data row11 col6">the degeneracy is EXACT for the forward model and only approximate once the reduction replaces phi(a-S) by a log mean - so the reduction manufactures a separation that is not there</td>
</tr>
<tr class="odd">
<td id="T_brk_row12_col0" class="data row12 col0">N* computed at 99 % instead of 95 %</td>
<td id="T_brk_row12_col1" class="data row12 col1">Nstar_blackman</td>
<td id="T_brk_row12_col2" class="data row12 col2">1.30352</td>
<td id="T_brk_row12_col3" class="data row12 col3">1.77637</td>
<td id="T_brk_row12_col4" class="data row12 col4">3.627e-01</td>
<td id="T_brk_row12_col5" class="data row12 col5">True</td>
<td id="T_brk_row12_col6" class="data row12 col6">declared convention</td>
</tr>
<tr class="even">
<td id="T_brk_row13_col0" class="data row13 col0">scatter taken from route A instead of route B</td>
<td id="T_brk_row13_col1" class="data row13 col1">Nstar_tessier</td>
<td id="T_brk_row13_col2" class="data row13 col2">10.2701</td>
<td id="T_brk_row13_col3" class="data row13 col3">31.0252</td>
<td id="T_brk_row13_col4" class="data row13 col4">2.021e+00</td>
<td id="T_brk_row13_col5" class="data row13 col5">True</td>
<td id="T_brk_row13_col6" class="data row13 col6">declared convention</td>
</tr>
<tr class="odd">
<td id="T_brk_row14_col0" class="data row14 col0">bootstrap at half the noise level</td>
<td id="T_brk_row14_col1" class="data row14 col1">boot_size_forward_truth</td>
<td id="T_brk_row14_col2" class="data row14 col2">0.3655</td>
<td id="T_brk_row14_col3" class="data row14 col3">0.559</td>
<td id="T_brk_row14_col4" class="data row14 col4">5.294e-01</td>
<td id="T_brk_row14_col5" class="data row14 col5">True</td>
<td id="T_brk_row14_col6" class="data row14 col6">the size distortion is a bias-to-noise ratio, so it must grow as noise falls</td>
</tr>
<tr class="even">
<td id="T_brk_row15_col0" class="data row15 col0">Rawlings' printed y = 1 replaced by 2</td>
<td id="T_brk_row15_col1" class="data row15 col1">rawlings_10_19_max_relerr</td>
<td id="T_brk_row15_col2" class="data row15 col2">0</td>
<td id="T_brk_row15_col3" class="data row15 col3">1</td>
<td id="T_brk_row15_col4" class="data row15 col4">1.000e+300</td>
<td id="T_brk_row15_col5" class="data row15 col5">True</td>
<td id="T_brk_row15_col6" class="data row15 col6">reproducing a printed number must fail when the printed number is changed</td>
</tr>
<tr class="odd">
<td id="T_brk_row16_col0" class="data row16 col0">bootstrap truth taken from route A's own model</td>
<td id="T_brk_row16_col1" class="data row16 col1">boot_median_n_forward_truth</td>
<td id="T_brk_row16_col2" class="data row16 col2">1.61168</td>
<td id="T_brk_row16_col3" class="data row16 col3">1.00887</td>
<td id="T_brk_row16_col4" class="data row16 col4">3.740e-01</td>
<td id="T_brk_row16_col5" class="data row16 col5">True</td>
<td id="T_brk_row16_col6" class="data row16 col6">THE CONTROL, recorded here as a row so the contrast is inside the table too</td>
</tr>
<tr class="even">
<td id="T_brk_row17_col0" class="data row17 col0">washout threshold loosened 1e-6 -&gt; 1e-3 of y S_f</td>
<td id="T_brk_row17_col1" class="data row17 col1">Dc_monod_transient_relerr</td>
<td id="T_brk_row17_col2" class="data row17 col2">0.000379663</td>
<td id="T_brk_row17_col3" class="data row17 col3">0.000505782</td>
<td id="T_brk_row17_col4" class="data row17 col4">3.322e-01</td>
<td id="T_brk_row17_col5" class="data row17 col5">True</td>
<td id="T_brk_row17_col6" class="data row17 col6">declared convention, and the convergence evidence for the quoted D_c</td>
</tr>
<tr class="odd">
<td id="T_brk_row18_col0" class="data row18 col0">Rawlings' printed K_s = 1 replaced by 2</td>
<td id="T_brk_row18_col1" class="data row18 col1">rawlings_Dc_relerr</td>
<td id="T_brk_row18_col2" class="data row18 col2">0.000214314</td>
<td id="T_brk_row18_col3" class="data row18 col3">0.142656</td>
<td id="T_brk_row18_col4" class="data row18 col4">6.646e+02</td>
<td id="T_brk_row18_col5" class="data row18 col5">True</td>
<td id="T_brk_row18_col6" class="data row18 col6">reproducing a printed number must fail when the printed number is changed</td>
</tr>
<tr class="even">
<td id="T_brk_row19_col0" class="data row19 col0">Rawlings' printed S_f = 5 replaced by 8</td>
<td id="T_brk_row19_col1" class="data row19 col1">rawlings_10_19_max_relerr</td>
<td id="T_brk_row19_col2" class="data row19 col2">0</td>
<td id="T_brk_row19_col3" class="data row19 col3">1.5</td>
<td id="T_brk_row19_col4" class="data row19 col4">1.500e+300</td>
<td id="T_brk_row19_col5" class="data row19 col5">True</td>
<td id="T_brk_row19_col6" class="data row19 col6">the same, for the steady-state pair</td>
</tr>
<tr class="odd">
<td id="T_brk_row20_col0" class="data row20 col0">plug flow with nu = 1 (cylindrical) instead of nu = 0</td>
<td id="T_brk_row20_col1" class="data row20 col1">pfr_batch_relerr_finest</td>
<td id="T_brk_row20_col2" class="data row20 col2">0.00122083</td>
<td id="T_brk_row20_col3" class="data row20 col3">1</td>
<td id="T_brk_row20_col4" class="data row20 col4">8.181e+02</td>
<td id="T_brk_row20_col5" class="data row20 col5">True</td>
<td id="T_brk_row20_col6" class="data row20 col6">nu is geometry, and a wrong one is invisible in a smooth profile</td>
</tr>
<tr class="even">
<td id="T_brk_row21_col0" class="data row21 col0">plug-flow outlet read at the last cell CENTRE</td>
<td id="T_brk_row21_col1" class="data row21 col1">pfr_batch_relerr_finest</td>
<td id="T_brk_row21_col2" class="data row21 col2">0.00122083</td>
<td id="T_brk_row21_col3" class="data row21 col3">0.000470665</td>
<td id="T_brk_row21_col4" class="data row21 col4">6.145e-01</td>
<td id="T_brk_row21_col5" class="data row21 col5">True</td>
<td id="T_brk_row21_col6" class="data row21 col6">half a cell short of the boundary. It MOVES the metric, which is the point, but on this problem it moves it DOWN - see the note under the grid study</td>
</tr>
<tr class="odd">
<td id="T_brk_row22_col0" class="data row22 col0">plug flow with the substrate sign flipped in the source</td>
<td id="T_brk_row22_col1" class="data row22 col1">pfr_batch_relerr_finest</td>
<td id="T_brk_row22_col2" class="data row22 col2">0.00122083</td>
<td id="T_brk_row22_col3" class="data row22 col3">33.1471</td>
<td id="T_brk_row22_col4" class="data row22 col4">2.715e+04</td>
<td id="T_brk_row22_col5" class="data row22 col5">True</td>
<td id="T_brk_row22_col6" class="data row22 col6">substrate must be consumed as biomass is made</td>
</tr>
<tr class="even">
<td id="T_brk_row23_col0" class="data row23 col0">pymrm batch marcher at 25 steps instead of the Richardson pair</td>
<td id="T_brk_row23_col1" class="data row23 col1">pymrm_refit_mum_relerr</td>
<td id="T_brk_row23_col2" class="data row23 col2">1.04439e-06</td>
<td id="T_brk_row23_col3" class="data row23 col3">0.0126791</td>
<td id="T_brk_row23_col4" class="data row23 col4">1.214e+04</td>
<td id="T_brk_row23_col5" class="data row23 col5">True</td>
<td id="T_brk_row23_col6" class="data row23 col6">the second route must be converged before it can confirm the first</td>
</tr>
<tr class="odd">
<td id="T_brk_row24_col0" class="data row24 col0">pymrm batch marcher with the yield used only in the source, not the state</td>
<td id="T_brk_row24_col1" class="data row24 col1">pymrm_batch_conservation_relerr</td>
<td id="T_brk_row24_col2" class="data row24 col2">4.32554e-16</td>
<td id="T_brk_row24_col3" class="data row24 col3">0.00245257</td>
<td id="T_brk_row24_col4" class="data row24 col4">5.670e+12</td>
<td id="T_brk_row24_col5" class="data row24 col5">True</td>
<td id="T_brk_row24_col6" class="data row24 col6">the conservation check is only structural if BOTH sides use the same yield</td>
</tr>
<tr class="even">
<td id="T_brk_row25_col0" class="data row25 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row25_col1" class="data row25 col1">rmsA_Monod</td>
<td id="T_brk_row25_col2" class="data row25 col2">0.0546903</td>
<td id="T_brk_row25_col3" class="data row25 col3">0.0468704</td>
<td id="T_brk_row25_col4" class="data row25 col4">1.430e-01</td>
<td id="T_brk_row25_col5" class="data row25 col5">True</td>
<td id="T_brk_row25_col6" class="data row25 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="odd">
<td id="T_brk_row26_col0" class="data row26 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row26_col1" class="data row26 col1">rmsA_Blackman</td>
<td id="T_brk_row26_col2" class="data row26 col2">0.0267723</td>
<td id="T_brk_row26_col3" class="data row26 col3">0.040646</td>
<td id="T_brk_row26_col4" class="data row26 col4">5.182e-01</td>
<td id="T_brk_row26_col5" class="data row26 col5">True</td>
<td id="T_brk_row26_col6" class="data row26 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="even">
<td id="T_brk_row27_col0" class="data row27 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row27_col1" class="data row27 col1">rmsA_Tessier</td>
<td id="T_brk_row27_col2" class="data row27 col2">0.0387098</td>
<td id="T_brk_row27_col3" class="data row27 col3">0.0356679</td>
<td id="T_brk_row27_col4" class="data row27 col4">7.858e-02</td>
<td id="T_brk_row27_col5" class="data row27 col5">True</td>
<td id="T_brk_row27_col6" class="data row27 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="odd">
<td id="T_brk_row28_col0" class="data row28 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row28_col1" class="data row28 col1">rmsA_Moser</td>
<td id="T_brk_row28_col2" class="data row28 col2">0.0271175</td>
<td id="T_brk_row28_col3" class="data row28 col3">0.0304976</td>
<td id="T_brk_row28_col4" class="data row28 col4">1.246e-01</td>
<td id="T_brk_row28_col5" class="data row28 col5">True</td>
<td id="T_brk_row28_col6" class="data row28 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="even">
<td id="T_brk_row29_col0" class="data row29 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row29_col1" class="data row29 col1">rmsA_Contois</td>
<td id="T_brk_row29_col2" class="data row29 col2">0.0515336</td>
<td id="T_brk_row29_col3" class="data row29 col3">0.0469358</td>
<td id="T_brk_row29_col4" class="data row29 col4">8.922e-02</td>
<td id="T_brk_row29_col5" class="data row29 col5">True</td>
<td id="T_brk_row29_col6" class="data row29 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="odd">
<td id="T_brk_row30_col0" class="data row30 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row30_col1" class="data row30 col1">rmsA_first_order</td>
<td id="T_brk_row30_col2" class="data row30 col2">0.201476</td>
<td id="T_brk_row30_col3" class="data row30 col3">0.176293</td>
<td id="T_brk_row30_col4" class="data row30 col4">1.250e-01</td>
<td id="T_brk_row30_col5" class="data row30 col5">True</td>
<td id="T_brk_row30_col6" class="data row30 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="even">
<td id="T_brk_row31_col0" class="data row31 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row31_col1" class="data row31 col1">routeA_n_moser</td>
<td id="T_brk_row31_col2" class="data row31 col2">1.93166</td>
<td id="T_brk_row31_col3" class="data row31 col3">1.70797</td>
<td id="T_brk_row31_col4" class="data row31 col4">1.158e-01</td>
<td id="T_brk_row31_col5" class="data row31 col5">True</td>
<td id="T_brk_row31_col6" class="data row31 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="odd">
<td id="T_brk_row32_col0" class="data row32 col0">every route-A fit with the flagged cell replaced by its balance-implied value</td>
<td id="T_brk_row32_col1" class="data row32 col1">routeA_F_moser_vs_monod</td>
<td id="T_brk_row32_col2" class="data row32 col2">12.2698</td>
<td id="T_brk_row32_col3" class="data row32 col3">5.44773</td>
<td id="T_brk_row32_col4" class="data row32 col4">5.560e-01</td>
<td id="T_brk_row32_col5" class="data row32 col5">True</td>
<td id="T_brk_row32_col6" class="data row32 col6">the single flagged cell, propagated through all seven route-A fits AND through route A's F test, which is where it decides a verdict; a labelled INFERENCE, run to show exactly what depends on that cell</td>
</tr>
<tr class="even">
<td id="T_brk_row33_col0" class="data row33 col0">the whole bootstrap fitted on the search grid alone, with no per-draw refinement</td>
<td id="T_brk_row33_col1" class="data row33 col1">boot_size_forward_truth</td>
<td id="T_brk_row33_col2" class="data row33 col2">0.3655</td>
<td id="T_brk_row33_col3" class="data row33 col3">0.308</td>
<td id="T_brk_row33_col4" class="data row33 col4">1.573e-01</td>
<td id="T_brk_row33_col5" class="data row33 col5">True</td>
<td id="T_brk_row33_col6" class="data row33 col6">THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: an unrefined Moser fit cannot reach its own optimum, so it deflates F on every draw and makes the control look conservative when it is at nominal size. A grid-limited extremum is invisible to every perturbation test, which is why the refinement's convergence is printed above</td>
</tr>
<tr class="odd">
<td id="T_brk_row34_col0" class="data row34 col0">the whole bootstrap fitted on the search grid alone, with no per-draw refinement</td>
<td id="T_brk_row34_col1" class="data row34 col1">boot_size_control_truth</td>
<td id="T_brk_row34_col2" class="data row34 col2">0.0495</td>
<td id="T_brk_row34_col3" class="data row34 col3">0.021</td>
<td id="T_brk_row34_col4" class="data row34 col4">5.758e-01</td>
<td id="T_brk_row34_col5" class="data row34 col5">True</td>
<td id="T_brk_row34_col6" class="data row34 col6">THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: an unrefined Moser fit cannot reach its own optimum, so it deflates F on every draw and makes the control look conservative when it is at nominal size. A grid-limited extremum is invisible to every perturbation test, which is why the refinement's convergence is printed above</td>
</tr>
<tr class="even">
<td id="T_brk_row35_col0" class="data row35 col0">the whole bootstrap fitted on the search grid alone, with no per-draw refinement</td>
<td id="T_brk_row35_col1" class="data row35 col1">boot_median_n_forward_truth</td>
<td id="T_brk_row35_col2" class="data row35 col2">1.61168</td>
<td id="T_brk_row35_col3" class="data row35 col3">1.60286</td>
<td id="T_brk_row35_col4" class="data row35 col4">5.475e-03</td>
<td id="T_brk_row35_col5" class="data row35 col5">True</td>
<td id="T_brk_row35_col6" class="data row35 col6">THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: an unrefined Moser fit cannot reach its own optimum, so it deflates F on every draw and makes the control look conservative when it is at nominal size. A grid-limited extremum is invisible to every perturbation test, which is why the refinement's convergence is printed above</td>
</tr>
<tr class="odd">
<td id="T_brk_row36_col0" class="data row36 col0">the whole bootstrap fitted on the search grid alone, with no per-draw refinement</td>
<td id="T_brk_row36_col1" class="data row36 col1">boot_median_n_control_truth</td>
<td id="T_brk_row36_col2" class="data row36 col2">1.00887</td>
<td id="T_brk_row36_col3" class="data row36 col3">0.951429</td>
<td id="T_brk_row36_col4" class="data row36 col4">5.693e-02</td>
<td id="T_brk_row36_col5" class="data row36 col5">True</td>
<td id="T_brk_row36_col6" class="data row36 col6">THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: an unrefined Moser fit cannot reach its own optimum, so it deflates F on every draw and makes the control look conservative when it is at nominal size. A grid-limited extremum is invisible to every perturbation test, which is why the refinement's convergence is printed above</td>
</tr>
<tr class="even">
<td id="T_brk_row37_col0" class="data row37 col0">the whole bootstrap fitted on the search grid alone, with no per-draw refinement</td>
<td id="T_brk_row37_col1" class="data row37 col1">boot_p_of_observed_F</td>
<td id="T_brk_row37_col2" class="data row37 col2">0.228</td>
<td id="T_brk_row37_col3" class="data row37 col3">0.1835</td>
<td id="T_brk_row37_col4" class="data row37 col4">1.952e-01</td>
<td id="T_brk_row37_col5" class="data row37 col5">True</td>
<td id="T_brk_row37_col6" class="data row37 col6">THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: an unrefined Moser fit cannot reach its own optimum, so it deflates F on every draw and makes the control look conservative when it is at nominal size. A grid-limited extremum is invisible to every perturbation test, which is why the refinement's convergence is printed above</td>
</tr>
<tr class="odd">
<td id="T_brk_row38_col0" class="data row38 col0">the whole bootstrap fitted on the search grid alone, with no per-draw refinement</td>
<td id="T_brk_row38_col1" class="data row38 col1">boot_p_of_observed_n</td>
<td id="T_brk_row38_col2" class="data row38 col2">0.1285</td>
<td id="T_brk_row38_col3" class="data row38 col3">0.1055</td>
<td id="T_brk_row38_col4" class="data row38 col4">1.790e-01</td>
<td id="T_brk_row38_col5" class="data row38 col5">True</td>
<td id="T_brk_row38_col6" class="data row38 col6">THE DEFECT THIS PAGE SHIPPED AND HAD TO FIX, kept as its own break row: an unrefined Moser fit cannot reach its own optimum, so it deflates F on every draw and makes the control look conservative when it is at nominal size. A grid-limited extremum is invisible to every perturbation test, which is why the refinement's convergence is printed above</td>
</tr>
<tr class="even">
<td id="T_brk_row39_col0" class="data row39 col0">mu itself from a forward difference over the ARITHMETIC-mean biomass</td>
<td id="T_brk_row39_col1" class="data row39 col1">rmsA_zero_order</td>
<td id="T_brk_row39_col2" class="data row39 col2">0.278278</td>
<td id="T_brk_row39_col3" class="data row39 col3">0.27597</td>
<td id="T_brk_row39_col4" class="data row39 col4">8.296e-03</td>
<td id="T_brk_row39_col5" class="data row39 col5">True</td>
<td id="T_brk_row39_col6" class="data row39 col6">d(ln C)/dt = mu is EXACT; a difference quotient over the wrong mean is not, and the one-parameter nulls see only mu</td>
</tr>
<tr class="odd">
<td id="T_brk_row40_col0" class="data row40 col0">mu itself from a forward difference over the ARITHMETIC-mean biomass</td>
<td id="T_brk_row40_col1" class="data row40 col1">rmsB_zero_order</td>
<td id="T_brk_row40_col2" class="data row40 col2">0.278278</td>
<td id="T_brk_row40_col3" class="data row40 col3">0.27597</td>
<td id="T_brk_row40_col4" class="data row40 col4">8.296e-03</td>
<td id="T_brk_row40_col5" class="data row40 col5">True</td>
<td id="T_brk_row40_col6" class="data row40 col6">d(ln C)/dt = mu is EXACT; a difference quotient over the wrong mean is not, and the one-parameter nulls see only mu</td>
</tr>
<tr class="even">
<td id="T_brk_row41_col0" class="data row41 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row41_col1" class="data row41 col1">rmsB_Monod</td>
<td id="T_brk_row41_col2" class="data row41 col2">0.0314659</td>
<td id="T_brk_row41_col3" class="data row41 col3">0.0301554</td>
<td id="T_brk_row41_col4" class="data row41 col4">4.165e-02</td>
<td id="T_brk_row41_col5" class="data row41 col5">True</td>
<td id="T_brk_row41_col6" class="data row41 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="odd">
<td id="T_brk_row42_col0" class="data row42 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row42_col1" class="data row42 col1">rmsB_Blackman</td>
<td id="T_brk_row42_col2" class="data row42 col2">0.0395542</td>
<td id="T_brk_row42_col3" class="data row42 col3">0.0418822</td>
<td id="T_brk_row42_col4" class="data row42 col4">5.886e-02</td>
<td id="T_brk_row42_col5" class="data row42 col5">True</td>
<td id="T_brk_row42_col6" class="data row42 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="even">
<td id="T_brk_row43_col0" class="data row43 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row43_col1" class="data row43 col1">rmsB_Tessier</td>
<td id="T_brk_row43_col2" class="data row43 col2">0.026308</td>
<td id="T_brk_row43_col3" class="data row43 col3">0.0283739</td>
<td id="T_brk_row43_col4" class="data row43 col4">7.853e-02</td>
<td id="T_brk_row43_col5" class="data row43 col5">True</td>
<td id="T_brk_row43_col6" class="data row43 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="odd">
<td id="T_brk_row44_col0" class="data row44 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row44_col1" class="data row44 col1">rmsB_Moser</td>
<td id="T_brk_row44_col2" class="data row44 col2">0.0269846</td>
<td id="T_brk_row44_col3" class="data row44 col3">0.0296387</td>
<td id="T_brk_row44_col4" class="data row44 col4">9.835e-02</td>
<td id="T_brk_row44_col5" class="data row44 col5">True</td>
<td id="T_brk_row44_col6" class="data row44 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="even">
<td id="T_brk_row45_col0" class="data row45 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row45_col1" class="data row45 col1">rmsB_Contois</td>
<td id="T_brk_row45_col2" class="data row45 col2">0.0314659</td>
<td id="T_brk_row45_col3" class="data row45 col3">0.0301554</td>
<td id="T_brk_row45_col4" class="data row45 col4">4.165e-02</td>
<td id="T_brk_row45_col5" class="data row45 col5">True</td>
<td id="T_brk_row45_col6" class="data row45 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="odd">
<td id="T_brk_row46_col0" class="data row46 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row46_col1" class="data row46 col1">rmsB_first_order</td>
<td id="T_brk_row46_col2" class="data row46 col2">0.151597</td>
<td id="T_brk_row46_col3" class="data row46 col3">0.157474</td>
<td id="T_brk_row46_col4" class="data row46 col4">3.876e-02</td>
<td id="T_brk_row46_col5" class="data row46 col5">True</td>
<td id="T_brk_row46_col6" class="data row46 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="even">
<td id="T_brk_row47_col0" class="data row47 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row47_col1" class="data row47 col1">routeB_monod_mu_m</td>
<td id="T_brk_row47_col2" class="data row47 col2">0.880923</td>
<td id="T_brk_row47_col3" class="data row47 col3">0.855603</td>
<td id="T_brk_row47_col4" class="data row47 col4">2.874e-02</td>
<td id="T_brk_row47_col5" class="data row47 col5">True</td>
<td id="T_brk_row47_col6" class="data row47 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="odd">
<td id="T_brk_row48_col0" class="data row48 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row48_col1" class="data row48 col1">routeB_monod_K_S</td>
<td id="T_brk_row48_col2" class="data row48 col2">20.4535</td>
<td id="T_brk_row48_col3" class="data row48 col3">16.5777</td>
<td id="T_brk_row48_col4" class="data row48 col4">1.895e-01</td>
<td id="T_brk_row48_col5" class="data row48 col5">True</td>
<td id="T_brk_row48_col6" class="data row48 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="even">
<td id="T_brk_row49_col0" class="data row49 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row49_col1" class="data row49 col1">routeB_F_moser_vs_monod</td>
<td id="T_brk_row49_col2" class="data row49 col2">1.43886</td>
<td id="T_brk_row49_col3" class="data row49 col3">0.14068</td>
<td id="T_brk_row49_col4" class="data row49 col4">9.022e-01</td>
<td id="T_brk_row49_col5" class="data row49 col5">True</td>
<td id="T_brk_row49_col6" class="data row49 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="odd">
<td id="T_brk_row50_col0" class="data row50 col0">every route-B fit with the ALL-SEVEN balance line</td>
<td id="T_brk_row50_col1" class="data row50 col1">routeA_over_routeB_monod_rms</td>
<td id="T_brk_row50_col2" class="data row50 col2">1.73808</td>
<td id="T_brk_row50_col3" class="data row50 col3">1.81362</td>
<td id="T_brk_row50_col4" class="data row50 col4">4.346e-02</td>
<td id="T_brk_row50_col5" class="data row50 col5">True</td>
<td id="T_brk_row50_col6" class="data row50 col6">phi and a carry the flagged row into every route-B number at once</td>
</tr>
<tr class="even">
<td id="T_brk_row51_col0" class="data row51 col0">every separation measured at 3 of the 7 design points</td>
<td id="T_brk_row51_col1" class="data row51 col1">sep_blackman</td>
<td id="T_brk_row51_col2" class="data row51 col2">0.034659</td>
<td id="T_brk_row51_col3" class="data row51 col3">0.0476185</td>
<td id="T_brk_row51_col4" class="data row51 col4">3.739e-01</td>
<td id="T_brk_row51_col5" class="data row51 col5">True</td>
<td id="T_brk_row51_col6" class="data row51 col6">identifiability is a property of the DESIGN, so dropping four points must move every separation and every N*</td>
</tr>
<tr class="odd">
<td id="T_brk_row52_col0" class="data row52 col0">every separation measured at 3 of the 7 design points</td>
<td id="T_brk_row52_col1" class="data row52 col1">sep_over_scatter_blackman</td>
<td id="T_brk_row52_col2" class="data row52 col2">1.10148</td>
<td id="T_brk_row52_col3" class="data row52 col3">1.51333</td>
<td id="T_brk_row52_col4" class="data row52 col4">3.739e-01</td>
<td id="T_brk_row52_col5" class="data row52 col5">True</td>
<td id="T_brk_row52_col6" class="data row52 col6">identifiability is a property of the DESIGN, so dropping four points must move every separation and every N*</td>
</tr>
<tr class="even">
<td id="T_brk_row53_col0" class="data row53 col0">every separation measured at 3 of the 7 design points</td>
<td id="T_brk_row53_col1" class="data row53 col1">Nstar_blackman</td>
<td id="T_brk_row53_col2" class="data row53 col2">1.30352</td>
<td id="T_brk_row53_col3" class="data row53 col3">1.6113</td>
<td id="T_brk_row53_col4" class="data row53 col4">2.361e-01</td>
<td id="T_brk_row53_col5" class="data row53 col5">True</td>
<td id="T_brk_row53_col6" class="data row53 col6">identifiability is a property of the DESIGN, so dropping four points must move every separation and every N*</td>
</tr>
<tr class="odd">
<td id="T_brk_row54_col0" class="data row54 col0">every separation measured at 3 of the 7 design points</td>
<td id="T_brk_row54_col1" class="data row54 col1">sep_tessier</td>
<td id="T_brk_row54_col2" class="data row54 col2">0.0123477</td>
<td id="T_brk_row54_col3" class="data row54 col3">0.013377</td>
<td id="T_brk_row54_col4" class="data row54 col4">8.336e-02</td>
<td id="T_brk_row54_col5" class="data row54 col5">True</td>
<td id="T_brk_row54_col6" class="data row54 col6">identifiability is a property of the DESIGN, so dropping four points must move every separation and every N*</td>
</tr>
<tr class="even">
<td id="T_brk_row55_col0" class="data row55 col0">every separation measured at 3 of the 7 design points</td>
<td id="T_brk_row55_col1" class="data row55 col1">sep_over_scatter_tessier</td>
<td id="T_brk_row55_col2" class="data row55 col2">0.392416</td>
<td id="T_brk_row55_col3" class="data row55 col3">0.425127</td>
<td id="T_brk_row55_col4" class="data row55 col4">8.336e-02</td>
<td id="T_brk_row55_col5" class="data row55 col5">True</td>
<td id="T_brk_row55_col6" class="data row55 col6">identifiability is a property of the DESIGN, so dropping four points must move every separation and every N*</td>
</tr>
<tr class="odd">
<td id="T_brk_row56_col0" class="data row56 col0">every separation measured at 3 of the 7 design points</td>
<td id="T_brk_row56_col1" class="data row56 col1">Nstar_tessier</td>
<td id="T_brk_row56_col2" class="data row56 col2">10.2701</td>
<td id="T_brk_row56_col3" class="data row56 col3">20.4177</td>
<td id="T_brk_row56_col4" class="data row56 col4">9.881e-01</td>
<td id="T_brk_row56_col5" class="data row56 col5">True</td>
<td id="T_brk_row56_col6" class="data row56 col6">identifiability is a property of the DESIGN, so dropping four points must move every separation and every N*</td>
</tr>
<tr class="even">
<td id="T_brk_row57_col0" class="data row57 col0">the whole bootstrap re-drawn at half the noise level</td>
<td id="T_brk_row57_col1" class="data row57 col1">boot_p_of_observed_F</td>
<td id="T_brk_row57_col2" class="data row57 col2">0.228</td>
<td id="T_brk_row57_col3" class="data row57 col3">0.301</td>
<td id="T_brk_row57_col4" class="data row57 col4">3.202e-01</td>
<td id="T_brk_row57_col5" class="data row57 col5">True</td>
<td id="T_brk_row57_col6" class="data row57 col6">every bootstrap number is a property of the noise level and the seed, and the page says so - the seed is fixed and printed</td>
</tr>
<tr class="odd">
<td id="T_brk_row58_col0" class="data row58 col0">the whole bootstrap re-drawn at half the noise level</td>
<td id="T_brk_row58_col1" class="data row58 col1">boot_p_of_observed_n</td>
<td id="T_brk_row58_col2" class="data row58 col2">0.1285</td>
<td id="T_brk_row58_col3" class="data row58 col3">0.01</td>
<td id="T_brk_row58_col4" class="data row58 col4">9.222e-01</td>
<td id="T_brk_row58_col5" class="data row58 col5">True</td>
<td id="T_brk_row58_col6" class="data row58 col6">every bootstrap number is a property of the noise level and the seed, and the page says so - the seed is fixed and printed</td>
</tr>
<tr class="even">
<td id="T_brk_row59_col0" class="data row59 col0">the whole bootstrap re-drawn at half the noise level</td>
<td id="T_brk_row59_col1" class="data row59 col1">boot_size_control_truth</td>
<td id="T_brk_row59_col2" class="data row59 col2">0.0495</td>
<td id="T_brk_row59_col3" class="data row59 col3">0.0445</td>
<td id="T_brk_row59_col4" class="data row59 col4">1.010e-01</td>
<td id="T_brk_row59_col5" class="data row59 col5">True</td>
<td id="T_brk_row59_col6" class="data row59 col6">every bootstrap number is a property of the noise level and the seed, and the page says so - the seed is fixed and printed</td>
</tr>
<tr class="odd">
<td id="T_brk_row60_col0" class="data row60 col0">the whole bootstrap re-drawn at half the noise level</td>
<td id="T_brk_row60_col1" class="data row60 col1">boot_median_n_control_truth</td>
<td id="T_brk_row60_col2" class="data row60 col2">1.00887</td>
<td id="T_brk_row60_col3" class="data row60 col3">1.00572</td>
<td id="T_brk_row60_col4" class="data row60 col4">3.115e-03</td>
<td id="T_brk_row60_col5" class="data row60 col5">True</td>
<td id="T_brk_row60_col6" class="data row60 col6">every bootstrap number is a property of the noise level and the seed, and the page says so - the seed is fixed and printed</td>
</tr>
<tr class="even">
<td id="T_brk_row61_col0" class="data row61 col0">the reduction bias evaluated at the ROUTE-B constants</td>
<td id="T_brk_row61_col1" class="data row61 col1">bias_max_abs</td>
<td id="T_brk_row61_col2" class="data row61 col2">0.068561</td>
<td id="T_brk_row61_col3" class="data row61 col3">0.0973647</td>
<td id="T_brk_row61_col4" class="data row61 col4">4.201e-01</td>
<td id="T_brk_row61_col5" class="data row61 col5">True</td>
<td id="T_brk_row61_col6" class="data row61 col6">the bias is a property of the curve it is evaluated on, so quoting it from the route-A fit is a declared choice - and the route-A fit is the one the bias is being charged against</td>
</tr>
<tr class="odd">
<td id="T_brk_row62_col0" class="data row62 col0">the reduction bias evaluated at the ROUTE-B constants</td>
<td id="T_brk_row62_col1" class="data row62 col1">bias_max_abs_excl_bad_row</td>
<td id="T_brk_row62_col2" class="data row62 col2">0.06631</td>
<td id="T_brk_row62_col3" class="data row62 col3">0.0973647</td>
<td id="T_brk_row62_col4" class="data row62 col4">4.683e-01</td>
<td id="T_brk_row62_col5" class="data row62 col5">True</td>
<td id="T_brk_row62_col6" class="data row62 col6">the bias is a property of the curve it is evaluated on, so quoting it from the route-A fit is a declared choice - and the route-A fit is the one the bias is being charged against</td>
</tr>
<tr class="even">
<td id="T_brk_row63_col0" class="data row63 col0">the reduction bias evaluated at the ROUTE-B constants</td>
<td id="T_brk_row63_col1" class="data row63 col1">bias_over_routeA_rms</td>
<td id="T_brk_row63_col2" class="data row63 col2">1.21247</td>
<td id="T_brk_row63_col3" class="data row63 col3">1.78029</td>
<td id="T_brk_row63_col4" class="data row63 col4">4.683e-01</td>
<td id="T_brk_row63_col5" class="data row63 col5">True</td>
<td id="T_brk_row63_col6" class="data row63 col6">the bias is a property of the curve it is evaluated on, so quoting it from the route-A fit is a declared choice - and the route-A fit is the one the bias is being charged against</td>
</tr>
<tr class="odd">
<td id="T_brk_row64_col0" class="data row64 col0">the whole balance test on the ARITHMETIC-mean biomass</td>
<td id="T_brk_row64_col1" class="data row64 col1">balance_R2_all_rows</td>
<td id="T_brk_row64_col2" class="data row64 col2">0.985047</td>
<td id="T_brk_row64_col3" class="data row64 col3">0.985372</td>
<td id="T_brk_row64_col4" class="data row64 col4">3.295e-04</td>
<td id="T_brk_row64_col5" class="data row64 col5">True</td>
<td id="T_brk_row64_col6" class="data row64 col6">declared convention: the exact time average under exponential growth is the LOG mean</td>
</tr>
<tr class="even">
<td id="T_brk_row65_col0" class="data row65 col0">the whole balance test on the ARITHMETIC-mean biomass</td>
<td id="T_brk_row65_col1" class="data row65 col1">balance_row4_residual</td>
<td id="T_brk_row65_col2" class="data row65 col2">-17.1804</td>
<td id="T_brk_row65_col3" class="data row65 col3">-16.9919</td>
<td id="T_brk_row65_col4" class="data row65 col4">1.097e-02</td>
<td id="T_brk_row65_col5" class="data row65 col5">True</td>
<td id="T_brk_row65_col6" class="data row65 col6">declared convention: the exact time average under exponential growth is the LOG mean</td>
</tr>
<tr class="odd">
<td id="T_brk_row66_col0" class="data row66 col0">the whole balance test on the ARITHMETIC-mean biomass</td>
<td id="T_brk_row66_col1" class="data row66 col1">balance_worst_other_residual</td>
<td id="T_brk_row66_col2" class="data row66 col2">0.65414</td>
<td id="T_brk_row66_col3" class="data row66 col3">0.730071</td>
<td id="T_brk_row66_col4" class="data row66 col4">1.161e-01</td>
<td id="T_brk_row66_col5" class="data row66 col5">True</td>
<td id="T_brk_row66_col6" class="data row66 col6">declared convention: the exact time average under exponential growth is the LOG mean</td>
</tr>
<tr class="even">
<td id="T_brk_row67_col0" class="data row67 col0">the whole balance test on the ARITHMETIC-mean biomass</td>
<td id="T_brk_row67_col1" class="data row67 col1">row4_end_of_interval_relgap</td>
<td id="T_brk_row67_col2" class="data row67 col2">0.0310236</td>
<td id="T_brk_row67_col3" class="data row67 col3">0.0381567</td>
<td id="T_brk_row67_col4" class="data row67 col4">2.299e-01</td>
<td id="T_brk_row67_col5" class="data row67 col5">True</td>
<td id="T_brk_row67_col6" class="data row67 col6">declared convention: the exact time average under exponential growth is the LOG mean</td>
</tr>
<tr class="odd">
<td id="T_brk_row68_col0" class="data row68 col0">the chemostat prediction built from the ROUTE-A constants</td>
<td id="T_brk_row68_col1" class="data row68 col1">Dc_ratio_at_Sf20</td>
<td id="T_brk_row68_col2" class="data row68 col2">1.83253</td>
<td id="T_brk_row68_col3" class="data row68 col3">2.12315</td>
<td id="T_brk_row68_col4" class="data row68 col4">1.586e-01</td>
<td id="T_brk_row68_col5" class="data row68 col5">True</td>
<td id="T_brk_row68_col6" class="data row68 col6">the whole point of the page: which reduction you fit with changes what you predict for an experiment you have not run</td>
</tr>
<tr class="even">
<td id="T_brk_row69_col0" class="data row69 col0">the chemostat prediction built from the ROUTE-A constants</td>
<td id="T_brk_row69_col1" class="data row69 col1">Sf_crossing</td>
<td id="T_brk_row69_col2" class="data row69 col2">197.118</td>
<td id="T_brk_row69_col3" class="data row69 col3">199.078</td>
<td id="T_brk_row69_col4" class="data row69 col4">9.944e-03</td>
<td id="T_brk_row69_col5" class="data row69 col5">True</td>
<td id="T_brk_row69_col6" class="data row69 col6">the whole point of the page: which reduction you fit with changes what you predict for an experiment you have not run</td>
</tr>
<tr class="odd">
<td id="T_brk_row70_col0" class="data row70 col0">the chemostat prediction built from the ROUTE-A constants</td>
<td id="T_brk_row70_col1" class="data row70 col1">Sf_for_10pct_gap</td>
<td id="T_brk_row70_col2" class="data row70 col2">95.5152</td>
<td id="T_brk_row70_col3" class="data row70 col3">110.771</td>
<td id="T_brk_row70_col4" class="data row70 col4">1.597e-01</td>
<td id="T_brk_row70_col5" class="data row70 col5">True</td>
<td id="T_brk_row70_col6" class="data row70 col6">the whole point of the page: which reduction you fit with changes what you predict for an experiment you have not run</td>
</tr>
<tr class="even">
<td id="T_brk_row71_col0" class="data row71 col0">the chemostat prediction built from the ROUTE-A constants</td>
<td id="T_brk_row71_col1" class="data row71 col1">Dc_monod_closed_form</td>
<td id="T_brk_row71_col2" class="data row71 col2">0.435523</td>
<td id="T_brk_row71_col3" class="data row71 col3">0.392452</td>
<td id="T_brk_row71_col4" class="data row71 col4">9.889e-02</td>
<td id="T_brk_row71_col5" class="data row71 col5">True</td>
<td id="T_brk_row71_col6" class="data row71 col6">the whole point of the page: which reduction you fit with changes what you predict for an experiment you have not run</td>
</tr>
<tr class="odd">
<td id="T_brk_row72_col0" class="data row72 col0">every plug-flow number read off the two COARSEST grids</td>
<td id="T_brk_row72_col1" class="data row72 col1">pfr_observed_order</td>
<td id="T_brk_row72_col2" class="data row72 col2">0.998081</td>
<td id="T_brk_row72_col3" class="data row72 col3">0.984914</td>
<td id="T_brk_row72_col4" class="data row72 col4">1.319e-02</td>
<td id="T_brk_row72_col5" class="data row72 col5">True</td>
<td id="T_brk_row72_col6" class="data row72 col6">an order quoted from an unconverged pair is the classic way to publish a wrong one</td>
</tr>
<tr class="even">
<td id="T_brk_row73_col0" class="data row73 col0">every plug-flow number read off the two COARSEST grids</td>
<td id="T_brk_row73_col1" class="data row73 col1">pfr_centre_read_order</td>
<td id="T_brk_row73_col2" class="data row73 col2">0.995683</td>
<td id="T_brk_row73_col3" class="data row73 col3">0.965313</td>
<td id="T_brk_row73_col4" class="data row73 col4">3.050e-02</td>
<td id="T_brk_row73_col5" class="data row73 col5">True</td>
<td id="T_brk_row73_col6" class="data row73 col6">an order quoted from an unconverged pair is the classic way to publish a wrong one</td>
</tr>
<tr class="odd">
<td id="T_brk_row74_col0" class="data row74 col0">every plug-flow number read off the two COARSEST grids</td>
<td id="T_brk_row74_col1" class="data row74 col1">pfr_centre_over_boundary_read</td>
<td id="T_brk_row74_col2" class="data row74 col2">0.385529</td>
<td id="T_brk_row74_col3" class="data row74 col3">0.381041</td>
<td id="T_brk_row74_col4" class="data row74 col4">1.164e-02</td>
<td id="T_brk_row74_col5" class="data row74 col5">True</td>
<td id="T_brk_row74_col6" class="data row74 col6">an order quoted from an unconverged pair is the classic way to publish a wrong one</td>
</tr>
<tr class="even">
<td id="T_brk_row75_col0" class="data row75 col0">every plug-flow number read off the two COARSEST grids</td>
<td id="T_brk_row75_col1" class="data row75 col1">pfr_richardson_relerr</td>
<td id="T_brk_row75_col2" class="data row75 col2">3.2458e-06</td>
<td id="T_brk_row75_col3" class="data row75 col3">0.000201314</td>
<td id="T_brk_row75_col4" class="data row75 col4">6.102e+01</td>
<td id="T_brk_row75_col5" class="data row75 col5">True</td>
<td id="T_brk_row75_col6" class="data row75 col6">an order quoted from an unconverged pair is the classic way to publish a wrong one</td>
</tr>
<tr class="odd">
<td id="T_brk_row76_col0" class="data row76 col0">the pymrm marcher's order read off 25/50 steps, and its refit unconverged</td>
<td id="T_brk_row76_col1" class="data row76 col1">pymrm_batch_observed_order</td>
<td id="T_brk_row76_col2" class="data row76 col2">0.999316</td>
<td id="T_brk_row76_col3" class="data row76 col3">0.994242</td>
<td id="T_brk_row76_col4" class="data row76 col4">5.077e-03</td>
<td id="T_brk_row76_col5" class="data row76 col5">True</td>
<td id="T_brk_row76_col6" class="data row76 col6">same reason as the plug-flow row, for the second independent computation</td>
</tr>
<tr class="even">
<td id="T_brk_row77_col0" class="data row77 col0">the pymrm marcher's order read off 25/50 steps, and its refit unconverged</td>
<td id="T_brk_row77_col1" class="data row77 col1">pymrm_refit_KS_relerr</td>
<td id="T_brk_row77_col2" class="data row77 col2">7.77934e-06</td>
<td id="T_brk_row77_col3" class="data row77 col3">0.0450968</td>
<td id="T_brk_row77_col4" class="data row77 col4">5.796e+03</td>
<td id="T_brk_row77_col5" class="data row77 col5">True</td>
<td id="T_brk_row77_col6" class="data row77 col6">same reason as the plug-flow row, for the second independent computation</td>
</tr>
<tr class="odd">
<td id="T_brk_row78_col0" class="data row78 col0">Contois map evaluated with the wrong yield (phi -&gt; 2 phi)</td>
<td id="T_brk_row78_col1" class="data row78 col1">contois_map_KS_relerr</td>
<td id="T_brk_row78_col2" class="data row78 col2">1.2844e-05</td>
<td id="T_brk_row78_col3" class="data row78 col3">1.23152</td>
<td id="T_brk_row78_col4" class="data row78 col4">9.588e+04</td>
<td id="T_brk_row78_col5" class="data row78 col5">True</td>
<td id="T_brk_row78_col6" class="data row78 col6">companion for the exactly-zero symbolic residual</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
79 injections, 79 of which move their metric by more than MOVE_TOL = 1e-06 relative.</code></pre>
</div>
</div>
<div id="6045644b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:27.847660Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:27.847471Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:27.855697Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:27.854939Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb44-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- coverage map, asserted key-for-key against agreement.json</span></span>
<span id="cb44-2">STRUCTURAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb44-3"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_is_langmuir_residual"</span>:</span>
<span id="cb44-4">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT ZERO, a bound at 0 (identity). Rawlings' printed claim, proved in sympy. "</span></span>
<span id="cb44-5">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Companion: sym_blackman_gap_at_switch_over_mum, the same class of "</span></span>
<span id="cb44-6">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed-form statement with a numerical check attached."</span>,</span>
<span id="cb44-7"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_half_rate_residual"</span>:</span>
<span id="cb44-8">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT ZERO, a bound at 0 (identity). Froment's definition of K_S, verified. "</span></span>
<span id="cb44-9">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Companion: num_blackman_gap_switch_relerr, which is what that property does "</span></span>
<span id="cb44-10">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NOT settle, and which has a break row."</span>,</span>
<span id="cb44-11"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_half_rate_residual"</span>:</span>
<span id="cb44-12">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT ZERO, a bound at 0 (identity) - and it IS the finding: Blackman shares "</span></span>
<span id="cb44-13">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the property. Companion: sym_blackman_gap_at_switch_over_mum = 1/3."</span>,</span>
<span id="cb44-14"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_moser_at_n1_residual"</span>:</span>
<span id="cb44-15">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT ZERO, a bound at 0 (identity), by nesting. Companion: "</span></span>
<span id="cb44-16">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod, which has a break row freezing n = 1 and collapsing it."</span>,</span>
<span id="cb44-17"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_contois_is_monod_residual"</span>:</span>
<span id="cb44-18">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT ZERO, a bound at 0 (identity), and it is the page's strongest claim. "</span></span>
<span id="cb44-19">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Companions: Sf_crossing, the crossing this very identity fixes at S_f = a, and "</span></span>
<span id="cb44-20">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_ratio_at_Sf20 - both functions of the Contois fit, both with break rows. "</span></span>
<span id="cb44-21">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The two contois_map_* errors are themselves exactly-zero quantities, "</span></span>
<span id="cb44-22">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"registered as tolerance bounds, and keep their break rows."</span>,</span>
<span id="cb44-23"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL: zero to the optimiser's tolerance because Contois IS "</span></span>
<span id="cb44-24">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod under a constant yield, so it is a tolerance bound. It does "</span></span>
<span id="cb44-25">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"have a break row - measuring the same separation on the ROUTE-A "</span></span>
<span id="cb44-26">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"design gives 6.7e-3, which is the reduction manufacturing a "</span></span>
<span id="cb44-27">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"separation that is not there - and its companions are Sf_crossing "</span></span>
<span id="cb44-28">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and Dc_ratio_at_Sf20."</span>,</span>
<span id="cb44-29"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_contois"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL, see sep_contois."</span>,</span>
<span id="cb44-30"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_moser"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL: zero to the optimiser's tolerance because Moser "</span></span>
<span id="cb44-31">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CONTAINS Monod at n = 1, so it is a tolerance bound. Companion: "</span></span>
<span id="cb44-32">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod."</span>,</span>
<span id="cb44-33"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_moser"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL, see sep_moser."</span>,</span>
<span id="cb44-34"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_minus_monod_rms"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL: one curve fitted twice, so the RMS gap is "</span></span>
<span id="cb44-35">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two optimisers' exit tolerances, a tolerance bound. Companions: "</span></span>
<span id="cb44-36">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two contois_map_* errors, which have break rows."</span>,</span>
<span id="cb44-37"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing_vs_a_relerr"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL: S_f = a identically, so what is left is "</span></span>
<span id="cb44-38">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the Contois fit's two exit tolerances, decomposed on the page; a "</span></span>
<span id="cb44-39">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance bound. Companion: Sf_crossing, which has a break row."</span>,</span>
<span id="cb44-40"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_crit_95"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A TABULATED CONSTANT, not a computed result: F(1,4) at 95 %. It "</span></span>
<span id="cb44-41">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cannot move and must not."</span>,</span>
<span id="cb44-42"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_at_switch_over_mum"</span>:</span>
<span id="cb44-43">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT RATIONAL 1/3, closed form. Companion and check: "</span></span>
<span id="cb44-44">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_switch_relerr, which has a break row."</span>,</span>
<span id="cb44-45"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_lower_over_mum"</span>:</span>
<span id="cb44-46">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT SURD (3 - 2 sqrt 2)/2, closed form. Companion and check: "</span></span>
<span id="cb44-47">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_lower_relerr."</span>,</span>
<span id="cb44-48"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_Sstar_over_Ks_relerr"</span>:</span>
<span id="cb44-49">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a root-find checked against a closed form, so it measures brentq's xtol: a "</span></span>
<span id="cb44-50">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance bound. Companion: sym_blackman_gap_lower_over_mum."</span>,</span>
<span id="cb44-51"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_lower_relerr"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as above."</span>,</span>
<span id="cb44-52"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_conservation_relerr"</span>:</span>
<span id="cb44-53">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a bound (identity) at round-off, because backward Euler conserves S + X/phi "</span></span>
<span id="cb44-54">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"when both fields use the same yield. It IS covered by a break row (the yield "</span></span>
<span id="cb44-55">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"changed in the source but not in the invariant, 2.5e-3), and its companion is "</span></span>
<span id="cb44-56">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_mum_relerr."</span>,</span>
<span id="cb44-57"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>:</span>
<span id="cb44-58">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EXACT ZERO to double precision, a tolerance bound: the marched steady state "</span></span>
<span id="cb44-59">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reproduces Rawlings' eq. (10.19) to the last bit. Two break rows DO move it "</span></span>
<span id="cb44-60">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(their K_s and their y changed), and its companion is rawlings_Dc_relerr."</span>,</span>
<span id="cb44-61"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_switch_relerr"</span>:</span>
<span id="cb44-62">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a bound (identity), because it is exact arithmetic (1 - 2/3 against 1/3), not "</span></span>
<span id="cb44-63">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a computation. It IS covered by a break row - reading the gap at S = K_S "</span></span>
<span id="cb44-64">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"instead of the switch moves it to 0.5 - and its companion is "</span></span>
<span id="cb44-65">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_at_switch_over_mum."</span>,</span>
<span id="cb44-66"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_contois_transient_relerr"</span>:</span>
<span id="cb44-67">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL: D_c = mu_m for Contois is exact, so what is left is a measurement "</span></span>
<span id="cb44-68">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of the transient solve and of the declared WASH threshold - both of which "</span></span>
<span id="cb44-69">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"move it, which is why it is NOT in the exactly-zero class below. Companion: "</span></span>
<span id="cb44-70">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_transient_relerr, which has a break row on that very threshold."</span>,</span>
<span id="cb44-71"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_swing_over_CAbar"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a property of the printed table, not a computed result: "</span></span>
<span id="cb44-72">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the largest substrate swing over an interval divided by that interval's "</span></span>
<span id="cb44-73">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed average. It cannot be broken without editing the CSV."</span>,</span>
<span id="cb44-74"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_a"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reported for reuse; its break row lives on balance_phi, which is "</span></span>
<span id="cb44-75">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same line's other coefficient."</span>,</span>
<span id="cb44-76"> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_closed_form"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a closed form evaluated at the fitted constants; its "</span></span>
<span id="cb44-77">   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break rows live on Dc_ratio_at_Sf20 and Dc_monod_transient_relerr."</span>,</span>
<span id="cb44-78">}</span>
<span id="cb44-79">covered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb44-80"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb44-81">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>]:</span>
<span id="cb44-82">        covered.setdefault(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>], []).append(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>])</span>
<span id="cb44-83">lines, uncovered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb44-84"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(M):</span>
<span id="cb44-85">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> covered:</span>
<span id="cb44-86">        lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> covered, strongest row moves it </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(covered[k])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb44-87">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL:</span>
<span id="cb44-88">        lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> STRUCTURAL - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STRUCTURAL[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb44-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb44-90">        uncovered.append(k)</span>
<span id="cb44-91">        lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:38s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> UNCOVERED"</span>)</span>
<span id="cb44-92">N_METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(M)</span>
<span id="cb44-93">N_COVERED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>([k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> covered <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M])</span>
<span id="cb44-94">N_STRUCT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_METRICS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_COVERED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(uncovered)</span>
<span id="cb44-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"coverage map (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> moved by an injection, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> structural):"</span></span>
<span id="cb44-96">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (N_METRICS, N_COVERED, N_STRUCT))</span>
<span id="cb44-97"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(lines))</span>
<span id="cb44-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The quantities this page PROVES are exactly zero (identities, nesting, exact</span></span>
<span id="cb44-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arithmetic, optimiser and root-finder exits).  Every one of them is a</span></span>
<span id="cb44-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># registered BOUND in the claims cell below, with a basis and a limit that holds</span></span>
<span id="cb44-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># on any machine, so none is ever compared as a value and the set of claims</span></span>
<span id="cb44-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># never depends on where a round-off number happens to land.</span></span>
<span id="cb44-103">PROVED_ZERO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb44-104">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_is_langmuir_residual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_half_rate_residual"</span>,</span>
<span id="cb44-105">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_half_rate_residual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_moser_at_n1_residual"</span>,</span>
<span id="cb44-106">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_contois_is_monod_residual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_Sstar_over_Ks_relerr"</span>,</span>
<span id="cb44-107">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_lower_relerr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_switch_relerr"</span>,</span>
<span id="cb44-108">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_conservation_relerr"</span>,</span>
<span id="cb44-109">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_moser"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_moser"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois"</span>,</span>
<span id="cb44-110">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_contois"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_minus_monod_rms"</span>,</span>
<span id="cb44-111">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_mum_relerr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_KS_relerr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing_vs_a_relerr"</span>]</span>
<span id="cb44-112"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PROVED_ZERO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PROVED_ZERO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M)</span>
<span id="cb44-113"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> uncovered, uncovered</span>
<span id="cb44-114"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(covered) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(STRUCTURAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(covered) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(STRUCTURAL)</span>
<span id="cb44-115"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Every metric is either moved by an injection or named structural, and no"</span>)</span>
<span id="cb44-116"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"generic fallback label is used anywhere in this map."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>coverage map (80 metrics: 62 moved by an injection, 18 structural):
  Dc_contois_transient_relerr            STRUCTURAL - STRUCTURAL: D_c = mu_m for Contois is exact, so what is left is a measurement of the transient solve and of the declared WASH threshold - both of which move it, which is why it is NOT in the exactly-zero class below. Companion: Dc_monod_transient_relerr, which has a break row on that very threshold.
  Dc_monod_closed_form                   covered, strongest row moves it 9.889e-02
  Dc_monod_transient_relerr              covered, strongest row moves it 3.322e-01
  Dc_ratio_at_Sf20                       covered, strongest row moves it 1.586e-01
  F_crit_95                              STRUCTURAL - A TABULATED CONSTANT, not a computed result: F(1,4) at 95 %. It cannot move and must not.
  Nstar_blackman                         covered, strongest row moves it 3.627e-01
  Nstar_tessier                          covered, strongest row moves it 2.021e+00
  Sf_crossing                            covered, strongest row moves it 9.944e-03
  Sf_crossing_vs_a_relerr                STRUCTURAL - STRUCTURAL: S_f = a identically, so what is left is the Contois fit's two exit tolerances, decomposed on the page; a tolerance bound. Companion: Sf_crossing, which has a break row.
  Sf_for_10pct_gap                       covered, strongest row moves it 1.597e-01
  balance_R2_all_rows                    covered, strongest row moves it 3.295e-04
  balance_R2_six_rows                    covered, strongest row moves it 1.491e-02
  balance_a                              STRUCTURAL - reported for reuse; its break row lives on balance_phi, which is the same line's other coefficient.
  balance_phi                            covered, strongest row moves it 1.412e-02
  balance_row4_residual                  covered, strongest row moves it 1.097e-02
  balance_worst_other_residual           covered, strongest row moves it 1.161e-01
  bias_max_abs                           covered, strongest row moves it 4.201e-01
  bias_max_abs_excl_bad_row              covered, strongest row moves it 4.683e-01
  bias_over_routeA_rms                   covered, strongest row moves it 4.683e-01
  boot_median_n_control_truth            covered, strongest row moves it 5.693e-02
  boot_median_n_forward_truth            covered, strongest row moves it 3.740e-01
  boot_p_of_observed_F                   covered, strongest row moves it 3.202e-01
  boot_p_of_observed_n                   covered, strongest row moves it 9.222e-01
  boot_size_control_truth                covered, strongest row moves it 5.758e-01
  boot_size_forward_truth                covered, strongest row moves it 5.294e-01
  contois_map_KS_relerr                  covered, strongest row moves it 9.588e+04
  contois_map_mum_relerr                 covered, strongest row moves it 5.291e+04
  contois_minus_monod_rms                STRUCTURAL - STRUCTURAL: one curve fitted twice, so the RMS gap is the two optimisers' exit tolerances, a tolerance bound. Companions: the two contois_map_* errors, which have break rows.
  max_swing_over_CAbar                   STRUCTURAL - a property of the printed table, not a computed result: the largest substrate swing over an interval divided by that interval's printed average. It cannot be broken without editing the CSV.
  num_blackman_Sstar_over_Ks_relerr      STRUCTURAL - a root-find checked against a closed form, so it measures brentq's xtol: a tolerance bound. Companion: sym_blackman_gap_lower_over_mum.
  num_blackman_gap_lower_relerr          STRUCTURAL - as above.
  num_blackman_gap_switch_relerr         covered, strongest row moves it 3.002e+15
  pfr_batch_relerr_finest                covered, strongest row moves it 2.715e+04
  pfr_centre_over_boundary_read          covered, strongest row moves it 1.164e-02
  pfr_centre_read_order                  covered, strongest row moves it 3.050e-02
  pfr_observed_order                     covered, strongest row moves it 1.319e-02
  pfr_richardson_relerr                  covered, strongest row moves it 6.102e+01
  pymrm_batch_conservation_relerr        covered, strongest row moves it 5.670e+12
  pymrm_batch_observed_order             covered, strongest row moves it 5.077e-03
  pymrm_refit_KS_relerr                  covered, strongest row moves it 5.796e+03
  pymrm_refit_mum_relerr                 covered, strongest row moves it 1.214e+04
  rawlings_10_19_max_relerr              covered, strongest row moves it 1.500e+300
  rawlings_Dc_relerr                     covered, strongest row moves it 6.646e+02
  rmsA_Blackman                          covered, strongest row moves it 5.182e-01
  rmsA_Contois                           covered, strongest row moves it 8.922e-02
  rmsA_Monod                             covered, strongest row moves it 1.430e-01
  rmsA_Moser                             covered, strongest row moves it 1.246e-01
  rmsA_Tessier                           covered, strongest row moves it 7.858e-02
  rmsA_first_order                       covered, strongest row moves it 1.250e-01
  rmsA_zero_order                        covered, strongest row moves it 8.296e-03
  rmsB_Blackman                          covered, strongest row moves it 5.886e-02
  rmsB_Contois                           covered, strongest row moves it 4.165e-02
  rmsB_Monod                             covered, strongest row moves it 4.165e-02
  rmsB_Moser                             covered, strongest row moves it 9.835e-02
  rmsB_Tessier                           covered, strongest row moves it 7.853e-02
  rmsB_first_order                       covered, strongest row moves it 3.876e-02
  rmsB_zero_order                        covered, strongest row moves it 8.296e-03
  routeA_F_moser_vs_monod                covered, strongest row moves it 1.000e+00
  routeA_n_moser                         covered, strongest row moves it 2.235e-01
  routeA_over_routeB_monod_rms           covered, strongest row moves it 4.346e-02
  routeB_F_moser_vs_monod                covered, strongest row moves it 9.022e-01
  routeB_monod_K_S                       covered, strongest row moves it 1.895e-01
  routeB_monod_mu_m                      covered, strongest row moves it 2.874e-02
  routeB_n_moser                         covered, strongest row moves it 7.729e-01
  row4_end_of_interval_relgap            covered, strongest row moves it 2.299e-01
  sep_blackman                           covered, strongest row moves it 3.739e-01
  sep_contois                            covered, strongest row moves it 1.064e+11
  sep_moser                              STRUCTURAL - STRUCTURAL: zero to the optimiser's tolerance because Moser CONTAINS Monod at n = 1, so it is a tolerance bound. Companion: routeA_F_moser_vs_monod.
  sep_over_scatter_blackman              covered, strongest row moves it 3.739e-01
  sep_over_scatter_contois               STRUCTURAL - STRUCTURAL, see sep_contois.
  sep_over_scatter_moser                 STRUCTURAL - STRUCTURAL, see sep_moser.
  sep_over_scatter_tessier               covered, strongest row moves it 8.336e-02
  sep_tessier                            covered, strongest row moves it 8.336e-02
  sym_blackman_gap_at_switch_over_mum    STRUCTURAL - EXACT RATIONAL 1/3, closed form. Companion and check: num_blackman_gap_switch_relerr, which has a break row.
  sym_blackman_gap_lower_over_mum        STRUCTURAL - EXACT SURD (3 - 2 sqrt 2)/2, closed form. Companion and check: num_blackman_gap_lower_relerr.
  sym_blackman_half_rate_residual        STRUCTURAL - EXACT ZERO, a bound at 0 (identity) - and it IS the finding: Blackman shares the property. Companion: sym_blackman_gap_at_switch_over_mum = 1/3.
  sym_contois_is_monod_residual          STRUCTURAL - EXACT ZERO, a bound at 0 (identity), and it is the page's strongest claim. Companions: Sf_crossing, the crossing this very identity fixes at S_f = a, and Dc_ratio_at_Sf20 - both functions of the Contois fit, both with break rows. The two contois_map_* errors are themselves exactly-zero quantities, registered as tolerance bounds, and keep their break rows.
  sym_monod_half_rate_residual           STRUCTURAL - EXACT ZERO, a bound at 0 (identity). Froment's definition of K_S, verified. Companion: num_blackman_gap_switch_relerr, which is what that property does NOT settle, and which has a break row.
  sym_monod_is_langmuir_residual         STRUCTURAL - EXACT ZERO, a bound at 0 (identity). Rawlings' printed claim, proved in sympy. Companion: sym_blackman_gap_at_switch_over_mum, the same class of closed-form statement with a numerical check attached.
  sym_moser_at_n1_residual               STRUCTURAL - EXACT ZERO, a bound at 0 (identity), by nesting. Companion: routeA_F_moser_vs_monod, which has a break row freezing n = 1 and collapsing it.

Every metric is either moved by an injection or named structural, and no
generic fallback label is used anywhere in this map.</code></pre>
</div>
</div>
<div id="1724335e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:27.858004Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:27.857825Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:27.869925Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:27.869089Z&quot;}}" data-execution_count="23">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every metric is registered ONCE with how it is checked (docs/claims-design.md):</span></span>
<span id="cb46-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a value against the committed baseline within its rtol, a bound against its</span></span>
<span id="cb46-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># limit on every run and on any machine, an exact result by equality.  The set</span></span>
<span id="cb46-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of names is fixed and never depends on a value.  Residuals, identities,</span></span>
<span id="cb46-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two-route gaps and optimiser or root-finder exits are BOUNDS whatever their</span></span>
<span id="cb46-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># size, and the prose quotes the bound, never their round-off digits.</span></span>
<span id="cb46-7">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.1"</span>)</span>
<span id="cb46-8">B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># name -&gt; bound arguments; every name in PROVED_ZERO is here</span></span>
<span id="cb46-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- symbolic identities: sympy simplifies each to exactly 0</span></span>
<span id="cb46-10">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb46-11">               note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy residual, simplified to exactly 0"</span>)</span>
<span id="cb46-12">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_is_langmuir_residual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_monod_half_rate_residual"</span>,</span>
<span id="cb46-13">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_half_rate_residual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_moser_at_n1_residual"</span>,</span>
<span id="cb46-14">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_contois_is_monod_residual"</span>)},</span>
<span id="cb46-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- exact arithmetic and root-finds against closed forms</span></span>
<span id="cb46-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_switch_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-17">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb46-18">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to 1/3; exact arithmetic, 1 - 2/3 against 1/3, measured 1.7e-16"</span>),</span>
<span id="cb46-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_gap_lower_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-20">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-21">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the closed-form gap; brentq at xtol 1e-14 on a stationary"</span></span>
<span id="cb46-22">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" point, so the error is second order in xtol; measured 1.6e-16"</span>),</span>
<span id="cb46-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"num_blackman_Sstar_over_Ks_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-24">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-25">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to S*/K_S; brentq's own guarantee xtol + rtol|x| is 2.5e-14"</span></span>
<span id="cb46-26">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" relative here; measured 0"</span>),</span>
<span id="cb46-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-28">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-29">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the closed-form steady state; LSODA at rtol 1e-11 marched"</span></span>
<span id="cb46-30">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" to t = 40000; measured exactly 0"</span>),</span>
<span id="cb46-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_conservation_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-32">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb46-33">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to S + X/phi; backward Euler keeps a linear invariant of the"</span></span>
<span id="cb46-34">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" source to round-off; measured 4.3e-16 to 1.3e-15 across BLAS kernels,"</span></span>
<span id="cb46-35">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the bound is about 77x that"</span>),</span>
<span id="cb46-36">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- optimiser exits on quantities the identities make exactly zero</span></span>
<span id="cb46-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_moser"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEP_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/h"</span>,</span>
<span id="cb46-38">                      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser contains Monod at n = 1; least_squares at xtol 1e-13;"</span></span>
<span id="cb46-39">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" measured 2.0e-14 to 3.9e-14 across BLAS kernels and above 1e-12 on"</span></span>
<span id="cb46-40">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" other machines; 1e-9 is also the degeneracy threshold"</span>),</span>
<span id="cb46-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_moser"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEP_SCATTER_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-42">                                   note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_moser over the route-B scatter"</span>),</span>
<span id="cb46-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEP_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/h"</span>,</span>
<span id="cb46-44">                        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Contois is Monod under a constant yield; least_squares"</span></span>
<span id="cb46-45">                             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" at xtol 1e-13; measured 2.0e-14 to 6.3e-14 across BLAS"</span></span>
<span id="cb46-46">                             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" kernels; 1e-9 is also the degeneracy threshold"</span>),</span>
<span id="cb46-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_contois"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SEP_SCATTER_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-48">                                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois over the route-B scatter"</span>),</span>
<span id="cb46-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_minus_monod_rms"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-50">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RMS_GAP_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/h"</span>,</span>
<span id="cb46-51">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one curve fitted twice; two least_squares exits; measured 7.9e-13"</span></span>
<span id="cb46-52">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" to 4.2e-12 across BLAS kernels, the bound is 15x the largest"</span>),</span>
<span id="cb46-53">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_mum_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-54">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MAP_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-55">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the Monod mu_m; two least_squares exits; measured 3.4e-7"</span></span>
<span id="cb46-56">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" to 2.2e-6 across BLAS kernels"</span>),</span>
<span id="cb46-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_KS_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-58">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MAP_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-59">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the Monod K_S; two least_squares exits; measured 3.2e-6"</span></span>
<span id="cb46-60">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" to 1.3e-5 across BLAS kernels, the bound is about 78x the largest"</span>),</span>
<span id="cb46-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing_vs_a_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-62">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MAP_BOUND, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-63">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to a; S_f = a identically, the gap is the Contois fit's two"</span></span>
<span id="cb46-64">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" exit tolerances (decomposed on the page); measured 4.1e-7 to 1.0e-5"</span></span>
<span id="cb46-65">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" across BLAS kernels, the bound is 50x the largest"</span>),</span>
<span id="cb46-66">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- convergence orders and the second computation of the fit</span></span>
<span id="cb46-67">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_observed_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-68">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.995</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.005</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb46-69">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler is first order in dt, and 200/400 steps are in the"</span></span>
<span id="cb46-70">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" asymptotic range: 0.9993 measured; the 25/50-step row gives 0.9942"</span>),</span>
<span id="cb46-71">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_observed_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-72">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb46-73">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind, asymptotic at 800/1600 cells; outlet from"</span></span>
<span id="cb46-74">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" compute_boundary_values, 0.9981 measured; the 100/200 row gives 0.985"</span>),</span>
<span id="cb46-75">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_read_order"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-76">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb46-77">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind, asymptotic at 800/1600 cells; outlet read at the"</span></span>
<span id="cb46-78">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" last cell centre, 0.9957 measured; the 100/200 row gives 0.965"</span>),</span>
<span id="cb46-79">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_mum_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-80">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb46-81">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap, LSODA fit against Richardson-extrapolated backward Euler"</span></span>
<span id="cb46-82">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" at 200/400 steps; set by the two fits' stopping rules, measured 1.0e-6 to"</span></span>
<span id="cb46-83">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 1.2e-6 across BLAS kernels; the bound is the prose claim and 1e2 below"</span></span>
<span id="cb46-84">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" the 25-step row"</span>),</span>
<span id="cb46-85">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_KS_relerr"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb46-86">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb46-87">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as for mu_m; measured 2.6e-6 to 7.8e-6 across BLAS kernels; the bound"</span></span>
<span id="cb46-88">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" is the prose claim and below the unconverged 25-step refit"</span>),</span>
<span id="cb46-89">}</span>
<span id="cb46-90"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PROVED_ZERO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(B), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PROVED_ZERO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(B)</span>
<span id="cb46-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Value claims whose rtol is tightened so that their break row fails the claim's</span></span>
<span id="cb46-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># own check; each stays admissible (rtol*|x0| at least 100x its spread across</span></span>
<span id="cb46-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BLAS kernels), and the row's relative move is in the comment.</span></span>
<span id="cb46-94">RTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_six_rows"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># flagged row kept: 1.5e-2</span></span>
<span id="cb46-95">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_all_rows"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arithmetic-mean biomass: 3.3e-4</span></span>
<span id="cb46-96">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_phi"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># drop row 1 instead: 1.4e-2</span></span>
<span id="cb46-97">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># drop row 1 instead: 2.5e-2</span></span>
<span id="cb46-98">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_row4_residual"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arithmetic-mean biomass: 1.1e-2</span></span>
<span id="cb46-99">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_zero_order"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># forward-difference mu: 8.3e-3</span></span>
<span id="cb46-100">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_zero_order"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># forward-difference mu: 8.3e-3</span></span>
<span id="cb46-101">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Monod"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all-seven balance line: 4.2e-2</span></span>
<span id="cb46-102">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Contois"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all-seven balance line: 4.2e-2</span></span>
<span id="cb46-103">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_first_order"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all-seven balance line: 3.9e-2</span></span>
<span id="cb46-104">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_mu_m"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all-seven balance line: 2.9e-2</span></span>
<span id="cb46-105">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_over_routeB_monod_rms"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>,  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># all-seven balance line: 4.3e-2</span></span>
<span id="cb46-106">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>,                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route-A constants: 9.9e-3</span></span>
<span id="cb46-107">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>}  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two coarsest grids: 1.2e-2</span></span>
<span id="cb46-108"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M.items():</span>
<span id="cb46-109">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> B:</span>
<span id="cb46-110">        claims.bound(k_, v, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>B[k_])</span>
<span id="cb46-111">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb46-112">        claims.value(k_, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RTOL.get(k_, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>))</span>
<span id="cb46-113"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The one count on the page: N* exists only for an alternative whose separation</span></span>
<span id="cb46-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exceeds the 1e-9 1/h the degenerate two are bounded by, and the margin to that</span></span>
<span id="cb46-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># threshold is recorded so that the set of N* claims can never be decided by noise.</span></span>
<span id="cb46-116">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_separable_alternatives"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> SEP_BOUND),</span>
<span id="cb46-117">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log10(d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SEP_BOUND)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP.values()),</span>
<span id="cb46-118">             min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb46-119">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternatives with a separation above the SEP_BOUND 1/h bound, so"</span></span>
<span id="cb46-120">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" that N* is defined: Blackman and Tessier; margin in decades to"</span></span>
<span id="cb46-121">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" that bound; decided by the identities, which no row can move"</span>)</span>
<span id="cb46-122"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_separable_alternatives"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nstar_"</span>))</span>
<span id="cb46-123"></span>
<span id="cb46-124"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the break table, wired row by row to the claim it targets: a row breaks a</span></span>
<span id="cb46-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    claim when the claim's own check (rtol or bound) fails on the injected value</span></span>
<span id="cb46-126"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb46-127">    claims.breaks(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>], r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>], r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>])</span>
<span id="cb46-128"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the route-A-design row on sep_contois, carried to its scatter ratio</span></span>
<span id="cb46-129">_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois"</span>]</span>
<span id="cb46-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb46-131">claims.breaks(_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_over_scatter_contois"</span>, _r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_obs)</span>
<span id="cb46-132"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the drop-row-1 row on balance_phi, carried to the same line's other coefficient</span></span>
<span id="cb46-133">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance line drops row 1 instead of the flagged row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_a"</span>,</span>
<span id="cb46-134">              loo[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb46-135"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the route-A-constants row on Sf_crossing, carried to its gap from a</span></span>
<span id="cb46-136">_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing"</span>]</span>
<span id="cb46-137"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb46-138">claims.breaks(_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing_vs_a_relerr"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A_BAL)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A_BAL)</span>
<span id="cb46-139">_kinds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {kd: [k_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kd]</span>
<span id="cb46-140">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)}</span>
<span id="cb46-141"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims registered: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values,"</span></span>
<span id="cb46-142">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bound'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exact'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact.  The bounds:"</span>)</span>
<span id="cb46-143"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>]:</span>
<span id="cb46-144">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[k_]</span>
<span id="cb46-145">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>), c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>)</span>
<span id="cb46-146">    rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb46-147">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:36s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rng<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'basis'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb46-148"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claims.report() runs at the end of the prose cell below, after every number</span></span>
<span id="cb46-149"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the prose quotes has been checked against its claim with claims.says.</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>81 claims registered: 57 values, 23 bounds, 1 exact.  The bounds:
  sym_monod_is_langmuir_residual       &lt;= 0           [identity]  here 0
  sym_monod_half_rate_residual         &lt;= 0           [identity]  here 0
  sym_blackman_half_rate_residual      &lt;= 0           [identity]  here 0
  sym_moser_at_n1_residual             &lt;= 0           [identity]  here 0
  sym_contois_is_monod_residual        &lt;= 0           [identity]  here 0
  num_blackman_gap_lower_relerr        &lt;= 1e-14       [tolerance]  here 1.62e-16
  num_blackman_gap_switch_relerr       &lt;= 1e-14       [identity]  here 1.67e-16
  num_blackman_Sstar_over_Ks_relerr    &lt;= 1e-13       [tolerance]  here 0
  contois_map_mum_relerr               &lt;= 0.001       [tolerance]  here 2.19e-06
  contois_map_KS_relerr                &lt;= 0.001       [tolerance]  here 1.28e-05
  contois_minus_monod_rms              &lt;= 1e-10       [tolerance]  here 4.25e-12
  sep_moser                            &lt;= 1e-09       [tolerance]  here 2.49e-14
  sep_over_scatter_moser               &lt;= 1e-07       [tolerance]  here 7.91e-13
  sep_contois                          &lt;= 1e-09       [tolerance]  here 6.33e-14
  sep_over_scatter_contois             &lt;= 1e-07       [tolerance]  here 2.01e-12
  Sf_crossing_vs_a_relerr              &lt;= 0.001       [tolerance]  here 1.04e-05
  rawlings_10_19_max_relerr            &lt;= 1e-09       [tolerance]  here 0
  pymrm_batch_observed_order           [0.995, 1.005] [theory]  here 0.999
  pymrm_batch_conservation_relerr      &lt;= 1e-13       [identity]  here 4.33e-16
  pymrm_refit_mum_relerr               &lt;= 0.0001      [chosen]  here 1.04e-06
  pymrm_refit_KS_relerr                &lt;= 0.0001      [chosen]  here 7.78e-06
  pfr_observed_order                   [0.99, 1.01]   [theory]  here 0.998
  pfr_centre_read_order                [0.99, 1.01]   [theory]  here 0.996</code></pre>
</div>
</div>
<div id="6b1824e4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:27.872052Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:27.871885Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:27.906817Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:27.905908Z&quot;}}" data-execution_count="24">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb48-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number quoted in prose, in meta.yaml and in README.md is checked here</span></span>
<span id="cb48-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># against the live computation. The page fails to execute if any has drifted.</span></span>
<span id="cb48-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> close(a, b, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>):</span>
<span id="cb48-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-30</span>), (label, a, b)</span>
<span id="cb48-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb48-6"></span>
<span id="cb48-7"></span>
<span id="cb48-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOUNDS, NOT PINS. Every quantity in the proved-exactly-zero class is an exit</span></span>
<span id="cb48-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tolerance or a round-off residual, so it is a registered bound and is quoted</span></span>
<span id="cb48-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># as that bound in the prose, in meta.yaml and in models.yaml - never to two</span></span>
<span id="cb48-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># significant figures, whose last digit differs between machines.  The exact</span></span>
<span id="cb48-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># values are PRINTED in the cells above, beside their bound.  The limits join</span></span>
<span id="cb48-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the sweep's pool below.  One bound is NOT a claim limit and is not in this</span></span>
<span id="cb48-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># list: the crossing's root-find is asserted against brentq's own xtol +</span></span>
<span id="cb48-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rtol|x|, computed where the root is found, because a round number there</span></span>
<span id="cb48-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># would be a bound on an accident.</span></span>
<span id="cb48-17">BOUNDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.values()</span>
<span id="cb48-18">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>)})</span>
<span id="cb48-19"></span>
<span id="cb48-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- numbers that ARE registered claims, as written in the prose: checked by</span></span>
<span id="cb48-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    claims.says, within one unit of the last written place, or, for a bound</span></span>
<span id="cb48-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    phrase such as "below 1e-9", at least as loose as the claim's own bound</span></span>
<span id="cb48-23">SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb48-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_six_rows"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.99996"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_all_rows"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.98505"</span>],</span>
<span id="cb48-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_row4_residual"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-17.2"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_phi"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.3174"</span>],</span>
<span id="cb48-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_a"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"197.12"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_worst_other_residual"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.65"</span>],</span>
<span id="cb48-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row4_end_of_interval_relgap"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.1 %"</span>],</span>
<span id="cb48-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Monod"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.05469"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Blackman"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.02677"</span>],</span>
<span id="cb48-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Tessier"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.03871"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Contois"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.05153"</span>],</span>
<span id="cb48-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Monod"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.03147"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Blackman"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.03955"</span>],</span>
<span id="cb48-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Tessier"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.02631"</span>],</span>
<span id="cb48-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_n_moser"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.93"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_n_moser"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.51"</span>],</span>
<span id="cb48-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"12.3"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_F_moser_vs_monod"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.44"</span>],</span>
<span id="cb48-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_crit_95"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.71"</span>],</span>
<span id="cb48-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_mu_m"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.8809"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_monod_K_S"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"20.45"</span>],</span>
<span id="cb48-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_forward_truth"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.37"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"36.55 %"</span>],</span>
<span id="cb48-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_control_truth"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0495"</span>],</span>
<span id="cb48-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_forward_truth"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.61"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_control_truth"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.01"</span>],</span>
<span id="cb48-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_F"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.23"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_p_of_observed_n"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.13"</span>],</span>
<span id="cb48-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nstar_tessier"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10.3"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nstar_blackman"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.30"</span>],</span>
<span id="cb48-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_ratio_at_Sf20"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.83"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_for_10pct_gap"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"95.5"</span>],</span>
<span id="cb48-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"197.1"</span>],</span>
<span id="cb48-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_lower_over_mum"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0858"</span>],</span>
<span id="cb48-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_over_routeA_rms"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.21"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bias_max_abs_excl_bad_row"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0663"</span>],</span>
<span id="cb48-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max_swing_over_CAbar"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.89"</span>],</span>
<span id="cb48-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_observed_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9981"</span>],</span>
<span id="cb48-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_observed_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9993"</span>],</span>
<span id="cb48-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_read_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.00"</span>],</span>
<span id="cb48-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.39"</span>],</span>
<span id="cb48-50">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_richardson_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.2e-6"</span>],</span>
<span id="cb48-51">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_Dc_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.1e-4"</span>],</span>
<span id="cb48-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-9"</span>],</span>
<span id="cb48-53">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_monod_transient_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1 %"</span>],</span>
<span id="cb48-54">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dc_contois_transient_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1 %"</span>],</span>
<span id="cb48-55">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_mum_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-4"</span>],</span>
<span id="cb48-56">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_refit_KS_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-4"</span>],</span>
<span id="cb48-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_batch_conservation_relerr"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-13"</span>],</span>
<span id="cb48-58">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the proved-zero class, quoted only as the bounds they are checked against</span></span>
<span id="cb48-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_mum_relerr"</span>: [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb48-60">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_map_KS_relerr"</span>: [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb48-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sf_crossing_vs_a_relerr"</span>: [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb48-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contois_minus_monod_rms"</span>: [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RMS_GAP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb48-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_moser"</span>: [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_contois"</span>: [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP_BOUND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb48-64">}</span>
<span id="cb48-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.items():</span>
<span id="cb48-66">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lits:</span>
<span id="cb48-67">        claims.says(lit, k_)</span>
<span id="cb48-68">N_SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.values())</span>
<span id="cb48-69"></span>
<span id="cb48-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- quoted numbers that are NOT claims: derived quantities, other readings and</span></span>
<span id="cb48-71"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    the page's own counts.  Each is deterministic to far below the tolerance it</span></span>
<span id="cb48-72"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    is checked at, on any machine.</span></span>
<span id="cb48-73">CHECKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb48-74"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flagged row is row 4"</span>,               BAD_ROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>),</span>
<span id="cb48-75"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod last of the four on route A"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-76">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Monod"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmsA_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TWO_PAR))),</span>
<span id="cb48-77"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman worst of the four on route B"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-78">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Blackman"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmsB_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TWO_PAR))),</span>
<span id="cb48-79"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod residual falls 42 %"</span>,</span>
<span id="cb48-80">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsB_Monod"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Monod"</span>])), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">42.0</span>),</span>
<span id="cb48-81"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the control is AT nominal, not conservative"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-82">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_control_truth"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NBOOT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)),</span>
<span id="cb48-83"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid-only control size = 0.021"</span>,     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.021</span>),</span>
<span id="cb48-84"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid-only control median n = 0.95"</span>,  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>),</span>
<span id="cb48-85"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid-only forward size = 0.308"</span>,     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.308</span>),</span>
<span id="cb48-86"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid-only forward median n = 1.60"</span>,  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.60</span>),</span>
<span id="cb48-87"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid-only p of the observed F = 0.18"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pF"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.18</span>),</span>
<span id="cb48-88"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward size at sigma = route A's RMS is 0.2355"</span>,</span>
<span id="cb48-89">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(SIG_TABLE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route A RMS"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2355</span>),</span>
<span id="cb48-90"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the control's size is scale-free"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-91">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SIG_TABLE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route A RMS"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SIG_TABLE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route B RMS (used above)"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb48-92">       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NBOOT)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)),</span>
<span id="cb48-93"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the imputed cell flips route A's F verdict"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-94">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(FA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_crit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> FA_IMP)),</span>
<span id="cb48-95"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route A F with the imputed cell = 5.45"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(FA_IMP, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.45</span>),</span>
<span id="cb48-96"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance-implied CA_bar for row 4 = 60.18"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(CAB_IMPUTED, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.18</span>),</span>
<span id="cb48-97"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman still beats Monod with the cell imputed"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-98">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> RA_IMP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rms"</span>])),</span>
<span id="cb48-99"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row 3 end-of-interval value = 74.89"</span>,</span>
<span id="cb48-100">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">74.89</span>),</span>
<span id="cb48-101"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row 5 end-of-interval value = 13.46"</span>,</span>
<span id="cb48-102">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.46</span>),</span>
<span id="cb48-103"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row 4 end-of-interval value = 44.33"</span>,</span>
<span id="cb48-104">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.33</span>),</span>
<span id="cb48-105"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rawlings' D_c at their printed set is 5/6"</span>, Dc_r_closed, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>),</span>
<span id="cb48-106"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"81 claims registered"</span>,               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">81</span>),</span>
<span id="cb48-107"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"57 of them values"</span>,                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">57</span>),</span>
<span id="cb48-108"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"23 of them bounds"</span>,                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">23</span>),</span>
<span id="cb48-109"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 of them exact"</span>,                    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb48-110"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"57 prose literals checked by claims.says"</span>, N_SAYS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">57</span>),</span>
<span id="cb48-111"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"80 metrics in the coverage map"</span>,     N_METRICS, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>),</span>
<span id="cb48-112"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"62 of them covered by an injection"</span>, N_COVERED, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">62</span>),</span>
<span id="cb48-113"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18 named structural"</span>,                N_STRUCT, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>),</span>
<span id="cb48-114"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"79 injections, all 79 move"</span>,         <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(TBK), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">79</span>),</span>
<span id="cb48-115"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18 quantities proved exactly zero, all bounds"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PROVED_ZERO), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>),</span>
<span id="cb48-116"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the cross-check is blind to a wrong yield"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-117">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(BLIND_MOVE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BLIND_GAP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BLIND_GAP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb48-118">       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>BLIND_GAP[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])),</span>
<span id="cb48-119"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"S + X/phi does not move when mu_m is tripled"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(INV_3X_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)),</span>
<span id="cb48-120"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman gap at the switch = 1/3"</span>,   M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_blackman_gap_at_switch_over_mum"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb48-121"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the Monte-Carlo sampling errors, quoted beside every one of the six numbers</span></span>
<span id="cb48-122"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward size MC error = 1.1 %"</span>,     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size_se"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>),</span>
<span id="cb48-123"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control size MC error = 0.5 %"</span>,     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size_se"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb48-124"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward median n MC error = 0.0074"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med_se"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0074</span>),</span>
<span id="cb48-125"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control median n MC error = 0.0049"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"med_se"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0049</span>),</span>
<span id="cb48-126"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p(F&gt;obs) MC error = 0.0094"</span>,        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pF_se"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0094</span>),</span>
<span id="cb48-127"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p(n&gt;obs) MC error = 0.0075"</span>,        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pn_se"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0075</span>),</span>
<span id="cb48-128"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the root-find is inside BRENTQ'S OWN GUARANTEE, xtol + rtol|x|, rather than</span></span>
<span id="cb48-129"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># under the round 1e-15 the observed residual happens to sit below: that residual</span></span>
<span id="cb48-130"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is Brent's last interpolation, not anything declared - it moves by more than an</span></span>
<span id="cb48-131"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># order under a change of BRACKET that changes no mathematics - so asserting it</span></span>
<span id="cb48-132"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># would stop this page executing the day scipy moves a fitted constant in its 9th</span></span>
<span id="cb48-133"> <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># figure.  The printed residual is the observation; this line is the guarantee.</span></span>
<span id="cb48-134"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the root-find is inside brentq's declared tolerance"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb48-135">  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(SF_ROOTFIND_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> SF_ROOTFIND_BOUND)),</span>
<span id="cb48-136"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell-centre read is 2.59x closer"</span>,   <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.59</span>),</span>
<span id="cb48-137"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"substrate ran 148.3 -&gt; 0.23"</span>,        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_a"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc0[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_phi"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">148.3</span>),</span>
<span id="cb48-138"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monod beats the best null 3.68x"</span>,    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_first_order"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Monod"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.68</span>),</span>
<span id="cb48-139"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman beats it 7.53x"</span>,            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_first_order"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Blackman"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.53</span>),</span>
<span id="cb48-140"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"worst leave-one-out R2 = 0.9757"</span>,    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(loo[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS)</span>
<span id="cb48-141">                                                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9757</span>),</span>
<span id="cb48-142"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best other leave-one-out = 0.9848"</span>,  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(loo[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(NOBS)</span>
<span id="cb48-143">                                                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> BAD_ROW), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9848</span>),</span>
<span id="cb48-144"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row 3 end-of-interval 16.8 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% o</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ff"</span>,</span>
<span id="cb48-145">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.8</span>),</span>
<span id="cb48-146"> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row 5 end-of-interval 53.6 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% o</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ff"</span>,</span>
<span id="cb48-147">  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A_BAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PHI_BAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CAb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">53.6</span>),</span>
<span id="cb48-148">]</span>
<span id="cb48-149"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CHECKS:</span>
<span id="cb48-150">    close(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(a), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, lab)</span>
<span id="cb48-151"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CHECKS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CHECKS)       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the count README.md and meta.yaml quote</span></span>
<span id="cb48-152"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># values that exist only in the break table are LOOKED UP, never retyped</span></span>
<span id="cb48-153">brk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>], r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>]): r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK}</span>
<span id="cb48-154"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the flagged row kept in the balance line"</span>,</span>
<span id="cb48-155">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_six_rows"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance_R2_all_rows"</span>]</span>
<span id="cb48-156"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Moser's exponent frozen at n = 1"</span>,</span>
<span id="cb48-157">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb48-158"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bootstrap truth taken from route A's own model"</span>,</span>
<span id="cb48-159">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_forward_truth"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_median_n_control_truth"</span>]</span>
<span id="cb48-160"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every route-A fit with the flagged cell replaced by its "</span></span>
<span id="cb48-161">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"balance-implied value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeA_F_moser_vs_monod"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> FA_IMP</span>
<span id="cb48-162"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the whole bootstrap fitted on the search grid alone, with no per-draw "</span></span>
<span id="cb48-163">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refinement"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boot_size_control_truth"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb48-164">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> GRID_ONLY[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"size"</span>]</span>
<span id="cb48-165">Y_TO_2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rawlings' printed y = 1 replaced by 2"</span>,</span>
<span id="cb48-166">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_10_19_max_relerr"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>]</span>
<span id="cb48-167">KS_TO_2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rawlings' printed K_s = 1 replaced by 2"</span>,</span>
<span id="cb48-168">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings_Dc_relerr"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>]</span>
<span id="cb48-169">close(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.log10(Y_TO_2)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">300.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the y = 2 row's relative move is 1.0e+300"</span>)</span>
<span id="cb48-170">close(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(KS_TO_2, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">660.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the K_s = 2 row's relative move is 6.6e+02"</span>)</span>
<span id="cb48-171">LOCAL_BLACKMAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Blackman fitted from a single local start, no global scan"</span>,</span>
<span id="cb48-172">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmsA_Blackman"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>]</span>
<span id="cb48-173">CENTRE_READ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug-flow outlet read at the last cell CENTRE"</span>,</span>
<span id="cb48-174">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>]</span>
<span id="cb48-175">NU_ONE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug flow with nu = 1 (cylindrical) instead of nu = 0"</span>,</span>
<span id="cb48-176">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>)][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>]</span>
<span id="cb48-177">close(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(LOCAL_BLACKMAN, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0406</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local-start Blackman RMS = 0.0406"</span>)</span>
<span id="cb48-178">close(CENTRE_READ<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_batch_relerr_finest"</span>],</span>
<span id="cb48-179">      M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell-centre read factor"</span>)</span>
<span id="cb48-180">close(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_over_boundary_read"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.39</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-2</span>,</span>
<span id="cb48-181">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the cell-centre read is 0.39x the boundary read here"</span>)</span>
<span id="cb48-182">close(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pfr_centre_read_order"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.00</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell-centre read order"</span>)</span>
<span id="cb48-183">N_BRK_LOOKUPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the asserts and close() calls immediately above</span></span>
<span id="cb48-184"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SAYS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose literals of registered claims checked by claims.says,"</span></span>
<span id="cb48-185">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CHECKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> other prose/metadata</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">values checked against the live"</span></span>
<span id="cb48-186">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" computation, plus </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BRK_LOOKUPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> break-table lookups. All agree."</span>)</span>
<span id="cb48-187"></span>
<span id="cb48-188"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- MECHANICAL SWEEP of the metadata files for numbers in scientific notation.</span></span>
<span id="cb48-189"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The list above is curated and a curated list drifts; this one enumerates the</span></span>
<span id="cb48-190"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tokens instead. Every a.bce+xy in meta.yaml, README.md, models_entry.yaml and</span></span>
<span id="cb48-191"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two data sidecars must match a live value - a registered claim, a bound</span></span>
<span id="cb48-192"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a claim is checked against, a break-table entry or a declared constant - to</span></span>
<span id="cb48-193"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HALF AN ULP OF ITS OWN PRINTED DIGITS, taken from the token itself:</span></span>
<span id="cb48-194"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     half ulp = 0.5 * 10**(exponent - decimals in the mantissa),  compared</span></span>
<span id="cb48-195"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ABSOLUTELY. A relative window of 5*10**-sig is half an ulp only when the</span></span>
<span id="cb48-196"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mantissa is 1 and is up to ten times looser otherwise - a +-5 % window on</span></span>
<span id="cb48-197"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 6.6e+02, where half an ulp is 0.8 %. The window below is exact, and the sweep</span></span>
<span id="cb48-198"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MEASURES its own detection rate below instead of claiming one. The regex</span></span>
<span id="cb48-199"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># accepts a token followed by a full stop, i.e. a value that ends a sentence. Files absent (Colab, or</span></span>
<span id="cb48-200"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># models_entry.yaml once spliced into models.yaml) are skipped and counted.</span></span>
<span id="cb48-201"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb48-202">POOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M.values()] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [MOVE_TOL, RES_CA, RES_CC, RES_DT]</span>
<span id="cb48-203">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BOUNDS                                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the claims' own limits</span></span>
<span id="cb48-204">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BLIND_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BLIND_MOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [INV_3X_RELERR, FA_IMP, CAB_IMPUTED]</span>
<span id="cb48-205">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GRID_ONLY.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d.values()]</span>
<span id="cb48-206">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pair <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_TABLE.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pair]</span>
<span id="cb48-207">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r[k]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel. move"</span>)])</span>
<span id="cb48-208"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOTH spellings: 1.23e-04 in the YAML files, and 1.23x10^-4 with typeset</span></span>
<span id="cb48-209"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># superscripts in the Markdown. README.md writes every one of its exponents the</span></span>
<span id="cb48-210"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second way, so until this was added the sweep read that file and found NOTHING</span></span>
<span id="cb48-211"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># in it while the metadata claimed it was covered.</span></span>
<span id="cb48-212">SUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.maketrans(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\u2070\u00b9\u00b2\u00b3\u2074\u2075\u2076\u2077</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb48-213">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\u2078\u2079\u207a\u207b</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0123456789+-"</span>)</span>
<span id="cb48-214">TOK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">compile</span>(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>(?:<span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\.</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span>(?:<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[eE]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[+-]</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\u00d7</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">x]</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">10"</span></span>
<span id="cb48-215">                 <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\u2070\u00b9\u00b2\u00b3\u2074</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">-</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\u2079\u207a\u207b</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb48-216">                 <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">]</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\.</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb48-217"></span>
<span id="cb48-218"></span>
<span id="cb48-219"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> token(m_):</span>
<span id="cb48-220">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(value, half an ulp of its OWN printed digits) - both from the token"""</span></span>
<span id="cb48-221">    mant <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m_.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb48-222">    exp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(m_.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m_.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> m_.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>).translate(SUP))</span>
<span id="cb48-223">    dec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(mant.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> mant <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb48-224">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mant<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">e</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>exp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(exp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dec)</span>
<span id="cb48-225"></span>
<span id="cb48-226"></span>
<span id="cb48-227"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _matched(v, half):</span>
<span id="cb48-228">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(half, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-299</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> POOL)</span>
<span id="cb48-229"></span>
<span id="cb48-230"></span>
<span id="cb48-231">SCAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"meta.yaml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"README.md"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"../models_entry.yaml"</span>,</span>
<span id="cb48-232">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/levenspiel-p644-monod-batch.meta.yaml"</span>,</span>
<span id="cb48-233">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/printed-growth-laws.meta.yaml"</span>]</span>
<span id="cb48-234">n_file, found, missing, skipped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, [], [], []</span>
<span id="cb48-235"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOTH directions, and counted by OCCURRENCE (the same token appears in more than</span></span>
<span id="cb48-236"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one file): sets of indices into `found`.</span></span>
<span id="cb48-237">blind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"up"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"down"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>()}</span>
<span id="cb48-238"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SCAN:</span>
<span id="cb48-239">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path(fn)</span>
<span id="cb48-240">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> p.is_file():</span>
<span id="cb48-241">        skipped.append(fn)</span>
<span id="cb48-242">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb48-243">    n_file <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb48-244">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TOK.finditer(p.read_text(encoding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utf-8"</span>)):</span>
<span id="cb48-245">        tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m_.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb48-246">        v, h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> token(m_)</span>
<span id="cb48-247">        found.append((fn, tok, v, h))</span>
<span id="cb48-248">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _matched(v, h):</span>
<span id="cb48-249">            missing.append((fn, tok))</span>
<span id="cb48-250">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the sweep's own teeth, measured on the spot: would it notice this very</span></span>
<span id="cb48-251">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># token if its LAST PRINTED DIGIT were one out?  BOTH WAYS: probing only</span></span>
<span id="cb48-252">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># +1 would flatter the detection rate - a mantissa of exactly 1 corrupts</span></span>
<span id="cb48-253">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DOWNWARD to zero, and 0.0 is a live value on this page.</span></span>
<span id="cb48-254">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sgn, key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"up"</span>), (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"down"</span>)):</span>
<span id="cb48-255">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _matched(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sgn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>h, h):</span>
<span id="cb48-256">                blind[key].add(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(found) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb48-257">n_tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(found)</span>
<span id="cb48-258">BLIND_ANY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"up"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"down"</span>])</span>
<span id="cb48-259"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># how many of the downward blind spots are DEGENERATE - a mantissa of exactly 1,</span></span>
<span id="cb48-260"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># whose last digit one lower is 0, and 0.0 is a live value on this page</span></span>
<span id="cb48-261">N_DEGEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"down"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(found[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>found[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-299</span>)</span>
<span id="cb48-262"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mechanical sweep: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_tok<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> scientific-notation values in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_file<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metadata"</span></span>
<span id="cb48-263">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" file(s)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">checked against the live metrics and the break table, each to half"</span></span>
<span id="cb48-264">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" an ulp of its</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">own printed digits, in both the 1e-04 and the 1x10^-4 spelling"</span></span>
<span id="cb48-265">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"; skipped (absent here): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(skipped)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> skipped <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb48-266">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f".</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(missing)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> unmatched."</span>)</span>
<span id="cb48-267"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">WHAT THIS SWEEP CAN AND CANNOT CATCH, measured rather than claimed, and"</span></span>
<span id="cb48-268">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" measured</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">IN BOTH DIRECTIONS: corrupt the last printed digit of each of the"</span></span>
<span id="cb48-269">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_tok<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tokens by one</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the window above rejects"</span></span>
<span id="cb48-270">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'up'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them UPWARD and"</span></span>
<span id="cb48-271">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'down'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> DOWNWARD -"</span></span>
<span id="cb48-272">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_tok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BLIND_ANY)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them in</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">both directions, which is the honest"</span></span>
<span id="cb48-273">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" figure for a slip of unknown sign. The</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">remaining </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BLIND_ANY)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are"</span></span>
<span id="cb48-274">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" invisible in at least one direction: the corrupted value still</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lands within"</span></span>
<span id="cb48-275">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" half an ulp of SOME live value, in a pool of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(POOL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and a token printed"</span></span>
<span id="cb48-276">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to one or two significant figures has an ulp wide enough that something"</span></span>
<span id="cb48-277">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" usually</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">does. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_DEGEN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the downward ones are degenerate rather than"</span></span>
<span id="cb48-278">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" alarming - their mantissa is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">exactly 1, so one less in the last digit is"</span></span>
<span id="cb48-279">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" 0, and 0.0 is a live value here:"</span>)</span>
<span id="cb48-280"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BLIND_ANY:</span>
<span id="cb48-281">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+1 and -1"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"up"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"down"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb48-282">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+1 only"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> blind[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"up"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1 only"</span>)</span>
<span id="cb48-283">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>found[i][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (blind to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb48-284"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"So the sweep is a guard against a value drifting out of the curated list, not"</span></span>
<span id="cb48-285">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">a proof that every printed digit is right; it is also blind to a wrong SIGN,"</span></span>
<span id="cb48-286">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">which its regex does not read. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CHECKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> curated checks stand"</span></span>
<span id="cb48-287">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" behind it."</span>)</span>
<span id="cb48-288"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   per file: "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">",  "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> found <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> fn)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb48-289">                                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SCAN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> fn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> skipped))</span>
<span id="cb48-290"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> missing, missing</span>
<span id="cb48-291"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb48-292"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ten claims have no break row that fails their own check, so breaks are not</span></span>
<span id="cb48-293"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># required page-wide: two closed-form constants, two root-finds against closed</span></span>
<span id="cb48-294"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># forms, the tabulated F(1,4), a property of the printed table, two degenerate</span></span>
<span id="cb48-295"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># separations of Moser and the Contois RMS gap (nothing on this page injects a</span></span>
<span id="cb48-296"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect into those fits) and the Contois washout error.  report() lists them</span></span>
<span id="cb48-297"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># in agreement.json; every other claim has a row that fails it.</span></span>
<span id="cb48-298">PAYLOAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.report(require_breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb48-299"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the counts README.md and meta.yaml quote for the break table's reach</span></span>
<span id="cb48-300"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAYLOAD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unbroken"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, PAYLOAD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unbroken"</span>]</span>
<span id="cb48-301"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAYLOAD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"breaks"</span>].values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>, PAYLOAD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"breaks"</span>]</span>
<span id="cb48-302"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.values() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>57 prose literals of registered claims checked by claims.says, 48 other prose/metadata
values checked against the live computation, plus 10 break-table lookups. All agree.

mechanical sweep: 34 scientific-notation values in 4 metadata file(s)
checked against the live metrics and the break table, each to half an ulp of its
own printed digits, in both the 1e-04 and the 1x10^-4 spelling; skipped (absent here): ../models_entry.yaml.
0 unmatched.

WHAT THIS SWEEP CAN AND CANNOT CATCH, measured rather than claimed, and measured
IN BOTH DIRECTIONS: corrupt the last printed digit of each of the 34 tokens by one
and the window above rejects 23 of them UPWARD and 12 DOWNWARD - 12 of them in
both directions, which is the honest figure for a slip of unknown sign. The
remaining 22 are invisible in at least one direction: the corrupted value still
lands within half an ulp of SOME live value, in a pool of 373, and a token printed
to one or two significant figures has an ulp wide enough that something usually
does. 19 of the downward ones are degenerate rather than alarming - their mantissa is
exactly 1, so one less in the last digit is 0, and 0.0 is a live value here:
   meta.yaml 1e-3   (blind to +1 and -1)
   meta.yaml 1e-10   (blind to -1 only)
   meta.yaml 1e-9   (blind to -1 only)
   meta.yaml 1e-3   (blind to +1 and -1)
   meta.yaml 1e-9   (blind to -1 only)
   meta.yaml 1e-300   (blind to +1 and -1)
   meta.yaml 1e-4   (blind to +1 and -1)
   meta.yaml 1e-13   (blind to -1 only)
   meta.yaml 1e-13   (blind to -1 only)
   meta.yaml 1.3e-02   (blind to +1 and -1)
   meta.yaml 1e-6   (blind to +1 and -1)
   meta.yaml 2.1e-4   (blind to -1 only)
   meta.yaml 1e-4   (blind to +1 and -1)
   meta.yaml 1e-13   (blind to -1 only)
   README.md 1×10⁻³   (blind to +1 and -1)
   README.md 1×10⁻¹⁰   (blind to -1 only)
   README.md 1×10⁻³   (blind to +1 and -1)
   README.md 1×10⁻⁹   (blind to -1 only)
   README.md 2.1×10⁻⁴   (blind to -1 only)
   README.md 1×10⁻⁴   (blind to +1 and -1)
   README.md 1×10⁻¹³   (blind to -1 only)
   README.md 1×10⁻⁶   (blind to +1 and -1)
So the sweep is a guard against a value drifting out of the curated list, not
a proof that every printed digit is right; it is also blind to a wrong SIGN,
which its regex does not read. 105 curated checks stand behind it.
   per file: meta.yaml 25,  README.md 9,  data/levenspiel-p644-monod-batch.meta.yaml 0,  data/printed-growth-laws.meta.yaml 0

Claims for J4.1:
  sym_monod_is_langmuir_residual      = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sym_monod_half_rate_residual        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sym_blackman_half_rate_residual     = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sym_moser_at_n1_residual            = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sym_contois_is_monod_residual       = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sym_blackman_gap_at_switch_over_mum = 0.33333          value  rtol 0.05
  sym_blackman_gap_lower_over_mum     = 0.085786         value  rtol 0.05
  num_blackman_gap_lower_relerr       = (here 1.6e-16)   bound  bound &lt;= 1e-14 [tolerance]
  num_blackman_gap_switch_relerr      = (here 1.7e-16)   bound  bound &lt;= 1e-14 [identity]
  num_blackman_Sstar_over_Ks_relerr   = (here 0.0e+00)   bound  bound &lt;= 1e-13 [tolerance]
  balance_R2_all_rows                 = 0.98505          value  rtol 0.0001
  balance_R2_six_rows                 = 0.99996          value  rtol 0.001
  balance_row4_residual               = -17.18           value  rtol 0.001
  balance_worst_other_residual        = 0.65414          value  rtol 0.05
  balance_phi                         = 0.31744          value  rtol 0.001
  balance_a                           = 197.12           value  rtol 0.001
  row4_end_of_interval_relgap         = 0.031024         value  rtol 0.05
  rmsA_Monod                          = 0.05469          value  rtol 0.05
  rmsA_Blackman                       = 0.026772         value  rtol 0.05
  rmsA_Tessier                        = 0.03871          value  rtol 0.05
  rmsA_Moser                          = 0.027117         value  rtol 0.05
  rmsA_Contois                        = 0.051534         value  rtol 0.05
  rmsA_zero_order                     = 0.27828          value  rtol 0.001
  rmsA_first_order                    = 0.20148          value  rtol 0.05
  routeA_F_moser_vs_monod             = 12.27            value  rtol 0.05
  routeA_n_moser                      = 1.9317           value  rtol 0.05
  F_crit_95                           = 7.7086           value  rtol 0.05
  rmsB_Monod                          = 0.031466         value  rtol 0.01
  rmsB_Blackman                       = 0.039554         value  rtol 0.05
  rmsB_Tessier                        = 0.026308         value  rtol 0.05
  rmsB_Moser                          = 0.026985         value  rtol 0.05
  rmsB_Contois                        = 0.031466         value  rtol 0.01
  rmsB_zero_order                     = 0.27828          value  rtol 0.001
  rmsB_first_order                    = 0.1516           value  rtol 0.01
  routeB_F_moser_vs_monod             = 1.4389           value  rtol 0.05
  routeB_n_moser                      = 1.5099           value  rtol 0.05
  routeB_monod_mu_m                   = 0.88092          value  rtol 0.01
  routeB_monod_K_S                    = 20.454           value  rtol 0.05
  routeA_over_routeB_monod_rms        = 1.7381           value  rtol 0.01
  contois_map_mum_relerr              = (here 2.2e-06)   bound  bound &lt;= 0.001 [tolerance]
  contois_map_KS_relerr               = (here 1.3e-05)   bound  bound &lt;= 0.001 [tolerance]
  contois_minus_monod_rms             = (here 4.2e-12)   bound  bound &lt;= 1e-10 [tolerance]
  bias_max_abs                        = 0.068561         value  rtol 0.05
  bias_max_abs_excl_bad_row           = 0.06631          value  rtol 0.05
  bias_over_routeA_rms                = 1.2125           value  rtol 0.05
  max_swing_over_CAbar                = 1.8901           value  rtol 0.05
  boot_size_forward_truth             = 0.3655           value  rtol 0.05
  boot_size_control_truth             = 0.0495           value  rtol 0.05
  boot_median_n_forward_truth         = 1.6117           value  rtol 0.05
  boot_median_n_control_truth         = 1.0089           value  rtol 0.05
  boot_p_of_observed_F                = 0.228            value  rtol 0.05
  boot_p_of_observed_n                = 0.1285           value  rtol 0.05
  sep_blackman                        = 0.034659         value  rtol 0.05
  sep_over_scatter_blackman           = 1.1015           value  rtol 0.05
  Nstar_blackman                      = 1.3035           value  rtol 0.05
  sep_tessier                         = 0.012348         value  rtol 0.05
  sep_over_scatter_tessier            = 0.39242          value  rtol 0.05
  Nstar_tessier                       = 10.27            value  rtol 0.05
  sep_moser                           = (here 2.5e-14)   bound  bound &lt;= 1e-09 [tolerance]
  sep_over_scatter_moser              = (here 7.9e-13)   bound  bound &lt;= 1e-07 [tolerance]
  sep_contois                         = (here 6.3e-14)   bound  bound &lt;= 1e-09 [tolerance]
  sep_over_scatter_contois            = (here 2.0e-12)   bound  bound &lt;= 1e-07 [tolerance]
  Sf_crossing                         = 197.12           value  rtol 0.005
  Sf_for_10pct_gap                    = 95.515           value  rtol 0.05
  Dc_ratio_at_Sf20                    = 1.8325           value  rtol 0.05
  Sf_crossing_vs_a_relerr             = (here 1.0e-05)   bound  bound &lt;= 0.001 [tolerance]
  Dc_monod_closed_form                = 0.43552          value  rtol 0.05
  Dc_monod_transient_relerr           = 0.00037966       value  rtol 0.05
  Dc_contois_transient_relerr         = 0.00024545       value  rtol 0.05
  rawlings_10_19_max_relerr           = (here 0.0e+00)   bound  bound &lt;= 1e-09 [tolerance]
  rawlings_Dc_relerr                  = 0.00021431       value  rtol 0.05
  pymrm_batch_observed_order          = (here 1.0e+00)   bound  bound [0.995, 1.005] [theory]
  pymrm_batch_conservation_relerr     = (here 4.3e-16)   bound  bound &lt;= 1e-13 [identity]
  pymrm_refit_mum_relerr              = (here 1.0e-06)   bound  bound &lt;= 0.0001 [chosen]
  pymrm_refit_KS_relerr               = (here 7.8e-06)   bound  bound &lt;= 0.0001 [chosen]
  pfr_batch_relerr_finest             = 0.0012208        value  rtol 0.05
  pfr_observed_order                  = (here 1.0e+00)   bound  bound [0.99, 1.01] [theory]
  pfr_richardson_relerr               = 3.2458e-06       value  rtol 0.05
  pfr_centre_read_order               = (here 1.0e+00)   bound  bound [0.99, 1.01] [theory]
  pfr_centre_over_boundary_read       = 0.38553          value  rtol 0.005
  n_separable_alternatives            = 2                exact  exact, margin 4.2</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Honestly: the central argument is algebra and a seven-point fit, and scipy does most of it. Two things pymrm does here are load-bearing, and one is not.</strong></p>
<p>Load-bearing:</p>
<ul>
<li><strong>The second, independent computation of the fit.</strong> <code>BatchMarch</code> is a backward-Euler marcher built from <code>NumJac((1, 2))</code> and <code>newton</code>, and it re-derives <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> and <img src="https://latex.codecogs.com/png.latex?K_S"> through a different discretisation, a different Jacobian and a different linear solve, agreeing with the LSODA fit to below 1e-4 in both constants. A break row confirms the check has teeth by running it unconverged. Be precise about what it buys: it catches a bug in <em>either integrator</em>, and it is blind to everything the two share - a wrong yield, a wrong intercept or a mis-set interval moves both predictions together, which the Validation section measures. Carrying <img src="https://latex.codecogs.com/png.latex?S"> as an unknown instead of substituting the yield relation is worth having for its own sake, but <img src="https://latex.codecogs.com/png.latex?S%20+%20X/%5Cvarphi"> is then a <strong>tautology</strong> of the scheme, not a test of it: the source is <img src="https://latex.codecogs.com/png.latex?(-m/%5Cvarphi,%5C,m)"> built from one <img src="https://latex.codecogs.com/png.latex?m">, so backward Euler conserves it for any growth law, and tripling <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> moves it by nothing at all.</li>
<li><strong>Turning a caption into a test.</strong> <code>PlugFlowFermenter</code> makes Levenspiel’s <em>“batch <strong>or plug flow</strong>”</em> into a number: first-order upwind convergence at observed order 1.00 against the initial-value solution, Richardson checked. The break table then prices the usual mistakes on it: <code>nu=1</code> instead of <code>nu=0</code> is a relative move of 8.2e2, and a flipped substrate sign 2.7e4, both while the profile still looks perfectly smooth. Reading the outlet at the last cell centre instead of through <code>compute_boundary_values</code> also moves the number - but <em>down</em>, by a factor 0.39 here, and the page says so rather than repeating the general warning: with a zero-gradient outflow condition both reads are first order (measured: 1.00 and 1.00) and differ only in their constant.</li>
</ul>
<p>Not load-bearing, and the page says so: a well-mixed batch and a chemostat are 0-D, and <code>solve_ivp</code> integrates them - as it does, throughout, as the reference.</p>
<p><strong>What travels.</strong> The growth law is written as a pointwise source over the last axis, which is the shape the rest of the gallery uses, so <code>PlugFlowFermenter.source</code> transplants unchanged into a pellet (<code>B1.1</code>), an immobilised-enzyme particle (<code>J4.7</code>) or a dispersed tubular reactor (<code>A2.1</code>, <code>A2.6</code>): the ingredients gain <code>construct_grad</code>, and the rate law is the same object.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>If you have batch growth data and want <img src="https://latex.codecogs.com/png.latex?%5Cmu_m"> and <img src="https://latex.codecogs.com/png.latex?K_S">:</strong> do not compare <img src="https://latex.codecogs.com/png.latex?%5Cln(C_C%5E%7B%5Crm%20end%7D/C_C%5E%7B%5Crm%20start%7D)/%5CDelta%20t"> with <img src="https://latex.codecogs.com/png.latex?%5Cmu"> evaluated at the interval-average substrate concentration unless the substrate barely moves across the interval. On these seven intervals that shortcut biases the rate by up to 0.0663 h<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"> - <strong>1.21 times the residual scatter it is then judged against</strong> - always in the direction that makes a saturating law look too gradual near exhaustion. Integrate the law across the interval instead; constant yield makes that a single ODE and it costs nothing. <code>fit_B</code> on this page is the whole of it.</p>
<p><strong>If you are choosing between growth laws:</strong> ask first whether your experiment <em>can</em> tell them apart. Two of the four alternatives Rawlings &amp; Ekerdt print beside Monod cannot be separated from it by <strong>any</strong> constant-yield batch run. Moser contains Monod at <img src="https://latex.codecogs.com/png.latex?n%20=%201">. <strong>Contois <em>is</em> Monod</strong>, exactly, with <img src="https://latex.codecogs.com/png.latex?%5Cmu_m'%20=%20%5Cmu_m/(1-K_%7Bsx%7D%5Cvarphi)"> and <img src="https://latex.codecogs.com/png.latex?K_S'%20=%20K_%7Bsx%7D%5Cvarphi%20a/(1-K_%7Bsx%7D%5Cvarphi)"> - so a batch fit that “prefers” one over the other is reporting its own optimiser and its own reduction. Of the two that are separable at this design, Blackman needs 1.30 repeats of the seven-interval run and Tessier 10.3 - and read those as ~50 %-power thresholds, so one clean run is <em>within 30 % of</em> enough for Blackman rather than enough.</p>
<p><strong>If you need to separate Contois from Monod:</strong> run a chemostat and sweep the <em>feed</em> concentration, not the dilution rate alone. Monod washes out at <img src="https://latex.codecogs.com/png.latex?D_c%20=%20%5Cmu_m%20S_f/(K_S+S_f)"> and Contois at <img src="https://latex.codecogs.com/png.latex?D_c%20=%20%5Cmu_m"> regardless of <img src="https://latex.codecogs.com/png.latex?S_f">, so the two predictions cross at exactly <img src="https://latex.codecogs.com/png.latex?S_f%20=%20a"> - the substrate intercept of your own batch run’s material balance - and separate on either side. At the constants fitted here that is <img src="https://latex.codecogs.com/png.latex?S_f%20=%20197.1">; the gap exceeds 10 % below <img src="https://latex.codecogs.com/png.latex?S_f%20=%2095.5"> and reaches a factor 1.83 at <img src="https://latex.codecogs.com/png.latex?S_f%20=%2020">.</p>
<p><strong>If you are checking a printed table:</strong> the constant-yield material balance is free, needs no kinetics and is sharp. Six of these seven rows sit on it at <img src="https://latex.codecogs.com/png.latex?R%5E2%20=%200.99996">; the seventh is the whole reason the all-seven fit reads 0.98505. A leave-one-out sweep says <em>which</em> row, not merely that one is off - and that distinction matters, because “the table has scatter” and “one cell is wrong” lead to different analyses. Then price the cell before quoting anything that depends on it: on this table, putting that one cell at its balance-implied value takes route A’s F from 12.27 to 5.45 and flips the only significance verdict the page could have reported.</p>
<p><strong>If you want the neighbouring physics:</strong> substrate inhibition - Froment’s eq. (1.5.2-4) and Rawlings’ <img src="https://latex.codecogs.com/png.latex?%5Cmu_m%20S/(K_s+S+K_1S%5E2)">, the form whose rate has a <em>maximum</em> where Monod has an asymptote - is case <strong>J4.2</strong>, and gets no quantitative treatment here. Williams’ structured model, eqs. (1.5.2-5) to (1.5.2-8) of the same section, is <strong>J4.9</strong>. The enzyme rate law Froment says Monod-kinetics are <em>“shaped after”</em> is <strong>J4.6</strong>, and the isotherm this page proves Monod identical to is <strong>J1.1</strong>.</p>
<p><strong>What NOT to reuse.</strong> <img src="https://latex.codecogs.com/png.latex?K_S"> from this page is in the units of a column whose units the source does not print, for an organism the source does not name, on a substrate identified only as lactose. It is a number about a table, not about a culture. And the seven rows are attributed by Levenspiel to Monod (1958) p.&nbsp;74; neither that book nor the 1949 paper this case catalogues was consulted, so do not cite them as either.</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier2</category>
  <category>phase:liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.1-monod/</guid>
  <pubDate>Thu, 13 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Michaelis-Menten and Briggs-Haldane: one rate law, two constants, and what data can decide between them</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.6-michaelis-menten-briggs-haldane/</link>
  <description><![CDATA[ 




<section id="michaelis-menten-and-briggs-haldane-one-rate-law-two-constants-and-what-data-can-decide-between-them" class="level1">
<h1>Michaelis-Menten and Briggs-Haldane: one rate law, two constants, and what data can decide between them</h1>
<p><strong>Catalog ID:</strong> <code>J4.6</code> · <strong>Structures:</strong> <code>S1</code> · <strong>Tier:</strong> T0</p>
<p>Section 1.5.1 of Froment, De Wilde &amp; Bischoff derives the enzyme rate law <strong>twice</strong>. The first route assumes the complex decomposition is rate determining, so the binding step reaches equilibrium; it ends at</p>
<p><img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20A%7D%20=%20r_%7B%5Crm%20P%7D%20=%20%5Cfrac%7Bk_2%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%5E0%7D%7BK_M%20+%20C_%7B%5Crm%20A%7D%7D,%0A%5Cqquad%20K_M%20=%20%5Cfrac%7Bk_%7B-1%7D%7D%7Bk_1%7D,%20%5Ctag%7B1.5.1-8%7D"></p>
<p>which the book’s next line names <em>“the Michaelis-Menten equation for the rate of a simple enzymatic reaction”</em>. The second route - <em>“formulated by Briggs and Haldane”</em> - assumes only that the complex is at a pseudo steady state, and ends at the identical expression with</p>
<p><img src="https://latex.codecogs.com/png.latex?K_M%20=%20%5Cfrac%7Bk_%7B-1%7D%20+%20k_2%7D%7Bk_1%7D.%20%5Ctag%7B1.5.1-14%7D"></p>
<p>Same functional form. Different constant. The ratio between them is <img src="https://latex.codecogs.com/png.latex?1%20+%20k_2/k_%7B-1%7D">, and nothing in the rate law bounds it.</p>
<p><strong>So what can an experiment settle?</strong> That is the question this page is for, and it has to be asked carefully, because the tempting answer - “fit a Michaelis-Menten curve, and if it fits, the mechanism is confirmed” - is wrong in both directions. The page answers it in three steps.</p>
<p><strong>One: no amount of steady-state rate data can separate the two readings.</strong> Write <img src="https://latex.codecogs.com/png.latex?%5Crho%20=%20k_2/k_%7B-1%7D">. <strong>The result is algebraic, and it is proved that way here</strong>: substituting the reparameterisation <img src="https://latex.codecogs.com/png.latex?k_2%20=%20r_m/C_%7B%5Crm%20E%7D%5E0">, <img src="https://latex.codecogs.com/png.latex?k_%7B-1%7D%20=%20k_2/%5Crho">, <img src="https://latex.codecogs.com/png.latex?k_1%20=%20(k_%7B-1%7D+k_2)/K_M"> into eq. (1.5.1-13) returns eq. (1.5.1-15) identically and <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20r/%5Cpartial%5Crho%20%5Cequiv%200">, in sympy, in the symbolic cell under <em>The published model</em>. The numerical sweep is a <em>check on the code</em>, not the finding: holding <img src="https://latex.codecogs.com/png.latex?r_m%20=%20k_2%20C_%7B%5Crm%20E%7D%5E0"> and <img src="https://latex.codecogs.com/png.latex?K_M%20=%20(k_%7B-1%7D+k_2)/k_1"> fixed and sweeping <img src="https://latex.codecogs.com/png.latex?%5Crho"> over <strong>eight decades</strong>, <img src="https://latex.codecogs.com/png.latex?r(C_%7B%5Crm%20A%7D)"> evaluated from the elementary constants is identical to double precision over four decades of concentration - <strong>maximum relative difference below 1e-14</strong> on the nine swept <img src="https://latex.codecogs.com/png.latex?%5Crho"> at <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0%20=%2010%5E%7B-3%7D"> (where it comes out exactly zero, because the floating-point round trip through the elementary constants happens to be exact for those values), and <strong>below 1e-14</strong> over 2000 random <img src="https://latex.codecogs.com/png.latex?(%5Crho,%20C_%7B%5Crm%20E%7D%5E0)"> draws, where that round trip is no longer exact and the difference is a few ulp. The exact zero is a property of those particular values; the <em>degeneracy</em> is a property of the algebra. The map from four elementary constants <img src="https://latex.codecogs.com/png.latex?(k_1,%20k_%7B-1%7D,%20k_2,%20C_%7B%5Crm%20E%7D%5E0)"> to the two observable ones <img src="https://latex.codecogs.com/png.latex?(r_m,%20K_M)"> has a <strong>two-dimensional fibre</strong>, and <img src="https://latex.codecogs.com/png.latex?%5Crho"> runs along it. Meanwhile <img src="https://latex.codecogs.com/png.latex?K_M%5E%7B%5Crm%20BH%7D/K_M%5E%7B%5Crm%20MM%7D%20=%201+%5Crho"> runs from 1.0001 to <img src="https://latex.codecogs.com/png.latex?10%5E4"> across that same sweep. The book says this itself, in one sentence on p.&nbsp;25 that is easy to read past: <em>“If, for more insight into the process, the rate coefficients <img src="https://latex.codecogs.com/png.latex?k_1">, <img src="https://latex.codecogs.com/png.latex?k_%7B-1%7D"> and <img src="https://latex.codecogs.com/png.latex?k_2"> of the elementary steps themselves are required, only transient experimentation (stopped flow, or relaxation …) can help.”</em></p>
<p><strong>Two: a batch transient does see <img src="https://latex.codecogs.com/png.latex?%5Crho"> - at order <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon">, and mostly where nobody is looking.</strong> With <img src="https://latex.codecogs.com/png.latex?(r_m,%20K_M,%20C_%7B%5Crm%20E%7D%5E0)"> fixed, the full mass-action solution <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D(t)"> moves across the same eight decades of <img src="https://latex.codecogs.com/png.latex?%5Crho"> by <img src="https://latex.codecogs.com/png.latex?0.977%5C,%5Cvarepsilon">, where <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%20C_%7B%5Crm%20E%7D%5E0/(c_%7B%5Crm%20A0%7D+K_M)"> - the group that organises the quasi-steady-state error, derived here rather than taken from anywhere. But <strong>that maximum sits at <img src="https://latex.codecogs.com/png.latex?t%20=%202.0%5Ctimes10%5E%7B-7%7D"> min, inside the induction layer</strong>, whose duration is <img src="https://latex.codecogs.com/png.latex?1/%5Bk_1(c_%7B%5Crm%20A0%7D+K_M)%5D"> and therefore differs by the same four decades: 2.1e-8 min at <img src="https://latex.codecogs.com/png.latex?%5Crho%20=%2010%5E%7B-4%7D"> against 2.1e-4 min at <img src="https://latex.codecogs.com/png.latex?%5Crho%20=%2010%5E%7B4%7D">. A uniform 181-point scan of the 18-minute run misses it by <strong>66 %</strong>, which is why the maximum here is root-found on a logarithmic scan and not sampled. <strong>Froment’s one sentence about stopped-flow and relaxation experiments is exactly right, and this is the number behind it.</strong></p>
<p>Over the window an experiment sampled like the source table can actually see - <img src="https://latex.codecogs.com/png.latex?t%20%5Cge%203"> min, its first sample after zero - what is left is a persistent offset of <img src="https://latex.codecogs.com/png.latex?0.242%5C,%5Cvarepsilon">. Root-found against that table’s 5e-4 cmol/L print resolution it needs <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%202.07%5Ctimes10%5E%7B-3%7D">, and even that holds every other constant fixed, which no real fit does. <strong>Let the other three float and the requirement moves to <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%205.80%5Ctimes10%5E%7B-2%7D"></strong> - at which loading the quasi-steady-state approximation, the thing that makes the rate law Michaelis-Menten in the first place, is already off by <strong>88.9 times the resolution at which the discrimination becomes possible.</strong> The regime where the two derivations differ observably in a slow measurement is the regime where neither of them is the right model.</p>
<p><strong>How much of that is compensation, measured like for like.</strong> The two <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon">’s above are <em>not</em> the same measurement, so the page decomposes the ratio between them instead of charging all of it to compensation. The first, <img src="https://latex.codecogs.com/png.latex?2.07%5Ctimes10%5E%7B-3%7D">, is a <strong>maximum over <img src="https://latex.codecogs.com/png.latex?t%5Cin%5B3,18%5D"> min</strong> of the <img src="https://latex.codecogs.com/png.latex?%5Crho">-spread; the second, <img src="https://latex.codecogs.com/png.latex?5.80%5Ctimes10%5E%7B-2%7D">, is an <strong>RMS over a 25-point grid starting at <img src="https://latex.codecogs.com/png.latex?t%20=%200"></strong> of a <em>refitted</em> misfit. Repeat the first measurement with the second’s statistic and grid, still with nothing free to compensate, and the threshold is <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%203.18%5Ctimes10%5E%7B-3%7D">. So of the raw factor <strong>28.0</strong> between the two printed numbers, <strong>1.54 is the change of statistic and window</strong> and only <strong>18.2 is the price of letting <img src="https://latex.codecogs.com/png.latex?r_m">, <img src="https://latex.codecogs.com/png.latex?K_M"> and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> compensate.</strong> 18.2 is the number this page means by the cost of compensation.</p>
<p><strong>Three: on the actual data, the elementary constants are not merely poorly determined - they are free.</strong> Rawlings &amp; Ekerdt’s Exercise 9.15 prints seven <img src="https://latex.codecogs.com/png.latex?c_%7B%5Crm%20S%7D">-versus-time points. They give <img src="https://latex.codecogs.com/png.latex?r_m%20=%200.162583"> cmol/L/min and <img src="https://latex.codecogs.com/png.latex?K_M%20=%200.503055"> cmol/L at 4.02e-3 RMS, against 3.90e-2 for the best first-order null - a real result, and the page’s only empirical one. Pin <img src="https://latex.codecogs.com/png.latex?%5Crho"> anywhere from <img src="https://latex.codecogs.com/png.latex?10%5E%7B-4%7D"> to <img src="https://latex.codecogs.com/png.latex?10%5E%7B4%7D">, let <img src="https://latex.codecogs.com/png.latex?r_m">, <img src="https://latex.codecogs.com/png.latex?K_M"> and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> re-optimise, and the achievable sum of squares changes by <strong>8.6 %</strong> across those eight decades, monotonically, with no interior optimum. Adding both elementary-step parameters to the two-parameter fit is not significant on any account: <strong>F = 1.90 against F(2,3) = 9.55 at 95 %</strong>.</p>
<p><strong>What this page therefore does NOT claim.</strong> It does not validate “the Michaelis-Menten mechanism”. It establishes that a two-parameter saturating rate law describes one seven-point batch run far better than three simple-order alternatives, and that this is compatible with <em>every</em> mechanism in a two-parameter family that includes both of the book’s derivations as end members. That is a much narrower claim than the name of the case suggests, and saying so is the point of the page.</p>
<p><strong>Two printed defects, reported and not repaired</strong>, both provable from the book’s own equations. On p.&nbsp;24: <em>“the rate levels off and becomes zero order with respect to the reactant, <img src="https://latex.codecogs.com/png.latex?r_A%20=%20k_1%20C_E%5E0">”</em> [sic] - but eq. (1.5.1-8)’s own limit is <img src="https://latex.codecogs.com/png.latex?k_2%20C_%7B%5Crm%20E%7D%5E0">, eq. (1.5.1-15) calls <img src="https://latex.codecogs.com/png.latex?k_2%20C_%7B%5Crm%20E%7D%5E0"> “the maximum possible rate”, the book’s Problem 2.4(b) on p.&nbsp;144 asks the student to <em>show</em> that limit, and <img src="https://latex.codecogs.com/png.latex?k_1%20C_%7B%5Crm%20E%7D%5E0"> has units of s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">, which a rate cannot have. On p.&nbsp;25: <em>“the Lineweaver-Burke plot of <img src="https://latex.codecogs.com/png.latex?1/r"> versus <img src="https://latex.codecogs.com/png.latex?C_A">”</em> [sic] - <img src="https://latex.codecogs.com/png.latex?1/r"> is exactly linear in <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D"> (below 1e-13 off a straight line) and strictly convex in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%5E2(1/r)/%5Cmathrm%7Bd%7DC_%7B%5Crm%20A%7D%5E2%20=%0A2K_M/(r_m%20C_%7B%5Crm%20A%7D%5E3)%20%3E%200">, missing the best <em>least-squares</em> line by 50.3 % of its own range over 0.05-1.0 cmol/L. <strong>That percentage is a convention and is reported as one</strong>: it is the deviation from the line that minimises a <em>log-weighted</em> square error on the interval, which is how the page samples and plots it; weight the interval uniformly instead and the same curve misses by 66.9 %. Neither number answers <em>“how close can a straight line get”</em>, because the statistic is a <strong>maximum</strong> and the line that minimises a maximum is the <strong>Chebyshev</strong> line, not any least-squares one. That floor is <strong>31.7 %</strong> - a straight line does come that close - and it needs no weighting convention at all: for a convex <img src="https://latex.codecogs.com/png.latex?A/C%20+%20B"> it is closed form, with three-point equioscillation as its optimality certificate. What is convention-free is the sign of the second derivative, and that is what settles the defect.</p>
<p><strong>Neither origin was consulted and neither is on disk.</strong> Michaelis &amp; Menten, <em>Biochem. Z.</em> <strong>49</strong>, 333-369 (1913) and Briggs &amp; Haldane, <em>Biochem. J.</em> <strong>19</strong>, 338-339 (1925) are the origins recorded in the gallery catalogue; this page was built entirely from the 2011 Froment, De Wilde &amp; Bischoff monograph, and says about the two 1913/1925 papers <strong>only what that book prints about them</strong> - which is two clauses and, as the page shows below, no citation at all.</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<section id="the-source-precisely" class="level3">
<h3 class="anchored" data-anchor-id="the-source-precisely">The source, precisely</h3>
<p><strong>Gilbert F. Froment, Juray De Wilde and Kenneth B. Bischoff, <em>Chemical Reactor Analysis and Design</em>, 3rd edition, John Wiley &amp; Sons (2011), ISBN 978-0-470-56541-4, Chapter 1 “Elements of Reaction Kinetics”, section 1.5 “Bio-kinetics”, subsection 1.5.1 “Enzymatic Kinetics”, book pp.&nbsp;23-26 (PDF pp.&nbsp;65-68), equations (1.5.1-1) to (1.5.1-15).</strong></p>
<p>Identified from the book’s own title page (“Chemical Reactor Analysis and Design / 3rd Edition / Gilbert F. Froment, Texas A&amp;M University / Kenneth B. Bischoff (deceased), University of Delaware / Juray De Wilde, Universite Catholique de Louvain, Belgium / John Wiley &amp; Sons”), its imprint page and its Library of Congress CIP record. <strong>The file’s name says “Froment_Bischoff”; the document is the THIRD edition and De Wilde is a full author.</strong> The file is born-digital with embedded TrueType subsets, so the text layer is clean - including equation numbers, Greek and sub/superscripts - and the only raster image in it is the 200 ppi cover JPEG.</p>
<p><strong>The text layer was still not trusted for the two lines this page’s defect findings rest on.</strong> Both were rendered at 300 ppi and cropped to the line: p. 24’s “<img src="https://latex.codecogs.com/png.latex?r_A%20=%20k_1C_E%5E0">” (the subscript is a <strong>1</strong>, upright, with no minus sign, and the line reads “…becomes zero order with respect to the reactant, <img src="https://latex.codecogs.com/png.latex?r_A%20=%20k_1C_E%5E0">. At low <img src="https://latex.codecogs.com/png.latex?C_A"> (1.5.1-8) degenerates into a first order rate equation”) and p.&nbsp;25’s “Lineweaver-Burke plot of <img src="https://latex.codecogs.com/png.latex?1/r"> versus <img src="https://latex.codecogs.com/png.latex?C_A">” (the argument is <img src="https://latex.codecogs.com/png.latex?C_A">, not <img src="https://latex.codecogs.com/png.latex?1/C_A">). The extractor also silently mangled eq. (1.5.1-17) on p.&nbsp;26 - it drops the leading “<img src="https://latex.codecogs.com/png.latex?=%20C_%7BA-E%7D%20+">” so that the equation reads as an identity for <img src="https://latex.codecogs.com/png.latex?C_%7BA-E%7D"> - which is a text-layer artefact, not a defect in the book; the render shows the equation is correct. That equation is outside this page’s scope in any case (see <em>Scope</em>).</p>
</section>
<section id="this-is-a-canonical-source-page-and-here-is-exactly-what-that-means" class="level3">
<h3 class="anchored" data-anchor-id="this-is-a-canonical-source-page-and-here-is-exactly-what-that-means">This is a canonical-source page, and here is exactly what that means</h3>
<p>The catalogue reference for <code>J4.6</code> is “(1913); (1925)”: Michaelis, L. &amp; Menten, M. L., <em>Die Kinetik der Invertinwirkung</em>, <strong>Biochemische Zeitschrift 49</strong>, 333-369 (1913), and Briggs, G. E. &amp; Haldane, J. B. S., <strong>Biochemical Journal 19</strong>, 338-339 (1925). <strong>Neither is on disk and neither was consulted.</strong> The page is built under the repository’s textbook-canonical-source rule: the model is read from a monograph that states, attributes and carries the result, the monograph is named everywhere, and the origins go in <code>reference</code> while the text actually read goes in <code>reference_read_from</code>.</p>
<p>The discipline that goes with that rule is <em>attribution</em>. <strong>Nothing on this page of the form “Michaelis and Menten showed / assumed / argued”, or “Briggs and Haldane objected”, appears anywhere</strong>, because no sentence of that form appears in the book. What the book prints about the origins is two clauses:</p>
<blockquote class="blockquote">
<p>“This is the Michaelis-Menten equation for the rate of a simple enzymatic reaction and <img src="https://latex.codecogs.com/png.latex?K_M%20=%20k_%7B-1%7D/k_1"> is known as the Michaelis-Menten constant.” (p.&nbsp;24)</p>
</blockquote>
<blockquote class="blockquote">
<p>“In the second approach, formulated by Briggs and Haldane, the formation of the complex A-E does not necessarily reach equilibrium, but its concentration is eliminated by applying the pseudo steady state approximation” (p.&nbsp;24)</p>
</blockquote>
<p>and, in Problem 2.4 on p.&nbsp;144, the compound name <em>“The Michaelis-Menten (Briggs-Haldane) mechanism”</em> - under which the book prints <img src="https://latex.codecogs.com/png.latex?K_m%20=%20(k_2+k_3)/k_1">, i.e.&nbsp;the <strong>Briggs-Haldane</strong> constant. The book treats the two as one mechanism, which is exactly why this case’s discriminating question is worth asking.</p>
<p><strong>The book prints no citation for either origin.</strong> That is a negative claim, so here is the search. (1) A case-insensitive full-text search of the book’s own text layer, all 902 PDF pages, for <code>michaelis|menten|briggs|haldane</code> returns <strong>fourteen lines</strong>, the same fourteen in all three <code>pdftotext</code> modes (default, <code>-layout</code>, <code>-raw</code>): <strong>five</strong> in sections 1.5.1-1.5.2 (PDF 66 x3, 67, 69), <strong>three</strong> in Problem 2.4 (PDF 186), <strong>three</strong> in later running text and problem sets (PDF 436, 494, 503 - the last citing “Bischoff [1966]”), and <strong>three</strong> in the Subject Index (PDF 899: the Michaelis-Menten constant, equation and kinetics). None is a bibliographic entry. The index’s fourth enzyme-related entry, “Lineweaver-Burke plot, 25”, does not match that search pattern and is not counted here. (2) The <strong>Chapter 1 REFERENCES list</strong> (book pp.&nbsp;58-59) was read in full at the alphabetical positions where the entries would fall - between “Boudart” and “Caddell” for Briggs, between “Mc Laughlin” and “McQuarrie”/“Monod” for Michaelis. Neither is there, <strong>although Graef &amp; Andrews [1973], Monod [1949] and Williams [1967] - the other named results of section 1.5 - all are.</strong> (3) The Subject Index (book p.&nbsp;857) carries page numbers only. So the two results this case is named for are the only named results in section 1.5 that the book attributes without citing. Everything this page says about 1913 and 1925 is bounded by the two clauses above.</p>
</section>
<section id="the-second-book-and-what-it-is-used-for" class="level3">
<h3 class="anchored" data-anchor-id="the-second-book-and-what-it-is-used-for">The second book, and what it is used for</h3>
<p><strong>Levenspiel, <em>Chemical Reaction Engineering</em>, 3rd edn (Wiley, 1999), Ch. 27, is NOT a second source for the derivation and is not adjudicated against Froment.</strong> It is cited here for two specific things, both of which this page uses:</p>
<ol type="1">
<li>p.&nbsp;615 prints the reciprocal plot’s axes as <em>“<img src="https://latex.codecogs.com/png.latex?1/(-r_%7B%5Crm%20A%7D)"> versus <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D"> … the Lineweaver plot”</em>, read on a 600 ppi native render. That is independent corroboration of the second printed defect - though the defect is settled by Froment’s own eq. (1.5.1-15), not by Levenspiel.</li>
<li>the same page states, of the reciprocal plots, that fitting <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> versus <img src="https://latex.codecogs.com/png.latex?%5Ctau"> directly <em>“is direct, is less prone to fiddling, and is more reliable”</em>. That is a testable claim and the page measures it on the one dataset it has.</li>
</ol>
</section>
<section id="where-this-sits-in-the-gallery" class="level3">
<h3 class="anchored" data-anchor-id="where-this-sits-in-the-gallery">Where this sits in the gallery</h3>
<p><code>J4.7</code> (immobilised enzyme particle) is this rate law inside a diffusion problem, which is <code>B1.1</code> with <img src="https://latex.codecogs.com/png.latex?r_m%20C/(K_M+C)"> substituted for the power law - the same <code>S3</code> machinery. <code>J4.8</code> (ASM1) and Monod growth are the microbial descendants; Froment’s own section 1.5.2 says so in as many words, calling Monod kinetics <em>“shaped after the Michaelis-Menten kinetics for enzymatic reactions”</em>. <code>C1.1</code> (Langmuir-Hinshelwood-Hougen-Watson) is the heterogeneous catalysis twin, and Froment says that too: eq. (1.5.1-8), he writes, <em>“is entirely similar to the Hougen-Watson rate equations that will be derived in Chapter 2”</em>. The identifiability result on this page is the same shape as <code>B2.3</code>’s degeneracy families and <code>C1.2</code>’s discrimination floor: a rate form that several mechanisms produce, and a measurement that cannot tell them apart.</p>
</section>
<section id="scope" class="level3">
<h3 class="anchored" data-anchor-id="scope">Scope</h3>
<p><strong>In:</strong> eqs. (1.5.1-1) to (1.5.1-15) - the scheme, both derivations, both constants, the saturating form and its half-max property. The batch integration of eq. (1.5.1-15), which the book does not print but which is what its own p.&nbsp;25 sentence about “the rigorous solution, which requires numerical methods” is about. Rawlings &amp; Ekerdt’s Exercise 9.15 table.</p>
<p><strong>Out:</strong> competitive inhibition, eqs. (1.5.1-16) to (1.5.1-18) - a different case; and all of section 1.5.2 (Monod, Graef-Andrews, Williams’ structured model), which belongs to <code>J4.9</code>/<code>J4.8</code>. No transport, no particle: this page is a well-mixed batch, structure <code>S1</code>.</p>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Every equation number below is the book’s. Symbols are the book’s: <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> is the reactant (substrate) concentration, <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D"> the free enzyme, <img src="https://latex.codecogs.com/png.latex?C_%7BA-E%7D"> the complex, <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> the total enzyme, <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0%20=%20C_%7B%5Crm%20E%7D%20+%20C_%7BA-E%7D">. Rates are positive by the book’s own convention (“a rate is positive; it is in the mass balance that the formation or disappearance leads to a quantity that is negative or positive”, p.&nbsp;23).</p>
<section id="the-scheme-and-the-three-mass-action-rates" class="level3">
<h3 class="anchored" data-anchor-id="the-scheme-and-the-three-mass-action-rates">The scheme and the three mass-action rates</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BA%7D%20+%20%5Cmathrm%7BE%7D%20%5C;%20%5Cunderset%7Bk_%7B-1%7D%7D%7B%5Coverset%7Bk_1%7D%7B%5Crightleftharpoons%7D%7D%20%5C;%0A%5Cmathrm%7BA%7D%5Ctext%7B-%7D%5Cmathrm%7BE%7D%20%5C;%20%5Coverset%7Bk_2%7D%7B%5Clongrightarrow%7D%20%5C;%20%5Cmathrm%7BE%7D%20+%20%5Cmathrm%7BP%7D%0A%5Ctag%7B1.5.1-1%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20A%7D%20=%20k_1%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%20-%20k_%7B-1%7D%20C_%7BA-E%7D%20%5Ctag%7B1.5.1-2%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20P%7D%20=%20k_2%20C_%7BA-E%7D%20%5Ctag%7B1.5.1-3%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7BA-E%7D%20=%20k_1%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%20-%20(k_%7B-1%7D%20+%20k_2)%20C_%7BA-E%7D%20%5Ctag%7B1.5.1-4%7D"></p>
</section>
<section id="route-1---decomposition-rate-determining-so-binding-equilibrates" class="level3">
<h3 class="anchored" data-anchor-id="route-1---decomposition-rate-determining-so-binding-equilibrates">Route 1 - decomposition rate determining, so binding equilibrates</h3>
<p><img src="https://latex.codecogs.com/png.latex?C_%7BA-E%7D%20=%20K%5C,%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D,%20%5Cquad%20K%20=%20k_1/k_%7B-1%7D%20%5Ctag%7B1.5.1-5%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20P%7D%20=%20k_2%20C_%7BA-E%7D%20=%20k_2%20K%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%20%5Ctag%7B1.5.1-6%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20P%7D%20=%20%5Cfrac%7Bk_2%20K%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%5E0%7D%7B1%20+%20K%20C_%7B%5Crm%20A%7D%7D%20%5Ctag%7B1.5.1-7%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20A%7D%20=%20r_%7B%5Crm%20P%7D%20=%20%5Cfrac%7Bk_2%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%5E0%7D%7BK_M%20+%20C_%7B%5Crm%20A%7D%7D,%0A%5Cqquad%20K_M%20=%20%5Cfrac%7Bk_%7B-1%7D%7D%7Bk_1%7D%20%5Ctag%7B1.5.1-8%7D"></p>
</section>
<section id="route-2---briggs-and-haldane-pseudo-steady-state-on-the-complex" class="level3">
<h3 class="anchored" data-anchor-id="route-2---briggs-and-haldane-pseudo-steady-state-on-the-complex">Route 2 - Briggs and Haldane: pseudo steady state on the complex</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7DC_%7BA-E%7D%7D%7B%5Cmathrm%7Bd%7Dt%7D%20=%200%20%5Ctag%7B1.5.1-9%7D"> <img src="https://latex.codecogs.com/png.latex?C_%7BA-E%7D%20=%20%5Cfrac%7Bk_1%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%7D%7Bk_%7B-1%7D+k_2%7D%20%5Ctag%7B1.5.1-10%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20A%7D%20=%20k_1%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%5Cleft(1%20-%20%5Cfrac%7Bk_%7B-1%7D%7D%7Bk_%7B-1%7D+k_2%7D%5Cright)%20%5Ctag%7B1.5.1-11%7D"> <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%20=%20%5Cfrac%7BC_%7B%5Crm%20E%7D%5E0%7D%7B1%20+%20%5Cdfrac%7Bk_1%20C_%7B%5Crm%20A%7D%7D%7Bk_%7B-1%7D+k_2%7D%7D%20%5Ctag%7B1.5.1-12%7D"> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20A%7D%20=%20r_%7B%5Crm%20P%7D%20=%20%5Cfrac%7Bk_2%20C_%7B%5Crm%20A%7D%20C_%7B%5Crm%20E%7D%5E0%7D%7BK_M%20+%20C_%7B%5Crm%20A%7D%7D,%0A%5Cqquad%20K_M%20=%20%5Cfrac%7Bk_%7B-1%7D+k_2%7D%7Bk_1%7D%20%5Ctag%7B1.5.1-13%7D,(1.5.1-14)"></p>
</section>
<section id="the-common-form" class="level3">
<h3 class="anchored" data-anchor-id="the-common-form">The common form</h3>
<p><img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20A%7D%20=%20%5Cfrac%7Br_m%20C_%7B%5Crm%20A%7D%7D%7BK_M%20+%20C_%7B%5Crm%20A%7D%7D,%20%5Cqquad%20r_m%20=%20k_2%20C_%7B%5Crm%20E%7D%5E0%0A%5Ctag%7B1.5.1-15%7D"></p>
<p><em>“where <img src="https://latex.codecogs.com/png.latex?r_m%20=%20k_2%20C_E%5E0"> is the maximum possible rate. The rate reaches half this maximum value when <img src="https://latex.codecogs.com/png.latex?C_A"> equals <img src="https://latex.codecogs.com/png.latex?K_M">.”</em></p>
<p>The first cell below closes this chain symbolically: ten identities, each one re-deriving a numbered equation from the numbered equations the book derives it from. These are <strong>identities, not agreement</strong> - what they protect is the transcription and the reading of the two routes, and they are labelled structural in the coverage map.</p>
<div id="d2d50cb8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:48.858223Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:48.858072Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:49.287385Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:49.286308Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Colab bootstrap</span></span>
<span id="cb1-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-3">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb1-5">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm</span>
<span id="cb1-6">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm"</span>, pymrm.__version__)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm 3.2.0</code></pre>
</div>
</div>
<div id="c227f049" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:49.289822Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:49.289333Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:50.187739Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:50.186394Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys, json</span>
<span id="cb3-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb3-3"></span>
<span id="cb3-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb3-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb3-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb3-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb3-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_ivp</span>
<span id="cb3-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> least_squares, brentq, minimize_scalar</span>
<span id="cb3-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.special <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> lambertw</span>
<span id="cb3-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.stats <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> f <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> f_dist</span>
<span id="cb3-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> identity <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> speye</span>
<span id="cb3-13"></span>
<span id="cb3-14"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> NumJac, newton</span>
<span id="cb3-15"></span>
<span id="cb3-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># gallery_utils: from the checkout when there is one, from raw GitHub on Colab</span></span>
<span id="cb3-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb3-18">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb3-19">    urllib.request.urlretrieve(</span>
<span id="cb3-20">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb3-21">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb3-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb3-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents):</span>
<span id="cb3-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb3-25">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))</span>
<span id="cb3-26">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb3-27"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, Claims, parse_literal</span>
<span id="cb3-28"></span>
<span id="cb3-29">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.6-michaelis-menten-briggs-haldane"</span></span>
<span id="cb3-30">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb3-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, assigned in fixed order and never cycled</span></span>
<span id="cb3-32">C_BLUE, C_ORANGE, C_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span></span>
<span id="cb3-33">C_PURPLE, C_YELLOW, C_GREY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span></span>
<span id="cb3-34">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb3-35"></span>
<span id="cb3-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># DETERMINISM: two consecutive executions must give identical content.</span></span>
<span id="cb3-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (i) ipykernel flushes stdout on a timer, so a cell that prints and then</span></span>
<span id="cb3-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     computes for seconds gets split into a different number of stream outputs</span></span>
<span id="cb3-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     each run. Batch the whole cell into one message instead.</span></span>
<span id="cb3-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (ii) a pandas Styler's text/plain repr is a MEMORY ADDRESS and its HTML</span></span>
<span id="cb3-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      carries a random CSS id prefix, so Stylers are rendered through</span></span>
<span id="cb3-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#      HTML(...to_html()) with a pinned uuid, never displayed directly.</span></span>
<span id="cb3-43"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb3-44">    sys.stdout.flush_interval <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span></span>
<span id="cb3-45"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>:</span>
<span id="cb3-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">pass</span></span>
<span id="cb3-47"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> HTML, display</span>
<span id="cb3-48"></span>
<span id="cb3-49"></span>
<span id="cb3-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> show(styler):</span>
<span id="cb3-51">    display(HTML(styler.to_html()))</span>
<span id="cb3-52"></span>
<span id="cb3-53"></span>
<span id="cb3-54">M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -&gt; agreement.json</span></span>
<span id="cb3-55">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect-injection table</span></span>
<span id="cb3-56">RES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-4</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># half-ulp of the source table's three printed decimals, cmol/L</span></span>
<span id="cb3-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"setup done"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>setup done</code></pre>
</div>
</div>
<div id="c0f2731d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:50.191005Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:50.190678Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:50.424281Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:50.423209Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- ten identities closing Froment's printed chain, eqs. (1.5.1-2)..(1.5.1-15)</span></span>
<span id="cb5-2">k1, km1, k2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k1 k_m1 k2"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-3">CA, CE, CAE, CE0s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_A C_E C_AE C_E0"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-4">rm_s, KM_s, uu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_m K_M u"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-5"></span>
<span id="cb5-6">rA_2   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> km1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CAE                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-2)</span></span>
<span id="cb5-7">rP_3   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CAE                                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-3)</span></span>
<span id="cb5-8">rAE_4  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (km1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CAE                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-4)</span></span>
<span id="cb5-9">CAE_5  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>km1)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE                                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-5), K = k1/k-1</span></span>
<span id="cb5-10">rP_7   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>km1)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>km1)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA)               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-7)</span></span>
<span id="cb5-11">rA_8   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(km1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>k1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> CA)                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-8), K_M = k-1/k1</span></span>
<span id="cb5-12">CAE_10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(km1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k2)                                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-10)</span></span>
<span id="cb5-13">rA_11  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> km1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(km1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k2))                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-11)</span></span>
<span id="cb5-14">CE_12  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CE0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(km1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k2))                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-12)</span></span>
<span id="cb5-15">rA_13  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE0s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((km1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>k1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> CA)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-13)+(1.5.1-14)</span></span>
<span id="cb5-16">r_15   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KM_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> CA)                                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-15)</span></span>
<span id="cb5-17"></span>
<span id="cb5-18">SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb5-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-4) = (1.5.1-2) - (1.5.1-3)"</span>:</span>
<span id="cb5-20">        rAE_4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (rA_2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rP_3),</span>
<span id="cb5-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-7) from (5), (6) and C_E0 = C_E + C_A-E"</span>:</span>
<span id="cb5-22">        k2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.solve(sp.Eq(CAE, CAE_5.subs(CE, CE0s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAE)), CAE)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rP_7,</span>
<span id="cb5-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-8) = (1.5.1-7) with K_M = k_-1/k_1"</span>:</span>
<span id="cb5-24">        rP_7 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rA_8,</span>
<span id="cb5-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-10) from (1.5.1-4) = 0, i.e. (1.5.1-9)"</span>:</span>
<span id="cb5-26">        sp.solve(sp.Eq(rAE_4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), CAE)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CAE_10,</span>
<span id="cb5-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-11) from (1.5.1-2) and (1.5.1-10)"</span>:</span>
<span id="cb5-28">        rA_2.subs(CAE, CAE_10) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rA_11,</span>
<span id="cb5-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-12) from C_E0 = C_E + C_A-E and (1.5.1-10)"</span>:</span>
<span id="cb5-30">        sp.solve(sp.Eq(CE0s, CE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> CAE_10), CE)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CE_12,</span>
<span id="cb5-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-13)+(1.5.1-14) from (1.5.1-11) and (1.5.1-12)"</span>:</span>
<span id="cb5-32">        rA_11.subs(CE, CE_12) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rA_13,</span>
<span id="cb5-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-8) is the k_2 -&gt; 0 limit of (1.5.1-13)"</span>:</span>
<span id="cb5-34">        sp.limit(rA_13, k2, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.limit(rA_8, k2, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb5-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1.5.1-15) is exactly r_m/2 at C_A = K_M"</span>:</span>
<span id="cb5-36">        r_15.subs(CA, KM_s) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rm_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb5-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/r is exactly linear in u = 1/C_A"</span>:</span>
<span id="cb5-38">        sp.diff((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_15).subs(CA, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>uu), uu, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb5-39">}</span>
<span id="cb5-40">SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: sp.simplify(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SYM.items()}</span>
<span id="cb5-41"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SYM.items():</span>
<span id="cb5-42">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-43"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SYM.values())</span>
<span id="cb5-44">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_symbolic_max_residual"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb5-45">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_identities_verified"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SYM))</span>
<span id="cb5-46"></span>
<span id="cb5-47">CURV  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_15, CA, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb5-48">LIM8  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.limit(rA_8, CA, sp.oo)</span>
<span id="cb5-49">LIM13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.limit(rA_13, CA, sp.oo)</span>
<span id="cb5-50">KMRAT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(((km1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>k1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (km1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>k1))</span>
<span id="cb5-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb5-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  d2(1/r)/dC_A^2                      ="</span>, CURV, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (&gt; 0 for K_M &gt; 0)"</span>)</span>
<span id="cb5-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  lim_{C_A -&gt; oo} of (1.5.1-8)        ="</span>, LIM8)</span>
<span id="cb5-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  lim_{C_A -&gt; oo} of (1.5.1-13)       ="</span>, LIM13)</span>
<span id="cb5-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  K_M(Briggs-Haldane)/K_M(Michaelis-Menten) ="</span>, KMRAT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"= 1 + k2/k_-1"</span>)</span>
<span id="cb5-56"></span>
<span id="cb5-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- THE DEGENERACY, PROVED rather than sampled. This is the page's central</span></span>
<span id="cb5-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># structural result; a grid can only *check* it.</span></span>
<span id="cb5-59">rho_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-60">REPARAM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k2: rm_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CE0s, km1: (rm_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CE0s)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rho_s,</span>
<span id="cb5-61">           k1: ((rm_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CE0s)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rho_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rm_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CE0s)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KM_s}</span>
<span id="cb5-62">rA_13_rep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(rA_13.subs(REPARAM, simultaneous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>))</span>
<span id="cb5-63">DEG_SAME  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(rA_13_rep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_15)</span>
<span id="cb5-64">DEG_DRHO  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(rA_13_rep, rho_s))</span>
<span id="cb5-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> DEG_SAME <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> DEG_DRHO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb5-66">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_degeneracy_symbolic_residual"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.Abs(DEG_DRHO))</span>
<span id="cb5-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb5-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  SYMBOLIC PROOF of the rho-degeneracy (not a sweep):"</span>)</span>
<span id="cb5-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    (1.5.1-13) under k2 = r_m/C_E0, k_-1 = k2/rho, k1 = (k_-1+k2)/K_M"</span>)</span>
<span id="cb5-70"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"      ="</span>, rA_13_rep, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" = eq. (1.5.1-15), independent of rho"</span>)</span>
<span id="cb5-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    d/drho of that expression ="</span>, DEG_DRHO, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" identically"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  True   (1.5.1-4) = (1.5.1-2) - (1.5.1-3)
  True   (1.5.1-7) from (5), (6) and C_E0 = C_E + C_A-E
  True   (1.5.1-8) = (1.5.1-7) with K_M = k_-1/k_1
  True   (1.5.1-10) from (1.5.1-4) = 0, i.e. (1.5.1-9)
  True   (1.5.1-11) from (1.5.1-2) and (1.5.1-10)
  True   (1.5.1-12) from C_E0 = C_E + C_A-E and (1.5.1-10)
  True   (1.5.1-13)+(1.5.1-14) from (1.5.1-11) and (1.5.1-12)
  True   (1.5.1-8) is the k_2 -&gt; 0 limit of (1.5.1-13)
  True   (1.5.1-15) is exactly r_m/2 at C_A = K_M
  True   1/r is exactly linear in u = 1/C_A

  d2(1/r)/dC_A^2                      = 2*K_M/(C_A**3*r_m)  (&gt; 0 for K_M &gt; 0)
  lim_{C_A -&gt; oo} of (1.5.1-8)        = C_E0*k2
  lim_{C_A -&gt; oo} of (1.5.1-13)       = C_E0*k2
  K_M(Briggs-Haldane)/K_M(Michaelis-Menten) = (k2 + k_m1)/k_m1 = 1 + k2/k_-1

  SYMBOLIC PROOF of the rho-degeneracy (not a sweep):
    (1.5.1-13) under k2 = r_m/C_E0, k_-1 = k2/rho, k1 = (k_-1+k2)/K_M
      = C_A*r_m/(C_A + K_M)  = eq. (1.5.1-15), independent of rho
    d/drho of that expression = 0  identically</code></pre>
</div>
</div>
<p><strong>The two printed defects, from the book’s own equations.</strong></p>
<p><em>Defect 1, p.&nbsp;24, quoted verbatim:</em> “At high reactant concentration (<img src="https://latex.codecogs.com/png.latex?C_A"> much larger than <img src="https://latex.codecogs.com/png.latex?K_M">), the rate levels off and becomes zero order with respect to the reactant, <img src="https://latex.codecogs.com/png.latex?r_A%20=%20k_1C_E%5E0">.” [sic]</p>
<p>The cell above prints the limit of the book’s own eq. (1.5.1-8) as <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D%5Cto%5Cinfty">: it is <img src="https://latex.codecogs.com/png.latex?k_2%20C_%7B%5Crm%20E%7D%5E0">, and so is the limit of eq. (1.5.1-13). Two more of the book’s own statements agree: eq. (1.5.1-15) introduces <img src="https://latex.codecogs.com/png.latex?r_m%20=%20k_2%20C_%7B%5Crm%20E%7D%5E0"> as <em>“the maximum possible rate”</em>, and Problem 2.4(b) on p.&nbsp;144 instructs the student to <em>“Show that the maximum initial rate is given by <img src="https://latex.codecogs.com/png.latex?-%5Cmathrm%7Bd%7D%5BS%5D/%5Cmathrm%7Bd%7Dt%7C_%7Bmax%7D%20=%20k_3%5BE_0%5D">”</em>, where that problem’s <img src="https://latex.codecogs.com/png.latex?k_3"> is section 1.5.1’s <img src="https://latex.codecogs.com/png.latex?k_2">. And the printed expression is <strong>dimensionally impossible</strong>: <img src="https://latex.codecogs.com/png.latex?k_1"> is a second-order coefficient (m<img src="https://latex.codecogs.com/png.latex?%5E3"> mol<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"> s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">), so <img src="https://latex.codecogs.com/png.latex?k_1%20C_%7B%5Crm%20E%7D%5E0"> has units of s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">, where a rate needs mol m<img src="https://latex.codecogs.com/png.latex?%5E%7B-3%7D"> s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">. Reported, not repaired; the transcription CSV carries the printed form.</p>
<p><em>Defect 2, p.&nbsp;25, quoted verbatim:</em> “One example is the Lineweaver-Burke plot of <img src="https://latex.codecogs.com/png.latex?1/r"> versus <img src="https://latex.codecogs.com/png.latex?C_A">.” [sic]</p>
<p><img src="https://latex.codecogs.com/png.latex?1/r%20=%20(K_M/r_m)(1/C_%7B%5Crm%20A%7D)%20+%201/r_m"> is exactly affine in <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D"> - the cell above verifies <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%5E2(1/r)/%5Cmathrm%7Bd%7Du%5E2%20=%200"> identically in <img src="https://latex.codecogs.com/png.latex?u%20=%201/C_%7B%5Crm%20A%7D"> - while in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> it is strictly convex, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%5E2(1/r)/%5Cmathrm%7Bd%7DC_%7B%5Crm%20A%7D%5E2%20=%202K_M/(r_m%20C_%7B%5Crm%20A%7D%5E3)%20%3E%200">. The next-but-one cell measures how far from a straight line that is on the fitted constants. Levenspiel p.&nbsp;615 prints the same plot with <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D"> on the abscissa. <strong>He prints no surname at all</strong>: his line reads <em>“<img src="https://latex.codecogs.com/png.latex?1/(-r_%7B%5Crm%20A%7D)"> versus <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D"> … the Lineweaver plot”</em>, read on a 600 ppi native render, and the string “Burk” does not occur anywhere in that book (case-insensitive full-text search of all 684 PDF pages, in all three <code>pdftotext</code> modes: two hits for “Lineweaver”, p.&nbsp;615 and the index; none for “Burk”). Froment prints “Lineweaver-Burke”. Reported, not repaired - and nothing on this page turns on the spelling.</p>
<p><strong>A defect this page does NOT report.</strong> Extracting eq. (1.5.1-17) on p.&nbsp;26 from the text layer produces “<img src="https://latex.codecogs.com/png.latex?C_%7BA-E%7D%20=%20(k_3%20C_I/k_%7B-3%7D%20+%201)C_E">”, which is wrong. The 300 ppi render shows the printed equation is “<img src="https://latex.codecogs.com/png.latex?=%20C_%7BA-E%7D%20+%20(k_3%20C_I/k_%7B-3%7D%20+%201)C_E">” and is correct: the extractor dropped the leading term. Recorded here because it is exactly the failure mode the repository warns about - a clean, born-digital text layer is still not a page.</p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p>There are no physical constants to transcribe: section 1.5.1 prints <strong>no numbers at all</strong>, no worked example and no table. Everything numeric on this page is one of three things, and each is labelled wherever it appears.</p>
<ol type="1">
<li><strong>Fitted</strong> to the seven-point table of Rawlings &amp; Ekerdt Exercise 9.15: <img src="https://latex.codecogs.com/png.latex?r_m"> and <img src="https://latex.codecogs.com/png.latex?K_M"> (equivalently their <img src="https://latex.codecogs.com/png.latex?k"> and <img src="https://latex.codecogs.com/png.latex?K">). The agreement between the Michaelis-Menten curve and those seven points is therefore a <strong>goodness of fit</strong>, not a test, and a null baseline is computed beside it.</li>
<li><strong>Structural</strong> - exact algebraic properties of the printed equations (the ten identities, the degeneracy, the convexity of <img src="https://latex.codecogs.com/png.latex?1/r"> in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D">). These cannot fail for the right reason and are named as such.</li>
<li><strong>Computed properties</strong> of the printed model: the cost of each reduction against the full mass-action solution, and the enzyme loading an experiment would need before <img src="https://latex.codecogs.com/png.latex?%5Crho%20=%20k_2/k_%7B-1%7D"> leaves a trace.</li>
</ol>
<section id="the-two-dimensionless-groups" class="level3">
<h3 class="anchored" data-anchor-id="the-two-dimensionless-groups">The two dimensionless groups</h3>
<p>Both are defined here, not taken from anywhere:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cequiv%20%5Cfrac%7Bk_2%7D%7Bk_%7B-1%7D%7D,%20%5Cqquad%0A%5Cvarepsilon%20%5Cequiv%20%5Cfrac%7BC_%7B%5Crm%20E%7D%5E0%7D%7Bc_%7B%5Crm%20A0%7D%20+%20K_M%7D."></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Crho"> is the whole difference between the two derivations: <img src="https://latex.codecogs.com/png.latex?K_M%5E%7B%5Crm%20BH%7D%20=%20(1+%5Crho)%5C,K_M%5E%7B%5Crm%20MM%7D">. <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> is the group that the quasi-steady-state error actually scales with - the page establishes that by sweeping <img src="https://latex.codecogs.com/png.latex?K_M"> over three decades at <strong>fixed</strong> <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0/c_%7B%5Crm%20A0%7D"> and watching which of the two candidate groups collapses the error. Froment’s own printed criterion compares <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> with the substrate alone (“in particular if the enzyme concentration is relatively large compared to that of the substrate”), which is the <img src="https://latex.codecogs.com/png.latex?K_M%20%5Cll%20c_%7B%5Crm%20A0%7D"> corner of <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> and is right there; the <img src="https://latex.codecogs.com/png.latex?K_M"> dependence is the part this page adds.</p>
</section>
<section id="the-reparameterisation-used-throughout" class="level3">
<h3 class="anchored" data-anchor-id="the-reparameterisation-used-throughout">The reparameterisation used throughout</h3>
<p>Given <img src="https://latex.codecogs.com/png.latex?(r_m,%20K_M,%20C_%7B%5Crm%20E%7D%5E0,%20%5Crho)"> the elementary constants follow uniquely:</p>
<p><img src="https://latex.codecogs.com/png.latex?k_2%20=%20%5Cfrac%7Br_m%7D%7BC_%7B%5Crm%20E%7D%5E0%7D,%20%5Cqquad%20k_%7B-1%7D%20=%20%5Cfrac%7Bk_2%7D%7B%5Crho%7D,%20%5Cqquad%0Ak_1%20=%20%5Cfrac%7Bk_%7B-1%7D+k_2%7D%7BK_M%7D."></p>
<p>This is a bijection onto the four-parameter mass-action model, so sweeping <img src="https://latex.codecogs.com/png.latex?%5Crho"> at fixed <img src="https://latex.codecogs.com/png.latex?(r_m,%20K_M,%20C_%7B%5Crm%20E%7D%5E0)"> walks along the fibre of the observable map without changing anything a steady-state rate measurement can see. Route 1’s constant is then <img src="https://latex.codecogs.com/png.latex?K_M%5E%7B%5Crm%20MM%7D%20=%20k_%7B-1%7D/k_1%20=%20K_M/(1+%5Crho)">.</p>
</section>
<section id="assumptions-inherited-from-the-book-stated" class="level3">
<h3 class="anchored" data-anchor-id="assumptions-inherited-from-the-book-stated">Assumptions inherited from the book, stated</h3>
<ul>
<li>Isothermal, well mixed, constant volume, batch: structure <code>S1</code>.</li>
<li>Product formation is irreversible (<img src="https://latex.codecogs.com/png.latex?k_2"> has no reverse). The book’s eq. (1.5.1-1) prints a single arrow, and so does the page. Note that Problem 2.4 in Chapter 2 does <em>not</em>: it derives a reversible form with a <img src="https://latex.codecogs.com/png.latex?%5BP%5D/K"> term. That is a different (larger) model and is out of scope.</li>
<li>Free enzyme and complex are the only enzyme species: <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0%20=%0AC_%7B%5Crm%20E%7D%20+%20C_%7BA-E%7D">, the book’s own balance.</li>
<li>No inhibitor (<img src="https://latex.codecogs.com/png.latex?C_I%20=%200">), which is what takes eqs. (1.5.1-16)-(1.5.1-18) out of scope.</li>
</ul>
</section>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Section 1.5.1 publishes none, so the empirical half of this page comes from a <strong>different book</strong>: Rawlings &amp; Ekerdt, <em>Chemical Reactor Analysis and Design Fundamentals</em>, 2nd edn (Nob Hill, 2025 printing), <strong>Exercise 9.15 “Parameters of Michaelis-Menten kinetics”</strong>, which prints seven <img src="https://latex.codecogs.com/png.latex?c_%7B%5Crm%20S%7D">-versus-time pairs. That book is a <strong>data source here and nothing else</strong> - the derivation, the attribution and both constants come from Froment, and no derivation is adjudicated between the two.</p>
<p><strong>Provenance: unstated, and the page says so everywhere.</strong> The exercise introduces the table with one sentence - <em>“The following measurements of cS versus time were taken in your laboratory.”</em> - and gives no citation, no enzyme, no enzyme loading, no temperature, no pH and no solvent. The whole exercise was read and the book’s bibliography searched; there is no reference attached to these numbers. “Taken in your laboratory” is a textbook framing addressed to a student, not a provenance claim, so <strong>this page does not call the table a laboratory record.</strong> Two things it <em>can</em> establish about it are computed below: the residual is far above the print resolution, so the table is not an exactly-rounded evaluation of the model it is set to fit; and the fitted constants land within a fraction of a percent of round values, which is consistent with - not proof of - a synthetic table.</p>
<p><strong><img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> is not printed</strong>, and for this case that is not a detail. Since <img src="https://latex.codecogs.com/png.latex?r_m%20=%20k_2%20C_%7B%5Crm%20E%7D%5E0">, no fit can separate <img src="https://latex.codecogs.com/png.latex?k_2"> from the enzyme loading; and <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon">, the group that decides whether the quasi-steady-state approximation holds for <em>this</em> run, cannot be evaluated at all. Every <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> on this page is therefore a property of a <em>designed</em> experiment, never of Exercise 9.15’s.</p>
<p>The exercise’s own hint - <em>“consider the transformation <img src="https://latex.codecogs.com/png.latex?1/r"> and formulate a linear least-squares problem that you can solve on a calculator”</em> - is the Lineweaver construction, and the page runs it as instructed alongside the direct fit, because that comparison is the one Levenspiel p.&nbsp;615 makes a claim about.</p>
<div id="89248a25" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:50.426737Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:50.426527Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:50.452274Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:50.451223Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">DATA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings-ekerdt-ex9.15-batch.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb7-2">DMETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rawlings-ekerdt-ex9.15-batch.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb7-3">PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-1.5.1-printed.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb7-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(DMETA))</span>
<span id="cb7-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-1.5.1-printed.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb7-6">t_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DATA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t_min"</span>].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb7-7">c_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DATA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_S_cmol_per_L"</span>].to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb7-8">cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb7-9">display(DATA)</span>
<span id="cb7-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t_d)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points, t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">..</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t_d[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min, "</span></span>
<span id="cb7-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"c_S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">..</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L"</span>)</span>
<span id="cb7-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"conversion reached: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb7-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb7-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"provenance, from the dataset sidecar:"</span>)</span>
<span id="cb7-15">_pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(DMETA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"notes"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PROVENANCE_IS_NOT_STATED"</span>].split())</span>
<span id="cb7-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _pv[:_pv.index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"So the table CANNOT"</span>)].strip())</span>
<span id="cb7-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb7-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed equations/quotes transcribed from Froment 1.5.1: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PRINTED)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb7-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  the two rows flagged as printed defects:"</span>)</span>
<span id="cb7-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PRINTED[PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"note"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PRINTED DEFECT"</span>)].iterrows():</span>
<span id="cb7-21">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    p.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'key'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Rawlings, J. B.; Ekerdt, J. G. (2025) — Chemical Reactor Analysis and Design Fundamentals, 2nd edition, Nob Hill Publishing (5th printing), Exercise 9.15 — table
Froment, G. F.; De Wilde, J.; Bischoff, K. B. (2011) — Chemical Reactor Analysis and Design, 3rd edition, John Wiley &amp; Sons, section 1.5.1 'Enzymatic Kinetics', book pp. 23-26 — table</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">t_min</th>
<th data-quarto-table-cell-role="th">c_S_cmol_per_L</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>0.0</td>
<td>0.978</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>3.0</td>
<td>0.671</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>6.0</td>
<td>0.423</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>9.0</td>
<td>0.241</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>12.0</td>
<td>0.110</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>15.0</td>
<td>0.049</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>18.0</td>
<td>0.014</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>7 points, t = 0..18 min, c_S = 0.014..0.978 cmol/L
conversion reached: 98.57 %

provenance, from the dataset sidecar:
  THIS IS THE ONE THING A USER OF THIS FILE MUST KNOW. The exercise introduces the table with a single sentence - "The following measurements of cS versus time were taken in your laboratory." - and gives no citation, no enzyme, no enzyme loading, no temperature, no pH and no solvent. The whole of Exercise 9.15 was read (it runs from the reaction scheme through the hint) and the book's bibliography was searched for an enzyme-kinetics entry; there is no reference attached to these numbers. "Taken in your laboratory" is a textbook framing addressed to the student, not a provenance claim.

printed equations/quotes transcribed from Froment 1.5.1: 24
  the two rows flagged as printed defects:
    p.24 [p24_zero_order]  At high reactant concentration (CA much larger than KM), the rate levels off and becomes zero order with respect to the reactant, rA = k1CE0.
    p.25 [p25_lineweaver]  One example is the Lineweaver-Burke plot of 1/r versus CA.</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Structure <code>S1</code>: an initial-value problem in time, in a single well-mixed cell. The pymrm way to march one is <strong>backward Euler with <code>newton</code>, and <code>NumJac</code> for the pointwise reaction Jacobian</strong> - which is what the two classes below do. Three models are needed, and keeping them separate is the point of the page:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>model</th>
<th>state</th>
<th>what it is</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>BatchMassAction</code></td>
<td><img src="https://latex.codecogs.com/png.latex?(C_%7B%5Crm%20A%7D,%20C_%7B%5Crm%20E%7D,%20C_%7BA-E%7D,%20C_%7B%5Crm%20P%7D)">, shape <code>(1, 4)</code></td>
<td>the scheme (1.5.1-1) with <strong>no</strong> approximation - the reference the two reductions are priced against</td>
</tr>
<tr class="even">
<td><code>BatchReduced</code></td>
<td><img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D">, shape <code>(1, 1)</code></td>
<td>eq. (1.5.1-15) marched in time</td>
</tr>
<tr class="odd">
<td><code>s_closed</code></td>
<td>-</td>
<td>the closed-form integral of eq. (1.5.1-15), <img src="https://latex.codecogs.com/png.latex?K_M%5Cln(c_%7BA0%7D/C_%7B%5Crm%20A%7D)%20+%20(c_%7BA0%7D-C_%7B%5Crm%20A%7D)%20=%20r_m%20t">, inverted with Lambert <img src="https://latex.codecogs.com/png.latex?W"></td>
</tr>
</tbody>
</table>
<p>Two <code>NumJac</code> details that matter and are easy to get wrong:</p>
<ul>
<li><strong><code>NumJac((1, 4))</code>, never <code>NumJac((4,))</code>.</strong> The default stencil couples the <em>last</em> axis in full, which is exactly right when the last axis is the field index and the source term is pointwise. Passing a bare 1-D shape would make space the last axis and build a dense Jacobian.</li>
<li><strong>No <code>axes_diagonals</code>.</strong> The source term here reads only its own cell; there is no spatial coupling at all in a batch.</li>
</ul>
<p>The reference solution for the mass-action system is <code>scipy</code>’s <code>Radau</code> with an analytic Jacobian; <code>LSODA</code> with the same Jacobian is used for the sweeps because it is ~20x faster on this stiff system, and the two are compared. The Lambert <img src="https://latex.codecogs.com/png.latex?W"> closed form and the pymrm marcher are two independent computations of the same reduced model, and the fit is done through <strong>both</strong>.</p>
<div id="f490e771" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:50.454461Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:50.454303Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:50.468503Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:50.467470Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------ the three models</span></span>
<span id="cb10-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> s_closed(t, s0, rm, KM):</span>
<span id="cb10-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Exact integral of (1.5.1-15): K_M ln(s0/s) + (s0-s) = r_m t, via Lambert W."""</span></span>
<span id="cb10-4">    z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (s0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KM)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp((s0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.asarray(t, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KM)</span>
<span id="cb10-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> KM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.real(lambertw(z, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb10-6"></span>
<span id="cb10-7"></span>
<span id="cb10-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> elem(rho, CE0, rm, KM):</span>
<span id="cb10-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(k1, k_-1, k2) from (rho, C_E0, r_m, K_M). Bijective; see Parameters."""</span></span>
<span id="cb10-10">    kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CE0</span>
<span id="cb10-11">    kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rho</span>
<span id="cb10-12">    kf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KM</span>
<span id="cb10-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kf, kr, kc</span>
<span id="cb10-14"></span>
<span id="cb10-15"></span>
<span id="cb10-16"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mass_action(p, CE0, te, a0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA"</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>,</span>
<span id="cb10-17">                dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb10-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(1.5.1-1) with no approximation. State (C_A, C_A-E); C_E = C_E0 - C_A-E.</span></span>
<span id="cb10-19"></span>
<span id="cb10-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    dense=True returns a callable t -&gt; C_A(t) instead of samples, so that a</span></span>
<span id="cb10-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    maximum in t can be ROOT-FOUND rather than read off a grid.</span></span>
<span id="cb10-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    total=True returns C_A + C_A-E instead of the free substrate C_A. Which of</span></span>
<span id="cb10-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the two the reduced model should be compared against is a CONVENTION - the</span></span>
<span id="cb10-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    reduced model has only one substrate variable - and the page reports both</span></span>
<span id="cb10-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    where the choice changes a headline.</span></span>
<span id="cb10-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb10-27">    kf, kr, kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p</span>
<span id="cb10-28">    a0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cA0 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> a0</span>
<span id="cb10-29"></span>
<span id="cb10-30">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> f(_, y):</span>
<span id="cb10-31">        v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb10-32">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb10-33"></span>
<span id="cb10-34">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> jac(_, y):</span>
<span id="cb10-35">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kr],</span>
<span id="cb10-36">                [ kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kc]]</span>
<span id="cb10-37"></span>
<span id="cb10-38">    kw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>method, jac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>jac, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>atol)</span>
<span id="cb10-39">    span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (te[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], te[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb10-40">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(f, span, [a0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], t_eval<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dense <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> te,</span>
<span id="cb10-41">                  dense_output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dense, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb10-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> s.success:                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only bites at eps ~ 1; Radau is robust</span></span>
<span id="cb10-43">        kw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"method"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Radau"</span></span>
<span id="cb10-44">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(f, span, [a0, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], t_eval<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dense <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> te,</span>
<span id="cb10-45">                      dense_output<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dense, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb10-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.success, s.message</span>
<span id="cb10-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dense:</span>
<span id="cb10-48">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: s.sol(t)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s.sol(t)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb10-49">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: s.sol(t)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-50">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> total <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb10-51"></span>
<span id="cb10-52"></span>
<span id="cb10-53"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> max_gap(f, g, window<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.0</span>), n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">181</span>, with_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb10-54">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max |f-g| over `window`, located on a log+linear scan and then ROOT-FOUND.</span></span>
<span id="cb10-55"></span>
<span id="cb10-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Never report a sampled maximum. Here it is not a rounding matter: the two</span></span>
<span id="cb10-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    mass-action solutions differ most inside the INDUCTION LAYER, which for the</span></span>
<span id="cb10-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    parameters on this page sits at t ~ 1e-4 min. A uniform scan of the 18 min</span></span>
<span id="cb10-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    run misses it entirely and reads a maximum 3x too small, so the scan is</span></span>
<span id="cb10-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    uniform AND logarithmic, and the peak is then refined in its own bracket.</span></span>
<span id="cb10-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb10-62">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> window</span>
<span id="cb10-63">    ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.unique(np.concatenate([</span>
<span id="cb10-64">        np.linspace(a, b, n_scan),</span>
<span id="cb10-65">        np.geomspace(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(a, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>), b, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">61</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.array([])]))</span>
<span id="cb10-66">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.asarray(f(ts), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.asarray(g(ts), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb10-67">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(d))</span>
<span id="cb10-68">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ts[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)], ts[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb10-69">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g(t))),</span>
<span id="cb10-70">                        bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo, hi), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb10-71">                        options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>})</span>
<span id="cb10-72">    val, tpk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r.fun), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.x)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r.fun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> d[i] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d[i]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ts[i]))</span>
<span id="cb10-73">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (val, tpk) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> with_t <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> val</span>
<span id="cb10-74"></span>
<span id="cb10-75"></span>
<span id="cb10-76"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> BatchMassAction:</span>
<span id="cb10-77">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Scheme (1.5.1-1) in a batch: one cell, four fields. Backward Euler."""</span></span>
<span id="cb10-78">    NC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span></span>
<span id="cb10-79"></span>
<span id="cb10-80">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, p):</span>
<span id="cb10-81">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p</span>
<span id="cb10-82">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.NC))     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># last axis in full: pointwise reaction</span></span>
<span id="cb10-83">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> speye(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.NC, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)</span>
<span id="cb10-84"></span>
<span id="cb10-85">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb10-86">        kf, kr, kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.p</span>
<span id="cb10-87">        cA, cE, cAE, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (c[..., i] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb10-88">        v1, vm, v2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cE, kr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cAE, kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cAE          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-2)..(1.5.1-4)</span></span>
<span id="cb10-89">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.stack([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> vm, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> vm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v2, v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v2, v2], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb10-90"></span>
<span id="cb10-91">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> step(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c_old, dt):</span>
<span id="cb10-92">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(w):</span>
<span id="cb10-93">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> w.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.NC)</span>
<span id="cb10-94">            f, jf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, c)</span>
<span id="cb10-95">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_old)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> jf).tocsc()</span>
<span id="cb10-96">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(res, c_old.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).copy(), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb10-97">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r.success</span>
<span id="cb10-98">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r.x.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.NC)</span>
<span id="cb10-99"></span>
<span id="cb10-100">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c0, t_end, n_steps, n_out):</span>
<span id="cb10-101">        dt, every <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n_steps, n_steps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span>n_out</span>
<span id="cb10-102">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(c0, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.NC)</span>
<span id="cb10-103">        out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty((n_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.NC))</span>
<span id="cb10-104">        out[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-105">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_steps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb10-106">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.step(c, dt)</span>
<span id="cb10-107">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> every <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb10-108">                out[j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb10-109">                j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-110">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb10-111"></span>
<span id="cb10-112"></span>
<span id="cb10-113"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> BatchReduced:</span>
<span id="cb10-114">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""dC_A/dt = -r_m C_A/(K_M+C_A), i.e. (1.5.1-15). One cell, one field."""</span></span>
<span id="cb10-115"></span>
<span id="cb10-116">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, rm, KM):</span>
<span id="cb10-117">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.rm, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.KM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm, KM</span>
<span id="cb10-118">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2-D shape: never NumJac((1,))</span></span>
<span id="cb10-119">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> speye(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)</span>
<span id="cb10-120"></span>
<span id="cb10-121">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb10-122">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.rm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.KM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c)</span>
<span id="cb10-123"></span>
<span id="cb10-124">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c0, t_end, n_steps, t_out):</span>
<span id="cb10-125">        dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n_steps</span>
<span id="cb10-126">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([[c0]], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb10-127">        idx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.asarray(t_out)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt).astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>)</span>
<span id="cb10-128">        out, k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb10-129">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(n_steps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb10-130">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(idx) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> idx[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> i:</span>
<span id="cb10-131">                out.append(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-132">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n_steps:</span>
<span id="cb10-133">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb10-134">            c_old <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c</span>
<span id="cb10-135"></span>
<span id="cb10-136">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(w):</span>
<span id="cb10-137">                cc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> w.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb10-138">                f, jf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.numjac(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.source, cc)</span>
<span id="cb10-139">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((cc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_old)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.eye<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> jf).tocsc()</span>
<span id="cb10-140">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(res, c.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).copy(), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb10-141">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r.success</span>
<span id="cb10-142">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.x.reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb10-143">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array(out)</span>
<span id="cb10-144"></span>
<span id="cb10-145"></span>
<span id="cb10-146"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"models defined:"</span>, BatchMassAction.<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">__name__</span>, BatchReduced.<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">__name__</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s_closed"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>models defined: BatchMassAction BatchReduced s_closed</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-fit-and-what-it-is-worth-against-a-null" class="level3">
<h3 class="anchored" data-anchor-id="the-fit-and-what-it-is-worth-against-a-null">1. The fit, and what it is worth against a null</h3>
<p>Fitting eq. (1.5.1-15) to the seven points means fitting its <strong>integral</strong>, not the rate law: the table is a batch decay curve, not a set of initial rates. That integral is closed-form, so the fit needs no ODE solver at all. Rawlings &amp; Ekerdt’s parameterisation is <img src="https://latex.codecogs.com/png.latex?r%20=%20k%20c_%7B%5Crm%20S%7D/(1+K%20c_%7B%5Crm%20S%7D)">, which is eq. (1.5.1-15) with <img src="https://latex.codecogs.com/png.latex?k%20=%20r_m/K_M"> and <img src="https://latex.codecogs.com/png.latex?K%20=%201/K_M">; both are reported.</p>
<p><strong>This is a fit, not a test.</strong> The null baselines below are the point of the exercise: a saturating law has two parameters and a simple order has one, so “it fits” means nothing until the one-parameter alternatives have been tried.</p>
<div id="ccd3c11b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:50.470836Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:50.470625Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:50.739053Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:50.737976Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_mm(t, y, K_fixed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, s0_free<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb12-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Multistart NLS of the integrated (1.5.1-15) to (t, y). Returns k, K, s0, resid."""</span></span>
<span id="cb12-3">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(q):</span>
<span id="cb12-4">        i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb12-5">        kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(q[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb12-6">        KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_fixed <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> K_fixed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.exp(q[i])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> K_fixed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb12-7">        ss <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(q[i]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s0_free <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s_closed(t, ss, kk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KK, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y</span>
<span id="cb12-9"></span>
<span id="cb12-10">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb12-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>):</span>
<span id="cb12-12">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> K0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>):</span>
<span id="cb12-13">            g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.log(k0)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ([] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> K_fixed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [np.log(K0)]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb12-14">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ([np.log(y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s0_free <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [])</span>
<span id="cb12-15">            r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(resid, g, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)</span>
<span id="cb12-16">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> r.cost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> best.cost:</span>
<span id="cb12-17">                best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r</span>
<span id="cb12-18">    q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(best.x)</span>
<span id="cb12-19">    kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-20">    KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_fixed <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> K_fixed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb12-21">    ss <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> q[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s0_free <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kk, KK, ss, best.fun</span>
<span id="cb12-23"></span>
<span id="cb12-24"></span>
<span id="cb12-25">k_fit, K_fit, _, res_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_mm(t_d, c_d)</span>
<span id="cb12-26">rm_fit, KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_fit, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_fit</span>
<span id="cb12-27">rms_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(res_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb12-28">sse_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(res_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb12-29">M.update(mm_fit_k_per_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k_fit, mm_fit_K_L_per_cmol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_fit,</span>
<span id="cb12-30">         mm_fit_rm_cmol_per_L_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rm_fit, mm_fit_KM_cmol_per_L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KM_fit,</span>
<span id="cb12-31">         mm_fit_rms_cmol_per_L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rms_fit,</span>
<span id="cb12-32">         mm_fit_maxres_over_print_resolution<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(res_fit))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RES))</span>
<span id="cb12-33"></span>
<span id="cb12-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Exercise 9.15 parameterisation : k   = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1/min, "</span></span>
<span id="cb12-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K   = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> L/cmol"</span>)</span>
<span id="cb12-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Froment (1.5.1-15) equivalent  : r_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rm_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/(L min), "</span></span>
<span id="cb12-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KM_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L"</span>)</span>
<span id="cb12-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"RMS residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rms_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L; max |residual| "</span></span>
<span id="cb12-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(res_fit))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = "</span></span>
<span id="cb12-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mm_fit_maxres_over_print_resolution'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x the 5e-4 print resolution"</span>)</span>
<span id="cb12-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"residuals:"</span>, np.array2string(res_fit, precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb12-42"></span>
<span id="cb12-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is the table an exactly-rounded model evaluation? and are the constants round?</span></span>
<span id="cb12-44">_, _, _, res_K2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_mm(t_d, c_d, K_fixed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb12-45">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_sse_penalty_K_pinned_at_2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(res_K2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sse_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb12-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">K pinned at exactly 2 L/cmol (K_M = 0.5): SSE penalty "</span></span>
<span id="cb12-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mm_fit_sse_penalty_K_pinned_at_2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % -- "</span></span>
<span id="cb12-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K_M is within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(KM_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of 0.5 cmol/L"</span>)</span>
<span id="cb12-49"></span>
<span id="cb12-50">k3, K3, s03, res3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_mm(t_d, c_d, s0_free<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb12-51">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_with_s0_free"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K3</span>
<span id="cb12-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"initial concentration also free: k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, K = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb12-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(K_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), c_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s03<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cA0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb12-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"RMS </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(np.mean(res3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-55"></span>
<span id="cb12-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- null baselines: one-parameter simple orders, each best-fitted</span></span>
<span id="cb12-57"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> null_fit(kind):</span>
<span id="cb12-58">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero"</span>:   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: np.maximum(c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t_d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d,</span>
<span id="cb12-59">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first"</span>:  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d,</span>
<span id="cb12-60">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second"</span>: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d}[kind]</span>
<span id="cb12-61">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(f, [np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)</span>
<span id="cb12-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(r.fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(r.x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb12-63"></span>
<span id="cb12-64"></span>
<span id="cb12-65">NULLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: null_fit(k) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second"</span>)}</span>
<span id="cb12-66">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms_fit</span>
<span id="cb12-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">null baselines (one parameter each, all best-fitted):"</span>)</span>
<span id="cb12-68"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kind, (rr, kk) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NULLS.items():</span>
<span id="cb12-69">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kind<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> order  k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   RMS = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb12-70">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x the Michaelis-Menten fit)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Exercise 9.15 parameterisation : k   = 0.323192 1/min, K   = 1.987853 L/cmol
Froment (1.5.1-15) equivalent  : r_m = 0.162583 cmol/(L min), K_M = 0.503055 cmol/L
RMS residual 4.020287e-03 cmol/L; max |residual| 6.932544e-03 = 13.87 x the 5e-4 print resolution
residuals: [ 0.        0.005021  0.000516 -0.006933  0.002936 -0.000333  0.005556]

K pinned at exactly 2 L/cmol (K_M = 0.5): SSE penalty 0.108 % -- K_M is within 0.61 % of 0.5 cmol/L
initial concentration also free: k = 0.325550, K = 2.027949 (K_M = 0.493109), c_A0 = 0.975739 vs printed 0.978; RMS 3.919827e-03

null baselines (one parameter each, all best-fitted):
  zero   order  k = 0.08638   RMS = 5.34118e-02  ( 13.29 x the Michaelis-Menten fit)
  first  order  k = 0.15529   RMS = 3.90482e-02  (  9.71 x the Michaelis-Menten fit)
  second order  k = 0.31125   RMS = 1.04701e-01  ( 26.04 x the Michaelis-Menten fit)</code></pre>
</div>
</div>
<div id="2366e7ac" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:50.741668Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:50.741462Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:51.032152Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:51.031234Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>))</span>
<span id="cb14-2">tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb14-3">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(tt, s_closed(tt, cA0, rm_fit, KM_fit), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>,</span>
<span id="cb14-4">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (1.5.1-15), fitted ($K_M$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KM_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-5">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(tt, cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>tt), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>,</span>
<span id="cb14-6">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order null"</span>)</span>
<span id="cb14-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(t_d, c_d, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.15"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Exercise 9.15 (provenance unstated)"</span>)</span>
<span id="cb14-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t (min)"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">c_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m S}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cmol/L</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb14-10"></span>
<span id="cb14-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axhline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb14-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axhspan(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>RES, RES, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.18</span>,</span>
<span id="cb14-13">              label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"print resolution $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pm 5</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">times10^{-4}$"</span>)</span>
<span id="cb14-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(t_d, res_fit, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o-"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Michaelis-Menten"</span>)</span>
<span id="cb14-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(t_d, cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s--"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb14-16">           color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order null"</span>)</span>
<span id="cb14-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t (min)"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"model - data (cmol/L)"</span>)</span>
<span id="cb14-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb14-19">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb14-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fit, not test: r_m and K_M were fitted to these same seven points. The "</span></span>
<span id="cb14-21">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"residual band shows why the table cannot be an exactly-rounded model "</span></span>
<span id="cb14-22">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evaluation - it is 13.9x too wide for that."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.6-michaelis-menten-briggs-haldane/index_files/figure-html/cell-8-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Fit, not test: r_m and K_M were fitted to these same seven points. The residual band shows why the table cannot be an exactly-rounded model evaluation - it is 13.9x too wide for that.</code></pre>
</div>
</div>
</section>
<section id="the-lineweaver-construction-run-exactly-as-both-books-instruct" class="level3">
<h3 class="anchored" data-anchor-id="the-lineweaver-construction-run-exactly-as-both-books-instruct">2. The Lineweaver construction, run exactly as both books instruct</h3>
<p>Froment says to plot <img src="https://latex.codecogs.com/png.latex?1/r"> against <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D">; Levenspiel p.&nbsp;615 says <img src="https://latex.codecogs.com/png.latex?1/(-r_%7B%5Crm%20A%7D)"> against <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D">. The first cell settles which is right from Froment’s own eq. (1.5.1-15) - by measuring, on the fitted constants, how far each is from a straight line. The second runs the exercise’s hint on the actual table (rates by central difference, then unweighted linear least squares on the reciprocals) and compares what comes out with the direct fit, which is the comparison Levenspiel makes a claim about.</p>
<div id="d57eedcb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:51.034896Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:51.034684Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:51.058442Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:51.057668Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "How far from a straight line" is a MAXIMUM OVER AN INTERVAL, and it is only</span></span>
<span id="cb16-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># well posed once WHICH straight line is named. Three answers are computed here,</span></span>
<span id="cb16-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the difference between them is larger than any grid effect:</span></span>
<span id="cb16-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   (i) the CHEBYSHEV (minimax) line is the one that minimises this very</span></span>
<span id="cb16-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       statistic, so it is the FLOOR - the honest answer to "how close can a</span></span>
<span id="cb16-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       straight line get". It needs no weighting convention at all, and for a</span></span>
<span id="cb16-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       convex A/C + B it is closed form with an equioscillation certificate.</span></span>
<span id="cb16-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   (ii) a LEAST-SQUARES line minimises a different (square) norm, so it is</span></span>
<span id="cb16-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       always further away in the max norm, and it additionally depends on how</span></span>
<span id="cb16-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       the interval is WEIGHTED: a least-squares fit on a geomspace grid</span></span>
<span id="cb16-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       weights it as dC/C, on a linspace grid as dC. Those two give 0.503 and</span></span>
<span id="cb16-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       0.669; the page reports both and names the one it quotes.</span></span>
<span id="cb16-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   (iii) in every case the maximum is ROOT-FOUND, not sampled: with the line</span></span>
<span id="cb16-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       fixed, the deviation of A/C + B from q0 + q1 C has one interior</span></span>
<span id="cb16-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#       stationary point, C* = sqrt(-A/q1), in closed form.</span></span>
<span id="cb16-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Moments and extrema are therefore all exact - there is no grid under any of</span></span>
<span id="cb16-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># these numbers. The grid sequence below is shown only as evidence that refining</span></span>
<span id="cb16-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a 400-point grid converges to the closed form.</span></span>
<span id="cb16-19">A_LW, B_LW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KM_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_fit, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_fit             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1/r = A/C_A + B</span></span>
<span id="cb16-20"></span>
<span id="cb16-21"></span>
<span id="cb16-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> straightness_exact(a, b, weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>, line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb16-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max |1/r - best LEAST-SQUARES line in C_A| / range, on [a, b].</span></span>
<span id="cb16-24"></span>
<span id="cb16-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Least squares minimises a square norm, NOT the maximum reported here, so</span></span>
<span id="cb16-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    this is an upper bound on the distance from the best straight line, never</span></span>
<span id="cb16-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the distance itself - straightness_minimax gives that.</span></span>
<span id="cb16-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `weight` = 'log' (dC/C, the geomspace convention) or 'uniform' (dC).</span></span>
<span id="cb16-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `line=True` returns the line's (intercept, slope) instead, so that the</span></span>
<span id="cb16-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    figure can draw the same line the number is measured against.</span></span>
<span id="cb16-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Closed-form weighted least squares, root-found extremum.</span></span>
<span id="cb16-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb16-33">    L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a)</span>
<span id="cb16-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> weight <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>:</span>
<span id="cb16-35">        m0, m1, m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a, (b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-36">        n0, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>L, A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a)</span>
<span id="cb16-37">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb16-38">        m0, m1, m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a, (b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, (b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb16-39">        n0, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a), A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-40">    q0, q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.solve(np.array([[m0, m1], [m1, m2]]), np.array([n0, n1]))</span>
<span id="cb16-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> line:</span>
<span id="cb16-42">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(q0), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(q1)</span>
<span id="cb16-43">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x</span>
<span id="cb16-44">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [a, b]</span>
<span id="cb16-45">    xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>q1) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dev'(x) = -A/x^2 - q1 = 0</span></span>
<span id="cb16-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> xc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> xc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> b:</span>
<span id="cb16-47">        xs.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(xc))</span>
<span id="cb16-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(x)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xs)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b)))</span>
<span id="cb16-49"></span>
<span id="cb16-50"></span>
<span id="cb16-51"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dev_sup(q0, q1, a, b):</span>
<span id="cb16-52">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""sup |1/r - (q0 + q1 C)| on [a, b], EXACTLY - no grid.</span></span>
<span id="cb16-53"></span>
<span id="cb16-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    1/r - line is convex in C, so its extrema on the interval are the two</span></span>
<span id="cb16-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    endpoints and the single interior stationary point sqrt(-A/q1).</span></span>
<span id="cb16-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb16-57">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x</span>
<span id="cb16-58">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [a, b]</span>
<span id="cb16-59">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> q1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> np.sqrt(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>q1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> b:</span>
<span id="cb16-60">        xs.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>q1)))</span>
<span id="cb16-61">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d(x)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xs)</span>
<span id="cb16-62"></span>
<span id="cb16-63"></span>
<span id="cb16-64"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> straightness_minimax(a, b):</span>
<span id="cb16-65">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max |1/r - THE BEST STRAIGHT LINE in C_A| / range, on [a, b].</span></span>
<span id="cb16-66"></span>
<span id="cb16-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Best in the CHEBYSHEV (minimax) sense: the line that minimises the maximum</span></span>
<span id="cb16-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    deviation, i.e. the statistic actually being reported. No straight line does</span></span>
<span id="cb16-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    better, so this is a convention-free FLOOR - it needs no weighting, and the</span></span>
<span id="cb16-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    normalisation by the range cancels r_m and K_M exactly, leaving a pure</span></span>
<span id="cb16-71"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    property of the interval.</span></span>
<span id="cb16-72"></span>
<span id="cb16-73"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Closed form for a strictly convex f = A/C + B: the optimal slope is the</span></span>
<span id="cb16-74"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    chord slope m = (f(b)-f(a))/(b-a), the tangency is at sqrt(A/|m|) = sqrt(ab),</span></span>
<span id="cb16-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    and the deviation equioscillates + - + at a, sqrt(ab), b. Chebyshev's</span></span>
<span id="cb16-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    theorem makes that equioscillation an optimality CERTIFICATE - but by</span></span>
<span id="cb16-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    CONSTRUCTION here, not by an independent check: q0 is set to the midpoint</span></span>
<span id="cb16-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    of g(a) and g(xt), so d[0] = -d[1] identically, and m is the exact chord</span></span>
<span id="cb16-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    slope, so g(b) = g(a) and d[2] = d[0] identically. The equal-magnitude</span></span>
<span id="cb16-80"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    assert below therefore compares each of those to itself up to round-off;</span></span>
<span id="cb16-81"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    what it actually earns is a &lt; xt &lt; b (tangency interior) and d[0] &gt; 0</span></span>
<span id="cb16-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    (convexity, i.e. xt is a minimum of g, not a maximum). The 21x21</span></span>
<span id="cb16-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    perturbation scan two cells down is the part of this notebook that tests</span></span>
<span id="cb16-84"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    optimality from outside the construction.</span></span>
<span id="cb16-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb16-86">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW</span>
<span id="cb16-87">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (f(b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(a))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># chord slope</span></span>
<span id="cb16-88">    xt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m)))                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># = sqrt(ab); f'(xt) = m</span></span>
<span id="cb16-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> xt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> b, (a, xt, b)</span>
<span id="cb16-90">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: f(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x</span>
<span id="cb16-91">    q0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (g(a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> g(xt))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># line midway between them</span></span>
<span id="cb16-92">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [g(a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q0, g(xt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q0, g(b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q0]</span>
<span id="cb16-93">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, d          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># alternating signs, + - +</span></span>
<span id="cb16-94">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), d</span>
<span id="cb16-95">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b)))</span>
<span id="cb16-96"></span>
<span id="cb16-97"></span>
<span id="cb16-98"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> straightness(x, y):</span>
<span id="cb16-99">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The sampled version: max |y - lstsq line in x| / range(y) on a grid."""</span></span>
<span id="cb16-100">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([x, np.ones_like(x)]).T</span>
<span id="cb16-101">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(A, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb16-102">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span>b))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.ptp(y))</span>
<span id="cb16-103"></span>
<span id="cb16-104"></span>
<span id="cb16-105">LW_A, LW_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># spans the data's own range</span></span>
<span id="cb16-106">c_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(LW_A, LW_B, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb16-107">r_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c_ex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_ex)</span>
<span id="cb16-108">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> straightness_minimax(LW_A, LW_B)</span>
<span id="cb16-109">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> straightness_exact(LW_A, LW_B, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb16-110">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb16-111">    straightness_exact(LW_A, LW_B, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform"</span>)</span>
<span id="cb16-112">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> straightness(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c_ex, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_ex)</span>
<span id="cb16-113"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"exact eq. (1.5.1-15) on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LW_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LW_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L, distance from a straight "</span></span>
<span id="cb16-114">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"line,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">as a fraction of the range of 1/r over that interval. WHICH "</span></span>
<span id="cb16-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"straight line is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">part of the question, and it is the bigger lever of "</span></span>
<span id="cb16-116">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two conventions here:"</span>)</span>
<span id="cb16-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  1/r vs C_A, MINIMAX line -- THE best straight line   : "</span></span>
<span id="cb16-118">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity_minimax'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-119">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   &lt;- floor, no convention"</span>)</span>
<span id="cb16-120"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  1/r vs C_A, best LEAST-SQUARES line, log-weighted    : "</span></span>
<span id="cb16-121">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;- the page's quoted "</span></span>
<span id="cb16-122">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"convention"</span>)</span>
<span id="cb16-123"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  1/r vs C_A, best LEAST-SQUARES line, uniform         : "</span></span>
<span id="cb16-124">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity_uniform_measure'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-125"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  1/r vs 1/C_A (Levenspiel p. 615), least squares      : "</span></span>
<span id="cb16-126">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-13 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_correct_axes_nonlinearity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb16-127"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and symbolically d2(1/r)/dC_A^2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CURV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &gt; 0, so no straight line "</span></span>
<span id="cb16-128">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"exists</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  -- which is the convention-free part, and the part the defect "</span></span>
<span id="cb16-129">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rests on."</span>)</span>
<span id="cb16-130"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  THE STATISTIC IS A MAXIMUM, so the line that minimises it is the "</span></span>
<span id="cb16-131">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"CHEBYSHEV</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  line, not a least-squares one: a straight line does come "</span></span>
<span id="cb16-132">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"within "</span></span>
<span id="cb16-133">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity_minimax'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-134">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  range, and the two least-squares numbers "</span></span>
<span id="cb16-135">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % and "</span></span>
<span id="cb16-136">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity_uniform_measure'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %) "</span></span>
<span id="cb16-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"answer a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  different question and do not even bracket it."</span>)</span>
<span id="cb16-138">_mmx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>]</span>
<span id="cb16-139">_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> B_LW</span>
<span id="cb16-140">_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (_f(LW_B) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _f(LW_A))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(LW_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> LW_A)</span>
<span id="cb16-141">_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: _f(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x</span>
<span id="cb16-142">_q0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (_g(LW_A) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _g(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_m)))))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-143">_rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_LW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>LW_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>LW_B)</span>
<span id="cb16-144">_PN, _PD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb16-145">_pert <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [dev_sup(_q0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> du), _m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv), LW_A, LW_B)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_rng</span>
<span id="cb16-146">         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> du <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_PD, _PD, _PN)</span>
<span id="cb16-147">         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_PD, _PD, _PN) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> du <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> dv]</span>
<span id="cb16-148">_worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_pert)</span>
<span id="cb16-149"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> _mmx, (_worst, _mmx)</span>
<span id="cb16-150"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the three deviations at C = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LW_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(LW_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>LW_B)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb16-151">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LW_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are equal in size and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  alternate in sign (asserted), which is "</span></span>
<span id="cb16-152">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Chebyshev's optimality certificate; and no</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  perturbed line in a "</span></span>
<span id="cb16-153">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_PN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_PN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grid of +-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_PD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on its slope and intercept beats "</span></span>
<span id="cb16-154">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"it -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the best of those </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_pert)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> gets to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_worst<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the "</span></span>
<span id="cb16-155">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"floor's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_mmx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb16-156"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  the two LEAST-SQUARES conventions are LIMITS of the two obvious "</span></span>
<span id="cb16-157">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grids, and the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  grid the page originally used (geomspace, n = 400) was "</span></span>
<span id="cb16-158">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"not converged at four digits:"</span>)</span>
<span id="cb16-159"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25600</span>):</span>
<span id="cb16-160">    cg, cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(LW_A, LW_B, n), np.linspace(LW_A, LW_B, n)</span>
<span id="cb16-161">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   geomspace </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>straightness(cg, (KM_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>cg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(rm_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cg))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-162">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   linspace </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>straightness(cl, (KM_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>cl)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(rm_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cl))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-163"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    n -&gt; inf     geomspace </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-164">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   linspace "</span></span>
<span id="cb16-165">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity_uniform_measure'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-166">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (closed form)"</span>)</span>
<span id="cb16-167"></span>
<span id="cb16-168"></span>
<span id="cb16-169"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lineweaver(tv, yv):</span>
<span id="cb16-170">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The exercise's hint: central-difference rates, then LS on 1/r vs 1/c."""</span></span>
<span id="cb16-171">    cm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(yv[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> yv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb16-172">    rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(yv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yv[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(tv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tv[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb16-173">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>cm, np.ones_like(cm)]).T</span>
<span id="cb16-174">    sl, ic <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(A, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rr, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb16-175">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sl, ic<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sl, cm, rr                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k = 1/slope, K = intercept*k</span></span>
<span id="cb16-176"></span>
<span id="cb16-177"></span>
<span id="cb16-178">k_lb, K_lb, cm_d, r_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lineweaver(t_d, c_d)</span>
<span id="cb16-179">k_lbm, K_lbm, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lineweaver(t_d, s_closed(t_d, cA0, rm_fit, KM_fit))</span>
<span id="cb16-180">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_rm_bias_vs_nls"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (k_lb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lb)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rm_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb16-181">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_vs_nls"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lb)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb16-182">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_finite_difference_only"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lbm)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb16-183"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Lineweaver on the seven printed points : k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_lb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, K = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_lb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb16-184"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   -&gt; r_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_lb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lb_rm_bias_vs_nls'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %), "</span></span>
<span id="cb16-185">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lb_KM_bias_vs_nls'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %) vs the direct fit"</span>)</span>
<span id="cb16-186"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"same construction on the FITTED CURVE sampled at the same seven times : "</span></span>
<span id="cb16-187">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lbm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lb_KM_bias_finite_difference_only'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)"</span>)</span>
<span id="cb16-188"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   so the differencing alone biases K_M UP by 14 %; the rest of the -47 %"</span></span>
<span id="cb16-189">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" is the reciprocal transform amplifying the scatter of the last points."</span>)</span>
<span id="cb16-190"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   Levenspiel p. 615 says the direct C_A-versus-tau fit 'is direct, is "</span></span>
<span id="cb16-191">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"less prone to fiddling, and is more reliable'. On this dataset it is."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>exact eq. (1.5.1-15) on 0.05-1.0 cmol/L, distance from a straight line,
as a fraction of the range of 1/r over that interval. WHICH straight line is
part of the question, and it is the bigger lever of the two conventions here:
  1/r vs C_A, MINIMAX line -- THE best straight line   : 0.317256   &lt;- floor, no convention
  1/r vs C_A, best LEAST-SQUARES line, log-weighted    : 0.503158   &lt;- the page's quoted convention
  1/r vs C_A, best LEAST-SQUARES line, uniform         : 0.668756
  1/r vs 1/C_A (Levenspiel p. 615), least squares      : below 1e-13 (here 4.8e-16)
  and symbolically d2(1/r)/dC_A^2 = 2*K_M/(C_A**3*r_m) &gt; 0, so no straight line exists
  -- which is the convention-free part, and the part the defect rests on.

  THE STATISTIC IS A MAXIMUM, so the line that minimises it is the CHEBYSHEV
  line, not a least-squares one: a straight line does come within 31.7 % of the
  range, and the two least-squares numbers (50.3 % and 66.9 %) answer a
  different question and do not even bracket it.
  the three deviations at C = 0.05, 0.2236068, 1 are equal in size and
  alternate in sign (asserted), which is Chebyshev's optimality certificate; and no
  perturbed line in a 21 x 21 grid of +-5 % on its slope and intercept beats it -
  the best of those 440 gets to 0.318434 against the floor's 0.317256.

  the two LEAST-SQUARES conventions are LIMITS of the two obvious grids, and the
  grid the page originally used (geomspace, n = 400) was not converged at four digits:
    n =    400   geomspace 0.502442   linspace 0.665642
    n =   1600   geomspace 0.502980   linspace 0.667984
    n =   6400   geomspace 0.503114   linspace 0.668563
    n =  25600   geomspace 0.503147   linspace 0.668708
    n -&gt; inf     geomspace 0.503158   linspace 0.668756   (closed form)

Lineweaver on the seven printed points : k = 0.40003, K = 3.73157
   -&gt; r_m = 0.10720 (-34.06 %), K_M = 0.26798 (-46.73 %) vs the direct fit
same construction on the FITTED CURVE sampled at the same seven times : K_M = 0.57361 (+14.02 %)
   so the differencing alone biases K_M UP by 14 %; the rest of the -47 % is the reciprocal transform amplifying the scatter of the last points.
   Levenspiel p. 615 says the direct C_A-versus-tau fit 'is direct, is less prone to fiddling, and is more reliable'. On this dataset it is.</code></pre>
</div>
</div>
<div id="3a2d28c3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:51.060939Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:51.060737Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:51.319227Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:51.318234Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>))</span>
<span id="cb18-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plotted over the data's own range; the METRICS above are read on 0.05-1.0,</span></span>
<span id="cb18-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which is a stated choice and has its own break row</span></span>
<span id="cb18-4">c_pl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cm_d.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb18-5">r_pl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c_pl<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_pl)</span>
<span id="cb18-6">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c_pl, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_pl, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (1.5.1-15), exact"</span>)</span>
<span id="cb18-7">A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c_pl, np.ones_like(c_pl)]).T</span>
<span id="cb18-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>c_pl, A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span>np.linalg.lstsq(A, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_pl, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY,</span>
<span id="cb18-9">           lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"straight line"</span>)</span>
<span id="cb18-10">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>cm_d, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_d, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.15"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Exercise 9.15, differenced"</span>)</span>
<span id="cb18-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/C_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m A}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">L/cmol</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/r</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">L min/cmol</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Levenspiel p. 615 axes: exactly straight"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb18-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb18-15"></span>
<span id="cb18-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(c_pl, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_pl, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (1.5.1-15), exact"</span>)</span>
<span id="cb18-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BOTH lines are the ones fitted on 0.05-1.0 cmol/L - the interval the two</span></span>
<span id="cb18-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reported percentages are measured on - drawn across the data's own range.</span></span>
<span id="cb18-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The dotted one minimises a log-weighted SQUARE error (50.3 %); the dashed one</span></span>
<span id="cb18-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># minimises the MAXIMUM deviation, which is the statistic being reported, and is</span></span>
<span id="cb18-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># therefore the best straight line there is (31.7 %).</span></span>
<span id="cb18-22">_qls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> straightness_exact(LW_A, LW_B, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>, line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb18-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(c_pl, _qls[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _qls[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c_pl, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY,</span>
<span id="cb18-24">           lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best least-squares line"</span>)</span>
<span id="cb18-25">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(c_pl, _q0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c_pl, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.35"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>,</span>
<span id="cb18-26">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best straight line (minimax)"</span>)</span>
<span id="cb18-27">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(cm_d, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_d, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.15"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Exercise 9.15, differenced"</span>)</span>
<span id="cb18-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m A}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cmol/L</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-29">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/r</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">L min/cmol</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-30">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Froment p. 25 axes, 0.05-1.0 cmol/L: no straight line "</span></span>
<span id="cb18-31">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"closer than "</span></span>
<span id="cb18-32">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lineweaver_printed_axes_nonlinearity_minimax'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-33">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" % of range"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb18-34">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb18-35">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.6-michaelis-menten-briggs-haldane/index_files/figure-html/cell-10-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-degeneracy-what-a-steady-state-rate-measurement-cannot-see" class="level3">
<h3 class="anchored" data-anchor-id="the-degeneracy-what-a-steady-state-rate-measurement-cannot-see">3. The degeneracy: what a steady-state rate measurement cannot see</h3>
<p>This is the case’s own question, and it was <strong>already settled symbolically</strong> in the symbolic cell under <em>The published model</em>: under the reparameterisation, eq. (1.5.1-13) <em>is</em> eq. (1.5.1-15) and <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20r/%5Cpartial%20%5Crho%20%5Cequiv%200">. What follows is the numerical check on that algebra, not the evidence for it. Hold the two observable constants <img src="https://latex.codecogs.com/png.latex?(r_m,%20K_M)"> fixed, sweep <img src="https://latex.codecogs.com/png.latex?%5Crho%20=%20k_2/k_%7B-1%7D"> over eight decades, and evaluate the rate law <strong>from the elementary constants</strong> on a four-decade concentration grid. If the two derivations were separable by rate-versus-substrate data, the curves would move.</p>
<p>The check returns exactly zero, and the cell then says what that zero is worth: it needs two floating-point round trips to be exact, and over 2000 random <img src="https://latex.codecogs.com/png.latex?(%5Crho,%20C_%7B%5Crm%20E%7D%5E0)"> draws they are not, so the same computation returns ulp-level noise instead. Both numbers are reported.</p>
<div id="c5bfaf1e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:51.321737Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:51.321529Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:51.409158Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:51.408336Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">rho_dec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb19-2">cg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb19-3">base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rm_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cg)</span>
<span id="cb19-4">CE0_probe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span></span>
<span id="cb19-5"></span>
<span id="cb19-6">worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb19-7">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb19-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rho_dec:</span>
<span id="cb19-9">    kf, kr, kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> elem(r_, CE0_probe, rm_fit, KM_fit)</span>
<span id="cb19-10">    r_from_elem <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE0_probe<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cg)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1.5.1-13)+(1.5.1-14)</span></span>
<span id="cb19-11">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r_from_elem<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb19-12">    worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst, d)</span>
<span id="cb19-13">    rows.append((r_, kf, kr, kc, kr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kf, d))</span>
<span id="cb19-14">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst</span>
<span id="cb19-15">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KM_ratio_at_rho_1e4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span></span>
<span id="cb19-16"></span>
<span id="cb19-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The exact 0.0 above is a property of these nine rho at this C_E0: it needs the</span></span>
<span id="cb19-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># float round trips (k_-1+k_2)/k_1 == K_M and k_2 C_E0 == r_m to be exact, and</span></span>
<span id="cb19-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># they are here. Over random draws they are not, and the same computation returns</span></span>
<span id="cb19-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ULP-level noise instead. THE ALGEBRA IS THE RESULT (proved in the first cell);</span></span>
<span id="cb19-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this is the size of the arithmetic underneath it.</span></span>
<span id="cb19-22">_rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.random.default_rng(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20260813</span>)             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># seeded: determinism</span></span>
<span id="cb19-23">_worst_rand, _inexact, _NDRAW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span></span>
<span id="cb19-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(_NDRAW):</span>
<span id="cb19-25">    r_, ce_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>_rng.uniform(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>_rng.uniform(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb19-26">    kf, kr, kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> elem(r_, ce_, rm_fit, KM_fit)</span>
<span id="cb19-27">    _worst_rand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_worst_rand, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb19-28">        kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ce_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))))</span>
<span id="cb19-29">    _inexact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ((kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kc)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> KM_fit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ce_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> rm_fit)</span>
<span id="cb19-30">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_random_draws_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _worst_rand</span>
<span id="cb19-31"></span>
<span id="cb19-32">df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho = k2/k-1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k1 (L/cmol/min)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-1 (1/min)"</span>,</span>
<span id="cb19-33">                                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k2 (1/min)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M(MM) = k-1/k1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max |dr/r|"</span>])</span>
<span id="cb19-34">show(df.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho = k2/k-1"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.0e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k1 (L/cmol/min)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb19-35">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-1 (1/min)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k2 (1/min)"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.4g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb19-36">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M(MM) = k-1/k1"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.6f}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max |dr/r|"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>})</span>
<span id="cb19-37">     .set_caption(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"All nine mechanisms have r_m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.6f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> and K_M(BH) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.6f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-38">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (rm_fit, KM_fit)).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"j46deg"</span>))</span>
<span id="cb19-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"max relative difference in r(C_A) across eight decades of rho: below 1e-14 "</span></span>
<span id="cb19-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb19-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K_M(Briggs-Haldane)/K_M(Michaelis-Menten) = 1 + rho over the same sweep: "</span></span>
<span id="cb19-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>rho_dec[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> .. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>rho_dec[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb19-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WHAT THAT EXACT ZERO IS, AND IS NOT. The degeneracy is proved above in "</span></span>
<span id="cb19-45">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">the 0.0 here additionally requires the float round trips "</span></span>
<span id="cb19-46">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(k_-1+k_2)/k_1 == K_M and</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">k_2 C_E0 == r_m to be exact, which they happen "</span></span>
<span id="cb19-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"to be for these nine rho at</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">C_E0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CE0_probe<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_NDRAW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> random "</span></span>
<span id="cb19-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(rho, C_E0) draws from the same ranges they are</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inexact in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_inexact<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb19-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cases, and the same computation returns below 1e-14 (here up to "</span></span>
<span id="cb19-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_law_rho_degeneracy_random_draws_max_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-- a few ulp of "</span></span>
<span id="cb19-51">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the rate, not a failure of the identity. Reported as such."</span>)</span>
<span id="cb19-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb19-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Companion that CAN move (the break table uses it): raise k2 by 1 % and "</span></span>
<span id="cb19-54">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"leave C_E0 alone, so r_m is no longer held fixed --"</span>)</span>
<span id="cb19-55">kf, kr, kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, CE0_probe, rm_fit, KM_fit)</span>
<span id="cb19-56">kc2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>kc</span>
<span id="cb19-57">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_break_k2_plus_1pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb19-58">    kc2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE0_probe<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>((kr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kc2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>kf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> cg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb19-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |dr/r| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rate_law_break_k2_plus_1pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<div id="T_j46deg" class="quarto-float quarto-figure quarto-figure-center anchored" data-quarto-postprocess="true">
<figure class="quarto-float quarto-float-tbl figure">
<figcaption class="quarto-float-caption-top quarto-float-caption quarto-float-tbl" id="T_j46deg-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: All nine mechanisms have r_m = 0.162583 and K_M(BH) = 0.503055
</figcaption>
<div aria-describedby="T_j46deg-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<table id="T_j46deg" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th class="blank level0" data-quarto-table-cell-role="th">&nbsp;</th>
<th id="T_j46deg_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">rho = k2/k-1</th>
<th id="T_j46deg_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">k1 (L/cmol/min)</th>
<th id="T_j46deg_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">k-1 (1/min)</th>
<th id="T_j46deg_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">k2 (1/min)</th>
<th id="T_j46deg_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">K_M(MM) = k-1/k1</th>
<th id="T_j46deg_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">max |dr/r|</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th id="T_j46deg_level0_row0" class="row_heading level0 row0" data-quarto-table-cell-role="th">0</th>
<td id="T_j46deg_row0_col0" class="data row0 col0">1e-04</td>
<td id="T_j46deg_row0_col1" class="data row0 col1">3.232e+06</td>
<td id="T_j46deg_row0_col2" class="data row0 col2">1.626e+06</td>
<td id="T_j46deg_row0_col3" class="data row0 col3">162.6</td>
<td id="T_j46deg_row0_col4" class="data row0 col4">0.503005</td>
<td id="T_j46deg_row0_col5" class="data row0 col5">0.00e+00</td>
</tr>
<tr class="even">
<th id="T_j46deg_level0_row1" class="row_heading level0 row1" data-quarto-table-cell-role="th">1</th>
<td id="T_j46deg_row1_col0" class="data row1 col0">1e-03</td>
<td id="T_j46deg_row1_col1" class="data row1 col1">3.235e+05</td>
<td id="T_j46deg_row1_col2" class="data row1 col2">1.626e+05</td>
<td id="T_j46deg_row1_col3" class="data row1 col3">162.6</td>
<td id="T_j46deg_row1_col4" class="data row1 col4">0.502553</td>
<td id="T_j46deg_row1_col5" class="data row1 col5">0.00e+00</td>
</tr>
<tr class="odd">
<th id="T_j46deg_level0_row2" class="row_heading level0 row2" data-quarto-table-cell-role="th">2</th>
<td id="T_j46deg_row2_col0" class="data row2 col0">1e-02</td>
<td id="T_j46deg_row2_col1" class="data row2 col1">3.264e+04</td>
<td id="T_j46deg_row2_col2" class="data row2 col2">1.626e+04</td>
<td id="T_j46deg_row2_col3" class="data row2 col3">162.6</td>
<td id="T_j46deg_row2_col4" class="data row2 col4">0.498074</td>
<td id="T_j46deg_row2_col5" class="data row2 col5">0.00e+00</td>
</tr>
<tr class="even">
<th id="T_j46deg_level0_row3" class="row_heading level0 row3" data-quarto-table-cell-role="th">3</th>
<td id="T_j46deg_row3_col0" class="data row3 col0">1e-01</td>
<td id="T_j46deg_row3_col1" class="data row3 col1">3555</td>
<td id="T_j46deg_row3_col2" class="data row3 col2">1626</td>
<td id="T_j46deg_row3_col3" class="data row3 col3">162.6</td>
<td id="T_j46deg_row3_col4" class="data row3 col4">0.457323</td>
<td id="T_j46deg_row3_col5" class="data row3 col5">0.00e+00</td>
</tr>
<tr class="odd">
<th id="T_j46deg_level0_row4" class="row_heading level0 row4" data-quarto-table-cell-role="th">4</th>
<td id="T_j46deg_row4_col0" class="data row4 col0">1e+00</td>
<td id="T_j46deg_row4_col1" class="data row4 col1">646.4</td>
<td id="T_j46deg_row4_col2" class="data row4 col2">162.6</td>
<td id="T_j46deg_row4_col3" class="data row4 col3">162.6</td>
<td id="T_j46deg_row4_col4" class="data row4 col4">0.251528</td>
<td id="T_j46deg_row4_col5" class="data row4 col5">0.00e+00</td>
</tr>
<tr class="even">
<th id="T_j46deg_level0_row5" class="row_heading level0 row5" data-quarto-table-cell-role="th">5</th>
<td id="T_j46deg_row5_col0" class="data row5 col0">1e+01</td>
<td id="T_j46deg_row5_col1" class="data row5 col1">355.5</td>
<td id="T_j46deg_row5_col2" class="data row5 col2">16.26</td>
<td id="T_j46deg_row5_col3" class="data row5 col3">162.6</td>
<td id="T_j46deg_row5_col4" class="data row5 col4">0.045732</td>
<td id="T_j46deg_row5_col5" class="data row5 col5">0.00e+00</td>
</tr>
<tr class="odd">
<th id="T_j46deg_level0_row6" class="row_heading level0 row6" data-quarto-table-cell-role="th">6</th>
<td id="T_j46deg_row6_col0" class="data row6 col0">1e+02</td>
<td id="T_j46deg_row6_col1" class="data row6 col1">326.4</td>
<td id="T_j46deg_row6_col2" class="data row6 col2">1.626</td>
<td id="T_j46deg_row6_col3" class="data row6 col3">162.6</td>
<td id="T_j46deg_row6_col4" class="data row6 col4">0.004981</td>
<td id="T_j46deg_row6_col5" class="data row6 col5">0.00e+00</td>
</tr>
<tr class="even">
<th id="T_j46deg_level0_row7" class="row_heading level0 row7" data-quarto-table-cell-role="th">7</th>
<td id="T_j46deg_row7_col0" class="data row7 col0">1e+03</td>
<td id="T_j46deg_row7_col1" class="data row7 col1">323.5</td>
<td id="T_j46deg_row7_col2" class="data row7 col2">0.1626</td>
<td id="T_j46deg_row7_col3" class="data row7 col3">162.6</td>
<td id="T_j46deg_row7_col4" class="data row7 col4">0.000503</td>
<td id="T_j46deg_row7_col5" class="data row7 col5">0.00e+00</td>
</tr>
<tr class="odd">
<th id="T_j46deg_level0_row8" class="row_heading level0 row8" data-quarto-table-cell-role="th">8</th>
<td id="T_j46deg_row8_col0" class="data row8 col0">1e+04</td>
<td id="T_j46deg_row8_col1" class="data row8 col1">323.2</td>
<td id="T_j46deg_row8_col2" class="data row8 col2">0.01626</td>
<td id="T_j46deg_row8_col3" class="data row8 col3">162.6</td>
<td id="T_j46deg_row8_col4" class="data row8 col4">0.000050</td>
<td id="T_j46deg_row8_col5" class="data row8 col5">0.00e+00</td>
</tr>
</tbody>
</table>
</div>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>max relative difference in r(C_A) across eight decades of rho: below 1e-14 (here 0.0e+00)
K_M(Briggs-Haldane)/K_M(Michaelis-Menten) = 1 + rho over the same sweep: 1.00010 .. 1e+04

WHAT THAT EXACT ZERO IS, AND IS NOT. The degeneracy is proved above in sympy;
the 0.0 here additionally requires the float round trips (k_-1+k_2)/k_1 == K_M and
k_2 C_E0 == r_m to be exact, which they happen to be for these nine rho at
C_E0 = 0.001. Over 2000 random (rho, C_E0) draws from the same ranges they are
inexact in 87 cases, and the same computation returns below 1e-14 (here up to 4.4e-16)
-- a few ulp of the rate, not a failure of the identity. Reported as such.

Companion that CAN move (the break table uses it): raise k2 by 1 % and leave C_E0 alone, so r_m is no longer held fixed --
   max |dr/r| = 9.7582e-03</code></pre>
</div>
</div>
</section>
<section id="what-a-batch-transient-sees-and-at-what-order" class="level3">
<h3 class="anchored" data-anchor-id="what-a-batch-transient-sees-and-at-what-order">4. What a batch transient sees, and at what order</h3>
<p>The rate law is blind to <img src="https://latex.codecogs.com/png.latex?%5Crho">; the full mass-action solution is not, because the quasi-steady-state approximation that produced the rate law is itself only approximate, and the size of its error depends on <img src="https://latex.codecogs.com/png.latex?%5Crho">. So the signal a batch run carries about <img src="https://latex.codecogs.com/png.latex?%5Crho"> is <em>the same size as the error in the model that made the question sensible</em>.</p>
<p>Three measurements, and the order matters. <strong>(a)</strong> Over the whole run, where the maximum turns out to sit inside the induction layer - which is why it is root-found on a logarithmic scan and not read off a uniform one; the uniform scan is 66 % low. <strong>(b)</strong> Over the window an experiment sampled like the printed table can see, <img src="https://latex.codecogs.com/png.latex?t%20%5Cge%203"> min, where only about a quarter of that survives as a persistent offset. <strong>(c)</strong> The honest version of (b): the same question with <img src="https://latex.codecogs.com/png.latex?r_m">, <img src="https://latex.codecogs.com/png.latex?K_M"> and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> all free to compensate, which is what a fit would do.</p>
<p><strong>(c) is not measured the way (b) is, and the page does not pretend otherwise.</strong> (b) is a <em>maximum over <img src="https://latex.codecogs.com/png.latex?t"></em> of the spread between two curves; (c) is an <em>RMS over a 25-point grid starting at <img src="https://latex.codecogs.com/png.latex?t%20=%200"></em> of a refitted misfit. Dividing (c) by (b) therefore charges to compensation a factor that is partly just the change of statistic and window. The second cell below measures the missing third quantity - the same RMS on the same grid with nothing free - so that the price of compensation can be quoted like for like.</p>
<div id="ad362532" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:51.411767Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:51.411529Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:28:52.635873Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:28:52.634849Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">te <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">181</span>)</span>
<span id="cb21-2">red <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s_closed(te, cA0, rm_fit, KM_fit)</span>
<span id="cb21-3"></span>
<span id="cb21-4"></span>
<span id="cb21-5">RHO_LO, RHO_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span></span>
<span id="cb21-6">eps_of <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> CE0: CE0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit)</span>
<span id="cb21-7"></span>
<span id="cb21-8"></span>
<span id="cb21-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ca_of_rho(rho, CE0):</span>
<span id="cb21-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> mass_action(elem(rho, CE0, rm_fit, KM_fit), CE0, te, dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb21-11"></span>
<span id="cb21-12"></span>
<span id="cb21-13">T_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 3 min: the earliest time the printed table samples</span></span>
<span id="cb21-14">WIN_ALL, WIN_OBS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.0</span>), (T_OBS, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.0</span>)</span>
<span id="cb21-15"></span>
<span id="cb21-16"></span>
<span id="cb21-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rho_spread(CE0, lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_LO, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_HI, window<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>WIN_OBS, check<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, with_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb21-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max |C_A(t; rho_lo) - C_A(t; rho_hi)| over `window`, ROOT-FOUND in t.</span></span>
<span id="cb21-19"></span>
<span id="cb21-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    check=True verifies on a 9-point rho grid that the ENDPOINTS really are the</span></span>
<span id="cb21-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    extremes, i.e. that the full-grid spread equals the endpoint spread. C_A(t)</span></span>
<span id="cb21-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    is NOT monotone in rho at every t - the curves cross late in the run, when</span></span>
<span id="cb21-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    they are all near zero - so this is checked rather than assumed.</span></span>
<span id="cb21-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb21-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> check:</span>
<span id="cb21-26">        tw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>window, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">181</span>)</span>
<span id="cb21-27">        Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([mass_action(elem(r_, CE0, rm_fit, KM_fit), CE0, tw)</span>
<span id="cb21-28">                      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.geomspace(lo, hi, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)])</span>
<span id="cb21-29">        full, ends <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(Y.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Y.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Y[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb21-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(full <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ends) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>full, (CE0, full, ends)</span>
<span id="cb21-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> max_gap(ca_of_rho(lo, CE0), ca_of_rho(hi, CE0), window<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>window, with_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_t)</span>
<span id="cb21-32"></span>
<span id="cb21-33"></span>
<span id="cb21-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) over the whole run, where the maximum sits INSIDE THE INDUCTION LAYER</span></span>
<span id="cb21-35">v_all, t_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rho_spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, window<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>WIN_ALL, with_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb21-36">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_over_eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v_all<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb21-37">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_peak_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_all</span>
<span id="cb21-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"over the whole run at C_E0 = 1e-4: spread = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v_all<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L "</span></span>
<span id="cb21-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v_all<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> eps), attained at t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t_all<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min"</span>)</span>
<span id="cb21-40">sc_unif <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ca_of_rho(RHO_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)(te) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ca_of_rho(RHO_HI, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)(te))))</span>
<span id="cb21-41">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sampled_max_shortfall_uniform_scan"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sc_unif<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>v_all</span>
<span id="cb21-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a UNIFORM 181-point scan of the same window reads </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sc_unif<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb21-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sampled_max_shortfall_uniform_scan'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % low -- the whole "</span></span>
<span id="cb21-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"signal is in the first ~1e-3 min"</span>)</span>
<span id="cb21-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  induction timescale 1/(k1(c_A0+K_M)): "</span></span>
<span id="cb21-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(elem(RHO_LO,<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,rm_fit,KM_fit)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>KM_fit))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min at rho = 1e-4, "</span></span>
<span id="cb21-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(elem(RHO_HI,<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,rm_fit,KM_fit)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>KM_fit))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min at rho = 1e4"</span>)</span>
<span id="cb21-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  THIS IS INVISIBLE TO THE PRINTED TABLE, whose first sample after t = 0 "</span></span>
<span id="cb21-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"is at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_OBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min. It is what Froment p. 25 means by 'only transient</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb21-50">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  experimentation (stopped flow, or relaxation ...) can help'."</span>)</span>
<span id="cb21-51"></span>
<span id="cb21-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) over the window an experiment sampling like the printed table can see</span></span>
<span id="cb21-53">SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {CE0: rho_spread(CE0, check<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> CE0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>)}</span>
<span id="cb21-54">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_over_eps_trace_limit"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SPREAD[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb21-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">over the OBSERVABLE window t in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_OBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 18] min "</span></span>
<span id="cb21-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(9-point rho grid confirms the endpoints are the extremes):"</span>)</span>
<span id="cb21-57"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> CE0, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SPREAD.items():</span>
<span id="cb21-58">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  C_E0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CE0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L   eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_of(CE0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb21-59">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"spread = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L   spread/eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(CE0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-60"></span>
<span id="cb21-61">CE0_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: rho_spread(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>)</span>
<span id="cb21-62">rho_spread(CE0_star, check<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the endpoint check, at the root too</span></span>
<span id="cb21-63">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CE0_star_cmol_per_L"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CE0_star</span>
<span id="cb21-64">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps_of(CE0_star)</span>
<span id="cb21-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ROOT-FOUND in BOTH coordinates (the peak in t, then the threshold in "</span></span>
<span id="cb21-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"C_E0):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the observable spread reaches the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L print "</span></span>
<span id="cb21-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"resolution at C_E0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CE0_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  i.e. eps = "</span></span>
<span id="cb21-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_of(CE0_star)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  -- and this holds r_m, K_M and C_E0 fixed, which no real fit does."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>over the whole run at C_E0 = 1e-4: spread = 6.598393e-05 cmol/L (= 0.9773 eps), attained at t = 2.011e-07 min
  a UNIFORM 181-point scan of the same window reads 2.225547e-05, 66.3 % low -- the whole signal is in the first ~1e-3 min
  induction timescale 1/(k1(c_A0+K_M)): 2.09e-08 min at rho = 1e-4, 2.09e-04 min at rho = 1e4
  THIS IS INVISIBLE TO THE PRINTED TABLE, whose first sample after t = 0 is at 3 min. It is what Froment p. 25 means by 'only transient
  experimentation (stopped flow, or relaxation ...) can help'.

over the OBSERVABLE window t in [3, 18] min (9-point rho grid confirms the endpoints are the extremes):
  C_E0 =   1e-04 cmol/L   eps = 6.7519e-05   spread = 1.635811e-05 cmol/L   spread/eps = 0.2423
  C_E0 =   1e-03 cmol/L   eps = 6.7519e-04   spread = 1.634577e-04 cmol/L   spread/eps = 0.2421
  C_E0 =   1e-02 cmol/L   eps = 6.7519e-03   spread = 1.622230e-03 cmol/L   spread/eps = 0.2403
  C_E0 =   1e-01 cmol/L   eps = 6.7519e-02   spread = 1.500097e-02 cmol/L   spread/eps = 0.2222

ROOT-FOUND in BOTH coordinates (the peak in t, then the threshold in C_E0):
  the observable spread reaches the 0.0005 cmol/L print resolution at C_E0 = 3.064199e-03 cmol/L,
  i.e. eps = 2.068930e-03
  -- and this holds r_m, K_M and C_E0 fixed, which no real fit does.</code></pre>
</div>
</div>
<div id="66f32c6f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:28:52.638660Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:28:52.638475Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:29:05.901636Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:29:05.900292Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the honest version: can a fit at the WRONG rho reproduce the data?</span></span>
<span id="cb23-2">tt_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>)</span>
<span id="cb23-3"></span>
<span id="cb23-4"></span>
<span id="cb23-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> discriminate(eps, rho_true<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, rho_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb23-6">                 rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>):</span>
<span id="cb23-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Min RMS misfit of the rho_fit model to noise-free rho_true data,</span></span>
<span id="cb23-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    with r_m, K_M and C_E0 all free. An optimiser returns an UPPER BOUND on a</span></span>
<span id="cb23-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    minimum, so 'not separable' is the safe direction.</span></span>
<span id="cb23-10"></span>
<span id="cb23-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    rtol/atol are exposed so that a break row can loosen the ODE solve UNDERNEATH</span></span>
<span id="cb23-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the root-find - a perturbation of the computation rather than of a declared</span></span>
<span id="cb23-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    convention, which is the only kind that can expose a wrong baseline."""</span></span>
<span id="cb23-14">    grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tt_d <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> grid <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> grid</span>
<span id="cb23-15">    CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit)</span>
<span id="cb23-16">    truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass_action(elem(rho_true, CE0, rm_fit, KM_fit), CE0, grid,</span>
<span id="cb23-17">                        rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>atol)</span>
<span id="cb23-18"></span>
<span id="cb23-19">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rr(q):</span>
<span id="cb23-20">        rmv, KMv, CE0v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(q)</span>
<span id="cb23-21">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> mass_action(elem(rho_fit, CE0v, rmv, KMv), CE0v, grid,</span>
<span id="cb23-22">                           rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>atol) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> truth</span>
<span id="cb23-23"></span>
<span id="cb23-24">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb23-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ([rm_fit, KM_fit, CE0], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rm_fit, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KM_fit, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CE0]):</span>
<span id="cb23-26">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(rr, np.log(g), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb23-27">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> r.cost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> best.cost:</span>
<span id="cb23-28">            best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r</span>
<span id="cb23-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(best.fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))), np.exp(best.x)</span>
<span id="cb23-30"></span>
<span id="cb23-31"></span>
<span id="cb23-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misfit of a rho = 1e-4 model to rho = 1e4 data, everything else free:"</span>)</span>
<span id="cb23-33"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> eps <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>):</span>
<span id="cb23-34">    v, q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> discriminate(eps)</span>
<span id="cb23-35">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  RMS = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L   "</span></span>
<span id="cb23-36">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(refitted r_m </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, K_M </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, C_E0 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-37">rev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> discriminate(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>, rho_true<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, rho_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb23-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  reverse direction at eps = 1e-1: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rev<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -- larger, so the direction "</span></span>
<span id="cb23-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reported is the binding one"</span>)</span>
<span id="cb23-40"></span>
<span id="cb23-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># EVERY brentq on this threshold uses this one tolerance, in log10(eps). It is</span></span>
<span id="cb23-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># named rather than repeated so that the break table can DERIVE the resolution of</span></span>
<span id="cb23-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a difference between two such root-finds instead of choosing a round number for</span></span>
<span id="cb23-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it: ln(10)*XTOL_LOG10 relative per root-find, twice that for a difference.</span></span>
<span id="cb23-45">XTOL_LOG10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb23-46">eps_star_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: discriminate(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>),</span>
<span id="cb23-47">                        xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XTOL_LOG10)</span>
<span id="cb23-48">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps_star_c</span>
<span id="cb23-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ROOT-FOUND: with the other three constants free, telling rho = 1e-4 from "</span></span>
<span id="cb23-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rho = 1e4</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  at the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L resolution needs eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_star_c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (C_E0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_star_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>KM_fit)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  brentq at xtol = "</span></span>
<span id="cb23-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XTOL_LOG10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in log10, i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>XTOL_LOG10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative)."</span>)</span>
<span id="cb23-53"></span>
<span id="cb23-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- LIKE FOR LIKE. eps_star_rho_visible_at_print_resolution is a MAX over</span></span>
<span id="cb23-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># t in [3, 18] of the rho-spread; eps_star_discrimination_with_compensation is an</span></span>
<span id="cb23-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RMS over tt_d (25 points, from t = 0) of a REFITTED misfit. Dividing one by the</span></span>
<span id="cb23-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># other charges the whole ratio to compensation, which is wrong: part of it is</span></span>
<span id="cb23-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the change of statistic and window. So the SAME statistic on the SAME grid is</span></span>
<span id="cb23-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># measured here with rho pinned and NOTHING free, and that is the baseline the</span></span>
<span id="cb23-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># compensation penalty is quoted against.</span></span>
<span id="cb23-61"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread_rms_same_grid(eps, lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_LO, hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_HI):</span>
<span id="cb23-62">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""RMS over tt_d of |C_A(rho=lo) - C_A(rho=hi)|; r_m, K_M, C_E0 all pinned."""</span></span>
<span id="cb23-63">    CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit)</span>
<span id="cb23-64">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass_action(elem(lo, CE0, rm_fit, KM_fit), CE0, tt_d)</span>
<span id="cb23-65">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass_action(elem(hi, CE0, rm_fit, KM_fit), CE0, tt_d)</span>
<span id="cb23-66">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb23-67"></span>
<span id="cb23-68"></span>
<span id="cb23-69">eps_star_ll <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: spread_rms_same_grid(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb23-70">                         xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb23-71">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps_star_ll</span>
<span id="cb23-72">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_compensation_penalty"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps_star_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_star_ll</span>
<span id="cb23-73">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_statistic_and_window_factor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-74">    eps_star_ll<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>]</span>
<span id="cb23-75">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_raw_ratio_unlike_statistics"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb23-76">    eps_star_c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>]</span>
<span id="cb23-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">THE THREE EPSILONS, AND WHAT EACH ONE IS. All at the same </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L "</span></span>
<span id="cb23-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"resolution</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the same rho pair [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]:"</span>)</span>
<span id="cb23-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (a) max over t in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_OBS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 18] of the spread, nothing free   "</span></span>
<span id="cb23-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eps* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_star_rho_visible_at_print_resolution'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (b) RMS over the 25-point grid from t = 0, nothing free  "</span></span>
<span id="cb23-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eps* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_star_ll<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-83"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (c) the same RMS on the same grid, r_m/K_M/C_E0 free    "</span></span>
<span id="cb23-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eps* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_star_c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (b)/(a) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_star_statistic_and_window_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;- change of "</span></span>
<span id="cb23-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"STATISTIC and WINDOW only, no compensation"</span>)</span>
<span id="cb23-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (c)/(b) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_star_compensation_penalty'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;- THE PRICE OF "</span></span>
<span id="cb23-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"COMPENSATION, like for like"</span>)</span>
<span id="cb23-89"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (c)/(a) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_star_raw_ratio_unlike_statistics'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;- the raw "</span></span>
<span id="cb23-90">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ratio of the two headline numbers; it is the product of the two above,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb23-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"            and quoting it as the cost of compensation overstates that "</span></span>
<span id="cb23-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cost by "</span></span>
<span id="cb23-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_star_statistic_and_window_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>misfit of a rho = 1e-4 model to rho = 1e4 data, everything else free:
  eps = 1e-03  RMS = 8.4085e-06 cmol/L   (refitted r_m 0.16243, K_M 0.50194, C_E0 1.0202e-03)
  eps = 1e-02  RMS = 8.3019e-05 cmol/L   (refitted r_m 0.16108, K_M 0.49202, C_E0 1.0133e-02)
  eps = 3e-02  RMS = 2.4286e-04 cmol/L   (refitted r_m 0.15810, K_M 0.47049, C_E0 2.9927e-02)
  eps = 1e-01  RMS = 1.3050e-03 cmol/L   (refitted r_m 0.15214, K_M 0.42256, C_E0 9.0107e-02)
  reverse direction at eps = 1e-1: 4.4529e-03 -- larger, so the direction reported is the binding one

ROOT-FOUND: with the other three constants free, telling rho = 1e-4 from rho = 1e4
  at the 0.0005 cmol/L resolution needs eps = 5.797637e-02  (C_E0 = 8.586620e-02 cmol/L,
  brentq at xtol = 1e-06 in log10, i.e. 2.30e-06 relative).

THE THREE EPSILONS, AND WHAT EACH ONE IS. All at the same 0.0005 cmol/L resolution
and the same rho pair [0.0001, 10000]:
  (a) max over t in [3, 18] of the spread, nothing free   eps* = 2.068930e-03
  (b) RMS over the 25-point grid from t = 0, nothing free  eps* = 3.184735e-03
  (c) the same RMS on the same grid, r_m/K_M/C_E0 free    eps* = 5.797637e-02
  (b)/(a) = 1.5393  &lt;- change of STATISTIC and WINDOW only, no compensation
  (c)/(b) = 18.2045  &lt;- THE PRICE OF COMPENSATION, like for like
  (c)/(a) = 28.0224  &lt;- the raw ratio of the two headline numbers; it is the product of the two above,
            and quoting it as the cost of compensation overstates that cost by 1.54x</code></pre>
</div>
</div>
</section>
<section id="the-price-of-each-reduction-against-the-full-mass-action-solution" class="level3">
<h3 class="anchored" data-anchor-id="the-price-of-each-reduction-against-the-full-mass-action-solution">5. The price of each reduction against the full mass-action solution</h3>
<p>Froment states when the pseudo steady state fails (<em>“in particular if the enzyme concentration is relatively large compared to that of the substrate”</em>, p.&nbsp;25) and states the condition for route 1 only as words (<em>“the decomposition of the complex A-E into the product P and the enzyme E is the rate determining step”</em>). Both are turned into numbers here.</p>
<div id="b0489a67" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:29:05.904234Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:29:05.904055Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:29:06.182363Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:29:06.181639Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1">red_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: s_closed(t, cA0, rm_fit, KM_fit)</span>
<span id="cb25-2">QSSA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb25-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> CE0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>):</span>
<span id="cb25-4">    QSSA[CE0] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {r_: max_gap(ca_of_rho(r_, CE0), red_f)</span>
<span id="cb25-5">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e2</span>)}</span>
<span id="cb25-6">ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(QSSA)</span>
<span id="cb25-7">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_order_in_eps"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(</span>
<span id="cb25-8">    [np.log10(QSSA[ks[i]][<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>QSSA[ks[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)]))</span>
<span id="cb25-9">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_over_eps_rho1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> QSSA[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>][<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb25-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max |C_A(full) - C_A(eq. 1.5.1-13)|, cmol/L, divided by eps:"</span>)</span>
<span id="cb25-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> CE0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ks:</span>
<span id="cb25-12">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  C_E0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CE0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eps_of(CE0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-13">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rho=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QSSA[CE0][r_]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(CE0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb25-14">                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e2</span>)))</span>
<span id="cb25-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed order in eps: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'qssa_error_order_in_eps'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb25-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(first order, as the error being O(eps) requires)"</span>)</span>
<span id="cb25-17"></span>
<span id="cb25-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same error evaluated at the enzyme loading a DISCRIMINATING experiment needs</span></span>
<span id="cb25-19">_ce <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit)</span>
<span id="cb25-20">qssa_at_eps_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_gap(ca_of_rho(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, _ce), red_f)</span>
<span id="cb25-21">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_at_discrimination_eps_over_resolution"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> qssa_at_eps_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RES</span>
<span id="cb25-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AT eps* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps_star_discrimination_with_compensation'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, where "</span></span>
<span id="cb25-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rho first becomes visible with the other constants free, the pseudo "</span></span>
<span id="cb25-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"steady state</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  is itself off by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>qssa_at_eps_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L = "</span></span>
<span id="cb25-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'qssa_error_at_discrimination_eps_over_resolution'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x the "</span></span>
<span id="cb25-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> resolution the discrimination is read at."</span>)</span>
<span id="cb25-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHICH substrate the reduced model is compared against is a convention, and it</span></span>
<span id="cb25-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># moves this number, so both are printed. The reduced model has one substrate</span></span>
<span id="cb25-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># variable; the full model has free C_A and bound C_A-E.</span></span>
<span id="cb25-30">qssa_at_eps_star_tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_gap(</span>
<span id="cb25-31">    mass_action(elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, _ce, rm_fit, KM_fit), _ce, te, dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>),</span>
<span id="cb25-32">    red_f)</span>
<span id="cb25-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  That compares eq. (1.5.1-15) with the FREE substrate C_A. Against the "</span></span>
<span id="cb25-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"TOTAL</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  substrate C_A + C_A-E - the other defensible convention - the "</span></span>
<span id="cb25-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"same error is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>qssa_at_eps_star_tot<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L = "</span></span>
<span id="cb25-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>qssa_at_eps_star_tot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x the resolution. Both are far above 1, "</span></span>
<span id="cb25-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"which is the claim;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the factor quoted elsewhere on this page is the "</span></span>
<span id="cb25-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"free-C_A one."</span>)</span>
<span id="cb25-39"></span>
<span id="cb25-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which group? fix C_E0/c_A0 and sweep K_M over three decades</span></span>
<span id="cb25-41">GROUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb25-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> KMv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>):</span>
<span id="cb25-43">    CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA0</span>
<span id="cb25-44">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_gap(mass_action(elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, CE0, rm_fit, KMv), CE0, te, dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>),</span>
<span id="cb25-45">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, KMv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KMv: s_closed(t, cA0, rm_fit, KMv))</span>
<span id="cb25-46">    GROUP[KMv] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (e, e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(CE0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KMv)))</span>
<span id="cb25-47">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GROUP.values())</span>
<span id="cb25-48">                                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GROUP.values()))</span>
<span id="cb25-49">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0_plus_KM"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GROUP.values())</span>
<span id="cb25-50">                                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GROUP.values()))</span>
<span id="cb25-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at FIXED C_E0/c_A0 = 1e-3, sweeping K_M over three decades:"</span>)</span>
<span id="cb25-52"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> KMv, (e, a, b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GROUP.items():</span>
<span id="cb25-53">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  K_M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KMv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  error = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   error/(C_E0/c_A0) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb25-54">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"error/(C_E0/(c_A0+K_M)) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  spread of the ratio: C_E0/c_A0 x</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'qssa_group_spread_CE0_over_cA0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb25-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"C_E0/(c_A0+K_M) x</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'qssa_group_spread_CE0_over_cA0_plus_KM'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Froment's printed comparison is with the substrate alone, which is the "</span></span>
<span id="cb25-58">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M &lt;&lt; c_A0 corner of eps and is right there (coefficient 0.95 at "</span></span>
<span id="cb25-59">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M = 0.05); the K_M term is what this page adds."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>max |C_A(full) - C_A(eq. 1.5.1-13)|, cmol/L, divided by eps:
  C_E0 =   1e-05  eps = 6.7519e-06   rho=0.01   0.9747   rho=1      0.8119   rho=100    0.6491
  C_E0 =   1e-04  eps = 6.7519e-05   rho=0.01   0.9747   rho=1      0.8118   rho=100    0.6490
  C_E0 =   1e-03  eps = 6.7519e-04   rho=0.01   0.9745   rho=1      0.8111   rho=100    0.6480
  C_E0 =   1e-02  eps = 6.7519e-03   rho=0.01   0.9723   rho=1      0.8054   rho=100    0.6406
  C_E0 =   1e-01  eps = 6.7519e-02   rho=0.01   0.9505   rho=1      0.7597   rho=100    0.5856
observed order in eps: 0.9988  (first order, as the error being O(eps) requires)

AT eps* = 5.7976e-02, where rho first becomes visible with the other constants free, the pseudo steady state
  is itself off by 0.04443 cmol/L = 88.9 x the 0.0005 resolution the discrimination is read at.
  That compares eq. (1.5.1-15) with the FREE substrate C_A. Against the TOTAL
  substrate C_A + C_A-E - the other defensible convention - the same error is
  0.01939 cmol/L = 38.8 x the resolution. Both are far above 1, which is the claim;
  the factor quoted elsewhere on this page is the free-C_A one.

at FIXED C_E0/c_A0 = 1e-3, sweeping K_M over three decades:
  K_M =   0.05  error = 9.0773e-04   error/(C_E0/c_A0) = 9.0773e-01   error/(C_E0/(c_A0+K_M)) = 0.9541
  K_M =   0.50  error = 5.3717e-04   error/(C_E0/c_A0) = 5.3717e-01   error/(C_E0/(c_A0+K_M)) = 0.8118
  K_M =   5.00  error = 9.2983e-05   error/(C_E0/c_A0) = 9.2983e-02   error/(C_E0/(c_A0+K_M)) = 0.5684
  K_M =  50.00  error = 9.5593e-06   error/(C_E0/c_A0) = 9.5593e-03   error/(C_E0/(c_A0+K_M)) = 0.4983
  spread of the ratio: C_E0/c_A0 x95.0, C_E0/(c_A0+K_M) x1.91
  Froment's printed comparison is with the substrate alone, which is the K_M &lt;&lt; c_A0 corner of eps and is right there (coefficient 0.95 at K_M = 0.05); the K_M term is what this page adds.</code></pre>
</div>
</div>
<div id="cefe36a8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:29:06.184952Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:29:06.184757Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:29:06.515198Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:29:06.514198Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- route 1 (rapid equilibrium, K_M = k_-1/k_1) priced against the full model</span></span>
<span id="cb27-2">CE0t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># trace enzyme, so the QSSA error is negligible</span></span>
<span id="cb27-3"></span>
<span id="cb27-4"></span>
<span id="cb27-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq_route_err(rho, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb27-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max_t |C_A(full) - C_A(route 1)|, the maximum ROOT-FOUND in t."""</span></span>
<span id="cb27-7">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> elem(rho, CE0t, rm_fit, KM_fit)</span>
<span id="cb27-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> max_gap(mass_action(p, CE0t, te, dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw),</span>
<span id="cb27-9">                   <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: s_closed(t, cA0, rm_fit, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb27-10"></span>
<span id="cb27-11"></span>
<span id="cb27-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route 1 predicts C_A(t) from the elementary constants via K_M = k_-1/k_1:"</span>)</span>
<span id="cb27-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>):</span>
<span id="cb27-14">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> elem(r_, CE0t, rm_fit, KM_fit)</span>
<span id="cb27-15">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  rho = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   K_M(MM) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb27-16">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"max |dC_A| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eq_route_err(r_)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (route 2: "</span></span>
<span id="cb27-17">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>max_gap(mass_action(p, CE0t, te, dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), red_f)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb27-18"></span>
<span id="cb27-19">rho_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: eq_route_err(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb27-20">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_route"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rho_star</span>
<span id="cb27-21"></span>
<span id="cb27-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- SECOND, INDEPENDENT ROUTE to the same number: analytic sensitivity of the</span></span>
<span id="cb27-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     closed-form solution to K_M, with the extremum ROOT-FOUND, not sampled.</span></span>
<span id="cb27-24">s_sym, s0_sym, KM_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s s_0 K_M"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb27-25">g_expr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s_sym<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(s0_sym<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_sym)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(s_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_sym)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># |ds/dK_M| along the curve</span></span>
<span id="cb27-26">g_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.lambdify((s_sym, s0_sym, KM_sym), g_expr, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numpy"</span>)</span>
<span id="cb27-27">dg_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.lambdify((s_sym, s0_sym, KM_sym), sp.diff(g_expr, s_sym), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numpy"</span>)</span>
<span id="cb27-28">s_pk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: dg_f(s, cA0, KM_fit), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb27-29">gmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(g_f(s_pk, cA0, KM_fit))</span>
<span id="cb27-30">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RES<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(gmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dK_M = K_M rho/(1+rho)</span></span>
<span id="cb27-31">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_two_route_rel_diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb27-32">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rho_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb27-33">s_samp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g_f(np.clip(red, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), cA0, KM_fit)))</span>
<span id="cb27-34">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsdKM_rootfound_over_sampled"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_samp</span>
<span id="cb27-35"></span>
<span id="cb27-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ROOT-FOUND: route 1 reaches the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cmol/L resolution at "</span></span>
<span id="cb27-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rho = k_2/k_-1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rho_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"SECOND ROUTE (analytic sensitivity, no ODE solver, no mass-action model):"</span>)</span>
<span id="cb27-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ds/dK_M = s ln(s_0/s)/(s + K_M); its maximum is root-found at "</span></span>
<span id="cb27-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"s = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_pk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, value </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gmax<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  giving rho* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rho_star_equilibrium_analytic'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb27-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rho_star_equilibrium_two_route_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from the "</span></span>
<span id="cb27-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nonlinear root-find"</span>)</span>
<span id="cb27-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (sampling that maximum on the 181-point t grid instead would give "</span></span>
<span id="cb27-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_samp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dsdKM_rootfound_over_sampled'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -- so on "</span></span>
<span id="cb27-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"THIS curve the sample happens to be right, which the root-find is what "</span></span>
<span id="cb27-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"establishes)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>route 1 predicts C_A(t) from the elementary constants via K_M = k_-1/k_1:
  rho =    0.001   K_M(MM) = 0.502553  max |dC_A| = 2.2755e-04   (route 2: 6.6011e-06)
  rho =     0.01   K_M(MM) = 0.498074  max |dC_A| = 2.2689e-03   (route 2: 6.5812e-06)
  rho =      0.1   K_M(MM) = 0.457323  max |dC_A| = 2.1446e-02   (route 2: 6.3995e-06)
  rho =        1   K_M(MM) = 0.251528  max |dC_A| = 1.4009e-01   (route 2: 5.4819e-06)
  rho =       10   K_M(MM) = 0.045732  max |dC_A| = 3.3572e-01   (route 2: 4.5643e-06)

ROOT-FOUND: route 1 reaches the 0.0005 cmol/L resolution at rho = k_2/k_-1 = 2.195118e-03
SECOND ROUTE (analytic sensitivity, no ODE solver, no mass-action model):
  ds/dK_M = s ln(s_0/s)/(s + K_M); its maximum is root-found at s = 0.228461, value 0.454146
  giving rho* = 2.193362e-03, 0.080 % from the nonlinear root-find
  (sampling that maximum on the 181-point t grid instead would give 0.454145, a factor 1.000002 -- so on THIS curve the sample happens to be right, which the root-find is what establishes)</code></pre>
</div>
</div>
<div id="2ce86f0a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:29:06.517672Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:29:06.517538Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:29:08.487924Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:29:08.486948Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>))</span>
<span id="cb29-2">epsv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([eps_of(c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ks])</span>
<span id="cb29-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, col, mk <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, C_BLUE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, C_ORANGE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e2</span>, C_GREEN, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^"</span>)):</span>
<span id="cb29-4">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(epsv, [QSSA[c][r_] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ks], mk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col,</span>
<span id="cb29-5">                 label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ho</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-6">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(epsv, epsv, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"slope 1"</span>)</span>
<span id="cb29-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(RES, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_PURPLE, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb29-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].text(epsv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], RES<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.25</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"print resolution"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_PURPLE)</span>
<span id="cb29-9">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\v</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">arepsilon = C_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m E}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">c_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m A0}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K_M</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-10">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"max </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m A}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">full</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- C_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m A}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1-13</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cost of the pseudo steady state"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb29-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both"</span>)</span>
<span id="cb29-13"></span>
<span id="cb29-14">rr_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb29-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(rr_g, [eq_route_err(r_) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rr_g], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_ORANGE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>,</span>
<span id="cb29-16">             label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route 1, $K_M = k_{-1}/k_1$"</span>)</span>
<span id="cb29-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(rr_g, [max_gap(ca_of_rho(r_, CE0t), red_f) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rr_g],</span>
<span id="cb29-18">             color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_BLUE, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route 2, $K_M = (k_{-1}+k_2)/k_1$"</span>)</span>
<span id="cb29-19">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axhline(RES, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_PURPLE, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb29-20">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axvline(rho_star, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_GREY, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb29-21">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].text(rho_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-5</span>, <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ho</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rho_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>)</span>
<span id="cb29-22">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ho = k_2/k_{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"max </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\D</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta C_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m A}</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cmol/L</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-24">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"at trace enzyme, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\v</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">arepsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1e"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> eps_of(CE0t), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb29-25">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both"</span>)</span>
<span id="cb29-26">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.6-michaelis-menten-briggs-haldane/index_files/figure-html/cell-16-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="what-the-actual-seven-points-say-about-rho" class="level3">
<h3 class="anchored" data-anchor-id="what-the-actual-seven-points-say-about-rho">6. What the actual seven points say about <img src="https://latex.codecogs.com/png.latex?%5Crho"></h3>
<p>Pin <img src="https://latex.codecogs.com/png.latex?%5Crho">, let <img src="https://latex.codecogs.com/png.latex?r_m">, <img src="https://latex.codecogs.com/png.latex?K_M"> and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> re-optimise against the printed table, and read the best achievable sum of squares. If <img src="https://latex.codecogs.com/png.latex?%5Crho"> mattered to the data there would be an interior optimum and a sharp one.</p>
<div id="ae419b90" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:29:08.490172Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:29:08.490036Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:29:13.136284Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:29:13.134997Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sse_pin_rho(rho):</span>
<span id="cb30-2">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rr(q):</span>
<span id="cb30-3">        rmv, KMv, CE0v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(q)</span>
<span id="cb30-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> mass_action(elem(rho, CE0v, rmv, KMv), CE0v, t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d</span>
<span id="cb30-5">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb30-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> CE0g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>):</span>
<span id="cb30-7">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(rr, np.log([rm_fit, KM_fit, CE0g]),</span>
<span id="cb30-8">                          xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb30-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> r.cost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> best.cost:</span>
<span id="cb30-10">            best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r</span>
<span id="cb30-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(best.cost), np.exp(best.x)</span>
<span id="cb30-12"></span>
<span id="cb30-13"></span>
<span id="cb30-14">PROF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {r_: sse_pin_rho(r_) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)}</span>
<span id="cb30-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, (s_, q_) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROF.items():</span>
<span id="cb30-16">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  rho = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   SSE = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb30-17">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"r_m </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  K_M </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  C_E0 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb30-18">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(eps </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>q_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(cA0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>q_[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb30-19">sses <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([v[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROF.values()])</span>
<span id="cb30-20">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_profile_sse_span_fraction"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sses.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sses.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb30-21">sse_best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sses.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb30-22">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_statistic"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(((sse_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sse_best)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(sse_best<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)))</span>
<span id="cb30-23">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_crit_95"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f_dist.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb30-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">SSE span across eight decades of rho: "</span></span>
<span id="cb30-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rho_profile_sse_span_fraction'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, monotone, no interior optimum"</span>)</span>
<span id="cb30-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"two-parameter Michaelis-Menten SSE </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sse_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; best four-parameter "</span></span>
<span id="cb30-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mass-action SSE </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sse_best<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"F = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'full_model_F_statistic'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against F(2, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t_d)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = "</span></span>
<span id="cb30-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'full_model_F_crit_95'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at 95 % -- the two extra parameters are "</span></span>
<span id="cb30-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"NOT justified by these data"</span>)</span>
<span id="cb30-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ONE CAVEAT ON THE F TEST, STATED BECAUSE IT IS A REAL ONE. The models "</span></span>
<span id="cb30-32">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"are nested</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">(the reduced model is the C_E0 -&gt; 0 limit at fixed r_m, "</span></span>
<span id="cb30-33">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M), but the nesting is</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">NON-REGULAR: the null sits on the boundary "</span></span>
<span id="cb30-34">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_E0 = 0 of the parameter space and rho</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">is unidentified under it, so "</span></span>
<span id="cb30-35">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F(2, 3) is an approximation to the null distribution</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">rather than the "</span></span>
<span id="cb30-36">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact one. The direction is safe. A boundary null makes the true</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">null "</span></span>
<span id="cb30-37">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"distribution stochastically no larger, so the real p-value is at least "</span></span>
<span id="cb30-38">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">tabulated one and 'not justified' holds a fortiori."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  rho =    1e-04   SSE = 5.418286e-05   r_m 0.13903  K_M 0.36904  C_E0 3.4254e-02 (eps 0.0254)
  rho =    1e-02   SSE = 5.415093e-05   r_m 0.13888  K_M 0.36829  C_E0 3.4598e-02 (eps 0.0257)
  rho =    1e+00   SSE = 5.227973e-05   r_m 0.14092  K_M 0.38272  C_E0 3.9282e-02 (eps 0.0289)
  rho =    1e+02   SSE = 4.995310e-05   r_m 0.14380  K_M 0.40298  C_E0 4.5967e-02 (eps 0.0333)
  rho =    1e+04   SSE = 4.990060e-05   r_m 0.14387  K_M 0.40349  C_E0 4.6125e-02 (eps 0.0334)

SSE span across eight decades of rho: 8.58 %, monotone, no interior optimum
two-parameter Michaelis-Menten SSE 1.131389e-04; best four-parameter mass-action SSE 4.990060e-05
F = 1.9009 against F(2, 3) = 9.5521 at 95 % -- the two extra parameters are NOT justified by these data

ONE CAVEAT ON THE F TEST, STATED BECAUSE IT IS A REAL ONE. The models are nested
(the reduced model is the C_E0 -&gt; 0 limit at fixed r_m, K_M), but the nesting is
NON-REGULAR: the null sits on the boundary C_E0 = 0 of the parameter space and rho
is unidentified under it, so F(2, 3) is an approximation to the null distribution
rather than the exact one. The direction is safe. A boundary null makes the true
null distribution stochastically no larger, so the real p-value is at least the
tabulated one and 'not justified' holds a fortiori.</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Five kinds, kept apart:</p>
<ol type="1">
<li><strong>Structural identities</strong> (the ten symbolic ones, the symbolic proof of the <img src="https://latex.codecogs.com/png.latex?%5Crho">-degeneracy, the exact linearity of <img src="https://latex.codecogs.com/png.latex?1/r"> in <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D">). These are proofs; they cannot fail for the right reason, the numerical ones sit at round-off and are registered as bounds, and each is named with a companion that can move in the coverage map. The <em>numerical</em> zero that goes with the degeneracy is reported beside its own float spread over random draws, because an exact 0.0 in floating point is a property of the values chosen, not of the algebra.</li>
<li><strong>Conservation</strong> in the pymrm mass-action marcher: the two balances the scheme implies, on a model that integrates all four fields independently, so a wrong stoichiometric row would break them.</li>
<li><strong>Time-step refinement with an observed order</strong>, plus Richardson extrapolation checked against a different solver family.</li>
<li><strong>A second, independent computation of a headline</strong> - two of them, in fact: the fit through the pymrm marcher instead of the Lambert <img src="https://latex.codecogs.com/png.latex?W"> closed form, and <img src="https://latex.codecogs.com/png.latex?%5Crho%5E*"> from an analytic sensitivity instead of a nonlinear root-find.</li>
<li><strong>A defect-injection table with a row for every reported metric</strong> - and, for every metric that has one, a printed measure of <em>how hard</em> its strongest row hits it. A row that clears a threshold by an ulp is not evidence, and one row on this table is written to show a metric does <strong>not</strong> move; it is labelled a robustness row and is not counted as coverage anywhere.</li>
</ol>
<div id="80245f9c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:29:13.138991Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:29:13.138843Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:29:20.563502Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:29:20.562587Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- pymrm backward Euler: order in dt, conservation, and a second solver family</span></span>
<span id="cb32-2">CE0h, n_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span></span>
<span id="cb32-3">te_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, n_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb32-4">p_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, CE0h, rm_fit, KM_fit)</span>
<span id="cb32-5">ref_lsoda <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass_action(p_h, CE0h, te_h)</span>
<span id="cb32-6">ref_radau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass_action(p_h, CE0h, te_h, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Radau"</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)</span>
<span id="cb32-7">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lsoda_vs_radau_reference"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ref_lsoda <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_radau)))</span>
<span id="cb32-8"></span>
<span id="cb32-9">bm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BatchMassAction(p_h)</span>
<span id="cb32-10">ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bm.run([cA0, CE0h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, n, n_out)[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb32-11">                              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_radau))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">180</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">720</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1440</span>)}</span>
<span id="cb32-12">ns <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(ERR)</span>
<span id="cb32-13">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_be_time_order"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(</span>
<span id="cb32-14">    [np.log2(ERR[ns[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ERR[ns[i]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)]))</span>
<span id="cb32-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(ns):</span>
<span id="cb32-16">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log2(ERR[ns[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ERR[n])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb32-17">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n_steps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  dt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min  max |dC_A| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ERR[n]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5e}{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb32-18"></span>
<span id="cb32-19">o1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bm.run([cA0, CE0h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">720</span>, n_out)</span>
<span id="cb32-20">o2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bm.run([cA0, CE0h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1440</span>, n_out)</span>
<span id="cb32-21">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>o2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> o1[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_radau)))</span>
<span id="cb32-22">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_enzyme_balance_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> o2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CE0h)))</span>
<span id="cb32-23">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> o2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb32-24">                                                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> o2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cA0)))</span>
<span id="cb32-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  mean observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_be_time_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (backward Euler: 1)"</span>)</span>
<span id="cb32-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Richardson(720, 1440) vs Radau      </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_richardson_vs_radau'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb32-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  LSODA vs Radau on the same problem  below 1e-9 "</span></span>
<span id="cb32-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lsoda_vs_radau_reference'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb32-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  enzyme balance   max |C_E + C_A-E - C_E0|      below 1e-13 "</span></span>
<span id="cb32-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_enzyme_balance_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb32-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  substrate balance max |C_A + C_A-E + C_P - c_A0| below 1e-13 "</span></span>
<span id="cb32-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_substrate_balance_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  n_steps =   180  dt = 0.10000 min  max |dC_A| = 1.94446e-03
  n_steps =   360  dt = 0.05000 min  max |dC_A| = 9.74358e-04   order 0.9968
  n_steps =   720  dt = 0.02500 min  max |dC_A| = 4.87798e-04   order 0.9982
  n_steps =  1440  dt = 0.01250 min  max |dC_A| = 2.44092e-04   order 0.9989

  mean observed order 0.9980 (backward Euler: 1)
  Richardson(720, 1440) vs Radau      4.1928e-07
  LSODA vs Radau on the same problem  below 1e-9 (here 3.8e-11)
  enzyme balance   max |C_E + C_A-E - C_E0|      below 1e-13 (here 1e-17)
  substrate balance max |C_A + C_A-E + C_P - c_A0| below 1e-13 (here 2e-15)</code></pre>
</div>
</div>
<div id="8e9dac56" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:29:20.565995Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:29:20.565859Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:31:33.522567Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:31:33.521501Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- SECOND INDEPENDENT ROUTE TO THE FIT: pymrm backward Euler + Richardson,</span></span>
<span id="cb34-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     sharing no algebra with the Lambert W closed form.</span></span>
<span id="cb34-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_via_pymrm(n_steps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1800</span>):</span>
<span id="cb34-4">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resid(q):</span>
<span id="cb34-5">        kk, KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(q)</span>
<span id="cb34-6">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BatchReduced(kk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KK, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KK).run(c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, n_steps, t_d)</span>
<span id="cb34-7">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BatchReduced(kk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KK, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KK).run(c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>n_steps, t_d)</span>
<span id="cb34-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d</span>
<span id="cb34-9">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(resid, np.log([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>]), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb34-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(r.x)</span>
<span id="cb34-11"></span>
<span id="cb34-12"></span>
<span id="cb34-13">k_alt, K_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_via_pymrm()</span>
<span id="cb34-14">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_k_rel_diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(k_alt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>k_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb34-15">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_K_rel_diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(K_alt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb34-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Lambert W closed form  : k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   K = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb34-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm BE + Richardson  : k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_alt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   K = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_alt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb34-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"relative difference    : below 1e-5 / below 1e-6 (here "</span></span>
<span id="cb34-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fit_second_route_k_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / "</span></span>
<span id="cb34-20">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fit_second_route_K_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb34-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">What this catches that a break row cannot: an algebra error in the "</span></span>
<span id="cb34-22">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lambert W inversion, or a wrong branch. Both routes integrate the same "</span></span>
<span id="cb34-23">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed ODE; they share no line of code."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Lambert W closed form  : k = 0.323192121   K = 1.987853303
pymrm BE + Richardson  : k = 0.323192140   K = 1.987853314
relative difference    : below 1e-5 / below 1e-6 (here 5.9e-08 / 5.6e-09)

What this catches that a break row cannot: an algebra error in the Lambert W inversion, or a wrong branch. Both routes integrate the same printed ODE; they share no line of code.</code></pre>
</div>
</div>
<section id="the-defect-injection-table" class="level3">
<h3 class="anchored" data-anchor-id="the-defect-injection-table">The defect-injection table</h3>
<p>Every metric in <code>agreement.json</code> needs something that moves it. Rows below are run live; the coverage map at the end is <strong>generated from the measured movers</strong>, not asserted.</p>
<div id="d4a56cfb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:31:33.525638Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:31:33.525481Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:32:48.108006Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:32:48.106994Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MOVE_TOL is 1e-6, not 1e-9, and the table prints the relative move of every</span></span>
<span id="cb36-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># row. Both for one reason: a row can clear a 1e-9 threshold and still be no</span></span>
<span id="cb36-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># evidence at all. Two</span></span>
<span id="cb36-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of this page's root-finds are themselves converged only to ~2e-6 relative</span></span>
<span id="cb36-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (brentq xtol 1e-6 in log10), so a "move" below that is inside the noise of the</span></span>
<span id="cb36-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># computation being probed. And a ROBUSTNESS row - one written to show a metric</span></span>
<span id="cb36-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># does NOT move - must never be counted as coverage for that metric, however the</span></span>
<span id="cb36-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># threshold falls; those are declared with kind="robustness" and asserted to</span></span>
<span id="cb36-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stay put instead.</span></span>
<span id="cb36-10">MOVE_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb36-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROOT_FIND_RES is DERIVED, not chosen. Each eps* on this page comes from brentq</span></span>
<span id="cb36-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at xtol = XTOL_LOG10 in log10, i.e. ln(10)*XTOL_LOG10 relative; a row that</span></span>
<span id="cb36-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># compares two such root-finds inherits both, so the worst case is twice that.</span></span>
<span id="cb36-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rounding it UP to 1e-5 would be 2.2x the arithmetic and would make the</span></span>
<span id="cb36-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># robustness row's move (5.7e-6, i.e. 1.2x the real bound) look unresolved when</span></span>
<span id="cb36-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it is not quite. The bound is the arithmetic.</span></span>
<span id="cb36-17">ROOT_FIND_RES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>XTOL_LOG10             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># = 4.61e-6</span></span>
<span id="cb36-18"></span>
<span id="cb36-19"></span>
<span id="cb36-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rec(name, metric, before, after, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, kind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span>):</span>
<span id="cb36-21">    rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(after <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> before)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(before), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb36-22">    real <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(after <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> before) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, MOVE_TOL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(before))</span>
<span id="cb36-23">    BREAK.append({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>: name, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>: metric, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>: before,</span>
<span id="cb36-24">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"injected"</span>: after, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>: rel, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>: kind,</span>
<span id="cb36-25">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (real <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NO"</span>,</span>
<span id="cb36-26">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"note"</span>: note})</span>
<span id="cb36-27"></span>
<span id="cb36-28"></span>
<span id="cb36-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R1 -- use route 1's K_M in the reduced model at rho = 1 (i.e. drop k2 from 1.5.1-14)</span></span>
<span id="cb36-30">r1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq_route_err(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(CE0t)</span>
<span id="cb36-31">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1"</span>,</span>
<span id="cb36-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_over_eps_rho1"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_over_eps_rho1"</span>], r1,</span>
<span id="cb36-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two K_M differ by 1+rho = 2 here"</span>)</span>
<span id="cb36-34"></span>
<span id="cb36-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R2 -- k2 up 1 % without compensating C_E0</span></span>
<span id="cb36-36">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k2 raised 1 % with C_E0 left alone"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>,</span>
<span id="cb36-37">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_break_k2_plus_1pct"</span>],</span>
<span id="cb36-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the exact-zero degeneracy is structural; this is its above-floor companion"</span>)</span>
<span id="cb36-39"></span>
<span id="cb36-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R3 -- Lineweaver on Froment's printed axes</span></span>
<span id="cb36-41">Bd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([cm_d, np.ones_like(cm_d)]).T</span>
<span id="cb36-42">slb, icb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(Bd, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_d, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-43">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lineweaver run on Froment's printed axes (1/r vs C_A)"</span>,</span>
<span id="cb36-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_cmol_per_L"</span>, KM_fit, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>icb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>slb) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> slb <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan,</span>
<span id="cb36-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed axes give an intercept/slope with no Michaelis-Menten meaning"</span>)</span>
<span id="cb36-46"></span>
<span id="cb36-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R4 -- move one datum by its own print resolution</span></span>
<span id="cb36-48">c_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c_d.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> c_p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> RES</span>
<span id="cb36-49">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_S(9 min) moved by +5e-4 (one print ulp)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_cmol_per_L"</span>,</span>
<span id="cb36-50">    KM_fit, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>fit_mm(t_d, c_p)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sensitivity of the fit to the last digit"</span>)</span>
<span id="cb36-51"></span>
<span id="cb36-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R5 -- the same, on the RMS</span></span>
<span id="cb36-53">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_S(9 min) moved by +5e-4 (one print ulp)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rms_cmol_per_L"</span>,</span>
<span id="cb36-54">    rms_fit, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(fit_mm(t_d, c_p)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-55"></span>
<span id="cb36-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R6 -- initial concentration treated as free</span></span>
<span id="cb36-57">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_A0 fitted instead of read off the table"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_cmol_per_L"</span>,</span>
<span id="cb36-58">    KM_fit, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_with_s0_free"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-59"></span>
<span id="cb36-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R7 -- break the P stoichiometry in the pymrm source term</span></span>
<span id="cb36-61"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> BadStoich(BatchMassAction):</span>
<span id="cb36-62">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb36-63">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">super</span>().source(c)</span>
<span id="cb36-64">        s[..., <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># P made twice as fast as A-E decays</span></span>
<span id="cb36-65">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> s</span>
<span id="cb36-66">ob <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BadStoich(p_h).run([cA0, CE0h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">720</span>, n_out)</span>
<span id="cb36-67">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P row of the pymrm source doubled"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>,</span>
<span id="cb36-68">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>],</span>
<span id="cb36-69">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ob[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ob[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ob[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cA0))),</span>
<span id="cb36-70">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the conservation check sits at round-off but is NOT an identity"</span>)</span>
<span id="cb36-71"></span>
<span id="cb36-72"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R8 -- drop the reverse step from the pymrm source</span></span>
<span id="cb36-73"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> NoReverse(BatchMassAction):</span>
<span id="cb36-74">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> source(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, c):</span>
<span id="cb36-75">        kf, kr, kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.p</span>
<span id="cb36-76">        cA, cE, cAE, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (c[..., i] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb36-77">        v1, v2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cE, kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cAE            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k_-1 term deleted</span></span>
<span id="cb36-78">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.stack([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v1, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v2, v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v2, v2], axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb36-79">onr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NoReverse(p_h).run([cA0, CE0h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">720</span>, n_out)</span>
<span id="cb36-80">onr2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NoReverse(p_h).run([cA0, CE0h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1440</span>, n_out)</span>
<span id="cb36-81">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_-1 term deleted from the pymrm source"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>,</span>
<span id="cb36-82">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>],</span>
<span id="cb36-83">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>onr2[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> onr[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_radau))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-84"></span>
<span id="cb36-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R9 -- report the coarsest backward-Euler run instead of the extrapolation</span></span>
<span id="cb36-86">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"coarsest run (n = 180) reported instead of Richardson"</span>,</span>
<span id="cb36-87">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>], ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">180</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-88"></span>
<span id="cb36-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R10 -- forward instead of backward Euler in the reduced marcher (order check)</span></span>
<span id="cb36-90"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fe_order():</span>
<span id="cb36-91">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb36-92">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">180</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">720</span>):</span>
<span id="cb36-93">        dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n</span>
<span id="cb36-94">        c, out, idx, k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cA0, [], np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(te_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dt).astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb36-95">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb36-96">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">while</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(idx) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> idx[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> i:</span>
<span id="cb36-97">                out.append(c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb36-98">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>rm_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c)</span>
<span id="cb36-99">        e[n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.array(out)</span>
<span id="cb36-100">                                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_closed(te_h, cA0, rm_fit, KM_fit))))</span>
<span id="cb36-101">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean([np.log2(e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">180</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span>]), np.log2(e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">360</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">720</span>])]))</span>
<span id="cb36-102">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"explicit Euler on the reduced ODE"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_be_time_order"</span>,</span>
<span id="cb36-103">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_be_time_order"</span>], fe_order(),</span>
<span id="cb36-104">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both are first order, so the ORDER is a weak check; the magnitude is not"</span>)</span>
<span id="cb36-105"></span>
<span id="cb36-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R11 -- sample max|ds/dK_M| on a coarse grid instead of root-finding</span></span>
<span id="cb36-107">s_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g_f(np.clip(s_closed(np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>), cA0, rm_fit, KM_fit),</span>
<span id="cb36-108">                               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), cA0, KM_fit)))</span>
<span id="cb36-109">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max |ds/dK_M| sampled on a 19-point t grid"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsdKM_rootfound_over_sampled"</span>,</span>
<span id="cb36-110">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsdKM_rootfound_over_sampled"</span>], gmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s_c, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-111"></span>
<span id="cb36-112"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R12 -- loose ODE tolerance under the rho* root-find</span></span>
<span id="cb36-113">eq_err_loose <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> rho: eq_route_err(rho, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb36-114">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ODE tolerance loosened to rtol 1e-6 under the root-find"</span>,</span>
<span id="cb36-115">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_route"</span>, rho_star,</span>
<span id="cb36-116">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: eq_err_loose(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-117"></span>
<span id="cb36-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R13 -- the threshold the eps* root-find is read at, doubled</span></span>
<span id="cb36-119">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution threshold doubled to 1e-3 cmol/L"</span>,</span>
<span id="cb36-120">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>,</span>
<span id="cb36-121">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>],</span>
<span id="cb36-122">    eps_of(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: rho_spread(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>)),</span>
<span id="cb36-123">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps* is a property of the resolution it is read at, and is reported as one"</span>)</span>
<span id="cb36-124">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution threshold doubled to 1e-3 cmol/L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CE0_star_cmol_per_L"</span>,</span>
<span id="cb36-125">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CE0_star_cmol_per_L"</span>],</span>
<span id="cb36-126">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: rho_spread(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-127">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"induction peak read on a uniform 181-point scan (sampled max)"</span>,</span>
<span id="cb36-128">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sampled_max_shortfall_uniform_scan"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sampled_max_shortfall_uniform_scan"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb36-129">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"by construction: this metric IS the size of that defect"</span>)</span>
<span id="cb36-130">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"induction spread read over the observable window instead"</span>,</span>
<span id="cb36-131">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_over_eps"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_over_eps"</span>],</span>
<span id="cb36-132">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_over_eps_trace_limit"</span>],</span>
<span id="cb36-133">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two windows are the page's point and are reported separately"</span>)</span>
<span id="cb36-134">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"induction spread read over the observable window instead"</span>,</span>
<span id="cb36-135">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_peak_min"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_peak_min"</span>],</span>
<span id="cb36-136">    rho_spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, with_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-137"></span>
<span id="cb36-138"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R14 -- discrimination fit given only the true starting point</span></span>
<span id="cb36-139"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> discr_single(eps):</span>
<span id="cb36-140">    CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit)</span>
<span id="cb36-141">    truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass_action(elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, CE0, rm_fit, KM_fit), CE0, tt_d)</span>
<span id="cb36-142">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: mass_action(elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(q[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])),</span>
<span id="cb36-143">                                            np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), tt_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> truth,</span>
<span id="cb36-144">                      np.log([rm_fit, KM_fit, CE0]),</span>
<span id="cb36-145">                      xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb36-146">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(r.fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb36-147">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discrimination fit reduced to a single start"</span>,</span>
<span id="cb36-148">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>, eps_star_c,</span>
<span id="cb36-149">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: discr_single(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>),</span>
<span id="cb36-150">               xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XTOL_LOG10),</span>
<span id="cb36-151">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ROBUSTNESS ROW, NOT COVERAGE: a narrower search can only raise the misfit, "</span></span>
<span id="cb36-152">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hence lower eps*; it must not move much, and it does not"</span>, kind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness"</span>)</span>
<span id="cb36-153"></span>
<span id="cb36-154"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R14b -- three rows that DO move the compensated eps*, because a metric whose</span></span>
<span id="cb36-155"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only entry is the robustness row above would have nothing to show if it were</span></span>
<span id="cb36-156"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># wrong. The first two are things the threshold is a declared PROPERTY of: the</span></span>
<span id="cb36-157"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># resolution it is read at (as row R13 does for its uncompensated sibling) and</span></span>
<span id="cb36-158"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the sampling grid. Those two are honest coverage but they are not a baseline</span></span>
<span id="cb36-159"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># test - they would move by the same 51 % and 20 % even if discriminate() itself</span></span>
<span id="cb36-160"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># were systematically wrong. The THIRD row is the baseline test: it perturbs the</span></span>
<span id="cb36-161"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># computation under the root-find rather than a declared convention, exactly as</span></span>
<span id="cb36-162"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R12 does for rho_star_equilibrium_route.</span></span>
<span id="cb36-163">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution threshold doubled to 1e-3 cmol/L"</span>,</span>
<span id="cb36-164">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>, eps_star_c,</span>
<span id="cb36-165">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: discriminate(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>),</span>
<span id="cb36-166">               xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XTOL_LOG10),</span>
<span id="cb36-167">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps* with compensation is a property of the resolution it is read at"</span>)</span>
<span id="cb36-168">_tt13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span>
<span id="cb36-169">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discrimination misfit read on 13 grid points instead of 25"</span>,</span>
<span id="cb36-170">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>, eps_star_c,</span>
<span id="cb36-171">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: discriminate(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g, grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_tt13)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb36-172">               np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XTOL_LOG10),</span>
<span id="cb36-173">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and of the 25-point grid the RMS is taken on -- the third thing the page "</span></span>
<span id="cb36-174">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"declares it depends on"</span>)</span>
<span id="cb36-175">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the ODE solve UNDER the discrimination root-find loosened to rtol 1e-6"</span>,</span>
<span id="cb36-176">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>, eps_star_c,</span>
<span id="cb36-177">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: discriminate(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb36-178">               np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XTOL_LOG10),</span>
<span id="cb36-179">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NOT A CONVENTION: this one perturbs the COMPUTATION, so unlike the two "</span></span>
<span id="cb36-180">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows above it would show a systematically wrong baseline (a mis-integrated "</span></span>
<span id="cb36-181">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"truth model, a solver at a tolerance too loose for the eps^1 signal). Its "</span></span>
<span id="cb36-182">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative move is also the convergence evidence for the quoted eps*, which "</span></span>
<span id="cb36-183">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is solved at rtol 1e-11"</span>)</span>
<span id="cb36-184">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution threshold doubled to 1e-3 cmol/L"</span>,</span>
<span id="cb36-185">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>, eps_star_ll,</span>
<span id="cb36-186">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: spread_rms_same_grid(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>),</span>
<span id="cb36-187">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the like-for-like baseline is a property of the same resolution"</span>)</span>
<span id="cb36-188">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho range narrowed from [1e-4, 1e4] to [0.5, 2]"</span>,</span>
<span id="cb36-189">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>, eps_star_ll,</span>
<span id="cb36-190">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: spread_rms_same_grid(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>g, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb36-191">               xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-192"></span>
<span id="cb36-193"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R15 -- everything the one-ulp perturbation touches, in one place</span></span>
<span id="cb36-194">k_p, K_p, _, res_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_mm(t_d, c_p)</span>
<span id="cb36-195">rms_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(res_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb36-196">nul_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(least_squares(</span>
<span id="cb36-197">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: c_p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_p, [np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)],</span>
<span id="cb36-198">    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>).fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb36-199">PERT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_S(9 min) moved by +5e-4 (one print ulp)"</span></span>
<span id="cb36-200">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>], nul_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms_p, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-201">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_k_per_min"</span>, k_fit, k_p, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-202">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_K_L_per_cmol"</span>, K_fit, K_p, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-203">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rm_cmol_per_L_min"</span>, rm_fit, k_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_p, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-204">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_maxres_over_print_resolution"</span>,</span>
<span id="cb36-205">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_maxres_over_print_resolution"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(res_p)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RES, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-206">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_sse_penalty_K_pinned_at_2"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_sse_penalty_K_pinned_at_2"</span>],</span>
<span id="cb36-207">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(fit_mm(t_d, c_p, K_fixed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(res_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-208">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_with_s0_free"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_with_s0_free"</span>],</span>
<span id="cb36-209">    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>fit_mm(t_d, c_p, s0_free<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-210">k_lp, K_lp, cm_p, r_lp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lineweaver(t_d, c_p)</span>
<span id="cb36-211">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_vs_nls"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_vs_nls"</span>], (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lp)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-212">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_rm_bias_vs_nls"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_rm_bias_vs_nls"</span>], (k_lp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_lp)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(k_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-213">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_finite_difference_only"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_finite_difference_only"</span>],</span>
<span id="cb36-214">    (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>lineweaver(t_d, s_closed(t_d, cA0, k_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_p, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_p))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-215"></span>
<span id="cb36-216"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R16 -- straightness measured on the wrong abscissa, on a narrower interval,</span></span>
<span id="cb36-217"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#        and under the other weighting convention</span></span>
<span id="cb36-218">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"straightness of 1/r measured against C_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>,</span>
<span id="cb36-219">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>],</span>
<span id="cb36-220">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the exactly-linear metric is structural; this is its above-floor companion"</span>)</span>
<span id="cb36-221">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)"</span>,</span>
<span id="cb36-222">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>],</span>
<span id="cb36-223">    straightness_exact(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>),</span>
<span id="cb36-224">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a curvature measure is a property of the interval it is read on"</span>)</span>
<span id="cb36-225">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"straightness weighted uniformly instead of logarithmically"</span>,</span>
<span id="cb36-226">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>],</span>
<span id="cb36-227">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>],</span>
<span id="cb36-228">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"THE MEASURE ITSELF, not the interval: the least-squares line depends on how "</span></span>
<span id="cb36-229">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the interval is weighted, and 50.3 % vs 66.9 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% i</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">s the size of that choice"</span>)</span>
<span id="cb36-230">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)"</span>,</span>
<span id="cb36-231">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>,</span>
<span id="cb36-232">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>],</span>
<span id="cb36-233">    straightness_exact(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-234">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 400-point geomspace grid used instead of the closed form"</span>,</span>
<span id="cb36-235">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>],</span>
<span id="cb36-236">    straightness(c_ex, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r_ex),</span>
<span id="cb36-237">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the unconverged sampled value (0.5024); the "</span></span>
<span id="cb36-238">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid sequence in Results 2 converges to the closed form"</span>)</span>
<span id="cb36-239">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the floor measured against the LEAST-SQUARES line instead of the minimax one"</span>,</span>
<span id="cb36-240">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>,</span>
<span id="cb36-241">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>],</span>
<span id="cb36-242">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>],</span>
<span id="cb36-243">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"THE DEFECT THIS ROW EXISTS FOR, injected verbatim: calling the "</span></span>
<span id="cb36-244">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"least-squares distance 'the distance from the best straight line'. A "</span></span>
<span id="cb36-245">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MAXIMUM is minimised by the Chebyshev line, not the least-squares one, and the gap between them is "</span></span>
<span id="cb36-246">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"larger than either weighting convention"</span>)</span>
<span id="cb36-247">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)"</span>,</span>
<span id="cb36-248">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>,</span>
<span id="cb36-249">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>],</span>
<span id="cb36-250">    straightness_minimax(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>),</span>
<span id="cb36-251">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the floor is a property of the interval, and of NOTHING else: the range "</span></span>
<span id="cb36-252">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"normalisation cancels r_m and K_M exactly, so no perturbation of the fit "</span></span>
<span id="cb36-253">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"can move this metric and the interval is the only lever there is"</span>)</span>
<span id="cb36-254"></span>
<span id="cb36-255"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R17 -- the eps group established on one decade of K_M instead of three</span></span>
<span id="cb36-256">G1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb36-257"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> KMv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>):</span>
<span id="cb36-258">    CE0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA0</span>
<span id="cb36-259">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_gap(mass_action(elem(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, CE0, rm_fit, KMv), CE0, te, dense<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>),</span>
<span id="cb36-260">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, KMv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KMv: s_closed(t, cA0, rm_fit, KMv))</span>
<span id="cb36-261">    G1[KMv] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(CE0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KMv)))</span>
<span id="cb36-262">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M swept over 0.4-0.6 instead of 0.05-50"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0"</span>,</span>
<span id="cb36-263">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0"</span>],</span>
<span id="cb36-264">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> G1.values())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> G1.values()),</span>
<span id="cb36-265">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the group comparison needs a K_M range that straddles c_A0; over a tenth "</span></span>
<span id="cb36-266">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of a decade neither group is distinguishable from the other"</span>)</span>
<span id="cb36-267">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M swept over 0.4-0.6 instead of 0.05-50"</span>,</span>
<span id="cb36-268">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0_plus_KM"</span>,</span>
<span id="cb36-269">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0_plus_KM"</span>],</span>
<span id="cb36-270">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> G1.values())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(g[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> G1.values()), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-271"></span>
<span id="cb36-272"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R18 -- the rho profile and the F test on the perturbed table</span></span>
<span id="cb36-273"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sse_pin_rho_on(rho, y):</span>
<span id="cb36-274">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rr(q):</span>
<span id="cb36-275">        rmv, KMv, CE0v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(q)</span>
<span id="cb36-276">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> mass_action(elem(rho, CE0v, rmv, KMv), CE0v, t_d, a0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y</span>
<span id="cb36-277">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb36-278">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> CE0g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>):</span>
<span id="cb36-279">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(rr, np.log([rm_fit, KM_fit, CE0g]),</span>
<span id="cb36-280">                          xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb36-281">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> r.cost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> best.cost:</span>
<span id="cb36-282">            best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r</span>
<span id="cb36-283">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(best.cost)</span>
<span id="cb36-284">sp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([sse_pin_rho_on(r_, c_p) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)])</span>
<span id="cb36-285">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_profile_sse_span_fraction"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_profile_sse_span_fraction"</span>],</span>
<span id="cb36-286">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sp_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-287">rec(PERT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_statistic"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_statistic"</span>],</span>
<span id="cb36-288">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(((np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(res_p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(sp_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-289"></span>
<span id="cb36-290"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R19 -- the analytic rho* route with its maximum SAMPLED instead of root-found</span></span>
<span id="cb36-291">gs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(g_f(np.clip(s_closed(np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>), cA0, rm_fit, KM_fit),</span>
<span id="cb36-292">                              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), cA0, KM_fit)))</span>
<span id="cb36-293">rho_a_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RES<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(gs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KM_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES)</span>
<span id="cb36-294">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"analytic route's max |ds/dK_M| sampled on 19 points"</span>,</span>
<span id="cb36-295">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>], rho_a_s, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-296">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"analytic route's max |ds/dK_M| sampled on 19 points"</span>,</span>
<span id="cb36-297">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_two_route_rel_diff"</span>,</span>
<span id="cb36-298">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_two_route_rel_diff"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rho_a_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rho_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-299"></span>
<span id="cb36-300"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R20 -- the second fit route without Richardson extrapolation</span></span>
<span id="cb36-301"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_pymrm_plain(n_steps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1800</span>):</span>
<span id="cb36-302">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: BatchReduced(np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb36-303">                                             <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])).run(c_d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.</span>, n_steps,</span>
<span id="cb36-304">                                                                 t_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_d,</span>
<span id="cb36-305">                      np.log([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>]), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb36-306">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(r.x)</span>
<span id="cb36-307">k_np, K_np <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_pymrm_plain()</span>
<span id="cb36-308">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second fit route run without Richardson extrapolation"</span>,</span>
<span id="cb36-309">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_k_rel_diff"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_k_rel_diff"</span>],</span>
<span id="cb36-310">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(k_np<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>k_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler alone is O(dt) and biases the fit"</span>)</span>
<span id="cb36-311">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second fit route run without Richardson extrapolation"</span>,</span>
<span id="cb36-312">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_K_rel_diff"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_K_rel_diff"</span>],</span>
<span id="cb36-313">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(K_np<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-314"></span>
<span id="cb36-315"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R21 -- the sweep solver at a loose tolerance</span></span>
<span id="cb36-316">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA at rtol 1e-6 instead of 1e-11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lsoda_vs_radau_reference"</span>,</span>
<span id="cb36-317">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lsoda_vs_radau_reference"</span>],</span>
<span id="cb36-318">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mass_action(p_h, CE0h, te_h, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb36-319">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_radau))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-320"></span>
<span id="cb36-321"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R22 -- the rho range narrowed to one decade</span></span>
<span id="cb36-322">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho range narrowed from [1e-4, 1e4] to [0.5, 2]"</span>,</span>
<span id="cb36-323">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_over_eps_trace_limit"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_over_eps_trace_limit"</span>],</span>
<span id="cb36-324">    rho_spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>eps_of(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>),</span>
<span id="cb36-325">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the spread is a property of the rho interval it is read over, and is "</span></span>
<span id="cb36-326">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reported as one"</span>)</span>
<span id="cb36-327"></span>
<span id="cb36-328">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1"</span>,</span>
<span id="cb36-329">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_at_discrimination_eps_over_resolution"</span>,</span>
<span id="cb36-330">    M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_at_discrimination_eps_over_resolution"</span>],</span>
<span id="cb36-331">    eq_route_err(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RES, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb36-332"></span>
<span id="cb36-333"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R23 -- the order in eps read including the point where it is no longer linear</span></span>
<span id="cb36-334">o_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean([np.log10(QSSA[ks[i]][<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>QSSA[ks[i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]][<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>])</span>
<span id="cb36-335">                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)]))</span>
<span id="cb36-336">rec(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order in eps read across eps = 1e-1 too"</span>,</span>
<span id="cb36-337">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_order_in_eps"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_order_in_eps"</span>], o_all,</span>
<span id="cb36-338">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"at eps = 6.8e-2 the error is no longer first order; the fitted range "</span></span>
<span id="cb36-339">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"matters and is stated"</span>)</span>
<span id="cb36-340"></span>
<span id="cb36-341">BRK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAK)</span>
<span id="cb36-342">show(BRK.style.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"injected"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.5g}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb36-343">                       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{:.2e}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>}).set_uuid(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"j46brk"</span>))</span>
<span id="cb36-344">movers <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>})</span>
<span id="cb36-345">ROB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness"</span>]</span>
<span id="cb36-346">n_def <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK)</span>
<span id="cb36-347">n_move <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK)</span>
<span id="cb36-348"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_def<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> defect injections, of which </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_move<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> move "</span></span>
<span id="cb36-349">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"their metric by more than</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">MOVE_TOL = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MOVE_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative, covering "</span></span>
<span id="cb36-350">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(movers)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> distinct metrics; and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ROB)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ROBUSTNESS ROW(S), which "</span></span>
<span id="cb36-351">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"are</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">written to show a metric does NOT move and are never counted as "</span></span>
<span id="cb36-352">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"coverage:"</span>)</span>
<span id="cb36-353"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROB:</span>
<span id="cb36-354">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The claim is stated at the strength the arithmetic supports, and no more.</span></span>
<span id="cb36-355">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ROOT_FIND_RES = 2*ln(10)*XTOL_LOG10 is what two brentq root-finds at this</span></span>
<span id="cb36-356">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># page's tolerance can resolve; the move is a small MULTIPLE of it, so it is</span></span>
<span id="cb36-357">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of the order of the tolerance rather than provably below it - part of it is</span></span>
<span id="cb36-358">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># real (a narrower search does return a slightly larger misfit, exactly as</span></span>
<span id="cb36-359">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the row's note argues). What IS provable is the comparison that matters:</span></span>
<span id="cb36-360">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the row is orders below every genuine mover of the same metric, so it is</span></span>
<span id="cb36-361">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># not evidence about it either way.</span></span>
<span id="cb36-362">    _rivals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [x[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> x[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>]</span>
<span id="cb36-363">               <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> x[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> x[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>]</span>
<span id="cb36-364">    _sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"injected"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span></span>
<span id="cb36-365">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'broken'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metric'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: relative move "</span></span>
<span id="cb36-366">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-5 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sgn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel move'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), i.e. about "</span></span>
<span id="cb36-367">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel move'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ROOT_FIND_RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROOT_FIND_RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> that two "</span></span>
<span id="cb36-368">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"brentq</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    root-finds at xtol </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XTOL_LOG10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in log10 can resolve "</span></span>
<span id="cb36-369">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"-- the order of the tolerance, not a</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    resolved effect; and "</span></span>
<span id="cb36-370">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"more than </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>floor(np.log10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rivals)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel move'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x "</span></span>
<span id="cb36-371">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"smaller than the WEAKEST of the "</span></span>
<span id="cb36-372">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_rivals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> defect rows on the same metric,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">    which is the "</span></span>
<span id="cb36-373">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"comparison that makes it not-coverage. Direction </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sgn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, as the "</span></span>
<span id="cb36-374">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"note argues."</span>)</span>
<span id="cb36-375">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Two asserts, both at the strength the arithmetic supports. The first has</span></span>
<span id="cb36-376">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># no free constant at all: the robustness row must be weaker than EVERY</span></span>
<span id="cb36-377">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect row on the same metric, which is what "not coverage" means here.</span></span>
<span id="cb36-378">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The second bounds it to within one decade of the derived resolution - the</span></span>
<span id="cb36-379">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># decade is a unit, not a fitted pad, and the margin is 8x, so it is not a</span></span>
<span id="cb36-380">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># number chosen to make the claim come out true.</span></span>
<span id="cb36-381">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rivals), r</span>
<span id="cb36-382">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ROOT_FIND_RES, r</span>
<span id="cb36-383"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> n_def <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n_move, [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span></span>
<span id="cb36-384">                         <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>]</span>
<span id="cb36-385"></span>
<span id="cb36-386"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HOW HARD does each metric's best row hit it? A metric whose strongest mover</span></span>
<span id="cb36-387"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># barely shifts it is covered on paper only - that is exactly how the</span></span>
<span id="cb36-388"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># compensated eps* looked while its single row was a robustness row.</span></span>
<span id="cb36-389">STRENGTH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK</span>
<span id="cb36-390">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> movers}</span>
<span id="cb36-391">weak <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(STRENGTH.items(), key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> kv: kv[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>]</span>
<span id="cb36-392"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">weakest strongest-movers, as a relative shift of the metric "</span></span>
<span id="cb36-393">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(movers)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are listed in the coverage map):"</span>)</span>
<span id="cb36-394"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m, s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> weak:</span>
<span id="cb36-395">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-396"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"every covered metric has a row that moves it by at least "</span></span>
<span id="cb36-397">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(STRENGTH.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative, which is above the "</span></span>
<span id="cb36-398">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROOT_FIND_RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">resolution of this page's own root-finds -- so no "</span></span>
<span id="cb36-399">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metric here is covered by a row that</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">only clears a threshold."</span>)</span>
<span id="cb36-400"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(STRENGTH.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ROOT_FIND_RES, weak[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<style type="text/css">
</style>

<table id="T_j46brk" class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th class="blank level0" data-quarto-table-cell-role="th">&nbsp;</th>
<th id="T_j46brk_level0_col0" class="col_heading level0 col0" data-quarto-table-cell-role="th">broken</th>
<th id="T_j46brk_level0_col1" class="col_heading level0 col1" data-quarto-table-cell-role="th">metric</th>
<th id="T_j46brk_level0_col2" class="col_heading level0 col2" data-quarto-table-cell-role="th">baseline</th>
<th id="T_j46brk_level0_col3" class="col_heading level0 col3" data-quarto-table-cell-role="th">injected</th>
<th id="T_j46brk_level0_col4" class="col_heading level0 col4" data-quarto-table-cell-role="th">rel move</th>
<th id="T_j46brk_level0_col5" class="col_heading level0 col5" data-quarto-table-cell-role="th">role</th>
<th id="T_j46brk_level0_col6" class="col_heading level0 col6" data-quarto-table-cell-role="th">moves</th>
<th id="T_j46brk_level0_col7" class="col_heading level0 col7" data-quarto-table-cell-role="th">note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th id="T_j46brk_level0_row0" class="row_heading level0 row0" data-quarto-table-cell-role="th">0</th>
<td id="T_j46brk_row0_col0" class="data row0 col0">eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1</td>
<td id="T_j46brk_row0_col1" class="data row0 col1">qssa_error_over_eps_rho1</td>
<td id="T_j46brk_row0_col2" class="data row0 col2">0.8119</td>
<td id="T_j46brk_row0_col3" class="data row0 col3">20748</td>
<td id="T_j46brk_row0_col4" class="data row0 col4">2.56e+04</td>
<td id="T_j46brk_row0_col5" class="data row0 col5">defect</td>
<td id="T_j46brk_row0_col6" class="data row0 col6">yes</td>
<td id="T_j46brk_row0_col7" class="data row0 col7">the two K_M differ by 1+rho = 2 here</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row1" class="row_heading level0 row1" data-quarto-table-cell-role="th">1</th>
<td id="T_j46brk_row1_col0" class="data row1 col0">k2 raised 1 % with C_E0 left alone</td>
<td id="T_j46brk_row1_col1" class="data row1 col1">rate_law_rho_degeneracy_max_rel</td>
<td id="T_j46brk_row1_col2" class="data row1 col2">0</td>
<td id="T_j46brk_row1_col3" class="data row1 col3">0.0097582</td>
<td id="T_j46brk_row1_col4" class="data row1 col4">9.76e+297</td>
<td id="T_j46brk_row1_col5" class="data row1 col5">defect</td>
<td id="T_j46brk_row1_col6" class="data row1 col6">yes</td>
<td id="T_j46brk_row1_col7" class="data row1 col7">the exact-zero degeneracy is structural; this is its above-floor companion</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row2" class="row_heading level0 row2" data-quarto-table-cell-role="th">2</th>
<td id="T_j46brk_row2_col0" class="data row2 col0">Lineweaver run on Froment's printed axes (1/r vs C_A)</td>
<td id="T_j46brk_row2_col1" class="data row2 col1">mm_fit_KM_cmol_per_L</td>
<td id="T_j46brk_row2_col2" class="data row2 col2">0.50306</td>
<td id="T_j46brk_row2_col3" class="data row2 col3">0.77733</td>
<td id="T_j46brk_row2_col4" class="data row2 col4">5.45e-01</td>
<td id="T_j46brk_row2_col5" class="data row2 col5">defect</td>
<td id="T_j46brk_row2_col6" class="data row2 col6">yes</td>
<td id="T_j46brk_row2_col7" class="data row2 col7">the printed axes give an intercept/slope with no Michaelis-Menten meaning</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row3" class="row_heading level0 row3" data-quarto-table-cell-role="th">3</th>
<td id="T_j46brk_row3_col0" class="data row3 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row3_col1" class="data row3 col1">mm_fit_KM_cmol_per_L</td>
<td id="T_j46brk_row3_col2" class="data row3 col2">0.50306</td>
<td id="T_j46brk_row3_col3" class="data row3 col3">0.50323</td>
<td id="T_j46brk_row3_col4" class="data row3 col4">3.50e-04</td>
<td id="T_j46brk_row3_col5" class="data row3 col5">defect</td>
<td id="T_j46brk_row3_col6" class="data row3 col6">yes</td>
<td id="T_j46brk_row3_col7" class="data row3 col7">sensitivity of the fit to the last digit</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row4" class="row_heading level0 row4" data-quarto-table-cell-role="th">4</th>
<td id="T_j46brk_row4_col0" class="data row4 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row4_col1" class="data row4 col1">mm_fit_rms_cmol_per_L</td>
<td id="T_j46brk_row4_col2" class="data row4 col2">0.0040203</td>
<td id="T_j46brk_row4_col3" class="data row4 col3">0.0041446</td>
<td id="T_j46brk_row4_col4" class="data row4 col4">3.09e-02</td>
<td id="T_j46brk_row4_col5" class="data row4 col5">defect</td>
<td id="T_j46brk_row4_col6" class="data row4 col6">yes</td>
<td id="T_j46brk_row4_col7" class="data row4 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row5" class="row_heading level0 row5" data-quarto-table-cell-role="th">5</th>
<td id="T_j46brk_row5_col0" class="data row5 col0">c_A0 fitted instead of read off the table</td>
<td id="T_j46brk_row5_col1" class="data row5 col1">mm_fit_KM_cmol_per_L</td>
<td id="T_j46brk_row5_col2" class="data row5 col2">0.50306</td>
<td id="T_j46brk_row5_col3" class="data row5 col3">0.49311</td>
<td id="T_j46brk_row5_col4" class="data row5 col4">1.98e-02</td>
<td id="T_j46brk_row5_col5" class="data row5 col5">defect</td>
<td id="T_j46brk_row5_col6" class="data row5 col6">yes</td>
<td id="T_j46brk_row5_col7" class="data row5 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row6" class="row_heading level0 row6" data-quarto-table-cell-role="th">6</th>
<td id="T_j46brk_row6_col0" class="data row6 col0">P row of the pymrm source doubled</td>
<td id="T_j46brk_row6_col1" class="data row6 col1">pymrm_substrate_balance_max</td>
<td id="T_j46brk_row6_col2" class="data row6 col2">1.6653e-15</td>
<td id="T_j46brk_row6_col3" class="data row6 col3">0.95749</td>
<td id="T_j46brk_row6_col4" class="data row6 col4">5.75e+14</td>
<td id="T_j46brk_row6_col5" class="data row6 col5">defect</td>
<td id="T_j46brk_row6_col6" class="data row6 col6">yes</td>
<td id="T_j46brk_row6_col7" class="data row6 col7">the conservation check sits at round-off but is NOT an identity</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row7" class="row_heading level0 row7" data-quarto-table-cell-role="th">7</th>
<td id="T_j46brk_row7_col0" class="data row7 col0">k_-1 term deleted from the pymrm source</td>
<td id="T_j46brk_row7_col1" class="data row7 col1">pymrm_richardson_vs_radau</td>
<td id="T_j46brk_row7_col2" class="data row7 col2">4.1928e-07</td>
<td id="T_j46brk_row7_col3" class="data row7 col3">0.13997</td>
<td id="T_j46brk_row7_col4" class="data row7 col4">3.34e+05</td>
<td id="T_j46brk_row7_col5" class="data row7 col5">defect</td>
<td id="T_j46brk_row7_col6" class="data row7 col6">yes</td>
<td id="T_j46brk_row7_col7" class="data row7 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row8" class="row_heading level0 row8" data-quarto-table-cell-role="th">8</th>
<td id="T_j46brk_row8_col0" class="data row8 col0">coarsest run (n = 180) reported instead of Richardson</td>
<td id="T_j46brk_row8_col1" class="data row8 col1">pymrm_richardson_vs_radau</td>
<td id="T_j46brk_row8_col2" class="data row8 col2">4.1928e-07</td>
<td id="T_j46brk_row8_col3" class="data row8 col3">0.0019445</td>
<td id="T_j46brk_row8_col4" class="data row8 col4">4.64e+03</td>
<td id="T_j46brk_row8_col5" class="data row8 col5">defect</td>
<td id="T_j46brk_row8_col6" class="data row8 col6">yes</td>
<td id="T_j46brk_row8_col7" class="data row8 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row9" class="row_heading level0 row9" data-quarto-table-cell-role="th">9</th>
<td id="T_j46brk_row9_col0" class="data row9 col0">explicit Euler on the reduced ODE</td>
<td id="T_j46brk_row9_col1" class="data row9 col1">pymrm_be_time_order</td>
<td id="T_j46brk_row9_col2" class="data row9 col2">0.99796</td>
<td id="T_j46brk_row9_col3" class="data row9 col3">1.0022</td>
<td id="T_j46brk_row9_col4" class="data row9 col4">4.26e-03</td>
<td id="T_j46brk_row9_col5" class="data row9 col5">defect</td>
<td id="T_j46brk_row9_col6" class="data row9 col6">yes</td>
<td id="T_j46brk_row9_col7" class="data row9 col7">both are first order, so the ORDER is a weak check; the magnitude is not</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row10" class="row_heading level0 row10" data-quarto-table-cell-role="th">10</th>
<td id="T_j46brk_row10_col0" class="data row10 col0">max |ds/dK_M| sampled on a 19-point t grid</td>
<td id="T_j46brk_row10_col1" class="data row10 col1">dsdKM_rootfound_over_sampled</td>
<td id="T_j46brk_row10_col2" class="data row10 col2">1</td>
<td id="T_j46brk_row10_col3" class="data row10 col3">1.0002</td>
<td id="T_j46brk_row10_col4" class="data row10 col4">2.02e-04</td>
<td id="T_j46brk_row10_col5" class="data row10 col5">defect</td>
<td id="T_j46brk_row10_col6" class="data row10 col6">yes</td>
<td id="T_j46brk_row10_col7" class="data row10 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row11" class="row_heading level0 row11" data-quarto-table-cell-role="th">11</th>
<td id="T_j46brk_row11_col0" class="data row11 col0">ODE tolerance loosened to rtol 1e-6 under the root-find</td>
<td id="T_j46brk_row11_col1" class="data row11 col1">rho_star_equilibrium_route</td>
<td id="T_j46brk_row11_col2" class="data row11 col2">0.0021951</td>
<td id="T_j46brk_row11_col3" class="data row11 col3">0.0021988</td>
<td id="T_j46brk_row11_col4" class="data row11 col4">1.67e-03</td>
<td id="T_j46brk_row11_col5" class="data row11 col5">defect</td>
<td id="T_j46brk_row11_col6" class="data row11 col6">yes</td>
<td id="T_j46brk_row11_col7" class="data row11 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row12" class="row_heading level0 row12" data-quarto-table-cell-role="th">12</th>
<td id="T_j46brk_row12_col0" class="data row12 col0">resolution threshold doubled to 1e-3 cmol/L</td>
<td id="T_j46brk_row12_col1" class="data row12 col1">eps_star_rho_visible_at_print_resolution</td>
<td id="T_j46brk_row12_col2" class="data row12 col2">0.0020689</td>
<td id="T_j46brk_row12_col3" class="data row12 col3">0.0041486</td>
<td id="T_j46brk_row12_col4" class="data row12 col4">1.01e+00</td>
<td id="T_j46brk_row12_col5" class="data row12 col5">defect</td>
<td id="T_j46brk_row12_col6" class="data row12 col6">yes</td>
<td id="T_j46brk_row12_col7" class="data row12 col7">eps* is a property of the resolution it is read at, and is reported as one</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row13" class="row_heading level0 row13" data-quarto-table-cell-role="th">13</th>
<td id="T_j46brk_row13_col0" class="data row13 col0">resolution threshold doubled to 1e-3 cmol/L</td>
<td id="T_j46brk_row13_col1" class="data row13 col1">CE0_star_cmol_per_L</td>
<td id="T_j46brk_row13_col2" class="data row13 col2">0.0030642</td>
<td id="T_j46brk_row13_col3" class="data row13 col3">0.0061443</td>
<td id="T_j46brk_row13_col4" class="data row13 col4">1.01e+00</td>
<td id="T_j46brk_row13_col5" class="data row13 col5">defect</td>
<td id="T_j46brk_row13_col6" class="data row13 col6">yes</td>
<td id="T_j46brk_row13_col7" class="data row13 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row14" class="row_heading level0 row14" data-quarto-table-cell-role="th">14</th>
<td id="T_j46brk_row14_col0" class="data row14 col0">induction peak read on a uniform 181-point scan (sampled max)</td>
<td id="T_j46brk_row14_col1" class="data row14 col1">sampled_max_shortfall_uniform_scan</td>
<td id="T_j46brk_row14_col2" class="data row14 col2">0.66271</td>
<td id="T_j46brk_row14_col3" class="data row14 col3">0</td>
<td id="T_j46brk_row14_col4" class="data row14 col4">1.00e+00</td>
<td id="T_j46brk_row14_col5" class="data row14 col5">defect</td>
<td id="T_j46brk_row14_col6" class="data row14 col6">yes</td>
<td id="T_j46brk_row14_col7" class="data row14 col7">by construction: this metric IS the size of that defect</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row15" class="row_heading level0 row15" data-quarto-table-cell-role="th">15</th>
<td id="T_j46brk_row15_col0" class="data row15 col0">induction spread read over the observable window instead</td>
<td id="T_j46brk_row15_col1" class="data row15 col1">rho_spread_induction_over_eps</td>
<td id="T_j46brk_row15_col2" class="data row15 col2">0.97726</td>
<td id="T_j46brk_row15_col3" class="data row15 col3">0.24227</td>
<td id="T_j46brk_row15_col4" class="data row15 col4">7.52e-01</td>
<td id="T_j46brk_row15_col5" class="data row15 col5">defect</td>
<td id="T_j46brk_row15_col6" class="data row15 col6">yes</td>
<td id="T_j46brk_row15_col7" class="data row15 col7">the two windows are the page's point and are reported separately</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row16" class="row_heading level0 row16" data-quarto-table-cell-role="th">16</th>
<td id="T_j46brk_row16_col0" class="data row16 col0">induction spread read over the observable window instead</td>
<td id="T_j46brk_row16_col1" class="data row16 col1">rho_spread_induction_peak_min</td>
<td id="T_j46brk_row16_col2" class="data row16 col2">2.0109e-07</td>
<td id="T_j46brk_row16_col3" class="data row16 col3">3</td>
<td id="T_j46brk_row16_col4" class="data row16 col4">1.49e+07</td>
<td id="T_j46brk_row16_col5" class="data row16 col5">defect</td>
<td id="T_j46brk_row16_col6" class="data row16 col6">yes</td>
<td id="T_j46brk_row16_col7" class="data row16 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row17" class="row_heading level0 row17" data-quarto-table-cell-role="th">17</th>
<td id="T_j46brk_row17_col0" class="data row17 col0">discrimination fit reduced to a single start</td>
<td id="T_j46brk_row17_col1" class="data row17 col1">eps_star_discrimination_with_compensation</td>
<td id="T_j46brk_row17_col2" class="data row17 col2">0.057976</td>
<td id="T_j46brk_row17_col3" class="data row17 col3">0.057976</td>
<td id="T_j46brk_row17_col4" class="data row17 col4">5.72e-06</td>
<td id="T_j46brk_row17_col5" class="data row17 col5">robustness</td>
<td id="T_j46brk_row17_col6" class="data row17 col6">NO</td>
<td id="T_j46brk_row17_col7" class="data row17 col7">ROBUSTNESS ROW, NOT COVERAGE: a narrower search can only raise the misfit, hence lower eps*; it must not move much, and it does not</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row18" class="row_heading level0 row18" data-quarto-table-cell-role="th">18</th>
<td id="T_j46brk_row18_col0" class="data row18 col0">resolution threshold doubled to 1e-3 cmol/L</td>
<td id="T_j46brk_row18_col1" class="data row18 col1">eps_star_discrimination_with_compensation</td>
<td id="T_j46brk_row18_col2" class="data row18 col2">0.057976</td>
<td id="T_j46brk_row18_col3" class="data row18 col3">0.087573</td>
<td id="T_j46brk_row18_col4" class="data row18 col4">5.10e-01</td>
<td id="T_j46brk_row18_col5" class="data row18 col5">defect</td>
<td id="T_j46brk_row18_col6" class="data row18 col6">yes</td>
<td id="T_j46brk_row18_col7" class="data row18 col7">eps* with compensation is a property of the resolution it is read at</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row19" class="row_heading level0 row19" data-quarto-table-cell-role="th">19</th>
<td id="T_j46brk_row19_col0" class="data row19 col0">discrimination misfit read on 13 grid points instead of 25</td>
<td id="T_j46brk_row19_col1" class="data row19 col1">eps_star_discrimination_with_compensation</td>
<td id="T_j46brk_row19_col2" class="data row19 col2">0.057976</td>
<td id="T_j46brk_row19_col3" class="data row19 col3">0.069539</td>
<td id="T_j46brk_row19_col4" class="data row19 col4">1.99e-01</td>
<td id="T_j46brk_row19_col5" class="data row19 col5">defect</td>
<td id="T_j46brk_row19_col6" class="data row19 col6">yes</td>
<td id="T_j46brk_row19_col7" class="data row19 col7">and of the 25-point grid the RMS is taken on -- the third thing the page declares it depends on</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row20" class="row_heading level0 row20" data-quarto-table-cell-role="th">20</th>
<td id="T_j46brk_row20_col0" class="data row20 col0">the ODE solve UNDER the discrimination root-find loosened to rtol 1e-6</td>
<td id="T_j46brk_row20_col1" class="data row20 col1">eps_star_discrimination_with_compensation</td>
<td id="T_j46brk_row20_col2" class="data row20 col2">0.057976</td>
<td id="T_j46brk_row20_col3" class="data row20 col3">0.057965</td>
<td id="T_j46brk_row20_col4" class="data row20 col4">2.01e-04</td>
<td id="T_j46brk_row20_col5" class="data row20 col5">defect</td>
<td id="T_j46brk_row20_col6" class="data row20 col6">yes</td>
<td id="T_j46brk_row20_col7" class="data row20 col7">NOT A CONVENTION: this one perturbs the COMPUTATION, so unlike the two rows above it would show a systematically wrong baseline (a mis-integrated truth model, a solver at a tolerance too loose for the eps^1 signal). Its relative move is also the convergence evidence for the quoted eps*, which is solved at rtol 1e-11</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row21" class="row_heading level0 row21" data-quarto-table-cell-role="th">21</th>
<td id="T_j46brk_row21_col0" class="data row21 col0">resolution threshold doubled to 1e-3 cmol/L</td>
<td id="T_j46brk_row21_col1" class="data row21 col1">eps_star_rms_25pt_grid_no_compensation</td>
<td id="T_j46brk_row21_col2" class="data row21 col2">0.0031847</td>
<td id="T_j46brk_row21_col3" class="data row21 col3">0.0063926</td>
<td id="T_j46brk_row21_col4" class="data row21 col4">1.01e+00</td>
<td id="T_j46brk_row21_col5" class="data row21 col5">defect</td>
<td id="T_j46brk_row21_col6" class="data row21 col6">yes</td>
<td id="T_j46brk_row21_col7" class="data row21 col7">the like-for-like baseline is a property of the same resolution</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row22" class="row_heading level0 row22" data-quarto-table-cell-role="th">22</th>
<td id="T_j46brk_row22_col0" class="data row22 col0">rho range narrowed from [1e-4, 1e4] to [0.5, 2]</td>
<td id="T_j46brk_row22_col1" class="data row22 col1">eps_star_rms_25pt_grid_no_compensation</td>
<td id="T_j46brk_row22_col2" class="data row22 col2">0.0031847</td>
<td id="T_j46brk_row22_col3" class="data row22 col3">0.0096221</td>
<td id="T_j46brk_row22_col4" class="data row22 col4">2.02e+00</td>
<td id="T_j46brk_row22_col5" class="data row22 col5">defect</td>
<td id="T_j46brk_row22_col6" class="data row22 col6">yes</td>
<td id="T_j46brk_row22_col7" class="data row22 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row23" class="row_heading level0 row23" data-quarto-table-cell-role="th">23</th>
<td id="T_j46brk_row23_col0" class="data row23 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row23_col1" class="data row23 col1">null_first_order_rms_ratio</td>
<td id="T_j46brk_row23_col2" class="data row23 col2">9.7128</td>
<td id="T_j46brk_row23_col3" class="data row23 col3">9.4213</td>
<td id="T_j46brk_row23_col4" class="data row23 col4">3.00e-02</td>
<td id="T_j46brk_row23_col5" class="data row23 col5">defect</td>
<td id="T_j46brk_row23_col6" class="data row23 col6">yes</td>
<td id="T_j46brk_row23_col7" class="data row23 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row24" class="row_heading level0 row24" data-quarto-table-cell-role="th">24</th>
<td id="T_j46brk_row24_col0" class="data row24 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row24_col1" class="data row24 col1">mm_fit_k_per_min</td>
<td id="T_j46brk_row24_col2" class="data row24 col2">0.32319</td>
<td id="T_j46brk_row24_col3" class="data row24 col3">0.32302</td>
<td id="T_j46brk_row24_col4" class="data row24 col4">5.21e-04</td>
<td id="T_j46brk_row24_col5" class="data row24 col5">defect</td>
<td id="T_j46brk_row24_col6" class="data row24 col6">yes</td>
<td id="T_j46brk_row24_col7" class="data row24 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row25" class="row_heading level0 row25" data-quarto-table-cell-role="th">25</th>
<td id="T_j46brk_row25_col0" class="data row25 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row25_col1" class="data row25 col1">mm_fit_K_L_per_cmol</td>
<td id="T_j46brk_row25_col2" class="data row25 col2">1.9879</td>
<td id="T_j46brk_row25_col3" class="data row25 col3">1.9872</td>
<td id="T_j46brk_row25_col4" class="data row25 col4">3.50e-04</td>
<td id="T_j46brk_row25_col5" class="data row25 col5">defect</td>
<td id="T_j46brk_row25_col6" class="data row25 col6">yes</td>
<td id="T_j46brk_row25_col7" class="data row25 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row26" class="row_heading level0 row26" data-quarto-table-cell-role="th">26</th>
<td id="T_j46brk_row26_col0" class="data row26 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row26_col1" class="data row26 col1">mm_fit_rm_cmol_per_L_min</td>
<td id="T_j46brk_row26_col2" class="data row26 col2">0.16258</td>
<td id="T_j46brk_row26_col3" class="data row26 col3">0.16256</td>
<td id="T_j46brk_row26_col4" class="data row26 col4">1.71e-04</td>
<td id="T_j46brk_row26_col5" class="data row26 col5">defect</td>
<td id="T_j46brk_row26_col6" class="data row26 col6">yes</td>
<td id="T_j46brk_row26_col7" class="data row26 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row27" class="row_heading level0 row27" data-quarto-table-cell-role="th">27</th>
<td id="T_j46brk_row27_col0" class="data row27 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row27_col1" class="data row27 col1">mm_fit_maxres_over_print_resolution</td>
<td id="T_j46brk_row27_col2" class="data row27 col2">13.865</td>
<td id="T_j46brk_row27_col3" class="data row27 col3">14.546</td>
<td id="T_j46brk_row27_col4" class="data row27 col4">4.91e-02</td>
<td id="T_j46brk_row27_col5" class="data row27 col5">defect</td>
<td id="T_j46brk_row27_col6" class="data row27 col6">yes</td>
<td id="T_j46brk_row27_col7" class="data row27 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row28" class="row_heading level0 row28" data-quarto-table-cell-role="th">28</th>
<td id="T_j46brk_row28_col0" class="data row28 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row28_col1" class="data row28 col1">mm_fit_sse_penalty_K_pinned_at_2</td>
<td id="T_j46brk_row28_col2" class="data row28 col2">0.0010832</td>
<td id="T_j46brk_row28_col3" class="data row28 col3">0.0011391</td>
<td id="T_j46brk_row28_col4" class="data row28 col4">5.16e-02</td>
<td id="T_j46brk_row28_col5" class="data row28 col5">defect</td>
<td id="T_j46brk_row28_col6" class="data row28 col6">yes</td>
<td id="T_j46brk_row28_col7" class="data row28 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row29" class="row_heading level0 row29" data-quarto-table-cell-role="th">29</th>
<td id="T_j46brk_row29_col0" class="data row29 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row29_col1" class="data row29 col1">mm_fit_KM_with_s0_free</td>
<td id="T_j46brk_row29_col2" class="data row29 col2">0.49311</td>
<td id="T_j46brk_row29_col3" class="data row29 col3">0.49303</td>
<td id="T_j46brk_row29_col4" class="data row29 col4">1.64e-04</td>
<td id="T_j46brk_row29_col5" class="data row29 col5">defect</td>
<td id="T_j46brk_row29_col6" class="data row29 col6">yes</td>
<td id="T_j46brk_row29_col7" class="data row29 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row30" class="row_heading level0 row30" data-quarto-table-cell-role="th">30</th>
<td id="T_j46brk_row30_col0" class="data row30 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row30_col1" class="data row30 col1">lb_KM_bias_vs_nls</td>
<td id="T_j46brk_row30_col2" class="data row30 col2">-0.46729</td>
<td id="T_j46brk_row30_col3" class="data row30 col3">-0.4674</td>
<td id="T_j46brk_row30_col4" class="data row30 col4">2.48e-04</td>
<td id="T_j46brk_row30_col5" class="data row30 col5">defect</td>
<td id="T_j46brk_row30_col6" class="data row30 col6">yes</td>
<td id="T_j46brk_row30_col7" class="data row30 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row31" class="row_heading level0 row31" data-quarto-table-cell-role="th">31</th>
<td id="T_j46brk_row31_col0" class="data row31 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row31_col1" class="data row31 col1">lb_rm_bias_vs_nls</td>
<td id="T_j46brk_row31_col2" class="data row31 col2">-0.34064</td>
<td id="T_j46brk_row31_col3" class="data row31 col3">-0.34041</td>
<td id="T_j46brk_row31_col4" class="data row31 col4">6.70e-04</td>
<td id="T_j46brk_row31_col5" class="data row31 col5">defect</td>
<td id="T_j46brk_row31_col6" class="data row31 col6">yes</td>
<td id="T_j46brk_row31_col7" class="data row31 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row32" class="row_heading level0 row32" data-quarto-table-cell-role="th">32</th>
<td id="T_j46brk_row32_col0" class="data row32 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row32_col1" class="data row32 col1">lb_KM_bias_finite_difference_only</td>
<td id="T_j46brk_row32_col2" class="data row32 col2">0.14024</td>
<td id="T_j46brk_row32_col3" class="data row32 col3">0.14006</td>
<td id="T_j46brk_row32_col4" class="data row32 col4">1.29e-03</td>
<td id="T_j46brk_row32_col5" class="data row32 col5">defect</td>
<td id="T_j46brk_row32_col6" class="data row32 col6">yes</td>
<td id="T_j46brk_row32_col7" class="data row32 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row33" class="row_heading level0 row33" data-quarto-table-cell-role="th">33</th>
<td id="T_j46brk_row33_col0" class="data row33 col0">straightness of 1/r measured against C_A</td>
<td id="T_j46brk_row33_col1" class="data row33 col1">lineweaver_correct_axes_nonlinearity</td>
<td id="T_j46brk_row33_col2" class="data row33 col2">4.8346e-16</td>
<td id="T_j46brk_row33_col3" class="data row33 col3">0.50316</td>
<td id="T_j46brk_row33_col4" class="data row33 col4">1.04e+15</td>
<td id="T_j46brk_row33_col5" class="data row33 col5">defect</td>
<td id="T_j46brk_row33_col6" class="data row33 col6">yes</td>
<td id="T_j46brk_row33_col7" class="data row33 col7">the exactly-linear metric is structural; this is its above-floor companion</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row34" class="row_heading level0 row34" data-quarto-table-cell-role="th">34</th>
<td id="T_j46brk_row34_col0" class="data row34 col0">straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)</td>
<td id="T_j46brk_row34_col1" class="data row34 col1">lineweaver_printed_axes_nonlinearity</td>
<td id="T_j46brk_row34_col2" class="data row34 col2">0.50316</td>
<td id="T_j46brk_row34_col3" class="data row34 col3">0.069936</td>
<td id="T_j46brk_row34_col4" class="data row34 col4">8.61e-01</td>
<td id="T_j46brk_row34_col5" class="data row34 col5">defect</td>
<td id="T_j46brk_row34_col6" class="data row34 col6">yes</td>
<td id="T_j46brk_row34_col7" class="data row34 col7">a curvature measure is a property of the interval it is read on</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row35" class="row_heading level0 row35" data-quarto-table-cell-role="th">35</th>
<td id="T_j46brk_row35_col0" class="data row35 col0">straightness weighted uniformly instead of logarithmically</td>
<td id="T_j46brk_row35_col1" class="data row35 col1">lineweaver_printed_axes_nonlinearity</td>
<td id="T_j46brk_row35_col2" class="data row35 col2">0.50316</td>
<td id="T_j46brk_row35_col3" class="data row35 col3">0.66876</td>
<td id="T_j46brk_row35_col4" class="data row35 col4">3.29e-01</td>
<td id="T_j46brk_row35_col5" class="data row35 col5">defect</td>
<td id="T_j46brk_row35_col6" class="data row35 col6">yes</td>
<td id="T_j46brk_row35_col7" class="data row35 col7">THE MEASURE ITSELF, not the interval: the least-squares line depends on how the interval is weighted, and 50.3 % vs 66.9 % is the size of that choice</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row36" class="row_heading level0 row36" data-quarto-table-cell-role="th">36</th>
<td id="T_j46brk_row36_col0" class="data row36 col0">straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)</td>
<td id="T_j46brk_row36_col1" class="data row36 col1">lineweaver_printed_axes_nonlinearity_uniform_measure</td>
<td id="T_j46brk_row36_col2" class="data row36 col2">0.66876</td>
<td id="T_j46brk_row36_col3" class="data row36 col3">0.07535</td>
<td id="T_j46brk_row36_col4" class="data row36 col4">8.87e-01</td>
<td id="T_j46brk_row36_col5" class="data row36 col5">defect</td>
<td id="T_j46brk_row36_col6" class="data row36 col6">yes</td>
<td id="T_j46brk_row36_col7" class="data row36 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row37" class="row_heading level0 row37" data-quarto-table-cell-role="th">37</th>
<td id="T_j46brk_row37_col0" class="data row37 col0">the 400-point geomspace grid used instead of the closed form</td>
<td id="T_j46brk_row37_col1" class="data row37 col1">lineweaver_printed_axes_nonlinearity</td>
<td id="T_j46brk_row37_col2" class="data row37 col2">0.50316</td>
<td id="T_j46brk_row37_col3" class="data row37 col3">0.50244</td>
<td id="T_j46brk_row37_col4" class="data row37 col4">1.42e-03</td>
<td id="T_j46brk_row37_col5" class="data row37 col5">defect</td>
<td id="T_j46brk_row37_col6" class="data row37 col6">yes</td>
<td id="T_j46brk_row37_col7" class="data row37 col7">the unconverged sampled value (0.5024); the grid sequence in Results 2 converges to the closed form</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row38" class="row_heading level0 row38" data-quarto-table-cell-role="th">38</th>
<td id="T_j46brk_row38_col0" class="data row38 col0">the floor measured against the LEAST-SQUARES line instead of the minimax one</td>
<td id="T_j46brk_row38_col1" class="data row38 col1">lineweaver_printed_axes_nonlinearity_minimax</td>
<td id="T_j46brk_row38_col2" class="data row38 col2">0.31726</td>
<td id="T_j46brk_row38_col3" class="data row38 col3">0.50316</td>
<td id="T_j46brk_row38_col4" class="data row38 col4">5.86e-01</td>
<td id="T_j46brk_row38_col5" class="data row38 col5">defect</td>
<td id="T_j46brk_row38_col6" class="data row38 col6">yes</td>
<td id="T_j46brk_row38_col7" class="data row38 col7">THE DEFECT THIS ROW EXISTS FOR, injected verbatim: calling the least-squares distance 'the distance from the best straight line'. A MAXIMUM is minimised by the Chebyshev line, not the least-squares one, and the gap between them is larger than either weighting convention</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row39" class="row_heading level0 row39" data-quarto-table-cell-role="th">39</th>
<td id="T_j46brk_row39_col0" class="data row39 col0">straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)</td>
<td id="T_j46brk_row39_col1" class="data row39 col1">lineweaver_printed_axes_nonlinearity_minimax</td>
<td id="T_j46brk_row39_col2" class="data row39 col2">0.31726</td>
<td id="T_j46brk_row39_col3" class="data row39 col3">0.05051</td>
<td id="T_j46brk_row39_col4" class="data row39 col4">8.41e-01</td>
<td id="T_j46brk_row39_col5" class="data row39 col5">defect</td>
<td id="T_j46brk_row39_col6" class="data row39 col6">yes</td>
<td id="T_j46brk_row39_col7" class="data row39 col7">the floor is a property of the interval, and of NOTHING else: the range normalisation cancels r_m and K_M exactly, so no perturbation of the fit can move this metric and the interval is the only lever there is</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row40" class="row_heading level0 row40" data-quarto-table-cell-role="th">40</th>
<td id="T_j46brk_row40_col0" class="data row40 col0">K_M swept over 0.4-0.6 instead of 0.05-50</td>
<td id="T_j46brk_row40_col1" class="data row40 col1">qssa_group_spread_CE0_over_cA0</td>
<td id="T_j46brk_row40_col2" class="data row40 col2">94.957</td>
<td id="T_j46brk_row40_col3" class="data row40 col3">1.2091</td>
<td id="T_j46brk_row40_col4" class="data row40 col4">9.87e-01</td>
<td id="T_j46brk_row40_col5" class="data row40 col5">defect</td>
<td id="T_j46brk_row40_col6" class="data row40 col6">yes</td>
<td id="T_j46brk_row40_col7" class="data row40 col7">the group comparison needs a K_M range that straddles c_A0; over a tenth of a decade neither group is distinguishable from the other</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row41" class="row_heading level0 row41" data-quarto-table-cell-role="th">41</th>
<td id="T_j46brk_row41_col0" class="data row41 col0">K_M swept over 0.4-0.6 instead of 0.05-50</td>
<td id="T_j46brk_row41_col1" class="data row41 col1">qssa_group_spread_CE0_over_cA0_plus_KM</td>
<td id="T_j46brk_row41_col2" class="data row41 col2">1.9149</td>
<td id="T_j46brk_row41_col3" class="data row41 col3">1.0558</td>
<td id="T_j46brk_row41_col4" class="data row41 col4">4.49e-01</td>
<td id="T_j46brk_row41_col5" class="data row41 col5">defect</td>
<td id="T_j46brk_row41_col6" class="data row41 col6">yes</td>
<td id="T_j46brk_row41_col7" class="data row41 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row42" class="row_heading level0 row42" data-quarto-table-cell-role="th">42</th>
<td id="T_j46brk_row42_col0" class="data row42 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row42_col1" class="data row42 col1">rho_profile_sse_span_fraction</td>
<td id="T_j46brk_row42_col2" class="data row42 col2">0.085816</td>
<td id="T_j46brk_row42_col3" class="data row42 col3">0.085257</td>
<td id="T_j46brk_row42_col4" class="data row42 col4">6.51e-03</td>
<td id="T_j46brk_row42_col5" class="data row42 col5">defect</td>
<td id="T_j46brk_row42_col6" class="data row42 col6">yes</td>
<td id="T_j46brk_row42_col7" class="data row42 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row43" class="row_heading level0 row43" data-quarto-table-cell-role="th">43</th>
<td id="T_j46brk_row43_col0" class="data row43 col0">c_S(9 min) moved by +5e-4 (one print ulp)</td>
<td id="T_j46brk_row43_col1" class="data row43 col1">full_model_F_statistic</td>
<td id="T_j46brk_row43_col2" class="data row43 col2">1.9009</td>
<td id="T_j46brk_row43_col3" class="data row43 col3">1.8498</td>
<td id="T_j46brk_row43_col4" class="data row43 col4">2.69e-02</td>
<td id="T_j46brk_row43_col5" class="data row43 col5">defect</td>
<td id="T_j46brk_row43_col6" class="data row43 col6">yes</td>
<td id="T_j46brk_row43_col7" class="data row43 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row44" class="row_heading level0 row44" data-quarto-table-cell-role="th">44</th>
<td id="T_j46brk_row44_col0" class="data row44 col0">analytic route's max |ds/dK_M| sampled on 19 points</td>
<td id="T_j46brk_row44_col1" class="data row44 col1">rho_star_equilibrium_analytic</td>
<td id="T_j46brk_row44_col2" class="data row44 col2">0.0021934</td>
<td id="T_j46brk_row44_col3" class="data row44 col3">0.0021938</td>
<td id="T_j46brk_row44_col4" class="data row44 col4">2.04e-04</td>
<td id="T_j46brk_row44_col5" class="data row44 col5">defect</td>
<td id="T_j46brk_row44_col6" class="data row44 col6">yes</td>
<td id="T_j46brk_row44_col7" class="data row44 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row45" class="row_heading level0 row45" data-quarto-table-cell-role="th">45</th>
<td id="T_j46brk_row45_col0" class="data row45 col0">analytic route's max |ds/dK_M| sampled on 19 points</td>
<td id="T_j46brk_row45_col1" class="data row45 col1">rho_star_equilibrium_two_route_rel_diff</td>
<td id="T_j46brk_row45_col2" class="data row45 col2">0.00080007</td>
<td id="T_j46brk_row45_col3" class="data row45 col3">0.00059588</td>
<td id="T_j46brk_row45_col4" class="data row45 col4">2.55e-01</td>
<td id="T_j46brk_row45_col5" class="data row45 col5">defect</td>
<td id="T_j46brk_row45_col6" class="data row45 col6">yes</td>
<td id="T_j46brk_row45_col7" class="data row45 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row46" class="row_heading level0 row46" data-quarto-table-cell-role="th">46</th>
<td id="T_j46brk_row46_col0" class="data row46 col0">second fit route run without Richardson extrapolation</td>
<td id="T_j46brk_row46_col1" class="data row46 col1">fit_second_route_k_rel_diff</td>
<td id="T_j46brk_row46_col2" class="data row46 col2">5.9048e-08</td>
<td id="T_j46brk_row46_col3" class="data row46 col3">0.0013419</td>
<td id="T_j46brk_row46_col4" class="data row46 col4">2.27e+04</td>
<td id="T_j46brk_row46_col5" class="data row46 col5">defect</td>
<td id="T_j46brk_row46_col6" class="data row46 col6">yes</td>
<td id="T_j46brk_row46_col7" class="data row46 col7">backward Euler alone is O(dt) and biases the fit</td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row47" class="row_heading level0 row47" data-quarto-table-cell-role="th">47</th>
<td id="T_j46brk_row47_col0" class="data row47 col0">second fit route run without Richardson extrapolation</td>
<td id="T_j46brk_row47_col1" class="data row47 col1">fit_second_route_K_rel_diff</td>
<td id="T_j46brk_row47_col2" class="data row47 col2">5.6493e-09</td>
<td id="T_j46brk_row47_col3" class="data row47 col3">0.0018173</td>
<td id="T_j46brk_row47_col4" class="data row47 col4">3.22e+05</td>
<td id="T_j46brk_row47_col5" class="data row47 col5">defect</td>
<td id="T_j46brk_row47_col6" class="data row47 col6">yes</td>
<td id="T_j46brk_row47_col7" class="data row47 col7"></td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row48" class="row_heading level0 row48" data-quarto-table-cell-role="th">48</th>
<td id="T_j46brk_row48_col0" class="data row48 col0">LSODA at rtol 1e-6 instead of 1e-11</td>
<td id="T_j46brk_row48_col1" class="data row48 col1">lsoda_vs_radau_reference</td>
<td id="T_j46brk_row48_col2" class="data row48 col2">3.8465e-11</td>
<td id="T_j46brk_row48_col3" class="data row48 col3">1.0999e-06</td>
<td id="T_j46brk_row48_col4" class="data row48 col4">2.86e+04</td>
<td id="T_j46brk_row48_col5" class="data row48 col5">defect</td>
<td id="T_j46brk_row48_col6" class="data row48 col6">yes</td>
<td id="T_j46brk_row48_col7" class="data row48 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row49" class="row_heading level0 row49" data-quarto-table-cell-role="th">49</th>
<td id="T_j46brk_row49_col0" class="data row49 col0">rho range narrowed from [1e-4, 1e4] to [0.5, 2]</td>
<td id="T_j46brk_row49_col1" class="data row49 col1">rho_spread_over_eps_trace_limit</td>
<td id="T_j46brk_row49_col2" class="data row49 col2">0.24227</td>
<td id="T_j46brk_row49_col3" class="data row49 col3">0.080774</td>
<td id="T_j46brk_row49_col4" class="data row49 col4">6.67e-01</td>
<td id="T_j46brk_row49_col5" class="data row49 col5">defect</td>
<td id="T_j46brk_row49_col6" class="data row49 col6">yes</td>
<td id="T_j46brk_row49_col7" class="data row49 col7">the spread is a property of the rho interval it is read over, and is reported as one</td>
</tr>
<tr class="odd">
<th id="T_j46brk_level0_row50" class="row_heading level0 row50" data-quarto-table-cell-role="th">50</th>
<td id="T_j46brk_row50_col0" class="data row50 col0">eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1</td>
<td id="T_j46brk_row50_col1" class="data row50 col1">qssa_error_at_discrimination_eps_over_resolution</td>
<td id="T_j46brk_row50_col2" class="data row50 col2">88.862</td>
<td id="T_j46brk_row50_col3" class="data row50 col3">280.17</td>
<td id="T_j46brk_row50_col4" class="data row50 col4">2.15e+00</td>
<td id="T_j46brk_row50_col5" class="data row50 col5">defect</td>
<td id="T_j46brk_row50_col6" class="data row50 col6">yes</td>
<td id="T_j46brk_row50_col7" class="data row50 col7"></td>
</tr>
<tr class="even">
<th id="T_j46brk_level0_row51" class="row_heading level0 row51" data-quarto-table-cell-role="th">51</th>
<td id="T_j46brk_row51_col0" class="data row51 col0">observed order in eps read across eps = 1e-1 too</td>
<td id="T_j46brk_row51_col1" class="data row51 col1">qssa_error_order_in_eps</td>
<td id="T_j46brk_row51_col2" class="data row51 col2">0.99883</td>
<td id="T_j46brk_row51_col3" class="data row51 col3">0.99278</td>
<td id="T_j46brk_row51_col4" class="data row51 col4">6.05e-03</td>
<td id="T_j46brk_row51_col5" class="data row51 col5">defect</td>
<td id="T_j46brk_row51_col6" class="data row51 col6">yes</td>
<td id="T_j46brk_row51_col7" class="data row51 col7">at eps = 6.8e-2 the error is no longer first order; the fitted range matters and is stated</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>52 rows: 51 defect injections, of which 51 move their metric by more than
MOVE_TOL = 1e-06 relative, covering 42 distinct metrics; and 1 ROBUSTNESS ROW(S), which are
written to show a metric does NOT move and are never counted as coverage:
  discrimination fit reduced to a single start -&gt; eps_star_discrimination_with_compensation: relative move below 1e-5 (here -5.7e-06), i.e. about 1.2x the 4.61e-06 that two brentq
    root-finds at xtol 1e-06 in log10 can resolve -- the order of the tolerance, not a
    resolved effect; and more than 10x smaller than the WEAKEST of the 3 defect rows on the same metric,
    which is the comparison that makes it not-coverage. Direction -, as the note argues.

weakest strongest-movers, as a relative shift of the metric (all 42 are listed in the coverage map):
  1.64e-04   mm_fit_KM_with_s0_free
  1.71e-04   mm_fit_rm_cmol_per_L_min
  2.02e-04   dsdKM_rootfound_over_sampled
  2.04e-04   rho_star_equilibrium_analytic
  2.48e-04   lb_KM_bias_vs_nls
every covered metric has a row that moves it by at least 1.6e-04 relative, which is above the 4.60517e-06
resolution of this page's own root-finds -- so no metric here is covered by a row that
only clears a threshold.</code></pre>
</div>
</div>
<div id="c6541e90" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:32:48.110337Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:32:48.110181Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:32:48.119837Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:32:48.118994Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1">STRUCTURAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb38-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_symbolic_max_residual"</span>:</span>
<span id="cb38-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly zero by construction: ten sympy identities. It cannot fail for "</span></span>
<span id="cb38-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the right reason; what it protects is the TRANSCRIPTION of the printed "</span></span>
<span id="cb38-5">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chain. Companion: froment_chain_identities_verified (a count, which "</span></span>
<span id="cb38-6">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drops if any identity is removed)."</span>,</span>
<span id="cb38-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>:</span>
<span id="cb38-8">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly zero on the nine swept rho at C_E0 = 1e-3, and that exact zero "</span></span>
<span id="cb38-9">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is a float coincidence of those values: it needs (k_-1+k_2)/k_1 == K_M "</span></span>
<span id="cb38-10">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and k_2 C_E0 == r_m to round-trip exactly. The RESULT is the algebra, "</span></span>
<span id="cb38-11">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"which is proved in rho_degeneracy_symbolic_residual; the arithmetic "</span></span>
<span id="cb38-12">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread is rate_law_rho_degeneracy_random_draws_max_rel (below 1e-14 "</span></span>
<span id="cb38-13">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over 2000 random draws). Companion: rate_law_break_k2_plus_1pct (9.8e-3), "</span></span>
<span id="cb38-14">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same computation with r_m no longer held fixed."</span>,</span>
<span id="cb38-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_random_draws_max_rel"</span>:</span>
<span id="cb38-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ulp-level: the same computation as above over 2000 seeded random "</span></span>
<span id="cb38-17">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(rho, C_E0) draws, where the two float round trips are NOT exact. It "</span></span>
<span id="cb38-18">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is the size of the arithmetic under an exact identity, not a test of "</span></span>
<span id="cb38-19">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the identity. Companion: rate_law_break_k2_plus_1pct."</span>,</span>
<span id="cb38-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_degeneracy_symbolic_residual"</span>:</span>
<span id="cb38-21">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly zero by proof: sympy's d/drho of eq. (1.5.1-13) under the "</span></span>
<span id="cb38-22">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reparameterisation, which also simplifies to eq. (1.5.1-15) itself. "</span></span>
<span id="cb38-23">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"This is the page's central structural result and it cannot fail for "</span></span>
<span id="cb38-24">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the right reason. Companion: rate_law_break_k2_plus_1pct."</span>,</span>
<span id="cb38-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>:</span>
<span id="cb38-26">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/r is exactly affine in 1/C_A, so this is float noise on a straight "</span></span>
<span id="cb38-27">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"line - and, unlike its sibling, it is still the SAMPLED version, on "</span></span>
<span id="cb38-28">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 400-point grid, because a straight line has nothing to converge. "</span></span>
<span id="cb38-29">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Companion: lineweaver_printed_axes_nonlinearity (0.50), the same "</span></span>
<span id="cb38-30">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure on the abscissa Froment prints."</span>,</span>
<span id="cb38-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_enzyme_balance_max"</span>:</span>
<span id="cb38-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_E + C_A-E is conserved to round-off by the mass-action source. NOT "</span></span>
<span id="cb38-33">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an identity - the two fields are integrated separately - but at "</span></span>
<span id="cb38-34">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"round-off. Companion: pymrm_richardson_vs_radau (4.2e-7)."</span>,</span>
<span id="cb38-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>:</span>
<span id="cb38-36">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as above for C_A + C_A-E + C_P. Break row R7 doubles the P row and "</span></span>
<span id="cb38-37">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves it to O(1), so the check does have teeth; it simply passes at "</span></span>
<span id="cb38-38">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"round-off. Companion: pymrm_richardson_vs_radau."</span>,</span>
<span id="cb38-39">}</span>
<span id="cb38-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metrics with no break row of their own, each named individually - a generic</span></span>
<span id="cb38-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fallback is how an uncovered metric hides (the A4.1 mechanism)</span></span>
<span id="cb38-42">DERIVED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb38-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_identities_verified"</span>:</span>
<span id="cb38-44">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COMPANION of froment_chain_symbolic_max_residual: a count, which falls "</span></span>
<span id="cb38-45">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"if any of the ten identities is deleted or fails to simplify to zero."</span>,</span>
<span id="cb38-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KM_ratio_at_rho_1e4"</span>:</span>
<span id="cb38-47">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DEFINITIONAL: 1 + rho at the top of the swept range. It is printed "</span></span>
<span id="cb38-48">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"because it is the size of the disagreement the degeneracy hides."</span>,</span>
<span id="cb38-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_crit_95"</span>:</span>
<span id="cb38-50">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DEFINITIONAL: the 95 % point of F(2, 3), a tabulated distribution "</span></span>
<span id="cb38-51">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value. It moves only if the number of data points or parameters does."</span>,</span>
<span id="cb38-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_break_k2_plus_1pct"</span>:</span>
<span id="cb38-53">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"IS the injected value of break row 'k2 raised 1 % with C_E0 left "</span></span>
<span id="cb38-54">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alone'; it is in agreement.json so the companion is itself under CI."</span>,</span>
<span id="cb38-55">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_compensation_penalty"</span>:</span>
<span id="cb38-56">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RATIO of two covered metrics measured LIKE FOR LIKE - "</span></span>
<span id="cb38-57">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation over "</span></span>
<span id="cb38-58">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation, same statistic, same 25-point "</span></span>
<span id="cb38-59">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid, same rho pair, same resolution, differing only in whether r_m, "</span></span>
<span id="cb38-60">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M and C_E0 are free. Both have movers of their own."</span>,</span>
<span id="cb38-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_statistic_and_window_factor"</span>:</span>
<span id="cb38-62">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RATIO of two covered metrics, eps_star_rms_25pt_grid_no_compensation "</span></span>
<span id="cb38-63">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over eps_star_rho_visible_at_print_resolution: the part of the raw "</span></span>
<span id="cb38-64">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio that is a change of STATISTIC (max -&gt; RMS) and WINDOW "</span></span>
<span id="cb38-65">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"([3,18] -&gt; the 25-point grid from 0), with nothing free to compensate "</span></span>
<span id="cb38-66">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"in either."</span>,</span>
<span id="cb38-67">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_raw_ratio_unlike_statistics"</span>:</span>
<span id="cb38-68">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RATIO of two covered metrics that are NOT the same measurement, "</span></span>
<span id="cb38-69">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed so that the page's own headline arithmetic is under CI: it is "</span></span>
<span id="cb38-70">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the product of eps_star_compensation_penalty and "</span></span>
<span id="cb38-71">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_statistic_and_window_factor, and it is NOT the cost of "</span></span>
<span id="cb38-72">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"compensation."</span>,</span>
<span id="cb38-73">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_at_discrimination_eps_over_resolution"</span>:</span>
<span id="cb38-74">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the qssa_error_over_eps_rho1 computation evaluated at "</span></span>
<span id="cb38-75">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation."</span>,</span>
<span id="cb38-76">}</span>
<span id="cb38-77">COVER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb38-78"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M:</span>
<span id="cb38-79">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>]</span>
<span id="cb38-80">    dead <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NO"</span>]</span>
<span id="cb38-81">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rows:</span>
<span id="cb38-82">        COVER[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"moved by (strongest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STRENGTH[name]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative): "</span></span>
<span id="cb38-83">                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows})))</span>
<span id="cb38-84">        rob <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> name</span>
<span id="cb38-85">               <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness"</span>]</span>
<span id="cb38-86">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rob:</span>
<span id="cb38-87">            COVER[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" | plus "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(rob)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" robustness row(s), "</span></span>
<span id="cb38-88">                            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"which are NOT coverage: "</span></span>
<span id="cb38-89">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rob})))</span>
<span id="cb38-90">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL:</span>
<span id="cb38-91">        COVER[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL - "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> STRUCTURAL[name]</span>
<span id="cb38-92">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DERIVED:</span>
<span id="cb38-93">        COVER[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DERIVED[name]</span>
<span id="cb38-94">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> dead:</span>
<span id="cb38-95">        COVER[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ROBUSTNESS ROWS ONLY, WHICH IS NOT COVERAGE - "</span></span>
<span id="cb38-96">                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> dead)</span>
<span id="cb38-97">                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DECLARED NON-MOVER - "</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dead[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"note"</span>]</span>
<span id="cb38-98">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb38-99">        COVER[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"UNCOVERED"</span></span>
<span id="cb38-100"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVER) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVER) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M)</span>
<span id="cb38-101">uncovered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVER.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"UNCOVERED"</span>]</span>
<span id="cb38-102"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> uncovered, uncovered</span>
<span id="cb38-103"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ...and the OTHER not-coverage branch: a metric whose only rows are robustness</span></span>
<span id="cb38-104"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rows would land here, print a loud label and still PASS - including</span></span>
<span id="cb38-105"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># n_def == n_move, since robustness rows are excluded from n_def. That is</span></span>
<span id="cb38-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># precisely the illusion the robustness/defect split exists to prevent, so it is</span></span>
<span id="cb38-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># an assert.</span></span>
<span id="cb38-108">robonly <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COVER.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ROBUSTNESS ROWS ONLY"</span>)]</span>
<span id="cb38-109"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> robonly, robonly</span>
<span id="cb38-110"></span>
<span id="cb38-111"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The metrics at round-off are registered as bounds in the next cell, so CI</span></span>
<span id="cb38-112"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># checks each against its bound rather than skipping it.</span></span>
<span id="cb38-113">roundoff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>]</span>
<span id="cb38-114"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(M)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(roundoff)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sit at round-off and are registered as "</span></span>
<span id="cb38-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bounds, never as values:"</span>)</span>
<span id="cb38-116"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> roundoff:</span>
<span id="cb38-117">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-118">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL, k</span>
<span id="cb38-119"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>()</span>
<span id="cb38-120"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(COVER):</span>
<span id="cb38-121">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">      </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>COVER[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>53 metrics; 7 sit at round-off and are registered as bounds, never as values:
  froment_chain_symbolic_max_residual
  rho_degeneracy_symbolic_residual
  lineweaver_correct_axes_nonlinearity
  rate_law_rho_degeneracy_max_rel
  rate_law_rho_degeneracy_random_draws_max_rel
  pymrm_enzyme_balance_max
  pymrm_substrate_balance_max

  CE0_star_cmol_per_L
      moved by (strongest 1.0e+00 relative): resolution threshold doubled to 1e-3 cmol/L
  KM_ratio_at_rho_1e4
      DEFINITIONAL: 1 + rho at the top of the swept range. It is printed because it is the size of the disagreement the degeneracy hides.
  dsdKM_rootfound_over_sampled
      moved by (strongest 2.0e-04 relative): max |ds/dK_M| sampled on a 19-point t grid
  eps_star_compensation_penalty
      RATIO of two covered metrics measured LIKE FOR LIKE - eps_star_discrimination_with_compensation over eps_star_rms_25pt_grid_no_compensation, same statistic, same 25-point grid, same rho pair, same resolution, differing only in whether r_m, K_M and C_E0 are free. Both have movers of their own.
  eps_star_discrimination_with_compensation
      moved by (strongest 5.1e-01 relative): discrimination misfit read on 13 grid points instead of 25; resolution threshold doubled to 1e-3 cmol/L; the ODE solve UNDER the discrimination root-find loosened to rtol 1e-6 | plus 1 robustness row(s), which are NOT coverage: discrimination fit reduced to a single start
  eps_star_raw_ratio_unlike_statistics
      RATIO of two covered metrics that are NOT the same measurement, printed so that the page's own headline arithmetic is under CI: it is the product of eps_star_compensation_penalty and eps_star_statistic_and_window_factor, and it is NOT the cost of compensation.
  eps_star_rho_visible_at_print_resolution
      moved by (strongest 1.0e+00 relative): resolution threshold doubled to 1e-3 cmol/L
  eps_star_rms_25pt_grid_no_compensation
      moved by (strongest 2.0e+00 relative): resolution threshold doubled to 1e-3 cmol/L; rho range narrowed from [1e-4, 1e4] to [0.5, 2]
  eps_star_statistic_and_window_factor
      RATIO of two covered metrics, eps_star_rms_25pt_grid_no_compensation over eps_star_rho_visible_at_print_resolution: the part of the raw ratio that is a change of STATISTIC (max -&gt; RMS) and WINDOW ([3,18] -&gt; the 25-point grid from 0), with nothing free to compensate in either.
  fit_second_route_K_rel_diff
      moved by (strongest 3.2e+05 relative): second fit route run without Richardson extrapolation
  fit_second_route_k_rel_diff
      moved by (strongest 2.3e+04 relative): second fit route run without Richardson extrapolation
  froment_chain_identities_verified
      COMPANION of froment_chain_symbolic_max_residual: a count, which falls if any of the ten identities is deleted or fails to simplify to zero.
  froment_chain_symbolic_max_residual
      STRUCTURAL - exactly zero by construction: ten sympy identities. It cannot fail for the right reason; what it protects is the TRANSCRIPTION of the printed chain. Companion: froment_chain_identities_verified (a count, which drops if any identity is removed).
  full_model_F_crit_95
      DEFINITIONAL: the 95 % point of F(2, 3), a tabulated distribution value. It moves only if the number of data points or parameters does.
  full_model_F_statistic
      moved by (strongest 2.7e-02 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  lb_KM_bias_finite_difference_only
      moved by (strongest 1.3e-03 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  lb_KM_bias_vs_nls
      moved by (strongest 2.5e-04 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  lb_rm_bias_vs_nls
      moved by (strongest 6.7e-04 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  lineweaver_correct_axes_nonlinearity
      moved by (strongest 1.0e+15 relative): straightness of 1/r measured against C_A
  lineweaver_printed_axes_nonlinearity
      moved by (strongest 8.6e-01 relative): straightness measured on 0.4-0.6 cmol/L only (a tenth of the range); straightness weighted uniformly instead of logarithmically; the 400-point geomspace grid used instead of the closed form
  lineweaver_printed_axes_nonlinearity_minimax
      moved by (strongest 8.4e-01 relative): straightness measured on 0.4-0.6 cmol/L only (a tenth of the range); the floor measured against the LEAST-SQUARES line instead of the minimax one
  lineweaver_printed_axes_nonlinearity_uniform_measure
      moved by (strongest 8.9e-01 relative): straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)
  lsoda_vs_radau_reference
      moved by (strongest 2.9e+04 relative): LSODA at rtol 1e-6 instead of 1e-11
  mm_fit_KM_cmol_per_L
      moved by (strongest 5.5e-01 relative): Lineweaver run on Froment's printed axes (1/r vs C_A); c_A0 fitted instead of read off the table; c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_KM_with_s0_free
      moved by (strongest 1.6e-04 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_K_L_per_cmol
      moved by (strongest 3.5e-04 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_k_per_min
      moved by (strongest 5.2e-04 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_maxres_over_print_resolution
      moved by (strongest 4.9e-02 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_rm_cmol_per_L_min
      moved by (strongest 1.7e-04 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_rms_cmol_per_L
      moved by (strongest 3.1e-02 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  mm_fit_sse_penalty_K_pinned_at_2
      moved by (strongest 5.2e-02 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  null_first_order_rms_ratio
      moved by (strongest 3.0e-02 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  pymrm_be_time_order
      moved by (strongest 4.3e-03 relative): explicit Euler on the reduced ODE
  pymrm_enzyme_balance_max
      STRUCTURAL - C_E + C_A-E is conserved to round-off by the mass-action source. NOT an identity - the two fields are integrated separately - but at round-off. Companion: pymrm_richardson_vs_radau (4.2e-7).
  pymrm_richardson_vs_radau
      moved by (strongest 3.3e+05 relative): coarsest run (n = 180) reported instead of Richardson; k_-1 term deleted from the pymrm source
  pymrm_substrate_balance_max
      moved by (strongest 5.7e+14 relative): P row of the pymrm source doubled
  qssa_error_at_discrimination_eps_over_resolution
      moved by (strongest 2.2e+00 relative): eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1
  qssa_error_order_in_eps
      moved by (strongest 6.1e-03 relative): observed order in eps read across eps = 1e-1 too
  qssa_error_over_eps_rho1
      moved by (strongest 2.6e+04 relative): eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1
  qssa_group_spread_CE0_over_cA0
      moved by (strongest 9.9e-01 relative): K_M swept over 0.4-0.6 instead of 0.05-50
  qssa_group_spread_CE0_over_cA0_plus_KM
      moved by (strongest 4.5e-01 relative): K_M swept over 0.4-0.6 instead of 0.05-50
  rate_law_break_k2_plus_1pct
      IS the injected value of break row 'k2 raised 1 % with C_E0 left alone'; it is in agreement.json so the companion is itself under CI.
  rate_law_rho_degeneracy_max_rel
      moved by (strongest 9.8e+297 relative): k2 raised 1 % with C_E0 left alone
  rate_law_rho_degeneracy_random_draws_max_rel
      STRUCTURAL - ulp-level: the same computation as above over 2000 seeded random (rho, C_E0) draws, where the two float round trips are NOT exact. It is the size of the arithmetic under an exact identity, not a test of the identity. Companion: rate_law_break_k2_plus_1pct.
  rho_degeneracy_symbolic_residual
      STRUCTURAL - exactly zero by proof: sympy's d/drho of eq. (1.5.1-13) under the reparameterisation, which also simplifies to eq. (1.5.1-15) itself. This is the page's central structural result and it cannot fail for the right reason. Companion: rate_law_break_k2_plus_1pct.
  rho_profile_sse_span_fraction
      moved by (strongest 6.5e-03 relative): c_S(9 min) moved by +5e-4 (one print ulp)
  rho_spread_induction_over_eps
      moved by (strongest 7.5e-01 relative): induction spread read over the observable window instead
  rho_spread_induction_peak_min
      moved by (strongest 1.5e+07 relative): induction spread read over the observable window instead
  rho_spread_over_eps_trace_limit
      moved by (strongest 6.7e-01 relative): rho range narrowed from [1e-4, 1e4] to [0.5, 2]
  rho_star_equilibrium_analytic
      moved by (strongest 2.0e-04 relative): analytic route's max |ds/dK_M| sampled on 19 points
  rho_star_equilibrium_route
      moved by (strongest 1.7e-03 relative): ODE tolerance loosened to rtol 1e-6 under the root-find
  rho_star_equilibrium_two_route_rel_diff
      moved by (strongest 2.6e-01 relative): analytic route's max |ds/dK_M| sampled on 19 points
  sampled_max_shortfall_uniform_scan
      moved by (strongest 1.0e+00 relative): induction peak read on a uniform 181-point scan (sampled max)</code></pre>
</div>
</div>
<div id="87a8328d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:32:48.121934Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:32:48.121795Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:32:48.154174Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:32:48.153341Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every metric is registered ONCE with how it is checked (docs/claims-design.md):</span></span>
<span id="cb40-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a value against the committed baseline within its rtol, a bound against its</span></span>
<span id="cb40-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bound on every machine, an exact result by equality. Round-off-level numbers</span></span>
<span id="cb40-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are bounds; their exact digits differ between BLAS kernels and are never quoted.</span></span>
<span id="cb40-5">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J4.6"</span>)</span>
<span id="cb40-6"></span>
<span id="cb40-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- structure: proofs and their numerical companions</span></span>
<span id="cb40-8">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_symbolic_max_residual"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_symbolic_max_residual"</span>],</span>
<span id="cb40-9">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb40-10">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ten sympy identities simplify to 0; protects the transcription"</span>)</span>
<span id="cb40-11">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_identities_verified"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_identities_verified"</span>]),</span>
<span id="cb40-12">             structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the number of identities the code checks; it changes "</span></span>
<span id="cb40-13">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"only if the code does"</span>)</span>
<span id="cb40-14">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_degeneracy_symbolic_residual"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_degeneracy_symbolic_residual"</span>],</span>
<span id="cb40-15">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb40-16">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy d r/d rho of eq. (1.5.1-13) under the reparameterisation"</span>)</span>
<span id="cb40-17">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>],</span>
<span id="cb40-18">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb40-19">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the rate; exactly 0 where the float round trips are exact"</span>)</span>
<span id="cb40-20">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_random_draws_max_rel"</span>,</span>
<span id="cb40-21">             M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_random_draws_max_rel"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb40-22">             structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative to the rate; a few ulp over 2000 draws "</span></span>
<span id="cb40-23">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(4.4e-16 measured), the arithmetic under an exact identity"</span>)</span>
<span id="cb40-24">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KM_ratio_at_rho_1e4"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KM_ratio_at_rho_1e4"</span>], structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb40-25">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"definitional: 1 + rho at rho = 1e4"</span>)</span>
<span id="cb40-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_break_k2_plus_1pct"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_break_k2_plus_1pct"</span>],</span>
<span id="cb40-27">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the above-floor companion of the degeneracy: r_m no longer held fixed"</span>)</span>
<span id="cb40-28">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>],</span>
<span id="cb40-29">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fraction of the range of 1/r; 1/r is exactly "</span></span>
<span id="cb40-30">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"affine in 1/C_A, measured 4.8e-16 to 1.2e-15 across BLAS kernels"</span>)</span>
<span id="cb40-31"></span>
<span id="cb40-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the fit to the seven printed points. The tolerances are tight so that the</span></span>
<span id="cb40-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    one-print-ulp row (a 1e-4 relative shift) fails them; the closed-form fit is</span></span>
<span id="cb40-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    reproducible far below that.</span></span>
<span id="cb40-35">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_k_per_min"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_k_per_min"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/min"</span>)</span>
<span id="cb40-36">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_K_L_per_cmol"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_K_L_per_cmol"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L/cmol"</span>)</span>
<span id="cb40-37">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rm_cmol_per_L_min"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rm_cmol_per_L_min"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>,</span>
<span id="cb40-38">             unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L/min"</span>)</span>
<span id="cb40-39">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_cmol_per_L"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_cmol_per_L"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>)</span>
<span id="cb40-40">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rms_cmol_per_L"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rms_cmol_per_L"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>)</span>
<span id="cb40-41">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_maxres_over_print_resolution"</span>,</span>
<span id="cb40-42">             M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_maxres_over_print_resolution"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb40-43">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_sse_penalty_K_pinned_at_2"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_sse_penalty_K_pinned_at_2"</span>],</span>
<span id="cb40-44">             rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb40-45">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_with_s0_free"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_with_s0_free"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>,</span>
<span id="cb40-46">             unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>)</span>
<span id="cb40-47">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb40-48">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_rm_bias_vs_nls"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_rm_bias_vs_nls"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb40-49">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_vs_nls"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_vs_nls"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb40-50">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_finite_difference_only"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_finite_difference_only"</span>],</span>
<span id="cb40-51">             rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb40-52"></span>
<span id="cb40-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- straightness of the printed Lineweaver axes (closed form)</span></span>
<span id="cb40-54">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>,</span>
<span id="cb40-55">             M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>])</span>
<span id="cb40-56">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>])</span>
<span id="cb40-57">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>,</span>
<span id="cb40-58">             M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>])</span>
<span id="cb40-59"></span>
<span id="cb40-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- what a batch transient sees, and the epsilons</span></span>
<span id="cb40-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_over_eps"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_peak_min"</span>,</span>
<span id="cb40-62">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sampled_max_shortfall_uniform_scan"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_over_eps_trace_limit"</span>,</span>
<span id="cb40-63">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CE0_star_cmol_per_L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>,</span>
<span id="cb40-64">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>,</span>
<span id="cb40-65">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_compensation_penalty"</span>,</span>
<span id="cb40-66">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_statistic_and_window_factor"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_raw_ratio_unlike_statistics"</span>,</span>
<span id="cb40-67">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_over_eps_rho1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_at_discrimination_eps_over_resolution"</span>,</span>
<span id="cb40-68">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0_plus_KM"</span>,</span>
<span id="cb40-69">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_two_route_rel_diff"</span>):</span>
<span id="cb40-70">    claims.value(_k, M[_k])</span>
<span id="cb40-71">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_order_in_eps"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_order_in_eps"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>,</span>
<span id="cb40-72">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the quasi-steady-state error is first order in eps"</span>)</span>
<span id="cb40-73">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_route"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_route"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb40-74">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb40-75">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsdKM_rootfound_over_sampled"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsdKM_rootfound_over_sampled"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb40-76">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_profile_sse_span_fraction"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_profile_sse_span_fraction"</span>],</span>
<span id="cb40-77">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spreads 1e-4 relative across BLAS kernels (multi-start refits), so "</span></span>
<span id="cb40-78">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"it keeps the default rtol and the one-print-ulp row (6.5e-3) does not fail it"</span>)</span>
<span id="cb40-79">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_statistic"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_statistic"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb40-80">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_crit_95"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_crit_95"</span>],</span>
<span id="cb40-81">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"definitional: the 95 % point of F(2, 3)"</span>)</span>
<span id="cb40-82"></span>
<span id="cb40-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- numerics of the pymrm marcher and the second routes</span></span>
<span id="cb40-84">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lsoda_vs_radau_reference"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lsoda_vs_radau_reference"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>,</span>
<span id="cb40-85">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>,</span>
<span id="cb40-86">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LSODA at rtol 1e-11, atol 1e-14 against Radau at rtol 1e-12, atol 1e-15; "</span></span>
<span id="cb40-87">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measured 3.8e-11 to 5.8e-11 across BLAS kernels"</span>)</span>
<span id="cb40-88">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_be_time_order"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_be_time_order"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>,</span>
<span id="cb40-89">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler is first order in dt"</span>)</span>
<span id="cb40-90">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>], unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>,</span>
<span id="cb40-91">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the O(dt^2) remainder of Richardson(720, 1440), a discretisation error"</span>)</span>
<span id="cb40-92">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_enzyme_balance_max"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_enzyme_balance_max"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>,</span>
<span id="cb40-93">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>,</span>
<span id="cb40-94">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a linear invariant of the source, kept by every Newton step to round-off"</span>)</span>
<span id="cb40-95">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>,</span>
<span id="cb40-96">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmol/L"</span>,</span>
<span id="cb40-97">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a linear invariant of the source, kept by every Newton step to round-off"</span>)</span>
<span id="cb40-98">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_k_rel_diff"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_k_rel_diff"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>,</span>
<span id="cb40-99">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap, Lambert W against Richardson-extrapolated "</span></span>
<span id="cb40-100">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler at 1800/3600 steps; measured 5.9e-8 to 1.1e-7 across BLAS "</span></span>
<span id="cb40-101">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kernels, the bound is about 100x that and 1e2 below the no-Richardson row"</span>)</span>
<span id="cb40-102">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_K_rel_diff"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_K_rel_diff"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb40-103">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as for k; measured 8e-10 to 7.4e-8 across BLAS kernels, "</span></span>
<span id="cb40-104">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the bound is about 13x the largest and 1e3 below the no-Richardson row"</span>)</span>
<span id="cb40-105"></span>
<span id="cb40-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the break table: every defect row is wired to the claim it targets; the</span></span>
<span id="cb40-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    robustness row is not, because it is written NOT to move its metric.</span></span>
<span id="cb40-108"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb40-109">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span>:</span>
<span id="cb40-110">        claims.breaks(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>], r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>], r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"injected"</span>])</span>
<span id="cb40-111"></span>
<span id="cb40-112"></span>
<span id="cb40-113"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(broken_prefix, metric, field<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"injected"</span>):</span>
<span id="cb40-114">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The live value of a break-table row, looked up by (row, metric).</span></span>
<span id="cb40-115"></span>
<span id="cb40-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    meta.yaml and models_entry.yaml quote numbers that exist ONLY as break-table</span></span>
<span id="cb40-117"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    entries; they are looked up here instead of retyped, so a row that changes</span></span>
<span id="cb40-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    cannot drift."""</span></span>
<span id="cb40-119">    hits <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> metric</span>
<span id="cb40-120">            <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>].startswith(broken_prefix)]</span>
<span id="cb40-121">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(hits) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, (broken_prefix, metric, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(hits))</span>
<span id="cb40-122">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(hits[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][field])</span>
<span id="cb40-123"></span>
<span id="cb40-124"></span>
<span id="cb40-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the three eps* ratios, evaluated with one of their factors broken by a row</span></span>
<span id="cb40-126">_RES2, _NARROW, _GRID13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution threshold doubled to 1e-3 cmol/L"</span>,</span>
<span id="cb40-127">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho range narrowed from [1e-4, 1e4] to [0.5, 2]"</span>,</span>
<span id="cb40-128">                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discrimination misfit read on 13 grid points instead of 25"</span>)</span>
<span id="cb40-129">claims.breaks(_RES2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_compensation_penalty"</span>,</span>
<span id="cb40-130">              brk(_RES2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>)</span>
<span id="cb40-131">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> brk(_RES2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>))</span>
<span id="cb40-132">claims.breaks(_NARROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (like-for-like eps* only)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_statistic_and_window_factor"</span>,</span>
<span id="cb40-133">              brk(_NARROW, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>)</span>
<span id="cb40-134">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>])</span>
<span id="cb40-135">claims.breaks(_GRID13, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_raw_ratio_unlike_statistics"</span>,</span>
<span id="cb40-136">              brk(_GRID13, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>)</span>
<span id="cb40-137">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>])</span>
<span id="cb40-138"></span>
<span id="cb40-139"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- every number quoted in prose, in meta.yaml, in README.md and in models.yaml</span></span>
<span id="cb40-140"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    that is a registered claim, as written there. A round-off-level number is</span></span>
<span id="cb40-141"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    quoted as the bound it is checked against.</span></span>
<span id="cb40-142"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> {</span>
<span id="cb40-143">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_KM_cmol_per_L"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.503055"</span>],</span>
<span id="cb40-144">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rm_cmol_per_L_min"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.162583"</span>],</span>
<span id="cb40-145">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_k_per_min"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.323192"</span>],</span>
<span id="cb40-146">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_K_L_per_cmol"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.987853"</span>],</span>
<span id="cb40-147">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rms_cmol_per_L"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.02e-3"</span>],</span>
<span id="cb40-148">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_maxres_over_print_resolution"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13.87"</span>],</span>
<span id="cb40-149">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_sse_penalty_K_pinned_at_2"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.108 %"</span>],</span>
<span id="cb40-150">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.71"</span>],</span>
<span id="cb40-151">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-14"</span>],</span>
<span id="cb40-152">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_law_rho_degeneracy_random_draws_max_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-14"</span>],</span>
<span id="cb40-153">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_over_eps_trace_limit"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.242"</span>],</span>
<span id="cb40-154">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_over_eps"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.977"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9773"</span>],</span>
<span id="cb40-155">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_spread_induction_peak_min"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0e-7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.011e-7"</span>],</span>
<span id="cb40-156">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sampled_max_shortfall_uniform_scan"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"66 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"66.3 %"</span>],</span>
<span id="cb40-157">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rho_visible_at_print_resolution"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.07e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.069e-3"</span>],</span>
<span id="cb40-158">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.80e-2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.798e-2"</span>],</span>
<span id="cb40-159">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.18e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.185e-3"</span>],</span>
<span id="cb40-160">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_compensation_penalty"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"18.20"</span>],</span>
<span id="cb40-161">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_statistic_and_window_factor"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.54"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.539"</span>],</span>
<span id="cb40-162">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_raw_ratio_unlike_statistics"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"28.0"</span>],</span>
<span id="cb40-163">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_profile_sse_span_fraction"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.6 %"</span>],</span>
<span id="cb40-164">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_statistic"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.90"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.9009"</span>],</span>
<span id="cb40-165">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full_model_F_crit_95"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.55"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.5521"</span>],</span>
<span id="cb40-166">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_minimax"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31.7 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31.72 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"31.7256 %"</span>],</span>
<span id="cb40-167">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50.3 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50.32 %"</span>],</span>
<span id="cb40-168">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_printed_axes_nonlinearity_uniform_measure"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"66.9 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"66.88 %"</span>],</span>
<span id="cb40-169">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lineweaver_correct_axes_nonlinearity"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-13"</span>],</span>
<span id="cb40-170">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_vs_nls"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.4673"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-46.7 %"</span>],</span>
<span id="cb40-171">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_rm_bias_vs_nls"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.3406"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-34.1 %"</span>],</span>
<span id="cb40-172">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lb_KM_bias_finite_difference_only"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.1402"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14.0 %"</span>],</span>
<span id="cb40-173">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"94.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"95.0"</span>],</span>
<span id="cb40-174">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_group_spread_CE0_over_cA0_plus_KM"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.91"</span>],</span>
<span id="cb40-175">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"qssa_error_at_discrimination_eps_over_resolution"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"88.9"</span>],</span>
<span id="cb40-176">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_route"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.195e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.1951e-3"</span>],</span>
<span id="cb40-177">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_analytic"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.1934e-3"</span>],</span>
<span id="cb40-178">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho_star_equilibrium_two_route_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.00e-4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.080 %"</span>],</span>
<span id="cb40-179">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_be_time_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.998"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9980"</span>],</span>
<span id="cb40-180">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_richardson_vs_radau"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.19e-7"</span>],</span>
<span id="cb40-181">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_enzyme_balance_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-13"</span>],</span>
<span id="cb40-182">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_substrate_balance_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-13"</span>],</span>
<span id="cb40-183">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lsoda_vs_radau_reference"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-9"</span>],</span>
<span id="cb40-184">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_k_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-5"</span>],</span>
<span id="cb40-185">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fit_second_route_K_rel_diff"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-6"</span>],</span>
<span id="cb40-186">}.items():</span>
<span id="cb40-187">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lits:</span>
<span id="cb40-188">        claims.says(lit, name)</span>
<span id="cb40-189"></span>
<span id="cb40-190"></span>
<span id="cb40-191"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- quoted numbers that are NOT metrics: derived quantities and break-table</span></span>
<span id="cb40-192"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    entries, checked by the same rule as claims.says (one unit in the last</span></span>
<span id="cb40-193"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#    written place), and the table's own counts, checked exactly.</span></span>
<span id="cb40-194"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> near(literal, computed):</span>
<span id="cb40-195">    lit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> parse_literal(literal)</span>
<span id="cb40-196">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lit[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nums"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(computed)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> lit[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unit"</span>]</span>
<span id="cb40-197"></span>
<span id="cb40-198"></span>
<span id="cb40-199">ROB_MOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discrimination fit reduced to a single start"</span>,</span>
<span id="cb40-200">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel move"</span>)</span>
<span id="cb40-201">OTHER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb40-202">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order null RMS"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.90e-2"</span>,</span>
<span id="cb40-203">     M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null_first_order_rms_ratio"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm_fit_rms_cmol_per_L"</span>]),</span>
<span id="cb40-204">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null zero-order ratio"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13.29"</span>, NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms_fit),</span>
<span id="cb40-205">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null second-order ratio"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"26.04"</span>, NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>rms_fit),</span>
<span id="cb40-206">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null zero-order RMS"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.34e-2"</span>, NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb40-207">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null second-order RMS"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.05e-1"</span>, NULLS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb40-208">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_M within of 0.5 cmol/L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.61 %"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(KM_fit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb40-209">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps coefficient at K_M = 0.05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.9541"</span>, GROUP[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb40-210">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"induction time at rho = 1e-4, min"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.09e-8"</span>,</span>
<span id="cb40-211">     <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(elem(RHO_LO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, rm_fit, KM_fit)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit))),</span>
<span id="cb40-212">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"induction time at rho = 1e4, min"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.09e-4"</span>,</span>
<span id="cb40-213">     <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(elem(RHO_HI, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, rm_fit, KM_fit)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(cA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KM_fit))),</span>
<span id="cb40-214">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ds/dK_M peak location"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.228461"</span>, s_pk),</span>
<span id="cb40-215">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA error at eps*, cmol/L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.04443"</span>, qssa_at_eps_star),</span>
<span id="cb40-216">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QSSA error at eps*, total substrate / resolution"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"38.8"</span>,</span>
<span id="cb40-217">     qssa_at_eps_star_tot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RES),</span>
<span id="cb40-218">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps* with compensation, resolution doubled"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.757e-2"</span>,</span>
<span id="cb40-219">     brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution threshold doubled"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>)),</span>
<span id="cb40-220">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps* with compensation, 13-point grid"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6.954e-2"</span>,</span>
<span id="cb40-221">     brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discrimination misfit read on 13"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_discrimination_with_compensation"</span>)),</span>
<span id="cb40-222">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"like-for-like eps*, rho pair narrowed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.622e-3"</span>,</span>
<span id="cb40-223">     brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rho range narrowed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps_star_rms_25pt_grid_no_compensation"</span>)),</span>
<span id="cb40-224">]</span>
<span id="cb40-225">COUNTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break rows"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">52</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect-injection rows"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">51</span>, n_def),</span>
<span id="cb40-226">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that move"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">51</span>, n_move), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness rows"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ROB)),</span>
<span id="cb40-227">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics covered by a mover"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(movers)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">53</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(M)),</span>
<span id="cb40-228">          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># an exact claim, compared here because Claims.says cannot yet take a</span></span>
<span id="cb40-229">          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bare integer for one (shared/gallery_utils.py _says_ok indexes nums[1])</span></span>
<span id="cb40-230">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identities"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_chain_identities_verified"</span>])]</span>
<span id="cb40-231">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(w, lit, x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w, lit, x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OTHER <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> near(lit, x)]</span>
<span id="cb40-232">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(w, n, x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w, n, x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COUNTS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> x]</span>
<span id="cb40-233"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the robustness row is quoted as "below 1e-5": it is of the order of the</span></span>
<span id="cb40-234"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># root-find resolution, and its exact size differs between BLAS kernels</span></span>
<span id="cb40-235">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ROB_MOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness row's relative move"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-5"</span>, ROB_MOVE)]</span>
<span id="cb40-236">n_says <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.quoted.values())</span>
<span id="cb40-237"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_says<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose literals of registered claims checked by claims.says, and "</span></span>
<span id="cb40-238">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(OTHER) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(COUNTS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> other quoted numbers; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(bad)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mismatched"</span>)</span>
<span id="cb40-239"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> bad:</span>
<span id="cb40-240">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  MISMATCH"</span>, b)</span>
<span id="cb40-241"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> bad, bad</span>
<span id="cb40-242"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Five claims have no break row that fails their check, so breaks are not</span></span>
<span id="cb40-243"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># required page-wide: two orders (theory bounds that no row leaves), two</span></span>
<span id="cb40-244"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># definitional or companion values, and the SSE span, whose only row moves it</span></span>
<span id="cb40-245"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># by less than its admissible tolerance. Every other claim has one.</span></span>
<span id="cb40-246">claims.report(require_breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>65 prose literals of registered claims checked by claims.says, and 23 other quoted numbers; 0 mismatched
Claims for J4.6:
  froment_chain_symbolic_max_residual                  = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  froment_chain_identities_verified                    = 10               exact  exact
  rho_degeneracy_symbolic_residual                     = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  rate_law_rho_degeneracy_max_rel                      = (here 0.0e+00)   bound  bound &lt;= 1e-14 [identity]
  rate_law_rho_degeneracy_random_draws_max_rel         = (here 4.4e-16)   bound  bound &lt;= 1e-14 [identity]
  KM_ratio_at_rho_1e4                                  = 10001            exact  exact
  rate_law_break_k2_plus_1pct                          = 0.0097582        value  rtol 0.05
  lineweaver_correct_axes_nonlinearity                 = (here 4.8e-16)   bound  bound &lt;= 1e-13 [identity]
  mm_fit_k_per_min                                     = 0.32319          value  rtol 1e-05
  mm_fit_K_L_per_cmol                                  = 1.9879           value  rtol 1e-05
  mm_fit_rm_cmol_per_L_min                             = 0.16258          value  rtol 1e-05
  mm_fit_KM_cmol_per_L                                 = 0.50306          value  rtol 1e-05
  mm_fit_rms_cmol_per_L                                = 0.0040203        value  rtol 0.001
  mm_fit_maxres_over_print_resolution                  = 13.865           value  rtol 0.001
  mm_fit_sse_penalty_K_pinned_at_2                     = 0.0010832        value  rtol 0.001
  mm_fit_KM_with_s0_free                               = 0.49311          value  rtol 1e-05
  null_first_order_rms_ratio                           = 9.7128           value  rtol 0.001
  lb_rm_bias_vs_nls                                    = -0.34064         value  rtol 1e-05
  lb_KM_bias_vs_nls                                    = -0.46729         value  rtol 1e-05
  lb_KM_bias_finite_difference_only                    = 0.14024          value  rtol 0.0001
  lineweaver_printed_axes_nonlinearity_minimax         = 0.31726          value  rtol 0.05
  lineweaver_printed_axes_nonlinearity                 = 0.50316          value  rtol 0.05
  lineweaver_printed_axes_nonlinearity_uniform_measure = 0.66876          value  rtol 0.05
  rho_spread_induction_over_eps                        = 0.97726          value  rtol 0.05
  rho_spread_induction_peak_min                        = 2.0109e-07       value  rtol 0.05
  sampled_max_shortfall_uniform_scan                   = 0.66271          value  rtol 0.05
  rho_spread_over_eps_trace_limit                      = 0.24227          value  rtol 0.05
  CE0_star_cmol_per_L                                  = 0.0030642        value  rtol 0.05
  eps_star_rho_visible_at_print_resolution             = 0.0020689        value  rtol 0.05
  eps_star_discrimination_with_compensation            = 0.057976         value  rtol 0.05
  eps_star_rms_25pt_grid_no_compensation               = 0.0031847        value  rtol 0.05
  eps_star_compensation_penalty                        = 18.204           value  rtol 0.05
  eps_star_statistic_and_window_factor                 = 1.5393           value  rtol 0.05
  eps_star_raw_ratio_unlike_statistics                 = 28.022           value  rtol 0.05
  qssa_error_over_eps_rho1                             = 0.8119           value  rtol 0.05
  qssa_error_at_discrimination_eps_over_resolution     = 88.862           value  rtol 0.05
  qssa_group_spread_CE0_over_cA0                       = 94.957           value  rtol 0.05
  qssa_group_spread_CE0_over_cA0_plus_KM               = 1.9149           value  rtol 0.05
  rho_star_equilibrium_two_route_rel_diff              = 0.00080007       value  rtol 0.05
  qssa_error_order_in_eps                              = (here 1.0e+00)   bound  bound [0.9, 1.1] [theory]
  rho_star_equilibrium_route                           = 0.0021951        value  rtol 0.0001
  rho_star_equilibrium_analytic                        = 0.0021934        value  rtol 1e-05
  dsdKM_rootfound_over_sampled                         = 1                value  rtol 1e-05
  rho_profile_sse_span_fraction                        = 0.085816         value  rtol 0.05
  full_model_F_statistic                               = 1.9009           value  rtol 0.001
  full_model_F_crit_95                                 = 9.5521           value  rtol 0.05
  lsoda_vs_radau_reference                             = (here 3.8e-11)   bound  bound &lt;= 1e-09 [tolerance]
  pymrm_be_time_order                                  = (here 1.0e+00)   bound  bound [0.9, 1.1] [theory]
  pymrm_richardson_vs_radau                            = 4.1928e-07       value  rtol 0.05
  pymrm_enzyme_balance_max                             = (here 1.2e-17)   bound  bound &lt;= 1e-13 [identity]
  pymrm_substrate_balance_max                          = (here 1.7e-15)   bound  bound &lt;= 1e-13 [identity]
  fit_second_route_k_rel_diff                          = (here 5.9e-08)   bound  bound &lt;= 1e-05 [chosen]
  fit_second_route_K_rel_diff                          = (here 5.6e-09)   bound  bound &lt;= 1e-06 [chosen]</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="21">
<pre><code>{'page': 'J4.6',
 'format': 2,
 'env': {'pymrm': '3.2.0',
  'numpy': '2.5.4',
  'scipy': '1.18.1',
  'openblas_coretype': 'Haswell',
  'threads': '1'},
 'metrics': {'froment_chain_symbolic_max_residual': {'kind': 'bound',
   'value': 0.0,
   'max': 0.0,
   'basis': 'identity',
   'structural': True,
   'note': 'ten sympy identities simplify to 0; protects the transcription'},
  'froment_chain_identities_verified': {'kind': 'exact',
   'value': 10,
   'structural': True,
   'note': 'the number of identities the code checks; it changes only if the code does'},
  'rho_degeneracy_symbolic_residual': {'kind': 'bound',
   'value': 0.0,
   'max': 0.0,
   'basis': 'identity',
   'structural': True,
   'note': 'sympy d r/d rho of eq. (1.5.1-13) under the reparameterisation'},
  'rate_law_rho_degeneracy_max_rel': {'kind': 'bound',
   'value': 0.0,
   'max': 1e-14,
   'basis': 'identity',
   'note': 'relative to the rate; exactly 0 where the float round trips are exact'},
  'rate_law_rho_degeneracy_random_draws_max_rel': {'kind': 'bound',
   'value': 4.440892098500626e-16,
   'max': 1e-14,
   'basis': 'identity',
   'structural': True,
   'note': 'relative to the rate; a few ulp over 2000 draws (4.4e-16 measured), the arithmetic under an exact identity'},
  'KM_ratio_at_rho_1e4': {'kind': 'exact',
   'value': 10001.0,
   'structural': True,
   'note': 'definitional: 1 + rho at rho = 1e4'},
  'rate_law_break_k2_plus_1pct': {'kind': 'value',
   'value': 0.009758182679510563,
   'rtol': 0.05,
   'note': 'the above-floor companion of the degeneracy: r_m no longer held fixed'},
  'lineweaver_correct_axes_nonlinearity': {'kind': 'bound',
   'value': 4.834564500641968e-16,
   'max': 1e-13,
   'basis': 'identity',
   'note': 'fraction of the range of 1/r; 1/r is exactly affine in 1/C_A, measured 4.8e-16 to 1.2e-15 across BLAS kernels'},
  'mm_fit_k_per_min': {'kind': 'value',
   'value': 0.32319212092828603,
   'rtol': 1e-05,
   'unit': '1/min'},
  'mm_fit_K_L_per_cmol': {'kind': 'value',
   'value': 1.9878533031368453,
   'rtol': 1e-05,
   'unit': 'L/cmol'},
  'mm_fit_rm_cmol_per_L_min': {'kind': 'value',
   'value': 0.16258348662765346,
   'rtol': 1e-05,
   'unit': 'cmol/L/min'},
  'mm_fit_KM_cmol_per_L': {'kind': 'value',
   'value': 0.503055229690236,
   'rtol': 1e-05,
   'unit': 'cmol/L'},
  'mm_fit_rms_cmol_per_L': {'kind': 'value',
   'value': 0.004020286831122744,
   'rtol': 0.001,
   'unit': 'cmol/L'},
  'mm_fit_maxres_over_print_resolution': {'kind': 'value',
   'value': 13.865088235622158,
   'rtol': 0.001},
  'mm_fit_sse_penalty_K_pinned_at_2': {'kind': 'value',
   'value': 0.0010831592863316253,
   'rtol': 0.001},
  'mm_fit_KM_with_s0_free': {'kind': 'value',
   'value': 0.4931091686632502,
   'rtol': 1e-05,
   'unit': 'cmol/L'},
  'null_first_order_rms_ratio': {'kind': 'value',
   'value': 9.712782795363925,
   'rtol': 0.001},
  'lb_rm_bias_vs_nls': {'kind': 'value',
   'value': -0.3406356205070935,
   'rtol': 1e-05},
  'lb_KM_bias_vs_nls': {'kind': 'value',
   'value': -0.4672878227088909,
   'rtol': 1e-05},
  'lb_KM_bias_finite_difference_only': {'kind': 'value',
   'value': 0.14024339306899058,
   'rtol': 0.0001},
  'lineweaver_printed_axes_nonlinearity_minimax': {'kind': 'value',
   'value': 0.3172560023684433,
   'rtol': 0.05},
  'lineweaver_printed_axes_nonlinearity': {'kind': 'value',
   'value': 0.503158181986443,
   'rtol': 0.05},
  'lineweaver_printed_axes_nonlinearity_uniform_measure': {'kind': 'value',
   'value': 0.6687562430924995,
   'rtol': 0.05},
  'rho_spread_induction_over_eps': {'kind': 'value',
   'value': 0.9772584052021954,
   'rtol': 0.05},
  'rho_spread_induction_peak_min': {'kind': 'value',
   'value': 2.0109014445706597e-07,
   'rtol': 0.05},
  'sampled_max_shortfall_uniform_scan': {'kind': 'value',
   'value': 0.6627137447477849,
   'rtol': 0.05},
  'rho_spread_over_eps_trace_limit': {'kind': 'value',
   'value': 0.24227268983182706,
   'rtol': 0.05},
  'CE0_star_cmol_per_L': {'kind': 'value',
   'value': 0.003064199490587384,
   'rtol': 0.05},
  'eps_star_rho_visible_at_print_resolution': {'kind': 'value',
   'value': 0.0020689299285808972,
   'rtol': 0.05},
  'eps_star_discrimination_with_compensation': {'kind': 'value',
   'value': 0.05797636889778094,
   'rtol': 0.05},
  'eps_star_rms_25pt_grid_no_compensation': {'kind': 'value',
   'value': 0.003184735412028877,
   'rtol': 0.05},
  'eps_star_compensation_penalty': {'kind': 'value',
   'value': 18.20445387042258,
   'rtol': 0.05},
  'eps_star_statistic_and_window_factor': {'kind': 'value',
   'value': 1.5393152605285785,
   'rtol': 0.05},
  'eps_star_raw_ratio_unlike_statistics': {'kind': 'value',
   'value': 28.02239365233002,
   'rtol': 0.05},
  'qssa_error_over_eps_rho1': {'kind': 'value',
   'value': 0.8118953820938575,
   'rtol': 0.05},
  'qssa_error_at_discrimination_eps_over_resolution': {'kind': 'value',
   'value': 88.86235709395463,
   'rtol': 0.05},
  'qssa_group_spread_CE0_over_cA0': {'kind': 'value',
   'value': 94.9574056725309,
   'rtol': 0.05},
  'qssa_group_spread_CE0_over_cA0_plus_KM': {'kind': 'value',
   'value': 1.9148694148723324,
   'rtol': 0.05},
  'rho_star_equilibrium_two_route_rel_diff': {'kind': 'value',
   'value': 0.0008000701175500113,
   'rtol': 0.05},
  'qssa_error_order_in_eps': {'kind': 'bound',
   'value': 0.9988307074166772,
   'min': 0.9,
   'max': 1.1,
   'basis': 'theory',
   'note': 'the quasi-steady-state error is first order in eps'},
  'rho_star_equilibrium_route': {'kind': 'value',
   'value': 0.0021951181181210917,
   'rtol': 0.0001},
  'rho_star_equilibrium_analytic': {'kind': 'value',
   'value': 0.0021933618697102903,
   'rtol': 1e-05},
  'dsdKM_rootfound_over_sampled': {'kind': 'value',
   'value': 1.0000015349430789,
   'rtol': 1e-05},
  'rho_profile_sse_span_fraction': {'kind': 'value',
   'value': 0.08581590544034068,
   'rtol': 0.05,
   'note': 'spreads 1e-4 relative across BLAS kernels (multi-start refits), so it keeps the default rtol and the one-print-ulp row (6.5e-3) does not fail it'},
  'full_model_F_statistic': {'kind': 'value',
   'value': 1.9009294390792295,
   'rtol': 0.001},
  'full_model_F_crit_95': {'kind': 'value',
   'value': 9.552094495921152,
   'rtol': 0.05,
   'note': 'definitional: the 95 % point of F(2, 3)'},
  'lsoda_vs_radau_reference': {'kind': 'bound',
   'value': 3.8464786911163173e-11,
   'max': 1e-09,
   'basis': 'tolerance',
   'unit': 'cmol/L',
   'note': 'LSODA at rtol 1e-11, atol 1e-14 against Radau at rtol 1e-12, atol 1e-15; measured 3.8e-11 to 5.8e-11 across BLAS kernels'},
  'pymrm_be_time_order': {'kind': 'bound',
   'value': 0.997957237920689,
   'min': 0.9,
   'max': 1.1,
   'basis': 'theory',
   'note': 'backward Euler is first order in dt'},
  'pymrm_richardson_vs_radau': {'kind': 'value',
   'value': 4.192750087672614e-07,
   'rtol': 0.05,
   'unit': 'cmol/L',
   'note': 'the O(dt^2) remainder of Richardson(720, 1440), a discretisation error'},
  'pymrm_enzyme_balance_max': {'kind': 'bound',
   'value': 1.214306433183765e-17,
   'max': 1e-13,
   'basis': 'identity',
   'structural': True,
   'unit': 'cmol/L',
   'note': 'a linear invariant of the source, kept by every Newton step to round-off'},
  'pymrm_substrate_balance_max': {'kind': 'bound',
   'value': 1.6653345369377348e-15,
   'max': 1e-13,
   'basis': 'identity',
   'unit': 'cmol/L',
   'note': 'a linear invariant of the source, kept by every Newton step to round-off'},
  'fit_second_route_k_rel_diff': {'kind': 'bound',
   'value': 5.9047809086720804e-08,
   'max': 1e-05,
   'basis': 'chosen',
   'note': 'two-route gap, Lambert W against Richardson-extrapolated backward Euler at 1800/3600 steps; measured 5.9e-8 to 1.1e-7 across BLAS kernels, the bound is about 100x that and 1e2 below the no-Richardson row'},
  'fit_second_route_K_rel_diff': {'kind': 'bound',
   'value': 5.6492854838552375e-09,
   'max': 1e-06,
   'basis': 'chosen',
   'note': 'as for k; measured 8e-10 to 7.4e-8 across BLAS kernels, the bound is about 13x the largest and 1e3 below the no-Richardson row'}},
 'quoted': {'mm_fit_KM_cmol_per_L': ['0.503055'],
  'mm_fit_rm_cmol_per_L_min': ['0.162583'],
  'mm_fit_k_per_min': ['0.323192'],
  'mm_fit_K_L_per_cmol': ['1.987853'],
  'mm_fit_rms_cmol_per_L': ['4.02e-3'],
  'mm_fit_maxres_over_print_resolution': ['13.9', '13.87'],
  'mm_fit_sse_penalty_K_pinned_at_2': ['0.108 %'],
  'null_first_order_rms_ratio': ['9.71'],
  'rate_law_rho_degeneracy_max_rel': ['below 1e-14'],
  'rate_law_rho_degeneracy_random_draws_max_rel': ['below 1e-14'],
  'rho_spread_over_eps_trace_limit': ['0.242'],
  'rho_spread_induction_over_eps': ['0.977', '0.9773'],
  'rho_spread_induction_peak_min': ['2.0e-7', '2.011e-7'],
  'sampled_max_shortfall_uniform_scan': ['66 %', '66.3 %'],
  'eps_star_rho_visible_at_print_resolution': ['2.07e-3', '2.069e-3'],
  'eps_star_discrimination_with_compensation': ['5.80e-2', '5.798e-2'],
  'eps_star_rms_25pt_grid_no_compensation': ['3.18e-3', '3.185e-3'],
  'eps_star_compensation_penalty': ['18.2', '18.20'],
  'eps_star_statistic_and_window_factor': ['1.54', '1.539'],
  'eps_star_raw_ratio_unlike_statistics': ['28.0'],
  'rho_profile_sse_span_fraction': ['8.6 %'],
  'full_model_F_statistic': ['1.90', '1.9009'],
  'full_model_F_crit_95': ['9.55', '9.5521'],
  'lineweaver_printed_axes_nonlinearity_minimax': ['31.7 %',
   '31.72 %',
   '31.7256 %'],
  'lineweaver_printed_axes_nonlinearity': ['50.3 %', '50.32 %'],
  'lineweaver_printed_axes_nonlinearity_uniform_measure': ['66.9 %',
   '66.88 %'],
  'lineweaver_correct_axes_nonlinearity': ['below 1e-13'],
  'lb_KM_bias_vs_nls': ['-0.4673', '-46.7 %'],
  'lb_rm_bias_vs_nls': ['-0.3406', '-34.1 %'],
  'lb_KM_bias_finite_difference_only': ['0.1402', '14.0 %'],
  'qssa_group_spread_CE0_over_cA0': ['94.9', '95.0'],
  'qssa_group_spread_CE0_over_cA0_plus_KM': ['1.91'],
  'qssa_error_at_discrimination_eps_over_resolution': ['88.9'],
  'rho_star_equilibrium_route': ['2.195e-3', '2.1951e-3'],
  'rho_star_equilibrium_analytic': ['2.1934e-3'],
  'rho_star_equilibrium_two_route_rel_diff': ['8.00e-4', '0.080 %'],
  'pymrm_be_time_order': ['0.998', '0.9980'],
  'pymrm_richardson_vs_radau': ['4.19e-7'],
  'pymrm_enzyme_balance_max': ['below 1e-13'],
  'pymrm_substrate_balance_max': ['below 1e-13'],
  'lsoda_vs_radau_reference': ['below 1e-9'],
  'fit_second_route_k_rel_diff': ['below 1e-5'],
  'fit_second_route_K_rel_diff': ['below 1e-6']},
 'breaks': {'qssa_error_over_eps_rho1': ['eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1'],
  'rate_law_rho_degeneracy_max_rel': ['k2 raised 1 % with C_E0 left alone'],
  'mm_fit_KM_cmol_per_L': ["Lineweaver run on Froment's printed axes (1/r vs C_A)",
   'c_S(9 min) moved by +5e-4 (one print ulp)',
   'c_A0 fitted instead of read off the table'],
  'mm_fit_rms_cmol_per_L': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'pymrm_substrate_balance_max': ['P row of the pymrm source doubled'],
  'pymrm_richardson_vs_radau': ['k_-1 term deleted from the pymrm source',
   'coarsest run (n = 180) reported instead of Richardson'],
  'pymrm_be_time_order': [],
  'dsdKM_rootfound_over_sampled': ['max |ds/dK_M| sampled on a 19-point t grid'],
  'rho_star_equilibrium_route': ['ODE tolerance loosened to rtol 1e-6 under the root-find'],
  'eps_star_rho_visible_at_print_resolution': ['resolution threshold doubled to 1e-3 cmol/L'],
  'CE0_star_cmol_per_L': ['resolution threshold doubled to 1e-3 cmol/L'],
  'sampled_max_shortfall_uniform_scan': ['induction peak read on a uniform 181-point scan (sampled max)'],
  'rho_spread_induction_over_eps': ['induction spread read over the observable window instead'],
  'rho_spread_induction_peak_min': ['induction spread read over the observable window instead'],
  'eps_star_discrimination_with_compensation': ['resolution threshold doubled to 1e-3 cmol/L',
   'discrimination misfit read on 13 grid points instead of 25'],
  'eps_star_rms_25pt_grid_no_compensation': ['resolution threshold doubled to 1e-3 cmol/L',
   'rho range narrowed from [1e-4, 1e4] to [0.5, 2]'],
  'null_first_order_rms_ratio': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'mm_fit_k_per_min': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'mm_fit_K_L_per_cmol': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'mm_fit_rm_cmol_per_L_min': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'mm_fit_maxres_over_print_resolution': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'mm_fit_sse_penalty_K_pinned_at_2': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'mm_fit_KM_with_s0_free': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'lb_KM_bias_vs_nls': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'lb_rm_bias_vs_nls': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'lb_KM_bias_finite_difference_only': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'lineweaver_correct_axes_nonlinearity': ['straightness of 1/r measured against C_A'],
  'lineweaver_printed_axes_nonlinearity': ['straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)',
   'straightness weighted uniformly instead of logarithmically'],
  'lineweaver_printed_axes_nonlinearity_uniform_measure': ['straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)'],
  'lineweaver_printed_axes_nonlinearity_minimax': ['the floor measured against the LEAST-SQUARES line instead of the minimax one',
   'straightness measured on 0.4-0.6 cmol/L only (a tenth of the range)'],
  'qssa_group_spread_CE0_over_cA0': ['K_M swept over 0.4-0.6 instead of 0.05-50'],
  'qssa_group_spread_CE0_over_cA0_plus_KM': ['K_M swept over 0.4-0.6 instead of 0.05-50'],
  'rho_profile_sse_span_fraction': [],
  'full_model_F_statistic': ['c_S(9 min) moved by +5e-4 (one print ulp)'],
  'rho_star_equilibrium_analytic': ["analytic route's max |ds/dK_M| sampled on 19 points"],
  'rho_star_equilibrium_two_route_rel_diff': ["analytic route's max |ds/dK_M| sampled on 19 points"],
  'fit_second_route_k_rel_diff': ['second fit route run without Richardson extrapolation'],
  'fit_second_route_K_rel_diff': ['second fit route run without Richardson extrapolation'],
  'lsoda_vs_radau_reference': ['LSODA at rtol 1e-6 instead of 1e-11'],
  'rho_spread_over_eps_trace_limit': ['rho range narrowed from [1e-4, 1e4] to [0.5, 2]'],
  'qssa_error_at_discrimination_eps_over_resolution': ['eq. (1.5.1-14) -&gt; (1.5.1-8): K_M = k_-1/k_1 at rho = 1'],
  'qssa_error_order_in_eps': [],
  'eps_star_compensation_penalty': ['resolution threshold doubled to 1e-3 cmol/L'],
  'eps_star_statistic_and_window_factor': ['rho range narrowed from [1e-4, 1e4] to [0.5, 2] (like-for-like eps* only)'],
  'eps_star_raw_ratio_unlike_statistics': ['discrimination misfit read on 13 grid points instead of 25']},
 'breaks_required': False,
 'unbroken': ['rate_law_break_k2_plus_1pct',
  'qssa_error_order_in_eps',
  'rho_profile_sse_span_fraction',
  'full_model_F_crit_95',
  'pymrm_be_time_order']}</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Honestly: for this page, not much, and the reason is worth stating.</strong> A well-mixed batch of four species is 0-D. <code>newton</code> plus <code>NumJac((1, 4))</code> gives a compact, correct backward-Euler marcher and the conservation checks come out at round-off, but <code>solve_ivp</code> would have integrated the same system, and does, as the reference. What pymrm buys here is (i) a Jacobian assembled by the same mechanism the rest of the gallery uses, so the model drops into a spatial page unchanged, and (ii) the discipline of <code>NumJac((1, n_c))</code> rather than <code>NumJac((n_c,))</code>, which is the difference between a pointwise block and a dense matrix once the cell count stops being 1.</p>
<p><strong>Point (i) is the real one.</strong> <code>J4.7</code> is this rate law in a diffusing particle and <code>B1.1</code> is that same <code>S3</code> problem with a power law; the <code>source</code> method of <code>BatchReduced</code> is transplantable into either without change. The reason this page exists as <code>S1</code> and not as part of <code>J4.7</code> is that the question it settles - what data can decide between two derivations of the same constant - is a question about the <em>kinetics</em>, and putting it inside a pellet would only add a diffusional resistance that further hides the elementary constants.</p>
<p><strong>What the page adds to the source</strong>, as opposed to what pymrm adds:</p>
<ul>
<li>the printed chain closed symbolically, ten identities, both routes;</li>
<li>the exact statement of what steady-state data cannot do - the rate law is provably independent of <img src="https://latex.codecogs.com/png.latex?k_2/k_%7B-1%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20r/%5Cpartial%5Crho%20%5Cequiv%200"> in sympy, and identical to double precision over eight decades of it - which the book gestures at in one sentence about stopped-flow experiments and does not quantify;</li>
<li>a number for “the decomposition is the rate determining step”: <img src="https://latex.codecogs.com/png.latex?%5Crho%20%5Cle%202.195%5Ctimes10%5E%7B-3%7D"> for route 1 to predict the batch curve to the source table’s own resolution, arrived at two independent ways;</li>
<li>the group that organises the pseudo-steady-state error, <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%20C_%7B%5Crm%20E%7D%5E0/(c_%7B%5Crm%20A0%7D+K_M)">, established by a <img src="https://latex.codecogs.com/png.latex?K_M"> sweep at fixed <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0/c_%7B%5Crm%20A0%7D"> - Froment’s printed comparison is with the substrate alone and is the <img src="https://latex.codecogs.com/png.latex?K_M%20%5Cll%20c_%7B%5Crm%20A0%7D"> corner of it;</li>
<li>and the enzyme loading a discriminating experiment would need, with the finding that at that loading the Michaelis-Menten form is already wrong by 88.9 times the discriminating signal.</li>
</ul>
<p><strong>Two printed defects reported, neither repaired</strong>, both settled from the book’s own equations rather than from outside knowledge.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>If you have rate-versus-substrate data and want <img src="https://latex.codecogs.com/png.latex?K_M">:</strong> fit eq. (1.5.1-15) - or, for a batch run, its integral - directly, and report <img src="https://latex.codecogs.com/png.latex?(r_m,%20K_M)">. Do <strong>not</strong> report <img src="https://latex.codecogs.com/png.latex?k_%7B-1%7D/k_1"> or <img src="https://latex.codecogs.com/png.latex?(k_%7B-1%7D+k_2)/k_1"> as though your data distinguished them. They do not, and this is exact, not approximate: the fibre of the observable map is two-dimensional and <img src="https://latex.codecogs.com/png.latex?k_2/k_%7B-1%7D"> runs along it. If you need the elementary constants, Froment p.&nbsp;25 says what is required and this page prices it: transient experimentation, or a batch run at <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%20C_%7B%5Crm%20E%7D%5E0/(c_%7B%5Crm%20A0%7D+K_M)"> of order <img src="https://latex.codecogs.com/png.latex?10%5E%7B-1%7D"> - at which point you must fit the mass-action model, because the Michaelis-Menten form is no longer valid there.</p>
<p><strong>If you are linearising:</strong> the abscissa is <img src="https://latex.codecogs.com/png.latex?1/C_%7B%5Crm%20A%7D">, and even then consider not doing it. On the one dataset here, the reciprocal construction run exactly as both books instruct returns <img src="https://latex.codecogs.com/png.latex?K_M"> <strong>47 % low</strong> and <img src="https://latex.codecogs.com/png.latex?r_m"> <strong>34 % low</strong> against the direct fit of the same seven points; +14 points of that is the central-difference rate estimate and the rest is the reciprocal transform weighting the three smallest concentrations most heavily. Levenspiel p.&nbsp;615 says the direct fit “is direct, is less prone to fiddling, and is more reliable”; on these data that is measurable and correct.</p>
<p><strong>If you are checking whether the quasi-steady state is safe:</strong> compute <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%20C_%7B%5Crm%20E%7D%5E0/(c_%7B%5Crm%20A0%7D+K_M)">, not <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0/c_%7B%5Crm%20A0%7D">. The maximum error in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D(t)"> is <img src="https://latex.codecogs.com/png.latex?%5Capprox%200.65">-<img src="https://latex.codecogs.com/png.latex?0.97%5C,%5Cvarepsilon"> (the coefficient falls with <img src="https://latex.codecogs.com/png.latex?%5Crho">), first order, over the four decades of <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20E%7D%5E0"> swept here (five values, <img src="https://latex.codecogs.com/png.latex?10%5E%7B-5%7D"> to <img src="https://latex.codecogs.com/png.latex?10%5E%7B-1%7D">). Comparing with the substrate alone mispredicts it by up to a factor 95 once <img src="https://latex.codecogs.com/png.latex?K_M"> is comparable to or larger than <img src="https://latex.codecogs.com/png.latex?c_%7B%5Crm%20A0%7D">.</p>
<p><strong>If you want this rate law inside transport:</strong> take <code>BatchReduced.source</code> to <code>J4.7</code> (immobilised enzyme particle, <code>S3</code>) or to <code>B1.1</code>’s pellet; the pymrm ingredients change from <code>newton</code> + <code>NumJac</code> alone to <code>construct_grad</code> + <code>construct_div</code> + <code>newton</code>, and the rate law is unchanged.</p>
<p><strong>What NOT to reuse.</strong> The seven-point table is an exercise dataset whose provenance the source book does not state. It is used here because the gallery is mostly tier-6 for want of any measurement at all, and because what the page concludes does not depend on it - the degeneracy, the <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> scaling and the two printed defects are all properties of the printed equations. Do not cite these numbers as a measured <img src="https://latex.codecogs.com/png.latex?K_M"> for any enzyme; no enzyme is named.</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier2</category>
  <category>phase:liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J4.6-michaelis-menten-briggs-haldane/</guid>
  <pubDate>Thu, 13 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Higbie’s penetration model: what a fixed contact time predicts, and the one measurement on disk that can test it</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.2-higbie-penetration/</link>
  <description><![CDATA[ 




<section id="higbies-penetration-model" class="level1">
<h1>Higbie’s penetration model</h1>
<p><strong>Catalog ID:</strong> <code>A3.2</code> · <strong>Structures:</strong> <code>S4</code> (1-D transient diffusion, marched in the flow direction) · <strong>Tier:</strong> T0</p>
<p>A liquid surface is exposed to a gas for a definite length of time, absorbs by unsteady diffusion the whole while, and is then swept away and replaced. Nothing reaches a steady state; there is no film thickness anywhere in the argument. The mass-transfer coefficient that comes out is</p>
<p><img src="https://latex.codecogs.com/png.latex?k_L%20=%202%5Csqrt%7B%5Cfrac%7B%5Cmathscr%7BD%7D_%7BAB%7D%7D%7B%5Cpi%5C,t_%7B%5Crm%20exp%7D%7D%7D,"></p>
<p>so <img src="https://latex.codecogs.com/png.latex?k_L%20%5Cpropto%20%5Cmathscr%7BD%7D%5E%7B1/2%7D"> where film theory gives <img src="https://latex.codecogs.com/png.latex?k_L%20%5Cpropto%20%5Cmathscr%7BD%7D">.</p>
<p><strong>Where this page reads the model from, and where it does not.</strong> R. Higbie, <em>Trans. AIChE</em> <strong>31</strong>, 365-389 (1935) is the origin. It is pre-DOI, it is not on disk, and <strong>it was not consulted</strong>. Everything below is read from <strong>Bird, Stewart &amp; Lightfoot, <em>Transport Phenomena</em>, 2nd edn (Wiley, 2002), section 18.5</strong> (book pp.&nbsp;558-561), which derives the result, names it the “penetration model”, attributes it to Higbie in the same paragraph, and prints the full citation with a biographical footnote. A second book on disk, <strong>Froment, De Wilde &amp; Bischoff, <em>Chemical Reactor Analysis and Design</em>, 3rd edn (Wiley, 2011), section 6.4</strong>, is used as a <strong>cross-check only</strong>: it treats Higbie’s picture as the uniform-surface-age special case of surface renewal and prints the same constant and a closed-form enhancement factor, independently. Where the two books disagree, that is reported as a finding, not adjudicated.</p>
<p><strong>What this page has that its two siblings do not.</strong> <a href="../A3.1-whitman-two-film/"><code>A3.1</code></a> (Whitman’s two films) and <a href="../A3.3-danckwerts-surface-renewal/"><code>A3.3</code></a> (Danckwerts’ surface renewal) cannot separate the three pictures from their own sources. This page takes the comparison, with two things the others do not have: <strong>one measured mass-transfer coefficient</strong> (Hammerton &amp; Garner’s 117 cm/hr for CO2 bubbles, quoted in BSL’s Problem 18A.7) and <strong>one printed table carrying all three models side by side</strong> (Froment’s Table 6.4.2.1). What those two can and cannot settle is the subject of <em>Results</em>.</p>
<div id="d736b0da" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:18.877185Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:18.876961Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:18.892672Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:18.891692Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A3.2-higbie-penetration"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="41d86280" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:18.895195Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:18.894957Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:19.707583Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:19.705955Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> quad</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.special <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> erf, erfc</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm.checks <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> find_roots, observed_orders</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, Claims</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Film, phi_extrapolated, phi_penetration, phi_wall_series  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this page's model.py</span></span>
<span id="cb2-11"></span>
<span id="cb2-12">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-13">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.width"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.max_columns"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb2-14">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb2-15">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb2-16"></span>
<span id="cb2-17"></span>
<span id="cb2-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(row, metric, broken):</span>
<span id="cb2-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One injected defect: ``broken`` is what claim ``metric`` becomes with it."""</span></span>
<span id="cb2-20">    caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.breaks(row, metric, broken)</span>
<span id="cb2-21">    BREAK.append((row, metric, claims[metric], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(broken), caught))</span>
<span id="cb2-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> caught</span>
<span id="cb2-23"></span>
<span id="cb2-24"></span>
<span id="cb2-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rel(a, b):</span>
<span id="cb2-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>Whitman’s film (1923) explains a liquid-side resistance by putting a stagnant layer of thickness <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> against the interface and letting it reach steady state: <img src="https://latex.codecogs.com/png.latex?k_L%20=%20%5Cmathscr%7BD%7D/%5Cdelta">. Section 18.5 sets up a different picture, and BSL states it as a restriction rather than as an objection: the diffusion is to take place “so slowly in the liquid film that <img src="https://latex.codecogs.com/png.latex?A"> will not ‘penetrate’ very far into the film, that is, that the penetration distance will be small in comparison with the film thickness.” In the two systems the section and its worked Example are about (liquid running down a wetted wall, liquid sliding round a rising bubble) <strong>the contact is too short for a steady state to be established at all</strong>: the solute penetrates a short distance into a surface that is moving past, and then that piece of surface is gone.</p>
<p><strong>Whose argument that is, exactly.</strong> All BSL prints about the 1935 paper is one sentence, “This approach for studying gas absorption was apparently first proposed by Higbie”, plus footnote 5, which is the citation and a biographical note that also credits him with having “provided the basis for the ‘penetration model’ of mass transfer”. It does not say what Higbie’s own argument was, which geometries he treated, or what he compared his result against. The origin was not consulted here, so <strong>nothing on this page is attributed to the 1935 paper beyond what BSL prints about it and, where Froment’s cross-check is described, what Froment prints about it</strong>: his “Higbie’s uniform age <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t">”, printed immediately above his Eq. 6.4.1-10, and his opening of section 6.4. Every problem, example and contact time below is BSL’s or Froment’s, and is named as such.</p>
<p>That changes what has to be solved. The film gives an ordinary differential equation in one steady coordinate; penetration gives the transient diffusion equation, with the time variable supplied by the flow. It also changes what is <em>adjustable</em>. A film thickness is not observable and must be fitted. <strong>A contact time, in the two examples BSL applies the result to, is not fitted: it is <img src="https://latex.codecogs.com/png.latex?L/v_%7B%5Cmax%7D"> for the falling film of section 18.5, and <img src="https://latex.codecogs.com/png.latex?D/v_t"> for the bubble of diameter <img src="https://latex.codecogs.com/png.latex?D"> rising at <img src="https://latex.codecogs.com/png.latex?v_t"> in BSL’s Example 18.5-1</strong>, both set by the geometry and the hydrodynamics. That is the difference this page is built around, because it makes one of the three pictures falsifiable on a single measurement and the other two not.</p>
<p><strong>Where the sibling pages leave the question.</strong> <code>A3.1</code> establishes that Whitman’s three runs cannot see the diffusivity exponent. <code>A3.3</code> proves <em>why</em> its own source cannot settle it: Danckwerts’ one physical number, <img src="https://latex.codecogs.com/png.latex?s%20%5Capprox%205%5C%20%7B%5Crm%0As%5E%7B-1%7D%7D">, is obtained by inverting <img src="https://latex.codecogs.com/png.latex?k_L=%5Csqrt%7B%5Cmathscr%7BD%7Ds%7D">, and film theory fits the same single datum exactly as well by inverting <img src="https://latex.codecogs.com/png.latex?k_L=%5Cmathscr%7BD%7D/%5Cdelta">: <strong>one free constant each, one datum, zero residual each</strong>. That argument is <code>A3.3</code>’s and is not re-derived here; what this page adds is a case in which the penetration model has <em>no</em> free constant to absorb the datum with. Neither sibling’s CSV is loaded here: nothing in them is an input to anything below, and their conclusions are referred to as theirs.</p>
<p><strong>A source that does not qualify.</strong> Levenspiel’s <em>Chemical Reaction Engineering</em> (3rd edn, 1999) is on disk and mentions Higbie (“Alternatives to the film theory are also in use. These models [Higbie (1935); Danckwerts (1950, 1955)] view that the liquid at the interface is continually washed …”), with the reference in the chapter list. Named and attributed, but neither derived nor tested. It is not used for this case.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Everything in this section is transcribed from BSL section 18.5 on 300 ppi renders of the scan at its native resolution. The equation numbers are BSL’s.</p>
<p><strong>The problem.</strong> Gas <img src="https://latex.codecogs.com/png.latex?A"> is absorbed by a laminar film of liquid <img src="https://latex.codecogs.com/png.latex?B"> running down a wall, <img src="https://latex.codecogs.com/png.latex?A"> only slightly soluble so the velocity field is unaffected. The velocity profile is Eq. 18.5-1,</p>
<p><img src="https://latex.codecogs.com/png.latex?v_z(x)%20=%20v_%7B%5Cmax%7D%5Cleft%5B1-%5Cleft(%5Cfrac%7Bx%7D%7B%5Cdelta%7D%5Cright)%5E%7B2%7D%5Cright%5D,"></p>
<p><img src="https://latex.codecogs.com/png.latex?x"> measured from the gas-liquid interface into the film of thickness <img src="https://latex.codecogs.com/png.latex?%5Cdelta">. A shell balance and the two flux approximations (convection only in <img src="https://latex.codecogs.com/png.latex?z">, diffusion only in <img src="https://latex.codecogs.com/png.latex?x">) give Eq. 18.5-7,</p>
<p><img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D%5Cleft%5B1-%5Cleft(%5Cfrac%7Bx%7D%7B%5Cdelta%7D%5Cright)%5E%7B2%7D%5Cright%5D%5Cfrac%7B%5Cpartial%20c_A%7D%7B%5Cpartial%20z%7D%0A%20%20=%20%5Cmathscr%7BD%7D_%7BAB%7D%5Cfrac%7B%5Cpartial%5E%7B2%7Dc_A%7D%7B%5Cpartial%20x%5E%7B2%7D%7D,"></p>
<p>with B.C. 1 <img src="https://latex.codecogs.com/png.latex?c_A=0"> at <img src="https://latex.codecogs.com/png.latex?z=0"> (Eq. 18.5-8), B.C. 2 <img src="https://latex.codecogs.com/png.latex?c_A=c_%7BA0%7D"> at <img src="https://latex.codecogs.com/png.latex?x=0"> (Eq. 18.5-9), and B.C. 3 <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20c_A/%5Cpartial%20x=0"> at <img src="https://latex.codecogs.com/png.latex?x=%5Cdelta"> (Eq. 18.5-10): <img src="https://latex.codecogs.com/png.latex?A"> cannot diffuse through the wall. BSL notes that this problem “has been solved analytically in the form of an infinite series” (footnote 2: R. L. Pigford, PhD thesis, University of Illinois, 1941) <strong>but does not give that solution</strong>.</p>
<p><strong>The penetration approximation.</strong> Instead BSL argues that if <img src="https://latex.codecogs.com/png.latex?A"> has penetrated only a short distance, it “has the impression” that the film moves everywhere at <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D">, and it does not “sense” the wall, so Eq. 18.5-7 and its boundary conditions are replaced by Eq. 18.5-11,</p>
<p><img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D%5Cfrac%7B%5Cpartial%20c_A%7D%7B%5Cpartial%20z%7D%20=%20%5Cmathscr%7BD%7D_%7BAB%7D%5Cfrac%7B%5Cpartial%5E%7B2%7Dc_A%7D%7B%5Cpartial%20x%5E%7B2%7D%7D,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?c_A=0"> at <img src="https://latex.codecogs.com/png.latex?z=0">, <img src="https://latex.codecogs.com/png.latex?c_A=c_%7BA0%7D"> at <img src="https://latex.codecogs.com/png.latex?x=0">, and <img src="https://latex.codecogs.com/png.latex?c_A=0"> at <img src="https://latex.codecogs.com/png.latex?x=%5Cinfty"> (Eqs. 18.5-12 to 14). <strong>Two approximations are made at once here, and <em>Results 7</em> separates them.</strong> The solution is Eq. 18.5-16,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7Bc_A%7D%7Bc_%7BA0%7D%7D%20=%20%5Coperatorname%7Berfc%7D%5Cfrac%7Bx%7D%7B%5Csqrt%7B4%5Cmathscr%7BD%7D_%7BAB%7Dz/v_%7B%5Cmax%7D%7D%7D,"></p>
<p>the interfacial flux is Eq. 18.5-17,</p>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BAx%7D%5Cbig%5Cvert_%7Bx=0%7D%20=%20c_%7BA0%7D%5Csqrt%7B%5Cfrac%7B%5Cmathscr%7BD%7D_%7BAB%7Dv_%7B%5Cmax%7D%7D%7B%5Cpi%20z%7D%7D,"></p>
<p>and the total absorbed by a film of length <img src="https://latex.codecogs.com/png.latex?L"> and width <img src="https://latex.codecogs.com/png.latex?W"> is Eq. 18.5-18,</p>
<p><img src="https://latex.codecogs.com/png.latex?W_A%20=%20WLc_%7BA0%7D%5Csqrt%7B%5Cfrac%7B4%5Cmathscr%7BD%7D_%7BAB%7Dv_%7B%5Cmax%7D%7D%7B%5Cpi%20L%7D%7D."></p>
<p>BSL adds that “the same result is obtained by integrating the product <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7Dc_A"> over the flow cross section at <img src="https://latex.codecogs.com/png.latex?z=L"> (see Problem 18C.3)”: a mass balance rather than a surface-flux integral, and the route the numerical solve below uses.</p>
<p><strong>The attribution, and the exposure time.</strong> Immediately after Eq. 18.5-18: “Equation 18.5-18 shows that the mass transfer rate is directly proportional to the square root of the diffusivity and inversely proportional to the square root of the ‘exposure time,’ <img src="https://latex.codecogs.com/png.latex?t_%7B%5Crm%20exp%7D=L/v_%7B%5Cmax%7D">. This approach for studying gas absorption was apparently first proposed by Higbie.<img src="https://latex.codecogs.com/png.latex?%5E5"> The problem discussed in this section illustrates the ‘penetration model’ of mass transfer. This model is discussed further in Chapters 20 and 22.” Footnote 5 is the full Higbie citation. Writing Eq. 18.5-18 as <img src="https://latex.codecogs.com/png.latex?W_A%20=%20WL%5C,k_L%20c_%7BA0%7D"> gives the coefficient quoted at the top of this page.</p>
<p><strong>The bubble, and the one place a measurement enters.</strong> Example 18.5-1 applies the same result to a gas bubble with internal (Rybczynski-Hadamard) circulation by replacing <img src="https://latex.codecogs.com/png.latex?t_%7B%5Crm%20exp%7D=L/v_%7B%5Cmax%7D"> with <img src="https://latex.codecogs.com/png.latex?D/v_t">, <img src="https://latex.codecogs.com/png.latex?D"> the bubble diameter, giving Eq. 18.5-19,</p>
<p><img src="https://latex.codecogs.com/png.latex?(N_A)_%7B%5Crm%20avg%7D%20=%20%5Csqrt%7B%5Cfrac%7B4%5Cmathscr%7BD%7D_%7BAB%7Dv_t%7D%7B%5Cpi%20D%7D%7D%5C;c_%7BA0%7D."></p>
<p>BSL: this “turns out to be correct for potential flow of the liquid around the bubble … This equation has been approximately confirmed<img src="https://latex.codecogs.com/png.latex?%5E6"> for gas bubbles 0.3 to 0.5 cm in diameter rising through carefully purified water”, footnote 6 being D. Hammerton and F. H. Garner, <em>Trans. Inst. Chem. Engrs. (London)</em> <strong>32</strong>, S18-S24 (1954). For <strong>creeping</strong> flow the corresponding result is Eq. 18.5-20,</p>
<p><img src="https://latex.codecogs.com/png.latex?(N_A)_%7B%5Crm%20avg%7D%20=%20%5Csqrt%7B%5Cfrac%7B4%5Cmathscr%7BD%7D_%7BAB%7Dv_t%7D%7B3%5Cpi%20D%7D%7D%5C;c_%7BA0%7D,"></p>
<p>attributed to Levich, lower than Eq. 18.5-19 by exactly <img src="https://latex.codecogs.com/png.latex?%5Csqrt3">. BSL also records that a surfactant skin, by killing the internal circulation, drops the exponent to <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1/3%7D"> “as for a solid sphere”, and section 18.6 (a solid dissolving into a falling film, where the velocity gradient at the interface is finite rather than zero) gives <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B2/3%7D">. <strong>Four exponents, then, in one chapter:</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1%7D"> (film), <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1/2%7D"> (penetration, mobile interface), <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B2/3%7D"> (linear velocity gradient) and <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1/3%7D"> (rigid sphere).</p>
<p><strong>The cross-check.</strong> Froment, De Wilde &amp; Bischoff section 6.4 arrives at the same constant from the other direction. Treating Higbie’s uniform surface age <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t"> as a special case of the surface-age distribution, their Eq. 6.4.1-10 is followed by: “since, for purely physical absorption, <img src="https://latex.codecogs.com/png.latex?N_A%20=%202C_%7BAi%7D%5Csqrt%7BD_A/%5Cpi%5Cbar%20t%7D">, but also <img src="https://latex.codecogs.com/png.latex?N_A%20=%20k_L%20C_%7BAi%7D">.” That is BSL’s coefficient, from a different book, a different derivation and a different starting point. They also print, as their Eq. 6.4.2-8, the enhancement factor Higbie’s uniform age gives for a pseudo-first-order reaction,</p>
<p><img src="https://latex.codecogs.com/png.latex?F_A%20=%20%5Cgamma%5Cleft%5B%5Cleft(1+%5Cfrac%7B%5Cpi%7D%7B8%5Cgamma%5E%7B2%7D%7D%5Cright)%0A%20%20%20%20%20%20%20%20%5Coperatorname%7Berf%7D%5C!%5Cleft(%5Cfrac%7B2%7D%7B%5Csqrt%5Cpi%7D%5Cgamma%5Cright)%0A%20%20%20%20%20%20%20%20+%20%5Cfrac%7B1%7D%7B2%5Cgamma%7D%5Cexp%5C!%5Cleft(-%5Cfrac%7B4%7D%7B%5Cpi%7D%5Cgamma%5E%7B2%7D%5Cright)%5Cright%5D,%0A%20%20%5Cqquad%20%5Cgamma%5E%7B2%7D=%5Cfrac%7BD_Ak%7D%7Bk_L%5E%7B2%7D%7D,"></p>
<p>against <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B1+%5Cgamma%5E2%7D"> for Danckwerts’ surface renewal (their Eq. 6.4.2-7) and <img src="https://latex.codecogs.com/png.latex?%5Cgamma/%5Ctanh%5Cgamma"> for the film. Their Table 6.4.2.1 tabulates all three.</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Nothing on this page uses a transport property that is not printed in a source on disk.</strong> The two worked problems supply their own diffusivities, solubilities and velocities; the one molecular weight needed comes from BSL’s own Table E.1.</p>
<ul>
<li><strong><code>18A.4</code>, chlorine into a falling water film.</strong> <img src="https://latex.codecogs.com/png.latex?R=1.4"> cm and <img src="https://latex.codecogs.com/png.latex?L=13"> cm are text labels on Fig. 18A.4 (nothing is traced or digitised); <img src="https://latex.codecogs.com/png.latex?%5Clangle%20v%5Crangle%0A=17.7"> cm/s, <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D_%7BAB%7D=1.26%5Ctimes10%5E%7B-5%7D"> cm<img src="https://latex.codecogs.com/png.latex?%5E2">/s and a saturation of 0.823 g Cl<img src="https://latex.codecogs.com/png.latex?_2"> per 100 g water at 16 C are printed in the statement. The wetted width is <img src="https://latex.codecogs.com/png.latex?W=2%5Cpi%20R">.</li>
<li><strong>The factor <img src="https://latex.codecogs.com/png.latex?3/2"> is derived, not remembered.</strong> Eq. 18.5-18 is written in <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D"> and the problem prints <img src="https://latex.codecogs.com/png.latex?%5Clangle%20v%5Crangle">. Averaging the <em>printed</em> Eq. 18.5-1 across the film, <img src="https://latex.codecogs.com/png.latex?%5Clangle%20v_z%5Crangle%20=%20%5Cfrac%7B1%7D%7B%5Cdelta%7D%5Cint_0%5E%7B%5Cdelta%7Dv_%7B%5Cmax%7D%5B1-(x/%5Cdelta)%5E2%5D%5C,dx%0A=%20%5Ctfrac23%20v_%7B%5Cmax%7D">, so <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D%20=%20%5Ctfrac32%5Clangle%20v%5Crangle">.</li>
<li><strong>One assumption, flagged.</strong> Converting “0.823 g per 100 g water” to mol cm<img src="https://latex.codecogs.com/png.latex?%5E%7B-3%7D"> needs the density of water, which the problem does not print. It is taken as exactly 1.000 g/cm<img src="https://latex.codecogs.com/png.latex?%5E3"> and the solution treated as dilute. <em>Results 1</em> re-evaluates the answer at 0.999: the two densities fall on <strong>opposite sides</strong> of a three-figure rounding step, so the choice is not harmless, and the printed answer still cannot <strong>decide between them</strong>, because the rounding of an input 18A.4 <em>does</em> print (the diffusivity) moves the answer by more.</li>
<li><strong><code>18A.7</code>, CO<img src="https://latex.codecogs.com/png.latex?_2"> from a rising bubble.</strong> <img src="https://latex.codecogs.com/png.latex?D=0.5"> cm, <img src="https://latex.codecogs.com/png.latex?v_t=22"> cm/s, <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D_%7BAB%7D=1.46%5Ctimes10%5E%7B-5%7D"> cm<img src="https://latex.codecogs.com/png.latex?%5E2">/s and <img src="https://latex.codecogs.com/png.latex?c_%7BA0%7D=0.041"> g-mol/liter at 18 C, 1 atm, all printed; and Hammerton &amp; Garner’s measured surface-averaged <img src="https://latex.codecogs.com/png.latex?k_c=117"> cm/hr, quoted by BSL from a paper that is <strong>not on disk and was not consulted</strong>.</li>
<li><strong><img src="https://latex.codecogs.com/png.latex?%5Cdelta"> is never invented.</strong> Problem 18A.4 prints no film thickness, no viscosity and no flow rate, so the finite-thickness correction is reported as a threshold in the dimensionless group <img src="https://latex.codecogs.com/png.latex?%5CLambda%20=%20%5Cmathscr%7BD%7D_%7BAB%7DL/(v_%7B%5Cmax%7D%0A%5Cdelta%5E%7B2%7D)"> and as the <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> at which that correction reaches 1 %, rather than as a number for that column.</li>
<li><strong>Nothing on this page is stochastic.</strong></li>
</ul>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Three CSVs, all of them printed numbers rather than measurements, which is why the data tier is <strong>6</strong>. Two come from the pinned source (BSL), one from the cross-check (Froment).</p>
<ol type="1">
<li><code>bsl-2002-sec18p5-worked-problems.csv</code>: the inputs and printed answers of Problems 18A.4 and 18A.7, plus the molecular weight of Cl<img src="https://latex.codecogs.com/png.latex?_2"> from BSL’s Table E.1. One row, <code>bub_kc_measured</code>, is a <strong>measurement</strong>: Hammerton &amp; Garner’s 117 cm/hr, quoted by BSL. That paper is not on disk and was not consulted; BSL prints no error bar for it and none is invented.</li>
<li><code>bsl-2002-penetration-vs-film-tables.csv</code>: BSL’s Table 20.1-1 (Arnold’s <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> and <img src="https://latex.codecogs.com/png.latex?%5Cpsi">) and Table 22.8-2, headed <em>Comparison of Film and Penetration Models</em>. <strong>That table is not about the exponent on diffusivity</strong>; it compares the two models’ corrections <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> for a finite net mass-transfer rate. The Arnold problem itself is case <code>A4.8</code>; <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> and <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> appear here only because Eq. 22.8-41 needs them.</li>
<li><code>froment-2011-table6p4p2-1-three-models.csv</code>: Froment’s Table 6.4.2.1, film, surface renewal and penetration enhancement factors at six <img src="https://latex.codecogs.com/png.latex?%5Cgamma">. Froment prints it “After Beek [1968]”; <strong>Beek 1968 is not on disk and was not consulted</strong>, so every statement made about these numbers is a statement about Froment’s printing.</li>
</ol>
<p>The two tables are also read as strings, so that each cell’s rounding window comes from the digits it is printed with (<code>0.270</code> read as a float would lose a digit). <strong>No other page’s dataset is loaded.</strong></p>
<div id="59abac6c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:19.711442Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:19.710997Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:19.744295Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:19.743519Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">prob <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl-2002-sec18p5-worked-problems.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"id"</span>)</span>
<span id="cb3-2">tabs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl-2002-penetration-vs-film-tables.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-3">tabs_str <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl-2002-penetration-vs-film-tables.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb3-4">fro <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-2011-table6p4p2-1-three-models.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-5">fro_str <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-2011-table6p4p2-1-three-models.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb3-6"></span>
<span id="cb3-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl-2002-sec18p5-worked-problems.csv"</span>,</span>
<span id="cb3-8">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-2011-table6p4p2-1-three-models.csv"</span>):</span>
<span id="cb3-9">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(_name, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)).replace(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">chr</span>(<span class="bn" style="color: #AD0000;
background-color: null;
font-style: inherit;">0x2014</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span>
<span id="cb3-10"></span>
<span id="cb3-11"></span>
<span id="cb3-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> P(key):</span>
<span id="cb3-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A value BSL prints, by its row id in the worked-problems CSV."""</span></span>
<span id="cb3-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(prob.loc[key, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])</span>
<span id="cb3-15"></span>
<span id="cb3-16"></span>
<span id="cb3-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> half_unit(cells):</span>
<span id="cb3-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Half a unit in the last printed place of each cell, from its string."""</span></span>
<span id="cb3-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(c).partition(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> cells])</span>
<span id="cb3-20"></span>
<span id="cb3-21"></span>
<span id="cb3-22">display(prob[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"problem"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>]])</span>
<span id="cb3-23">display(tabs)</span>
<span id="cb3-24">display(fro)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Bird, R. B.; Stewart, W. E.; Lightfoot, E. N. (2002), Transport Phenomena, 2nd edition, John Wiley &amp; Sons, table
Froment, G. F.; De Wilde, J.; Bischoff, K. B. (2011), Chemical Reactor Analysis and Design, 3rd edition, John Wiley &amp; Sons, ISBN 978-0-470-56541-4, table</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">problem</th>
<th data-quarto-table-cell-role="th">quantity</th>
<th data-quarto-table-cell-role="th">value</th>
<th data-quarto-table-cell-role="th">unit</th>
<th data-quarto-table-cell-role="th">role</th>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">id</th>
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th"></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">film_R</th>
<td>18A.4</td>
<td>inside radius of the wetted-wall column</td>
<td>1.400000</td>
<td>cm</td>
<td>input</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">film_L</th>
<td>18A.4</td>
<td>wetted length of the column</td>
<td>13.000000</td>
<td>cm</td>
<td>input</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">film_v_avg</th>
<td>18A.4</td>
<td>average velocity of the water film</td>
<td>17.700000</td>
<td>cm/s</td>
<td>input</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">film_D</th>
<td>18A.4</td>
<td>liquid-phase diffusivity of the chlorine-water...</td>
<td>0.000013</td>
<td>cm2/s</td>
<td>input</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">film_solubility</th>
<td>18A.4</td>
<td>saturation concentration of chlorine in water</td>
<td>0.823000</td>
<td>g Cl2 per 100 g water</td>
<td>input</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">film_T</th>
<td>18A.4</td>
<td>temperature</td>
<td>16.000000</td>
<td>degC</td>
<td>input</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">film_WA_printed</th>
<td>18A.4</td>
<td>absorption rate</td>
<td>0.273000</td>
<td>g-mol/hr</td>
<td>printed_answer</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">bub_D_bubble</th>
<td>18A.7</td>
<td>bubble diameter</td>
<td>0.500000</td>
<td>cm</td>
<td>input</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">bub_DAB</th>
<td>18A.7</td>
<td>liquid-phase diffusivity of CO2 in water</td>
<td>0.000015</td>
<td>cm2/s</td>
<td>input</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">bub_cA0</th>
<td>18A.7</td>
<td>solubility of CO2 in water at 18 C and 1 atm</td>
<td>0.041000</td>
<td>g-mol/liter</td>
<td>input</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">bub_vt</th>
<td>18A.7</td>
<td>terminal rise velocity of the bubble</td>
<td>22.000000</td>
<td>cm/s</td>
<td>input</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">bub_T</th>
<td>18A.7</td>
<td>temperature</td>
<td>18.000000</td>
<td>degC</td>
<td>input</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">bub_P</th>
<td>18A.7</td>
<td>pressure</td>
<td>1.000000</td>
<td>atm</td>
<td>input</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">bub_kc_measured</th>
<td>18A.7</td>
<td>surface-averaged mass-transfer coefficient mea...</td>
<td>117.000000</td>
<td>cm/hr</td>
<td>measurement</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">bub_Na_printed_a</th>
<td>18A.7</td>
<td>molar absorption flux from part (a)</td>
<td>0.000001</td>
<td>g-mol/(cm2 s)</td>
<td>printed_answer</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">bub_Na_printed_b</th>
<td>18A.7</td>
<td>molar absorption flux from part (b)</td>
<td>0.000001</td>
<td>g-mol/(cm2 s)</td>
<td>printed_answer</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">M_Cl2</th>
<td>18A.4</td>
<td>molecular weight of Cl2</td>
<td>70.905000</td>
<td>g/g-mol</td>
<td>constant</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">x_A0</th>
<th data-quarto-table-cell-role="th">phi_20p1_1</th>
<th data-quarto-table-cell-role="th">psi_20p1_1</th>
<th data-quarto-table-cell-role="th">theta_penetration_22p8_2</th>
<th data-quarto-table-cell-role="th">theta_film_22p8_2</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>0.00</td>
<td>0.0000</td>
<td>1.000</td>
<td>1.000</td>
<td>1.000</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>0.25</td>
<td>0.1562</td>
<td>1.108</td>
<td>0.831</td>
<td>0.863</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>0.50</td>
<td>0.3578</td>
<td>1.268</td>
<td>0.634</td>
<td>0.693</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>0.75</td>
<td>0.6618</td>
<td>1.564</td>
<td>0.391</td>
<td>0.462</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>1.00</td>
<td>NaN</td>
<td>NaN</td>
<td>0.000</td>
<td>0.000</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">gamma</th>
<th data-quarto-table-cell-role="th">FA_film_printed</th>
<th data-quarto-table-cell-role="th">FA_surface_renewal_printed</th>
<th data-quarto-table-cell-role="th">FA_penetration_printed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>0.01</td>
<td>1.00</td>
<td>1.00</td>
<td>0.940</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>0.10</td>
<td>1.00</td>
<td>1.00</td>
<td>1.005</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>0.30</td>
<td>1.04</td>
<td>1.04</td>
<td>1.035</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>1.00</td>
<td>1.31</td>
<td>1.41</td>
<td>1.370</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>3.00</td>
<td>3.02</td>
<td>3.16</td>
<td>3.120</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>10.00</td>
<td>10.00</td>
<td>10.05</td>
<td>10.390</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
<section id="what-the-sources-say-about-these-rows-and-what-it-costs" class="level3">
<h3 class="anchored" data-anchor-id="what-the-sources-say-about-these-rows-and-what-it-costs">What the sources say about these rows, and what it costs</h3>
<ul>
<li>BSL prints Problem 18A.7’s answers to <strong>three</strong> significant figures and 18A.4’s to three as well. Every reproduction below is therefore at best a 0.2 %-level statement, and 18A.4’s residual is <em>at</em> that level, not under it.</li>
<li>Section 18.5 itself carries <strong>no numerical result</strong>. The only figures printed anywhere in it are the “0.3 to 0.5 cm” bubble-diameter range over which BSL says Eq. 18.5-19 was approximately confirmed, and the <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1/3%7D"> exponent of a surfactant-skinned bubble, which book p.&nbsp;561 contrasts with the <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1/2%7D"> of Eq. 18.5-19. (The <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B2/3%7D"> belongs to <strong>section 18.6</strong>, not to 18.5: book p.&nbsp;563 is where BSL writes “in §18.5, <img src="https://latex.codecogs.com/png.latex?W_A%5Cpropto(%5Cmathscr%7BD%7D_%7BAB%7DL)%5E%7B1/2%7D">, whereas in this section <img src="https://latex.codecogs.com/png.latex?W_A%5Cpropto(%5Cmathscr%7BD%7D_%7BAB%7DL)%5E%7B2/3%7D">”.) Everything else is derivation and attribution; the numbers live in the problems.</li>
<li>The 117 cm/hr is a <em>surface-averaged</em> coefficient over a rising bubble, and BSL’s own words for the agreement are “approximately confirmed”. The page does not upgrade that to a validation.</li>
<li><strong>Table 22.8-2’s penetration column is not an independent computation.</strong> It is Table 20.1-1’s <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> column multiplied by <img src="https://latex.codecogs.com/png.latex?(1-x_%7BA0%7D)">, which is exactly what Eq. 22.8-41 says. The two reproductions below therefore carry the same information, and the notebook prints that coincidence instead of presenting them as two checks.</li>
<li>Froment’s Table 6.4.2.1 rows at <img src="https://latex.codecogs.com/png.latex?%5Cgamma=0.01"> and <img src="https://latex.codecogs.com/png.latex?%5Cgamma=10"> are examined below; they are inconsistent with the closed form printed at the head of their own column, and they are reported, not corrected.</li>
</ul>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>The structure is <code>S4</code>: a one-dimensional transient diffusion problem, here <em>marched</em> in the axial distance <img src="https://latex.codecogs.com/png.latex?z">, which plays the role of time because Eq. 18.5-7 has no axial diffusion. Non-dimensionalise with <img src="https://latex.codecogs.com/png.latex?%5Cxi=x/%5Cdelta">, <img src="https://latex.codecogs.com/png.latex?%5Czeta=z/L">, <img src="https://latex.codecogs.com/png.latex?u=c_A/c_%7BA0%7D"> and</p>
<p><img src="https://latex.codecogs.com/png.latex?%5CLambda%20%5Cequiv%20%5Cfrac%7B%5Cmathscr%7BD%7D_%7BAB%7DL%7D%7Bv_%7B%5Cmax%7D%5Cdelta%5E%7B2%7D%7D,%0A%5Cqquad%5Ctext%7Bso%7D%5Cqquad%0A(1-%5Cxi%5E%7B2%7D)%5Cfrac%7B%5Cpartial%20u%7D%7B%5Cpartial%5Czeta%7D%20=%20%5CLambda%5Cfrac%7B%5Cpartial%5E%7B2%7Du%7D%7B%5Cpartial%5Cxi%5E%7B2%7D%7D,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?u(%5Cxi,0)=0">, <img src="https://latex.codecogs.com/png.latex?u(0,%5Czeta)=1"> and <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20u/%5Cpartial%5Cxi%5Cvert_%7B%5Cxi=1%7D=0">. The penetration depth relative to the film is <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda%7D">, so <img src="https://latex.codecogs.com/png.latex?%5CLambda%5Cto0"> is BSL’s short-contact-time limit. One class, <code>Film</code> in <code>model.py</code>, covers every case the page needs by switching two things independently:</p>
<ul>
<li>the <strong>capacity</strong> <img src="https://latex.codecogs.com/png.latex?(1-%5Cxi%5E%7B2%7D)">, the parabolic velocity profile, or <img src="https://latex.codecogs.com/png.latex?1"> for plug flow at <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D"> (<code>profile=</code>): BSL’s first approximation;</li>
<li>the <strong>outer boundary</strong>, a no-flux wall at <img src="https://latex.codecogs.com/png.latex?%5Cxi=1"> or a domain several penetration depths deep (<code>XI=</code>): BSL’s second approximation.</li>
</ul>
<p>Turning both off gives Eq. 18.5-11; turning both on gives Eq. 18.5-7. The dimensionless uptake reported at the outlet is the mixing cup</p>
<p><img src="https://latex.codecogs.com/png.latex?%5CPhi%20%5Cequiv%20%5Cint_%7B0%7D%5E%7B1%7D(1-%5Cxi%5E%7B2%7D)%5C,u(%5Cxi,1)%5C,d%5Cxi%0A%20%20%5Cqquad%5CLongrightarrow%5Cqquad%20W_A%20=%20W%5C,%5Cdelta%5C,v_%7B%5Cmax%7Dc_%7BA0%7D%5C,%5CPhi,"></p>
<p>which is BSL’s Problem 18C.3 route. In the penetration limit <img src="https://latex.codecogs.com/png.latex?%5CPhi%5Cto%5Csqrt%7B4%5CLambda/%5Cpi%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> cancels out of <img src="https://latex.codecogs.com/png.latex?W_A">, as it must.</p>
<p><strong>What is pymrm and what is not.</strong> The transverse operator <img src="https://latex.codecogs.com/png.latex?%5CLambda%5C,%5Cpartial%5E2/%5Cpartial%5Cxi%5E2"> and its boundary vector come from <code>construct_grad</code> and <code>construct_div</code> on a grid stretched toward the interface, assembled once in the constructor with the state shaped <code>(n_x, 1)</code>. The interfacial flux is read with <code>compute_boundary_values</code> (gradient along <img src="https://latex.codecogs.com/png.latex?+%5Cxi">, so the flux into the film is <img src="https://latex.codecogs.com/png.latex?-%5CLambda%5C,%5Cpartial%20u/%5Cpartial%5Cxi">). The boundary conditions use the <strong>outward</strong> normal and each carries its physical equation in a comment. The march itself is numpy and scipy: backward Euler on steps uniform in <img src="https://latex.codecogs.com/png.latex?%5Csqrt%5Czeta">, each step one <code>scipy.linalg.solve_banded</code> call on the tridiagonal operator, which is stored once in banded form, so a step only adds <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bcap%7D/%5CDelta%5Czeta"> to its diagonal. Backward Euler is first order, so every production <img src="https://latex.codecogs.com/png.latex?%5CPhi"> is the Richardson combination <img src="https://latex.codecogs.com/png.latex?2%5CPhi(2n_t)-%5CPhi(n_t)"> (<code>phi_extrapolated</code>), with the raw value kept beside it. <em>Validation 3</em> measures that choice against BDF2 and Crank-Nicolson. The cell below checks the banded solve against a sparse LU of the same step matrix, assembled with <code>construct_coefficient_matrix</code> for the capacity.</p>
<div id="775e5d48" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:19.746398Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:19.746260Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.023609Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.022490Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1">_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb5-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Film(0.1): n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, state shape </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shape<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, cells from "</span></span>
<span id="cb5-3">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dx[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the interface to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dx[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the wall"</span>)</span>
<span id="cb5-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary conditions, outward normal:"</span>)</span>
<span id="cb5-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _side, _bc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xi = 0 "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xi = XI"</span>), _f.bc):</span>
<span id="cb5-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_side<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, b = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'b'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, d = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'d'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-7"></span>
<span id="cb5-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse.linalg <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> splu</span>
<span id="cb5-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> construct_coefficient_matrix</span>
<span id="cb5-10"></span>
<span id="cb5-11"></span>
<span id="cb5-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> march_splu(film, n_t, refactor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb5-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The same backward-Euler march with a sparse LU of the step matrix.</span></span>
<span id="cb5-14"></span>
<span id="cb5-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The capacity enters as ``construct_coefficient_matrix``; with</span></span>
<span id="cb5-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``refactor=False`` the LU of the first step is reused for every step."""</span></span>
<span id="cb5-17">    cap_mat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_coefficient_matrix(film.cap.reshape(film.shape), shape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>film.shape)</span>
<span id="cb5-18">    z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb5-19">    u, lu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros(film.n_x), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb5-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dz <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.diff(z):</span>
<span id="cb5-21">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> refactor <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> lu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb5-22">            lu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> splu((cap_mat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> film.jac_diff).tocsc())</span>
<span id="cb5-23">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lu.solve(film.cap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> film.g_const)</span>
<span id="cb5-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> film.cup(u)</span>
<span id="cb5-25"></span>
<span id="cb5-26"></span>
<span id="cb5-27">SPLU_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(march_splu(_f, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _f.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb5-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">800 steps on 600 cells: the banded solve and a sparse LU of the step matrix "</span></span>
<span id="cb5-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"give the same cup to below 1e-12 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPLU_GAP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb5-30">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"banded_vs_splu_cup_gap"</span>, SPLU_GAP, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb5-31">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same linear equations, two direct solvers"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Film(0.1): n_x = 600, state shape (600, 1), cells from 2.50e-05 at the interface to 9.97e-03 at the wall
boundary conditions, outward normal:
   xi = 0 : a = 0, b = 1, d = 1
   xi = XI: a = 1, b = 0, d = 0

800 steps on 600 cells: the banded solve and a sparse LU of the step matrix give the same cup to below 1e-12 (here 1.0e-14)</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="problem-18a.4-two-ways" class="level3">
<h3 class="anchored" data-anchor-id="problem-18a.4-two-ways">1. Problem 18A.4, two ways</h3>
<p>The closed form is Eq. 18.5-18. The second route never touches an error function: it marches Eq. 18.5-11 on finite volumes and reads the outlet mixing cup, which is BSL’s Problem 18C.3 identity used as a <em>different</em> route to the same number rather than as a check on itself.</p>
<div id="4d0c693b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.025568Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.025434Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.386468Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.385552Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">R, L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_R"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_L"</span>)</span>
<span id="cb7-2">v_avg, D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_v_avg"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_D"</span>)</span>
<span id="cb7-3">sol_g, M_Cl2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_solubility"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M_Cl2"</span>)</span>
<span id="cb7-4">RHO_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.000</span>        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># g/cm3, ASSUMED (not printed in the problem)</span></span>
<span id="cb7-5">WA_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_WA_printed"</span>)</span>
<span id="cb7-6"></span>
<span id="cb7-7">W_wet <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># wetted width of the column</span></span>
<span id="cb7-8">v_max <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v_avg                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># &lt;v&gt; = (2/3) v_max, from Eq. 18.5-1</span></span>
<span id="cb7-9"></span>
<span id="cb7-10"></span>
<span id="cb7-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> WA_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_max, four<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_W, mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>M_Cl2, D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_cl, d_exp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb7-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. 18.5-18 in g-mol/hr; the arguments are the inputs a defect can change."""</span></span>
<span id="cb7-13">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sol_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> mw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rho)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># g-mol/cm3</span></span>
<span id="cb7-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (W_wet <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(four <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> vmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> d_exp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span>)</span>
<span id="cb7-15"></span>
<span id="cb7-16"></span>
<span id="cb7-17">cA0_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sol_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> M_Cl2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RHO_W)</span>
<span id="cb7-18">t_exp_film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v_max</span>
<span id="cb7-19">pen_depth_film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t_exp_film)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sqrt(4 D t_exp), cm</span></span>
<span id="cb7-20">kL_film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t_exp_film))</span>
<span id="cb7-21">WA_closed_hr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WA_hr()</span>
<span id="cb7-22"></span>
<span id="cb7-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Second route: pymrm march of Eq. 18.5-11 (plug flow, deep domain). Lam is a free</span></span>
<span id="cb7-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># choice because delta cancels out of W_A in this limit; XI = 10 sqrt(4 Lam) puts</span></span>
<span id="cb7-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the far boundary ten penetration depths away.</span></span>
<span id="cb7-26">LAM_REF, NX_REF, NT_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span></span>
<span id="cb7-27">XI_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_REF)</span>
<span id="cb7-28">REF_FILM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(XI<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XI_REF, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX_REF, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>)</span>
<span id="cb7-29">Phi_pymrm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi_extrapolated(LAM_REF, NT_REF, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>REF_FILM)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]</span>
<span id="cb7-30"></span>
<span id="cb7-31"></span>
<span id="cb7-32"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ref_grid_ratio(which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>):</span>
<span id="cb7-33">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""How much the march's error against sqrt(4 Lam/pi) falls when n_x doubles."""</span></span>
<span id="cb7-34">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [rel(phi_extrapolated(LAM_REF, NT_REF, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>REF_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>: n})[which],</span>
<span id="cb7-35">             phi_penetration(LAM_REF)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (NX_REF, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NX_REF)]</span>
<span id="cb7-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb7-37"></span>
<span id="cb7-38"></span>
<span id="cb7-39">REF_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ref_grid_ratio()</span>
<span id="cb7-40"></span>
<span id="cb7-41"></span>
<span id="cb7-42"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> WA_pymrm_hr(phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Phi_pymrm, vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_max, rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_W, mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>M_Cl2):</span>
<span id="cb7-43">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""W_A from the marched Phi, W delta v_max c_A0 Phi, with delta = sqrt(D L/(v_max Lam))."""</span></span>
<span id="cb7-44">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sol_g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> mw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rho)</span>
<span id="cb7-45">    delta_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (vmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_REF))</span>
<span id="cb7-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> W_wet <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> delta_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> vmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span></span>
<span id="cb7-47"></span>
<span id="cb7-48"></span>
<span id="cb7-49">WA_pymrm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WA_pymrm_hr()</span>
<span id="cb7-50">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>, rel(WA_closed_hr, WA_printed))</span>
<span id="cb7-51">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_printed_18A4_rel"</span>, rel(WA_pymrm, WA_printed))</span>
<span id="cb7-52">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>, rel(WA_pymrm, WA_closed_hr))</span>
<span id="cb7-53">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_closed_gmol_per_hr"</span>, WA_closed_hr)</span>
<span id="cb7-54">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_grid_ratio"</span>, REF_RATIO, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb7-55">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"error of the march falls 4x when n_x doubles: a second-order grid error"</span>)</span>
<span id="cb7-56"></span>
<span id="cb7-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Does the closed form round to the printed three figures? Three printed decimals</span></span>
<span id="cb7-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># allow +/- 0.0005, and the page must not claim more agreement than that.</span></span>
<span id="cb7-59">WA_round3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(WA_closed_hr, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb7-60">round_half_rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0005</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WA_printed</span>
<span id="cb7-61">RHO_ALT, MW_ALT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">71.0</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two plausible unprinted alternatives</span></span>
<span id="cb7-62">WA_rho999, WA_mw71 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WA_hr(rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_ALT), WA_hr(mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MW_ALT)</span>
<span id="cb7-63">D_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (np.floor(np.log10(D_cl)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># D is printed to 3 figures</span></span>
<span id="cb7-64"></span>
<span id="cb7-65"></span>
<span id="cb7-66"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> D_window(d_exp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb7-67">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""How far half a unit in the last printed place of D moves W_A."""</span></span>
<span id="cb7-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rel(WA_hr(D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_half, d_exp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d_exp), WA_hr(d_exp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d_exp)))</span>
<span id="cb7-69">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb7-70"></span>
<span id="cb7-71"></span>
<span id="cb7-72">D_window_rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D_window()</span>
<span id="cb7-73">WA_excess <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WA_closed_hr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (WA_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0005</span>)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># how far outside the window</span></span>
<span id="cb7-74">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_window_rel"</span>, round_half_rel)</span>
<span id="cb7-75">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_rho999_gmol_per_hr"</span>, WA_rho999)</span>
<span id="cb7-76">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_mw71_gmol_per_hr"</span>, WA_mw71)</span>
<span id="cb7-77">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_half_unit_window_rel"</span>, D_window_rel)</span>
<span id="cb7-78">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_excess_over_window_gmol_per_hr"</span>, WA_excess)</span>
<span id="cb7-79">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_exposure_time_s"</span>, t_exp_film)</span>
<span id="cb7-80">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_penetration_depth_um"</span>, pen_depth_film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb7-81">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_kL_cm_s"</span>, kL_film)</span>
<span id="cb7-82"></span>
<span id="cb7-83">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb7-84"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> route </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> absorption rate </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">g-mol/hr</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs BSL's printed answer </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb7-85"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb7-86"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-18, closed form </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_closed_hr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb7-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> pymrm march of Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-11, outlet mixing cup </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_pymrm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_printed_18A4_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb7-88"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">BSL, printed</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb7-89"></span>
<span id="cb7-90"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">One route evaluates a square root; the other solves </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NX_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells over</span></span>
<span id="cb7-91"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NT_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> marching steps, extrapolates in the step and integrates</span></span>
<span id="cb7-92"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the outlet profile</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> They agree to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %,</span></span>
<span id="cb7-93"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">which is the grid error of the march: on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NX_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells it is</span></span>
<span id="cb7-94"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REF_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> times smaller</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Both sit</span></span>
<span id="cb7-95"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % from the printed answer</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb7-96"></span>
<span id="cb7-97"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">That residual is a hair </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">outside</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> three-figure rounding, not inside it</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span></span>
<span id="cb7-98"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_closed_hr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> rounds to </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_round3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, whereas BSL prints</span></span>
<span id="cb7-99"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; three printed decimals allow </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>round_half_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span></span>
<span id="cb7-100"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">and the deviation is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Two</span></span>
<span id="cb7-101"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">inputs Problem 18A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4 does </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> print are each worth about that much</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Taking the</span></span>
<span id="cb7-102"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">density of water as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_ALT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/cm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of the assumed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> gives</span></span>
<span id="cb7-103"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_rho999<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rel(WA_rho999, WA_printed)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; taking </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">M</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Cl</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">_2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> as</span></span>
<span id="cb7-104"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_ALT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of Table E</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_Cl2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_mw71<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span></span>
<span id="cb7-105"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rel(WA_mw71, WA_printed)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">each of those rounds to the printed</span></span>
<span id="cb7-106"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb7-107"></span>
<span id="cb7-108"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The excess is thin, and not theirs alone</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The amount to be explained is only</span></span>
<span id="cb7-109"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_excess<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> g-mol/hr, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_excess<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>WA_closed_hr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the value, and the</span></span>
<span id="cb7-110"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">inputs 18A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4 </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">does</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> print are three-figure as well</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Half a unit in the last printed</span></span>
<span id="cb7-111"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">place of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">AB</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> moves </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">W_A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_window_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on its</span></span>
<span id="cb7-112"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">own, more than the whole </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>round_half_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % window; and if BSL</span></span>
<span id="cb7-113"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">truncated to three decimals rather than rounding, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_closed_hr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> sits inside</span></span>
<span id="cb7-114"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">) and there is nothing to explain at all.</span></span>
<span id="cb7-115"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">So the page does not conclude that BSL used either unprinted value: a three-figure</span></span>
<span id="cb7-116"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">printed answer cannot tell, which is why neither is adopted.</span></span>
<span id="cb7-117"></span>
<span id="cb7-118"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">**Which half of the calculation each number tests.** The two routes are *not*</span></span>
<span id="cb7-119"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">independent end to end. The wetted width $W=2</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">pi R$, the factor $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">frac32$, the</span></span>
<span id="cb7-120"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">solubility conversion and the 3600 are computed once and enter both; and the</span></span>
<span id="cb7-121"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">reference thickness $</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">elta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">m ref</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">L/(v_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ax</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Lambda)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb7-122"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">carries the same dimensional group back out of the march, so $W$, $c_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$,</span></span>
<span id="cb7-123"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$v_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ax</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$, $</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$, $L$ and the 3600 cancel identically out of the ratio.</span></span>
<span id="cb7-124"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">`pymrm_vs_eq18518_rel` therefore **cannot see any of them**: the break table</span></span>
<span id="cb7-125"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">injects $v_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ax</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">=</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">langle v</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">angle$, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ho$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_ALT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> and $M$(Cl$_2$) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_ALT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> into it</span></span>
<span id="cb7-126"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">and it does not move. What it *does* test is the dimensionless solve, the marched</span></span>
<span id="cb7-127"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Phi(</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Lambda)$ against $</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Lambda/</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">pi</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$, an error function against</span></span>
<span id="cb7-128"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NX_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> finite volumes, with the 4 and the $</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">pi$ in it: drop the 4 from</span></span>
<span id="cb7-129"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Eq. 18.5-18 and it moves. **The dimensional prefactor is tested by the other</span></span>
<span id="cb7-130"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">column of the table**: the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> %</span></span>
<span id="cb7-131"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">against BSL's printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WA_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> g-mol/hr is what says $W$, the $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">frac32$,</span></span>
<span id="cb7-132"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">the solubility conversion and the units are right, and it is the only thing on the</span></span>
<span id="cb7-133"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">page that says so.</span></span>
<span id="cb7-134"></span>
<span id="cb7-135"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exposure time $t_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">m exp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> = L/v_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ax</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$ = **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t_exp_film<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> s**, penetration</span></span>
<span id="cb7-136"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">depth $</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">t_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">m exp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$ = **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pen_depth_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> um**,</span></span>
<span id="cb7-137"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$k_L = 2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">/</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">pi t_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">m exp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}}}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">$ = **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kL_film<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;"> cm/s**.</span></span>
<span id="cb7-138"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>route</th>
<th>absorption rate (g-mol/hr)</th>
<th>vs BSL’s printed answer</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Eq. 18.5-18, closed form</td>
<td>0.27351</td>
<td>+0.188 %</td>
</tr>
<tr class="even">
<td>pymrm march of Eq. 18.5-11, outlet mixing cup</td>
<td>0.27351</td>
<td>+0.187 %</td>
</tr>
<tr class="odd">
<td><strong>BSL, printed</strong></td>
<td><strong>0.273</strong></td>
<td></td>
</tr>
</tbody>
</table>
<p>One route evaluates a square root; the other solves 600 cells over 800 and 1600 marching steps, extrapolates in the step and integrates the outlet profile. They agree to 4.6e-04 %, which is the grid error of the march: on 1200 cells it is 3.92 times smaller. Both sit +0.19 % from the printed answer.</p>
<p><strong>That residual is a hair <em>outside</em> three-figure rounding, not inside it.</strong> 0.27351 rounds to <strong>0.274</strong>, whereas BSL prints <strong>0.273</strong>; three printed decimals allow $<img src="https://latex.codecogs.com/png.latex?0.183%20%25%0Aand%20the%20deviation%20is%20+0.188%20%25.%20Two%0Ainputs%20Problem%2018A.4%20does%20**not**%20print%20are%20each%20worth%20about%20that%20much.%20Taking%20the%0Adensity%20of%20water%20as%200.999%20g/cm">^3$ instead of the assumed 1.000 gives 0.27324 (+0.088 %); taking <img src="https://latex.codecogs.com/png.latex?M">(Cl<img src="https://latex.codecogs.com/png.latex?_2">) as 71.0 instead of Table E.1’s 70.905 gives 0.27315 (+0.054 %); <strong>each of those rounds to the printed 0.273</strong>.</p>
<p><strong>The excess is thin, and not theirs alone.</strong> The amount to be explained is only 1.28e-05 g-mol/hr, 0.0047 % of the value, and the inputs 18A.4 <em>does</em> print are three-figure as well. Half a unit in the last printed place of <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D_%7BAB%7D"> moves <img src="https://latex.codecogs.com/png.latex?W_A"> by $$0.199 % on its own, more than the whole $$0.183 % window; and if BSL truncated to three decimals rather than rounding, 0.27351 sits inside [0.273, 0.274) and there is nothing to explain at all. So the page does not conclude that BSL used either unprinted value: a three-figure printed answer cannot tell, which is why neither is adopted.</p>
<p><strong>Which half of the calculation each number tests.</strong> The two routes are <em>not</em> independent end to end. The wetted width <img src="https://latex.codecogs.com/png.latex?W=2%5Cpi%20R">, the factor <img src="https://latex.codecogs.com/png.latex?%5Ctfrac32">, the solubility conversion and the 3600 are computed once and enter both; and the reference thickness <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7B%5Crm%20ref%7D=%5Csqrt%7B%5Cmathscr%7BD%7DL/(v_%7B%5Cmax%7D%5CLambda)%7D"> carries the same dimensional group back out of the march, so <img src="https://latex.codecogs.com/png.latex?W">, <img src="https://latex.codecogs.com/png.latex?c_%7BA0%7D">, <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D">, <img src="https://latex.codecogs.com/png.latex?L"> and the 3600 cancel identically out of the ratio. <code>pymrm_vs_eq18518_rel</code> therefore <strong>cannot see any of them</strong>: the break table injects <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D=%5Clangle%20v%5Crangle">, <img src="https://latex.codecogs.com/png.latex?%5Crho"> = 0.999 and <img src="https://latex.codecogs.com/png.latex?M">(Cl<img src="https://latex.codecogs.com/png.latex?_2">) = 71.0 into it and it does not move. What it <em>does</em> test is the dimensionless solve, the marched <img src="https://latex.codecogs.com/png.latex?%5CPhi(%5CLambda)"> against <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda/%5Cpi%7D">, an error function against 600 finite volumes, with the 4 and the <img src="https://latex.codecogs.com/png.latex?%5Cpi"> in it: drop the 4 from Eq. 18.5-18 and it moves. <strong>The dimensional prefactor is tested by the other column of the table</strong>: the +0.188 % against BSL’s printed 0.273 g-mol/hr is what says <img src="https://latex.codecogs.com/png.latex?W">, the <img src="https://latex.codecogs.com/png.latex?%5Ctfrac32">, the solubility conversion and the units are right, and it is the only thing on the page that says so.</p>
<p>Exposure time <img src="https://latex.codecogs.com/png.latex?t_%7B%5Crm%20exp%7D%20=%20L/v_%7B%5Cmax%7D"> = <strong>0.4896 s</strong>, penetration depth <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5Cmathscr%7BD%7Dt_%7B%5Crm%20exp%7D%7D"> = <strong>49.7 um</strong>, <img src="https://latex.codecogs.com/png.latex?k_L%20=%202%5Csqrt%7B%5Cmathscr%7BD%7D/%5Cpi%20t_%7B%5Crm%20exp%7D%7D"> = <strong>5.7240e-03 cm/s</strong>.</p>
</div>
</div>
</section>
<section id="problem-18a.7a-the-instruction-and-the-answer-do-not-match" class="level3">
<h3 class="anchored" data-anchor-id="problem-18a.7a-the-instruction-and-the-answer-do-not-match">2. Problem 18A.7(a): the instruction and the answer do not match</h3>
<p>Part (a) says, in as many words, “Use Eq. 18.5-20”: the <strong>creeping-flow</strong> result with <img src="https://latex.codecogs.com/png.latex?3%5Cpi%20D"> in the denominator. Evaluating both printed equations on the problem’s own printed inputs settles which one produced the printed answer.</p>
<div id="5c70731d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.388966Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.388836Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.394653Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.393813Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">D_bub, DAB, cA0_bub, vt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_D_bubble"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_DAB"</span>),</span>
<span id="cb8-2">                           P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_cA0"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_vt"</span>))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># liter -&gt; cm3</span></span>
<span id="cb8-3">Na_a, Na_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_Na_printed_a"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_Na_printed_b"</span>)</span>
<span id="cb8-4">kc_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_kc_measured"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600.0</span>                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cm/hr -&gt; cm/s</span></span>
<span id="cb8-5"></span>
<span id="cb8-6"></span>
<span id="cb8-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> kL_bubble(texp, three<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb8-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""2 sqrt(D/(pi t_exp)), Eq. 18.5-19 (three = 1) or Eq. 18.5-20 (three = 3)."""</span></span>
<span id="cb8-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(DAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (three <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> texp))</span>
<span id="cb8-10"></span>
<span id="cb8-11"></span>
<span id="cb8-12">t_exp_bub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D_bub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> vt</span>
<span id="cb8-13">kL_19, kL_20 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kL_bubble(t_exp_bub), kL_bubble(t_exp_bub, three<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb8-14">N19, N20, Nmeas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kL_19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cA0_bub, kL_20 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cA0_bub, kc_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cA0_bub</span>
<span id="cb8-15"></span>
<span id="cb8-16">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18519_vs_printed_18A7a_rel"</span>, rel(N19, Na_a))</span>
<span id="cb8-17">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18520_vs_printed_18A7a_rel"</span>, rel(N20, Na_a))</span>
<span id="cb8-18">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18519_over_eq18520"</span>, kL_19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kL_20, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>,</span>
<span id="cb8-19">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two equations differ by sqrt(3)"</span>)</span>
<span id="cb8-20">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hg_measured_vs_printed_18A7b_rel"</span>, rel(Nmeas, Na_b))</span>
<span id="cb8-21"></span>
<span id="cb8-22">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb8-23"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> equation </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_A</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m avg</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">g-mol cm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-1</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs the printed answer </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Na_a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb8-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb8-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-19 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">potential flow, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pi D</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N19<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18519_vs_printed_18A7a_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb8-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-20 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">creeping flow, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pi D</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the one the problem names</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N20<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18520_vs_printed_18A7a_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb8-27"></span>
<span id="cb8-28"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The printed answer to part </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">a</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-19's, not Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-20's</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The two</span></span>
<span id="cb8-29"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">differ by exactly </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kL_19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kL_20<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; nothing about this depends on a</span></span>
<span id="cb8-30"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">transcription, since both equations and both numbers are printed on pages 561 and</span></span>
<span id="cb8-31"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">570 of the same book</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> This is reported, not repaired: the page does not decide</span></span>
<span id="cb8-32"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">whether the instruction or the answer is the error, and every result below that</span></span>
<span id="cb8-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">uses a bubble flux states which equation it came from</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb8-34"></span>
<span id="cb8-35"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Part </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">b</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> recomputes the rate from Hammerton &amp; Garner's measured surface-averaged</span></span>
<span id="cb8-36"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k_c</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_kc_measured"</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/hr = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kc_meas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/s, giving</span></span>
<span id="cb8-37"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Nmeas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, or </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hg_measured_vs_printed_18A7b_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the</span></span>
<span id="cb8-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Na_b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: part </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">b</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> reproduces and pins the units of the measurement</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb8-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>equation</th>
<th><img src="https://latex.codecogs.com/png.latex?(N_A)_%7B%5Crm%20avg%7D"> (g-mol cm<img src="https://latex.codecogs.com/png.latex?%5E%7B-2%7D"> s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D">)</th>
<th>vs the printed answer 1.17e-06</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Eq. 18.5-19 (potential flow, <img src="https://latex.codecogs.com/png.latex?%5Cpi%20D">)</td>
<td>1.1726e-06</td>
<td>+0.220 %</td>
</tr>
<tr class="even">
<td>Eq. 18.5-20 (creeping flow, <img src="https://latex.codecogs.com/png.latex?3%5Cpi%20D">), <strong>the one the problem names</strong></td>
<td>6.7699e-07</td>
<td>-42.14 %</td>
</tr>
</tbody>
</table>
<p><strong>The printed answer to part (a) is Eq. 18.5-19’s, not Eq. 18.5-20’s.</strong> The two differ by exactly <img src="https://latex.codecogs.com/png.latex?%5Csqrt3"> = 1.7320508; nothing about this depends on a transcription, since both equations and both numbers are printed on pages 561 and 570 of the same book. This is reported, not repaired: the page does not decide whether the instruction or the answer is the error, and every result below that uses a bubble flux states which equation it came from.</p>
<p>Part (b) recomputes the rate from Hammerton &amp; Garner’s measured surface-averaged <img src="https://latex.codecogs.com/png.latex?k_c"> = 117 cm/hr = 0.032500 cm/s, giving 1.3325e-06, or +0.188 % of the printed 1.33e-06: part (b) reproduces and pins the units of the measurement.</p>
</div>
</div>
</section>
<section id="the-only-empirical-test-on-disk-and-how-big-it-is" class="level3">
<h3 class="anchored" data-anchor-id="the-only-empirical-test-on-disk-and-how-big-it-is">3. The only empirical test on disk, and how big it is</h3>
<p>The penetration prediction for this bubble (BSL’s Example 18.5-1 evaluated on Problem 18A.7’s printed inputs) carries <strong>no adjustable constant</strong>: the exposure time is <img src="https://latex.codecogs.com/png.latex?D/v_t">, both printed. Put it against the measurement.</p>
<div id="d1c8539a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.396491Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.396358Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.402783Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.401981Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">kc_meas_hr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bub_kc_measured"</span>)</span>
<span id="cb9-2"></span>
<span id="cb9-3"></span>
<span id="cb9-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> three_way(kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kc_meas, texp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_exp_bub, three<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb9-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The penetration error against the measured k_c, and what film theory and</span></span>
<span id="cb9-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    surface renewal need to fit that k_c exactly."""</span></span>
<span id="cb9-7">    kl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kL_bubble(texp, three)</span>
<span id="cb9-8">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DAB                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># surface renewal: k_L = sqrt(D s)</span></span>
<span id="cb9-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>: rel(kl, kc), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_um"</span>: DAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>,   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># film: k_L = D/delta</span></span>
<span id="cb9-10">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>: s, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s_texp"</span>: s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> texp, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>: np.sqrt(np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> texp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>}</span>
<span id="cb9-11"></span>
<span id="cb9-12"></span>
<span id="cb9-13">TW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> three_way()</span>
<span id="cb9-14">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bubble_exposure_time_s"</span>, t_exp_bub)</span>
<span id="cb9-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kL_higbie_cm_per_hr"</span>, kL_19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span>)</span>
<span id="cb9-16">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kL_creep_cm_per_hr"</span>, kL_20 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span>)</span>
<span id="cb9-17">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_kL_vs_hg_measured_rel"</span>, TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>])</span>
<span id="cb9-18">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"creeping_kL_vs_hg_measured_rel"</span>, three_way(three<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>])</span>
<span id="cb9-19">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_thickness_implied_um"</span>, TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_um"</span>])</span>
<span id="cb9-20">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_rate_implied_s_inv"</span>, TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>])</span>
<span id="cb9-21">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_mean_age_ms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>])</span>
<span id="cb9-22">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_texp_times_renewal_rate"</span>, TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s_texp"</span>])</span>
<span id="cb9-23">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_over_higbie_kL_at_measured"</span>, TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>])</span>
<span id="cb9-24"></span>
<span id="cb9-25">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb9-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Exposure time </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">t_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m exp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = D/v_t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t_exp_bub<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> s</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: printed geometry</span></span>
<span id="cb9-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">over printed velocity, nothing fitted</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb9-28"></span>
<span id="cb9-29"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> picture </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> free constant </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k_L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cm/hr</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs measured </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kc_meas_hr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/hr </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb9-30"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb9-31"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> penetration, Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-19 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">potential flow</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kL_19<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_kL_vs_hg_measured_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb9-32"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> penetration, Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-20 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">creeping flow</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kL_20<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"creeping_kL_vs_hg_measured_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb9-33"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Whitman film, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k_L=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fits exactly </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 0 by construction </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb9-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Danckwerts renewal, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k_L=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fits exactly </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 0 by construction </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb9-35"></span>
<span id="cb9-36"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">This is the whole of the three-way comparison that a single measurement can</span></span>
<span id="cb9-37"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">support</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It does </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> say that penetration theory is right and the other two</span></span>
<span id="cb9-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">wrong</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It says that on this datum only penetration makes a prediction at all: the</span></span>
<span id="cb9-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">film and renewal pictures each have one free constant and there is one number to</span></span>
<span id="cb9-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fit, so each reproduces it with zero residual whatever it had been</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> That is</span></span>
<span id="cb9-41"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`A3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3`'s argument, inherited rather than re-derived</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> What is new is the other half:</span></span>
<span id="cb9-42"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the model with no free constant is</span></span>
<span id="cb9-43"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_kL_vs_hg_measured_rel"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % low</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and BSL's own words</span></span>
<span id="cb9-44"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">for that agreement are "approximately confirmed"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb9-45"></span>
<span id="cb9-46"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Inverting the same measurement through the other two pictures gives the constants</span></span>
<span id="cb9-47"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">they would need: a film </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_um"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> um</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> thick, or a renewal rate</span></span>
<span id="cb9-48"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-1</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">mean surface age </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> ms</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Those are</span></span>
<span id="cb9-49"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not independent facts about the liquid; they are the measurement, rewritten</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The</span></span>
<span id="cb9-50"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">renewal rate and the penetration exposure time come out at</span></span>
<span id="cb9-51"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">t_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m exp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s_texp"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the two pictures would predict the</span></span>
<span id="cb9-52"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">same </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k_L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> when </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pi s t_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m exp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/2 = 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; the value here is</span></span>
<span id="cb9-53"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, i</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">e</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the surface-renewal fit sits</span></span>
<span id="cb9-54"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % above the parameter-free penetration prediction</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> That</span></span>
<span id="cb9-55"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">is not a second finding: it is the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the table above,</span></span>
<span id="cb9-56"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">read backwards </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> - 1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>TW[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb9-57"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Exposure time <img src="https://latex.codecogs.com/png.latex?t_%7B%5Crm%20exp%7D%20=%20D/v_t"> = <strong>0.02273 s</strong>: printed geometry over printed velocity, nothing fitted.</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>picture</th>
<th>free constant</th>
<th><img src="https://latex.codecogs.com/png.latex?k_L"> (cm/hr)</th>
<th>vs measured 117 cm/hr</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>penetration, Eq. 18.5-19 (potential flow)</td>
<td><strong>none</strong></td>
<td>102.96</td>
<td>-12.0 %</td>
</tr>
<tr class="even">
<td>penetration, Eq. 18.5-20 (creeping flow)</td>
<td><strong>none</strong></td>
<td>59.44</td>
<td>-49.2 %</td>
</tr>
<tr class="odd">
<td>Whitman film, <img src="https://latex.codecogs.com/png.latex?k_L=%5Cmathscr%7BD%7D/%5Cdelta"></td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cdelta"></td>
<td>fits exactly</td>
<td>0 by construction</td>
</tr>
<tr class="even">
<td>Danckwerts renewal, <img src="https://latex.codecogs.com/png.latex?k_L=%5Csqrt%7B%5Cmathscr%7BD%7Ds%7D"></td>
<td><img src="https://latex.codecogs.com/png.latex?s"></td>
<td>fits exactly</td>
<td>0 by construction</td>
</tr>
</tbody>
</table>
<p><strong>This is the whole of the three-way comparison that a single measurement can support.</strong> It does <em>not</em> say that penetration theory is right and the other two wrong. It says that on this datum only penetration makes a prediction at all: the film and renewal pictures each have one free constant and there is one number to fit, so each reproduces it with zero residual whatever it had been. That is <code>A3.3</code>’s argument, inherited rather than re-derived. What is new is the other half: <strong>the model with no free constant is 12.0 % low</strong>, and BSL’s own words for that agreement are “approximately confirmed”.</p>
<p>Inverting the same measurement through the other two pictures gives the constants they would need: a film <strong>4.49 um</strong> thick, or a renewal rate <strong>72.3 s<img src="https://latex.codecogs.com/png.latex?%5E%7B-1%7D"></strong> (mean surface age 13.8 ms). Those are not independent facts about the liquid; they are the measurement, rewritten. The renewal rate and the penetration exposure time come out at <img src="https://latex.codecogs.com/png.latex?s%5C,t_%7B%5Crm%20exp%7D"> = 1.6442, and the two pictures would predict the same <img src="https://latex.codecogs.com/png.latex?k_L"> when <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B%5Cpi%20s%20t_%7B%5Crm%20exp%7D%7D/2%20=%201">; the value here is <strong>1.1364</strong>, i.e.&nbsp;the surface-renewal fit sits 13.6 % above the parameter-free penetration prediction. That is not a second finding: it is the -12.0 % of the table above, read backwards (<img src="https://latex.codecogs.com/png.latex?1/1.1364%20-%201%20=%20-12.0"> %).</p>
</div>
</div>
</section>
<section id="where-the-exponent-question-actually-stands" class="level3">
<h3 class="anchored" data-anchor-id="where-the-exponent-question-actually-stands">4. Where the exponent question actually stands</h3>
<p>The discriminating claim of penetration theory, as of surface renewal, is <img src="https://latex.codecogs.com/png.latex?k_L%5Cpropto%5Cmathscr%7BD%7D%5E%7B1/2%7D"> against the film’s <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1%7D">. <strong>Nothing on disk tests it for this case, and the reason is not “no data” but “one datum”.</strong> Here is the search behind that statement, because a negative claim needs one:</p>
<ul>
<li>BSL section 18.5 (book pp.&nbsp;558-561) carries <strong>no numerical result</strong>; the only figures in it are the “0.3 to 0.5 cm” bubble range over which Eq. 18.5-19 is said to have been approximately confirmed, and the competing exponents. Read in full at 300 ppi.</li>
<li><strong>Its problems, all of them.</strong> Every problem statement in Chapter 18, 18A.1 through 18D.2, book pp.&nbsp;568-581, was read on renders. Five touch Eqs. 18.5-16 to 20. <strong>18A.3</strong> propagates a <img src="https://latex.codecogs.com/png.latex?%5Cpm5"> % solubility and <img src="https://latex.codecogs.com/png.latex?%5Cpm15"> % diffusivity uncertainty through Eq. 18.5-18: a sensitivity question, not a test. <strong>18A.4</strong> prints one diffusivity and no measured rate at all: its “answer” is Eq. 18.5-18’s own output. <strong>18A.7</strong> prints one diffusivity and the single measured <img src="https://latex.codecogs.com/png.latex?k_c"> used above. <strong>18C.3</strong> asks for Eq. 18.5-18 to be re-derived by integrating <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7Dc_A"> across the outlet (the identity this page’s numerical route uses) and carries no numbers. <strong>18D.2</strong> asks for the analogue of Eq. 18.5-18 when <img src="https://latex.codecogs.com/png.latex?A"> reacts irreversibly in the film; its printed Answer is an algebraic expression, not a number. So exactly one measurement, at one diffusivity.</li>
<li>BSL Table 22.8-2, headed <em>Comparison of Film and Penetration Models</em>, is reproduced below. It compares the models on the <strong>high-net-flux correction</strong> <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x">, not on <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7Bn%7D">, and it contains no measurement.</li>
<li>Froment section 6.4 is theory throughout; its Table 6.4.2.1 (reproduced below) is model against model. Section 6.5 describes <em>how</em> <img src="https://latex.codecogs.com/png.latex?k_L">, <img src="https://latex.codecogs.com/png.latex?s"> and the interfacial area are measured, including Danckwerts et al.’s plot of <img src="https://latex.codecogs.com/png.latex?(N_AA_v/C_%7BAi%7D)%5E2"> against <img src="https://latex.codecogs.com/png.latex?k">, whose intercept gives <img src="https://latex.codecogs.com/png.latex?s">, <strong>but prints no measured values</strong>.</li>
</ul>
<p>One <img src="https://latex.codecogs.com/png.latex?(k_L,%20%5Cmathscr%7BD%7D)"> pair cannot resolve an exponent, so the exponent question is still exactly where <code>A3.3</code> left it, and this page does not claim to have moved it. What has moved is the <em>magnitude</em> question, which <code>A3.1</code> and <code>A3.3</code> could not touch at all.</p>
</section>
<section id="the-one-printed-table-that-carries-all-three-models" class="level3">
<h3 class="anchored" data-anchor-id="the-one-printed-table-that-carries-all-three-models">5. The one printed table that carries all three models</h3>
<p>Froment’s Table 6.4.2.1 tabulates the film, surface-renewal and penetration enhancement factors for a pseudo-first-order reaction at six values of <img src="https://latex.codecogs.com/png.latex?%5Cgamma=%5Csqrt%7B%5Cmathscr%7BD%7D_Ak%7D/k_L">, each column headed by its own closed form. The three closed forms are recomputed here and compared with the printed cells. A cell “reproduces” when the closed form rounds to it: when it lies within half a unit of the cell’s last printed digit, read from the cell as printed.</p>
<div id="05be7799" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.404871Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.404737Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.418086Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.417390Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> FA_film(g):        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.tanh(g)                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Froment 6.3.2-11</span></span>
<span id="cb10-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> FA_renewal(g):     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g)                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Froment 6.4.2-7</span></span>
<span id="cb10-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> FA_penetration(g, arg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(np.pi)):                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Froment 6.4.2-8</span></span>
<span id="cb10-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> erf(arg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g)</span>
<span id="cb10-5">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g))</span>
<span id="cb10-6"></span>
<span id="cb10-7"></span>
<span id="cb10-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The film and renewal columns are printed to two decimals, so "outside the</span></span>
<span id="cb10-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bracket" means outside by more than one unit in that last printed place.</span></span>
<span id="cb10-10">BRACKET_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span></span>
<span id="cb10-11"></span>
<span id="cb10-12"></span>
<span id="cb10-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bracket_test(pen, film, renew, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BRACKET_TOL):</span>
<span id="cb10-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Printed penetration cells outside the printed film/renewal bracket of their</span></span>
<span id="cb10-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    row, with each cell's distance to the nearest bracket edge."""</span></span>
<span id="cb10-16">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.minimum(film, renew) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tol, np.maximum(film, renew) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> tol</span>
<span id="cb10-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (pen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> (pen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> hi), np.minimum(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo), np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pen <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi))</span>
<span id="cb10-18"></span>
<span id="cb10-19"></span>
<span id="cb10-20">gam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fro[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma"</span>].to_numpy()</span>
<span id="cb10-21">COLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_film_printed"</span>, FA_film), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_surface_renewal_printed"</span>, FA_renewal),</span>
<span id="cb10-22">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_penetration_printed"</span>, FA_penetration)}</span>
<span id="cb10-23">t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fro.copy()</span>
<span id="cb10-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col, (pcol, fn) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COLS.items():</span>
<span id="cb10-25">    t3[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_computed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn(gam)</span>
<span id="cb10-26">    t3[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_computed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t3[pcol] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb10-27">    t3[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_off_in_half_units"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t3[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_computed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t3[pcol])</span>
<span id="cb10-28">                                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> half_unit(fro_str[pcol]))</span>
<span id="cb10-29">PEN_PR, FILM_PR, REN_PR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t3[c].to_numpy() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span></span>
<span id="cb10-30">                           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_penetration_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_film_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_surface_renewal_printed"</span>))</span>
<span id="cb10-31">OUT, OUT_DIST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bracket_test(PEN_PR, FILM_PR, REN_PR)</span>
<span id="cb10-32">t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_pen_outside_printed_bracket"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT</span>
<span id="cb10-33"></span>
<span id="cb10-34">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_film_worst_rel"</span>, t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_rel"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-35">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_renewal_worst_rel"</span>, t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_rel"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-36">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_penetration_worst_rel"</span>, t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_rel"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-37">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_at_gamma_10_rel"</span>, t3.loc[t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_rel"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-38">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_bracket_violations"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(OUT.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()), margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(OUT_DIST.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()),</span>
<span id="cb10-39">             min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"distance of the nearest printed cell to a bracket edge"</span>)</span>
<span id="cb10-40">N_OFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {col: claims.count(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"froment_t6421_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_cells_off_rounding"</span>,</span>
<span id="cb10-41">                           t3[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_off_in_half_units"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb10-42">                           note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells the closed form does not round to, of six"</span>)</span>
<span id="cb10-43">         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> COLS}</span>
<span id="cb10-44"></span>
<span id="cb10-45">display(t3[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_film_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_computed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_surface_renewal_printed"</span>,</span>
<span id="cb10-46">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_computed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_penetration_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_computed"</span>,</span>
<span id="cb10-47">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_pen_outside_printed_bracket"</span>]].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">gamma</th>
<th data-quarto-table-cell-role="th">FA_film_printed</th>
<th data-quarto-table-cell-role="th">film_computed</th>
<th data-quarto-table-cell-role="th">FA_surface_renewal_printed</th>
<th data-quarto-table-cell-role="th">renewal_computed</th>
<th data-quarto-table-cell-role="th">FA_penetration_printed</th>
<th data-quarto-table-cell-role="th">penetration_computed</th>
<th data-quarto-table-cell-role="th">penetration_rel</th>
<th data-quarto-table-cell-role="th">printed_pen_outside_printed_bracket</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>0.01</td>
<td>1.00</td>
<td>1.00003</td>
<td>1.00</td>
<td>1.00005</td>
<td>0.940</td>
<td>1.00004</td>
<td>0.06387</td>
<td>True</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>0.10</td>
<td>1.00</td>
<td>1.00333</td>
<td>1.00</td>
<td>1.00499</td>
<td>1.005</td>
<td>1.00424</td>
<td>-0.00076</td>
<td>False</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>0.30</td>
<td>1.04</td>
<td>1.02982</td>
<td>1.04</td>
<td>1.04403</td>
<td>1.035</td>
<td>1.03777</td>
<td>0.00267</td>
<td>False</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>1.00</td>
<td>1.31</td>
<td>1.31304</td>
<td>1.41</td>
<td>1.41421</td>
<td>1.370</td>
<td>1.37871</td>
<td>0.00636</td>
<td>False</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>3.00</td>
<td>3.02</td>
<td>3.01491</td>
<td>3.16</td>
<td>3.16228</td>
<td>3.120</td>
<td>3.13090</td>
<td>0.00349</td>
<td>False</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>10.00</td>
<td>10.00</td>
<td>10.00000</td>
<td>10.05</td>
<td>10.04988</td>
<td>10.390</td>
<td>10.03927</td>
<td>-0.03376</td>
<td>True</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
<div id="98ef6d37" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.421142Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.420853Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.844112Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.843322Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb11-2">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>))</span>
<span id="cb11-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ax:</span>
<span id="cb11-4">    a.plot(g, FA_film(g), label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"film, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">anh</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-5">    a.plot(g, FA_penetration(g), label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration (Higbie), Eq. 6.4.2-8"</span>)</span>
<span id="cb11-6">    a.plot(g, FA_renewal(g), label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"surface renewal, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt{1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-7">    a.plot(gam, PEN_PR, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kx"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 6.4.2.1, penetration column as printed"</span>)</span>
<span id="cb11-8">    a.set_xscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb11-9">    a.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-10">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_yscale(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>)</span>
<span id="cb11-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">F_A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all six printed rows"</span>)</span>
<span id="cb11-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlim(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb11-14">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylim(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.12</span>)</span>
<span id="cb11-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"the small-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> end, where </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">F_A </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">o 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb11-17">fig.tight_layout()</span>
<span id="cb11-18">plt.show()</span>
<span id="cb11-19"></span>
<span id="cb11-20">_film_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.loc[t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_off_in_half_units"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"FA_film_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_computed"</span>]]</span>
<span id="cb11-21">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb11-22"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The surface-renewal column reproduces </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at</span></span>
<span id="cb11-23"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_OFF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of six </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">worst</span></span>
<span id="cb11-24"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_renewal_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, which is rounding</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The</span></span>
<span id="cb11-25"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">film column is high by one unit in the last printed place at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_OFF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of</span></span>
<span id="cb11-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">six</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>gamma<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>FA_film_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>film_computed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _film_off.itertuples())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb11-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_film_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The penetration column</span></span>
<span id="cb11-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">disagrees with the closed form printed at the head of its own column at</span></span>
<span id="cb11-29"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_OFF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of six</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, worst</span></span>
<span id="cb11-30"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_penetration_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-31"></span>
<span id="cb11-32"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Two of those cells are wrong on the table's own evidence, with no computation</span></span>
<span id="cb11-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">needed:</span></span>
<span id="cb11-34"></span>
<span id="cb11-35"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma=0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">01</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the printed value is </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PEN_PR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, while the other two</span></span>
<span id="cb11-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  columns of the same row both read </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FILM_PR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> An enhancement factor below 1</span></span>
<span id="cb11-37"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  would mean a reaction that </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">suppresses</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> absorption;</span></span>
<span id="cb11-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma=10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the printed value is </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PEN_PR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, above the</span></span>
<span id="cb11-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  surface-renewal column's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REN_PR[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the same row, while Froment's own</span></span>
<span id="cb11-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  text two paragraphs earlier says the three expressions "differ only by a few</span></span>
<span id="cb11-41"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  percent"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The closed form is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_at_gamma_10_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span></span>
<span id="cb11-42"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  from what is printed, and it lies between the other two columns as it should</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-43"></span>
<span id="cb11-44"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`froment_t6421_pen_bracket_violations` = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(OUT.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> counts exactly those two</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-45"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The test is: is the printed penetration cell outside the interval spanned by the</span></span>
<span id="cb11-46"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> film and surface-renewal cells of the same row, by more than one unit</span></span>
<span id="cb11-47"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRACKET_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the last decimal place those two columns are printed to</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It uses</span></span>
<span id="cb11-48"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the printed digits alone</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and none of the closed forms</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-49"></span>
<span id="cb11-50"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Froment prints the table "After Beek </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[1968]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"; Beek 1968 is not on disk and was not</span></span>
<span id="cb11-51"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">consulted, so this is a statement about Froment's printing and nothing more</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-52"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Nothing is repaired</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: the CSV holds the cells as printed, and the curves above</span></span>
<span id="cb11-53"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">are the closed forms, not the cells</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-54"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.2-higbie-penetration/index_files/figure-html/cell-10-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The surface-renewal column reproduces <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B1+%5Cgamma%5E2%7D"> at 6 of six <img src="https://latex.codecogs.com/png.latex?%5Cgamma"></strong> (worst 0.50 %, which is rounding). <strong>The film column is high by one unit in the last printed place at 2 of six</strong> (<img src="https://latex.codecogs.com/png.latex?%5Cgamma"> = 0.3: 1.04 printed for 1.0298; <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> = 3: 3.02 printed for 3.0149), worst 0.98 %. <strong>The penetration column disagrees with the closed form printed at the head of its own column at 6 of six</strong>, worst 6.4 %.</p>
<p>Two of those cells are wrong on the table’s own evidence, with no computation needed:</p>
<ul>
<li>at <img src="https://latex.codecogs.com/png.latex?%5Cgamma=0.01"> the printed value is <strong>0.94</strong>, while the other two columns of the same row both read 1.00. An enhancement factor below 1 would mean a reaction that <em>suppresses</em> absorption;</li>
<li>at <img src="https://latex.codecogs.com/png.latex?%5Cgamma=10"> the printed value is <strong>10.39</strong>, above the surface-renewal column’s 10.05 in the same row, while Froment’s own text two paragraphs earlier says the three expressions “differ only by a few percent”. The closed form is -3.4 % from what is printed, and it lies between the other two columns as it should.</li>
</ul>
<p><code>froment_t6421_pen_bracket_violations</code> = 2 counts exactly those two. The test is: is the printed penetration cell outside the interval spanned by the <em>printed</em> film and surface-renewal cells of the same row, by more than one unit (0.01) in the last decimal place those two columns are printed to? It uses <strong>the printed digits alone</strong> and none of the closed forms.</p>
<p>Froment prints the table “After Beek [1968]”; Beek 1968 is not on disk and was not consulted, so this is a statement about Froment’s printing and nothing more. <strong>Nothing is repaired</strong>: the CSV holds the cells as printed, and the curves above are the closed forms, not the cells.</p>
</div>
</div>
</section>
<section id="bsls-own-film-versus-penetration-comparison-on-a-different-axis" class="level3">
<h3 class="anchored" data-anchor-id="bsls-own-film-versus-penetration-comparison-on-a-different-axis">6. BSL’s own film-versus-penetration comparison, on a different axis</h3>
<p>Chapter 22 compares the same two pictures on something else entirely: the correction factor <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> for a <strong>finite net mass-transfer rate</strong> across the interface. Eq. 22.8-41 gives <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x=(1-x_%7BA0%7D)%5Cpsi(x_%7BA0%7D)"> for the penetration model, with <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> from Arnold’s problem (section 20.1, Table 20.1-1), and Eq. 22.8-42 gives <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x=%5Cfrac%7B1-x_%7BA0%7D%7D%7Bx_%7BA0%7D%7D%5Cln%5Cfrac%7B1%7D%7B1-x_%7BA0%7D%7D"> for the film. <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> is obtained here by root-finding BSL’s Eq. 20.1-18, never by reading the printed <img src="https://latex.codecogs.com/png.latex?%5Cvarphi"> back in, so both printed columns of Table 20.1-1 are independent targets.</p>
<div id="49655c02" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.846499Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.846369Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:20.860196Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:20.859274Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> xA0_of_phi(p, with_erf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># BSL Eq. 20.1-18</span></span>
<span id="cb12-2">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> erf(p)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> with_erf <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb12-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.sqrt(np.pi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p)))</span>
<span id="cb12-4"></span>
<span id="cb12-5"></span>
<span id="cb12-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> phi_of_xA0(x, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb12-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: xA0_of_phi(p, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb12-8"></span>
<span id="cb12-9"></span>
<span id="cb12-10">INNER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (tabs[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_A0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (tabs[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_A0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb12-11">tt, tt_str <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tabs[INNER].copy(), tabs_str[INNER.to_numpy()]</span>
<span id="cb12-12">xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tt[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_A0"</span>].to_numpy()</span>
<span id="cb12-13">BSL_COLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi_20p1_1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_20p1_1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_penetration_22p8_2"</span>,</span>
<span id="cb12-14">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film_22p8_2"</span>}</span>
<span id="cb12-15"></span>
<span id="cb12-16"></span>
<span id="cb12-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bsl_columns(phi, psi_from_phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.sqrt(np.pi), pen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x, psi: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> psi,</span>
<span id="cb12-18">                film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x))):</span>
<span id="cb12-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 20.1-1 and 22.8-2 columns from phi; the arguments are the formulas."""</span></span>
<span id="cb12-20">    psi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> psi_from_phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> xs                                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># table head</span></span>
<span id="cb12-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>: phi, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>: psi, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>: pen(xs, psi), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film"</span>: film(xs)}</span>
<span id="cb12-22"></span>
<span id="cb12-23"></span>
<span id="cb12-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bsl_metrics(cols):</span>
<span id="cb12-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst relative deviation per column, and the cells off rounding in half units."""</span></span>
<span id="cb12-26">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: cols[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tt[c].to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BSL_COLS.items()}</span>
<span id="cb12-27">    off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cols[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tt[c].to_numpy()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> half_unit(tt_str[c])</span>
<span id="cb12-28">                          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BSL_COLS.items()])</span>
<span id="cb12-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> dev, off</span>
<span id="cb12-30"></span>
<span id="cb12-31"></span>
<span id="cb12-32">PHI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([phi_of_xA0(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xs])</span>
<span id="cb12-33">BSL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_columns(PHI)</span>
<span id="cb12-34">DEV, OFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_metrics(BSL)</span>
<span id="cb12-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BSL_COLS:</span>
<span id="cb12-36">    tt[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_computed"</span>], tt[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BSL[k], DEV[k]</span>
<span id="cb12-37">_short <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2011_phi"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2011_psi"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen"</span>,</span>
<span id="cb12-38">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_film"</span>}</span>
<span id="cb12-39"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _short.items():</span>
<span id="cb12-40">    claims.value(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DEV[k]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb12-41">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen_minus_psi_dev"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DEV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DEV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb12-42">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 22.8-41 makes the two deviation sets equal"</span>)</span>
<span id="cb12-43">GAP075 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BSL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>][xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BSL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film"</span>][xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-44">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_pen_film_gap_at_0p75"</span>, GAP075)</span>
<span id="cb12-45">N_BSL_OFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.count(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_cells_off_rounding"</span>, OFF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb12-46">                         note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of the twelve interior cells of the four columns"</span>)</span>
<span id="cb12-47"></span>
<span id="cb12-48">display(tt[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_A0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi_20p1_1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi_computed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_20p1_1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi_computed"</span>,</span>
<span id="cb12-49">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_penetration_22p8_2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen_computed"</span>,</span>
<span id="cb12-50">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film_22p8_2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film_computed"</span>]].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb12-51"></span>
<span id="cb12-52">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb12-53"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">All four printed columns round correctly from the recomputed values:</span></span>
<span id="cb12-54"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_BSL_OFF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OFF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> interior cells lie more than half a unit of their last</span></span>
<span id="cb12-55"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed digit away</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Worst relative deviations:</span></span>
<span id="cb12-56"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2011_phi_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\v</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">arphi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-57"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2011_psi_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb12-58"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on the penetration </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta_x</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span></span>
<span id="cb12-59"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_film_worst_rel"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on the film </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta_x</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Unlike</span></span>
<span id="cb12-60"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Froment's Table 6</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1, </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">BSL's two tables are internally consistent throughout</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb12-61"></span>
<span id="cb12-62"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">But the penetration </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta_x</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is not an independent check</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 22</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">8-41 is</span></span>
<span id="cb12-63"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1-x_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so the row-by-row deviations of the </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta_x</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> column and of</span></span>
<span id="cb12-64"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">psi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> column are the same number: they differ by round-off only, below</span></span>
<span id="cb12-65"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1e-14 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen_minus_psi_dev"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> One of the two</span></span>
<span id="cb12-66"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">metrics is redundant, and the notebook says so rather than counting it twice</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb12-67"></span>
<span id="cb12-68"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The physics BSL draws from the table: "the penetration model predicts a stronger</span></span>
<span id="cb12-69"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">correction </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta_x</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> for net mass transfer than does the film model</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> This is in</span></span>
<span id="cb12-70"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">part because the net flow thickens the boundary layer, an effect that the film</span></span>
<span id="cb12-71"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">model does not consider</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" The gap reaches </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAP075<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">x_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">=0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">75</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span></span>
<span id="cb12-72"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The two rows at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">x_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">=0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">x_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">=1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> are the two analytic limits of both</span></span>
<span id="cb12-73"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">models and agree by construction, so only the interior rows carry information; and</span></span>
<span id="cb12-74"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta_x</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is a high-flux correction, </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athscr</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> question</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb12-75"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">x_A0</th>
<th data-quarto-table-cell-role="th">phi_20p1_1</th>
<th data-quarto-table-cell-role="th">phi_computed</th>
<th data-quarto-table-cell-role="th">psi_20p1_1</th>
<th data-quarto-table-cell-role="th">psi_computed</th>
<th data-quarto-table-cell-role="th">theta_penetration_22p8_2</th>
<th data-quarto-table-cell-role="th">theta_pen_computed</th>
<th data-quarto-table-cell-role="th">theta_film_22p8_2</th>
<th data-quarto-table-cell-role="th">theta_film_computed</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">1</th>
<td>0.25</td>
<td>0.1562</td>
<td>0.15622</td>
<td>1.108</td>
<td>1.10754</td>
<td>0.831</td>
<td>0.83065</td>
<td>0.863</td>
<td>0.86305</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">2</th>
<td>0.50</td>
<td>0.3578</td>
<td>0.35783</td>
<td>1.268</td>
<td>1.26849</td>
<td>0.634</td>
<td>0.63425</td>
<td>0.693</td>
<td>0.69315</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">3</th>
<td>0.75</td>
<td>0.6618</td>
<td>0.66176</td>
<td>1.564</td>
<td>1.56392</td>
<td>0.391</td>
<td>0.39098</td>
<td>0.462</td>
<td>0.46210</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>All four printed columns round correctly from the recomputed values: 0 of the 12 interior cells lie more than half a unit of their last printed digit away. Worst relative deviations: 0.010 % on <img src="https://latex.codecogs.com/png.latex?%5Cvarphi">, 0.042 % on <img src="https://latex.codecogs.com/png.latex?%5Cpsi">, 0.042 % on the penetration <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> and 0.021 % on the film <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x">. Unlike Froment’s Table 6.4.2.1, <strong>BSL’s two tables are internally consistent throughout</strong>.</p>
<p><strong>But the penetration <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> is not an independent check.</strong> Eq. 22.8-41 is <img src="https://latex.codecogs.com/png.latex?(1-x_%7BA0%7D)%5Cpsi">, so the row-by-row deviations of the <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> column and of the <img src="https://latex.codecogs.com/png.latex?%5Cpsi"> column are the same number: they differ by round-off only, below 1e-14 (here 1e-16). One of the two metrics is redundant, and the notebook says so rather than counting it twice.</p>
<p>The physics BSL draws from the table: “the penetration model predicts a stronger correction <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> for net mass transfer than does the film model. This is in part because the net flow thickens the boundary layer, an effect that the film model does not consider.” The gap reaches 15.4 % at <img src="https://latex.codecogs.com/png.latex?x_%7BA0%7D=0.75">. The two rows at <img src="https://latex.codecogs.com/png.latex?x_%7BA0%7D=0"> and <img src="https://latex.codecogs.com/png.latex?x_%7BA0%7D=1"> are the two analytic limits of both models and agree by construction, so only the interior rows carry information; and <img src="https://latex.codecogs.com/png.latex?%5Ctheta_x"> is a high-flux correction, <strong>not</strong> the <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7Bn%7D"> question.</p>
</div>
</div>
</section>
<section id="when-is-the-penetration-approximation-actually-good" class="level3">
<h3 class="anchored" data-anchor-id="when-is-the-penetration-approximation-actually-good">7. When is the penetration approximation actually good?</h3>
<p>BSL replaces Eq. 18.5-7 by Eq. 18.5-11 with two arguments at once: <img src="https://latex.codecogs.com/png.latex?A"> “has the impression” the film moves at <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D">, and <img src="https://latex.codecogs.com/png.latex?A"> does not “sense” the wall. The solver can switch those separately, which turns the sentence into two numbers. Write</p>
<p><img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20full%7D(%5CLambda)=%5Cfrac%7B%5CPhi_%7B%5Crm%20full%7D%7D%7B%5CPhi_%7B%5Crm%20pen%7D%7D,%5Cqquad%0Ar_%7B%5Crm%20wall%7D(%5CLambda)=%5Cfrac%7B%5CPhi_%7B%5Crm%20plug,%5C,wall%7D%7D%7B%5CPhi_%7B%5Crm%20pen%7D%7D,%5Cqquad%0Ar_%7B%5Crm%20profile%7D(%5CLambda)=%5Cfrac%7B%5CPhi_%7B%5Crm%20full%7D%7D%7B%5CPhi_%7B%5Crm%20plug,%5C,wall%7D%7D,"></p>
<p>so that <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20full%7D=r_%7B%5Crm%20wall%7D%5C,r_%7B%5Crm%20profile%7D"> exactly. <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20wall%7D"> is taken from the <strong>exact eigenfunction series</strong> of <em>Validation 2</em>; <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20profile%7D"> is a ratio of two solves on the same grid with the same steps. Both choices are measured below: how large the solver’s own error is against the wall effect, and how much of it cancels in the ratio.</p>
<div id="6ac7460e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:20.862161Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:20.861987Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:28.464530Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:28.463559Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">NX, NT, STR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># production film grid and step count</span></span>
<span id="cb13-2"></span>
<span id="cb13-3"></span>
<span id="cb13-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> phi_film(Lam, profile, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NT, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb13-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Mixing cup on the film (wall at xi = 1): Richardson-extrapolated, or ``raw``."""</span></span>
<span id="cb13-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> phi_extrapolated(Lam, n_t, XI<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_x, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>profile,</span>
<span id="cb13-7">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[which]</span>
<span id="cb13-8"></span>
<span id="cb13-9"></span>
<span id="cb13-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_profile(Lam, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NT, n_x_plug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>):</span>
<span id="cb13-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Phi(full) / Phi(plug flow with the same wall), both on the same grid by default."""</span></span>
<span id="cb13-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (phi_film(Lam, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parabolic"</span>, n_x, n_t, which)</span>
<span id="cb13-13">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_film(Lam, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, n_x <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n_x_plug <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> n_x_plug, n_t, which))</span>
<span id="cb13-14"></span>
<span id="cb13-15"></span>
<span id="cb13-16"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_wall(Lam, n_terms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20000</span>):</span>
<span id="cb13-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Exact: the series with the wall over the semi-infinite answer."""</span></span>
<span id="cb13-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> phi_wall_series(Lam, n_terms) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(Lam)</span>
<span id="cb13-19"></span>
<span id="cb13-20"></span>
<span id="cb13-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_full(Lam, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb13-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r_wall(Lam) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_profile(Lam, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb13-23"></span>
<span id="cb13-24"></span>
<span id="cb13-25">lams <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>)</span>
<span id="cb13-26">rp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([r_profile(l) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lams])</span>
<span id="cb13-27">rw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([r_wall(l) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lams])</span>
<span id="cb13-28">rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> rp</span>
<span id="cb13-29"></span>
<span id="cb13-30">L_MARK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb13-31">PE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_profile(L_MARK)</span>
<span id="cb13-32">WE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_wall(L_MARK)</span>
<span id="cb13-33">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile_effect_at_lambda_0p1"</span>, PE)</span>
<span id="cb13-34">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_series_at_lambda_0p1"</span>, WE)</span>
<span id="cb13-35">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile_over_wall_effect_at_lambda_0p1"</span>, PE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WE)</span>
<span id="cb13-36">WE_SOLVER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> phi_film(L_MARK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(L_MARK)</span>
<span id="cb13-37">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_solver_at_lambda_0p1"</span>, WE_SOLVER)</span>
<span id="cb13-38"></span>
<span id="cb13-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The 1 % threshold, root-found with a scan that reports every sign change.</span></span>
<span id="cb13-40">ROOTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> l: r_full(l) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, log<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb13-41">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_roots_in_range"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ROOTS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]))</span>
<span id="cb13-42">lam_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ROOTS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb13-43">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_1pct"</span>, lam_star, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-44">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_depth_over_delta_at_1pct"</span>, np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_star), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-45">delta_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (v_max <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_star))</span>
<span id="cb13-46">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_star_18A4_um"</span>, delta_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb13-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The same threshold read off sweeps by interpolation, for the break table.</span></span>
<span id="cb13-48">lam_star_swept <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.interp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>rf, lams))</span>
<span id="cb13-49">lams_coarse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb13-50">lam_star_swept_coarse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.interp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.array([r_full(l) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lams_coarse]),</span>
<span id="cb13-51">                                        lams_coarse))</span>
<span id="cb13-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"find_roots on [1e-3, 0.5], 8 log-spaced scan points: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROOTS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'message'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb13-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Lambda* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lam_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-54"></span>
<span id="cb13-55">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>))</span>
<span id="cb13-56">ax.loglog(lams, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rf), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o-"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both (full Eq. 18.5-7)"</span>)</span>
<span id="cb13-57">ax.loglog(lams, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rp), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s--"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parabolic velocity profile alone"</span>)</span>
<span id="cb13-58">ax.loglog(lams, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.maximum(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rw, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^:"</span>,</span>
<span id="cb13-59">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finite film thickness alone (exact series)"</span>)</span>
<span id="cb13-60">ax.axhline(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb13-61">ax.axvline(lam_star, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb13-62">ax.set_ylim(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>)</span>
<span id="cb13-63">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda = </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athscr{D}L/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">v_{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ax}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-64">ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shortfall of Eq. 18.5-18 (%)"</span>)</span>
<span id="cb13-65">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what the penetration approximation costs, and which half costs it"</span>)</span>
<span id="cb13-66">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb13-67">fig.tight_layout()</span>
<span id="cb13-68">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>find_roots on [1e-3, 0.5], 8 log-spaced scan points: one root, Lambda* = 0.056426</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.2-higbie-penetration/index_files/figure-html/cell-12-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<p><strong>How accurate are these numbers?</strong> Three measurements, on grids refined from the production 600 cells with the step extrapolation kept: the solver’s own estimate of the wall effect on a grid ladder (its Richardson limit against the series), the profile effect at 600 and at 2400 cells, and <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20full%7D"> at <img src="https://latex.codecogs.com/png.latex?%5CLambda%5E%7B%5Cast%7D"> on the refined grid, converted to a shift of <img src="https://latex.codecogs.com/png.latex?%5CLambda%5E%7B%5Cast%7D"> with the local slope.</p>
<div id="575c43c8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:28.467062Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:28.466909Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:36.974170Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:36.973031Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">WALL_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4800</span>)</span>
<span id="cb15-2"></span>
<span id="cb15-3"></span>
<span id="cb15-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> wall_ladder(n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, joint<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb15-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Plug flow with the wall at Lambda = 0.1 on a grid ladder; ``joint`` refines the</span></span>
<span id="cb15-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    steps with the grid and drops the extrapolation (both axes at once)."""</span></span>
<span id="cb15-7">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cup(n):</span>
<span id="cb15-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> joint:</span>
<span id="cb15-9">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Film(L_MARK, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>).march(n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]</span>
<span id="cb15-10">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> phi_film(L_MARK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_t)</span>
<span id="cb15-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> observed_orders(cup, WALL_LADDER)</span>
<span id="cb15-12"></span>
<span id="cb15-13"></span>
<span id="cb15-14">WALL_NT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># two step pairs: n_t/2 n_t extrapolated</span></span>
<span id="cb15-15">WLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: wall_ladder(n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WALL_NT}</span>
<span id="cb15-16">WL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WLS[WALL_NT[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb15-17">WE_LAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> WLS[n][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(L_MARK) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WALL_NT}</span>
<span id="cb15-18">WE_REFINED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WE_LAD[WALL_NT[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb15-19">WE_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(WE_LAD[n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WALL_NT}</span>
<span id="cb15-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WALL_NT:</span>
<span id="cb15-21">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"plug flow with the wall, Lambda = 0.1, steps extrapolated from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb15-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nx, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(WALL_LADDER, WLS[n][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>]):</span>
<span id="cb15-23">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   1 - Phi/Phi_pen = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(L_MARK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-24">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   grid orders from successive differences: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(WLS[n][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb15-25">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"grid limit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_LAD[n]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_GAP[n]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the series"</span>)</span>
<span id="cb15-26">WE_GAP_DROP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WE_GAP[WALL_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WE_GAP[WALL_NT[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb15-27">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_ladder_grid_order"</span>, WL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb15-28">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"successive differences, n_x 1200/2400/4800"</span>)</span>
<span id="cb15-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_solver_refined_at_lambda_0p1"</span>, WE_REFINED, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb15-30">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_refined_vs_series_rel"</span>, WE_GAP[WALL_NT[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb15-31">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid limit at steps 6400/12800 against the series"</span>)</span>
<span id="cb15-32">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_refined_gap_drop_steps_x4"</span>, WE_GAP_DROP, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb15-33">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the remaining gap is the extrapolated step error, second order: 16 for 4x steps"</span>)</span>
<span id="cb15-34"></span>
<span id="cb15-35">PE_2400 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_profile(L_MARK, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>)</span>
<span id="cb15-36">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile_effect_grid_change_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(PE_2400 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb15-37">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile effect at 600 against 2400 cells, steps extrapolated"</span>)</span>
<span id="cb15-38"></span>
<span id="cb15-39"></span>
<span id="cb15-40"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lam_star_shift(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb15-41">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Relative shift of Lambda* implied by r_full(Lambda*) under other numerics."""</span></span>
<span id="cb15-42">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_star</span>
<span id="cb15-43">    slope <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (r_full(lam_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> h) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_full(lam_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> h)</span>
<span id="cb15-44">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((r_full(lam_star, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> slope) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam_star</span>
<span id="cb15-45"></span>
<span id="cb15-46"></span>
<span id="cb15-47">LS_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lam_star_shift(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)</span>
<span id="cb15-48">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_grid_shift_rel"</span>, LS_SHIFT, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb15-49">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_full at Lambda* on 2400 cells and 1600/3200 steps"</span>)</span>
<span id="cb15-50"></span>
<span id="cb15-51">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb15-52"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The two halves of BSL's argument are not equally load-bearing</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> At</span></span>
<span id="cb15-53"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_MARK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, where the penetration depth has reached</span></span>
<span id="cb15-54"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>L_MARK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the film thickness, the finite</span></span>
<span id="cb15-55"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">film costs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % while the parabolic velocity profile costs</span></span>
<span id="cb15-56"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, a factor </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>WE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> between them</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-57"></span>
<span id="cb15-58"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The reason is visible in the series: a reflecting wall only returns solute that a</span></span>
<span id="cb15-59"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">semi-infinite film would have retained anyway, so what is lost is only the far tail</span></span>
<span id="cb15-60"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">of the erfc profile, the part that would have reached beyond about </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">twice</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the</span></span>
<span id="cb15-61"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">film thickness, and the series puts that at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> here</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> What actually breaks</span></span>
<span id="cb15-62"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-18 is that the liquid </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">below</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the surface moves more slowly than</span></span>
<span id="cb15-63"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">v_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ax</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and therefore has longer to load up</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-64"></span>
<span id="cb15-65"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Why the wall effect comes from the series</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> On the production grid of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb15-66"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cells the solver's estimate is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_SOLVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, a factor</span></span>
<span id="cb15-67"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_SOLVER<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>WE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> above the exact </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: its grid error there </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Validation 2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb15-68"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">is larger than the effect</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> That is a property of the grid, not of the solver</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-69"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Refined to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WALL_LADDER[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells the grid error falls at order</span></span>
<span id="cb15-70"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> With steps 6400/12800 the Richardson limit of the grid</span></span>
<span id="cb15-71"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ladder gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_REFINED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_GAP[WALL_NT[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the</span></span>
<span id="cb15-72"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">series; with steps 1600/3200 the gap is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_GAP[WALL_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, and it</span></span>
<span id="cb15-73"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">falls </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WE_GAP_DROP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> times for four times the steps, so what remains is the</span></span>
<span id="cb15-74"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">extrapolated step error, not a difference between solver and series</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The series is</span></span>
<span id="cb15-75"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the cheaper route, and the solver confirms it</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-76"></span>
<span id="cb15-77"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The ratio cancels the grid error</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m profile</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> divides two solves on the</span></span>
<span id="cb15-78"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">same grid with the same steps, each with a grid error of a few parts per million</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-79"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Their errors nearly cancel: the profile effect at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells differs from its value</span></span>
<span id="cb15-80"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at 2400 cells by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(PE_2400<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">bound 1e-4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Solving the two</span></span>
<span id="cb15-81"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">halves of the ratio on different grids breaks the cancellation </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">break table</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-82"></span>
<span id="cb15-83"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The 1 % threshold, root-found rather than read off the sweep:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span></span>
<span id="cb15-84"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">st</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lam_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">one sign change on the scanned range, located</span></span>
<span id="cb15-85"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">by `pymrm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">checks</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">find_roots`</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, i</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">e</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-18 is within 1 % of the full</span></span>
<span id="cb15-86"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-7 for any film in which the penetration depth stays below</span></span>
<span id="cb15-87"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>lam_star)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> On 2400 cells with 1600/3200 steps,</span></span>
<span id="cb15-88"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m full</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">st</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> moves </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">st</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by</span></span>
<span id="cb15-89"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LS_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> For Problem 18A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4's column that means any water film</span></span>
<span id="cb15-90"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">thicker than </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>delta_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> um</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; the penetration depth there is</span></span>
<span id="cb15-91"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pen_depth_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> um</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Problem 18A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4 prints no film thickness, no viscosity</span></span>
<span id="cb15-92"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">and no flow rate, so </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">this page does not state a correction for that column</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: it</span></span>
<span id="cb15-93"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">states the threshold, which is what the printed data support</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-94"></span>
<span id="cb15-95"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A sampled crossing is not a root: reading the threshold off the twelve-point sweep</span></span>
<span id="cb15-96"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">plotted above, or off a five-point sweep over the same range, moves it by the</span></span>
<span id="cb15-97"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">amounts the break table prints</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Neither is what is reported</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb15-98"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>plug flow with the wall, Lambda = 0.1, steps extrapolated from 1600/3200:
   n_x =   600   1 - Phi/Phi_pen = 1.0343e-05
   n_x =  1200   1 - Phi/Phi_pen = 5.5816e-06
   n_x =  2400   1 - Phi/Phi_pen = 4.3912e-06
   n_x =  4800   1 - Phi/Phi_pen = 4.0935e-06
   grid orders from successive differences: [2. 2.]; grid limit 3.9943e-06, 1.8e-03 from the series
plug flow with the wall, Lambda = 0.1, steps extrapolated from 6400/12800:
   n_x =   600   1 - Phi/Phi_pen = 1.0337e-05
   n_x =  1200   1 - Phi/Phi_pen = 5.5751e-06
   n_x =  2400   1 - Phi/Phi_pen = 4.3846e-06
   n_x =  4800   1 - Phi/Phi_pen = 4.0870e-06
   grid orders from successive differences: [2. 2.]; grid limit 3.9877e-06, 1.0e-04 from the series</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The two halves of BSL’s argument are not equally load-bearing.</strong> At <img src="https://latex.codecogs.com/png.latex?%5CLambda=0.1">, where the penetration depth has reached <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda%7D"> = 0.63 of the film thickness, the finite film costs 0.00040 % while the parabolic velocity profile costs 1.92 %, a factor <strong>4810</strong> between them.</p>
<p>The reason is visible in the series: a reflecting wall only returns solute that a semi-infinite film would have retained anyway, so what is lost is only the far tail of the erfc profile, the part that would have reached beyond about <em>twice</em> the film thickness, and the series puts that at 4.0e-06 here. What actually breaks Eq. 18.5-18 is that the liquid <em>below</em> the surface moves more slowly than <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D"> and therefore has longer to load up.</p>
<p><strong>Why the wall effect comes from the series.</strong> On the production grid of 600 cells the solver’s estimate is 1.04e-05, a factor 2.6 above the exact 3.99e-06: its grid error there (<em>Validation 2</em>) is larger than the effect. That is a property of the grid, not of the solver. Refined to 4800 cells the grid error falls at order 2.00. With steps 6400/12800 the Richardson limit of the grid ladder gives 3.9877e-06, within 0.010 % of the series; with steps 1600/3200 the gap is 0.18 %, and it falls 17 times for four times the steps, so what remains is the extrapolated step error, not a difference between solver and series. The series is the cheaper route, and the solver confirms it.</p>
<p><strong>The ratio cancels the grid error.</strong> <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20profile%7D"> divides two solves on the same grid with the same steps, each with a grid error of a few parts per million. Their errors nearly cancel: the profile effect at 600 cells differs from its value at 2400 cells by 5.4e-06 relative (bound 1e-4). Solving the two halves of the ratio on different grids breaks the cancellation (break table).</p>
<p><strong>The 1 % threshold, root-found rather than read off the sweep:</strong> <img src="https://latex.codecogs.com/png.latex?%5CLambda%5E%7B%5Cast%7D"> = <strong>0.05643</strong> (one sign change on the scanned range, located by <code>pymrm.checks.find_roots</code>), i.e.&nbsp;Eq. 18.5-18 is within 1 % of the full Eq. 18.5-7 for any film in which the penetration depth stays below <strong>0.475<img src="https://latex.codecogs.com/png.latex?%5C,%5Cdelta"></strong>. On 2400 cells with 1600/3200 steps, <img src="https://latex.codecogs.com/png.latex?r_%7B%5Crm%20full%7D(%5CLambda%5E%7B%5Cast%7D)"> moves <img src="https://latex.codecogs.com/png.latex?%5CLambda%5E%7B%5Cast%7D"> by 1.4e-06 relative. For Problem 18A.4’s column that means any water film thicker than <strong>105 um</strong>; the penetration depth there is 49.7 um. Problem 18A.4 prints no film thickness, no viscosity and no flow rate, so <strong>this page does not state a correction for that column</strong>: it states the threshold, which is what the printed data support.</p>
<p>A sampled crossing is not a root: reading the threshold off the twelve-point sweep plotted above, or off a five-point sweep over the same range, moves it by the amounts the break table prints. Neither is what is reported.</p>
</div>
</div>
<div id="d45199d9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:36.977187Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:36.976976Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:37.262473Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:37.261533Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Profiles: the full problem against Eq. 18.5-16, at a Lambda where they part.</span></span>
<span id="cb17-2">LAM_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span></span>
<span id="cb17-3">f_full <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_P, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parabolic"</span>)</span>
<span id="cb17-4">f_plug <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_P, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>)</span>
<span id="cb17-5">OUT_FULL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_full.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, record_flux<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb17-6">xi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_full.x_c</span>
<span id="cb17-7"></span>
<span id="cb17-8">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>))</span>
<span id="cb17-9">ax.plot(xi, erfc(xi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_P)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-16, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athrm{erfc}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-10">ax.plot(xi, f_plug.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm, plug flow + no-flux wall"</span>)</span>
<span id="cb17-11">ax.plot(xi, OUT_FULL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-."</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm, full Eq. 18.5-7"</span>)</span>
<span id="cb17-12">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">xi = x/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">elta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-13">ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">c_A/c_{A0}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">z = L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-14">ax.set_title(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"outlet profiles at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAM_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-15">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb17-16">fig.tight_layout()</span>
<span id="cb17-17">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.2-higbie-penetration/index_files/figure-html/cell-14-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Four checks that can fail, and a break table. Every check below compares the solver with something that shares no code with it (a closed form, an exact series), with its own refinement, or with an identity of the scheme that a defect can break.</p>
<section id="the-penetration-branch-against-bsls-own-closed-forms" class="level3">
<h3 class="anchored" data-anchor-id="the-penetration-branch-against-bsls-own-closed-forms">1. The penetration branch against BSL’s own closed forms</h3>
<p>With the capacity set to 1 and the domain deep, the solver is Eq. 18.5-11 and must reproduce Eq. 18.5-16 pointwise and <img src="https://latex.codecogs.com/png.latex?%5CPhi=%5Csqrt%7B4%5CLambda/%5Cpi%7D"> (equivalently Eq. 18.5-18) in the integral. The march also integrates the interfacial flux over <img src="https://latex.codecogs.com/png.latex?%5Czeta">, read at every step with <code>compute_boundary_values</code>: under backward Euler on a conservative finite-volume scheme that integral equals the outlet mixing cup (BSL’s Problem 18C.3 identity) to round-off, whatever the physics.</p>
<div id="329a148f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:37.265106Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:37.264973Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:37.392767Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:37.392013Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1">LAM_V, NXV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span></span>
<span id="cb18-2">XIV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_V)</span>
<span id="cb18-3">V_FILM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(XI<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>XIV, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NXV, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>)</span>
<span id="cb18-4">fv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_V, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM)</span>
<span id="cb18-5">OUT_V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, record_flux<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb18-6">Phi_raw, Phi_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OUT_V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], fv.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]</span>
<span id="cb18-7">Phi_ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Phi_raw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Phi_half</span>
<span id="cb18-8"></span>
<span id="cb18-9"></span>
<span id="cb18-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> profile_err(film, u, Lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>LAM_V):</span>
<span id="cb18-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> erfc(film.x_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Lam))).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb18-12"></span>
<span id="cb18-13"></span>
<span id="cb18-14">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_profile_vs_eq18516_max_abs"</span>, profile_err(fv, OUT_V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]))</span>
<span id="cb18-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_rel"</span>, rel(Phi_ext, phi_penetration(LAM_V)))</span>
<span id="cb18-16">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_raw_rel"</span>, rel(Phi_raw, phi_penetration(LAM_V)))</span>
<span id="cb18-17">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixing_cup_vs_flux_integral_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rel(OUT_V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux_integral"</span>], Phi_raw)),</span>
<span id="cb18-18">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb18-19">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler on a conservative scheme: inventory = flux integral"</span>)</span>
<span id="cb18-20">FULL_ID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rel(OUT_FULL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux_integral"</span>], OUT_FULL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]))</span>
<span id="cb18-21">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixing_cup_vs_flux_integral_full_rel"</span>, FULL_ID, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb18-22">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same identity in the full model, cup weighted by 1 - xi^2; round-off "</span></span>
<span id="cb18-23">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"accumulated over 1600 steps, 2.8e-12 on three BLAS kernels, bound 35x above"</span>)</span>
<span id="cb18-24"></span>
<span id="cb18-25">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb18-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- outlet profile against Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 18</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5-16, worst absolute deviation in </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">c_A/c_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb18-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_profile_vs_eq18516_max_abs"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">raw, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n_t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1600; the</span></span>
<span id="cb18-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  marching error dominates it</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb18-29"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- outlet uptake against </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda/</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pi</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb18-30"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_rel"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> extrapolated,</span></span>
<span id="cb18-31"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_raw_rel"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> raw at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n_t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1600</span></span>
<span id="cb18-32"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- outlet mixing cup against the marched integral of the interfacial flux: below</span></span>
<span id="cb18-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  1e-11 relative here </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixing_cup_vs_flux_integral_rel"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and</span></span>
<span id="cb18-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  below 1e-10 in the full model at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LAM_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FULL_ID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb18-35"></span>
<span id="cb18-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The third is an identity of the scheme, not a test of the physics: it holds for any</span></span>
<span id="cb18-37"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and any grid</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It still tests something, the boundary reading and the</span></span>
<span id="cb18-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">capacity weight of the cup, and the break table moves it by leaving the</span></span>
<span id="cb18-39"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1-</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">xi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> weight out of the cup in the full model</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb18-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<ul>
<li>outlet profile against Eq. 18.5-16, worst absolute deviation in <img src="https://latex.codecogs.com/png.latex?c_A/c_%7BA0%7D">: <strong>1.148e-04</strong> (raw, <img src="https://latex.codecogs.com/png.latex?n_t"> = 1600; the marching error dominates it)</li>
<li>outlet uptake against <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda/%5Cpi%7D">: <strong>-2.834e-06</strong> extrapolated, -1.070e-04 raw at <img src="https://latex.codecogs.com/png.latex?n_t"> = 1600</li>
<li>outlet mixing cup against the marched integral of the interfacial flux: below 1e-11 relative here (here 3e-13), and below 1e-10 in the full model at <img src="https://latex.codecogs.com/png.latex?%5CLambda"> = 0.05 (here 3e-12)</li>
</ul>
<p>The third is an identity of the scheme, not a test of the physics: it holds for any <img src="https://latex.codecogs.com/png.latex?%5CLambda"> and any grid. It still tests something, the boundary reading and the capacity weight of the cup, and the break table moves it by leaving the <img src="https://latex.codecogs.com/png.latex?(1-%5Cxi%5E2)"> weight out of the cup in the full model.</p>
</div>
</div>
</section>
<section id="the-wall-branch-against-an-exact-series" class="level3">
<h3 class="anchored" data-anchor-id="the-wall-branch-against-an-exact-series">2. The wall branch against an exact series</h3>
<p>Plug flow with a no-flux wall has a closed solution by separation of variables that the books do not print, and which shares nothing with the solver: with <img src="https://latex.codecogs.com/png.latex?v=1-u">, <img src="https://latex.codecogs.com/png.latex?v(0)=0">, <img src="https://latex.codecogs.com/png.latex?v_%5Cxi(1)=0">, <img src="https://latex.codecogs.com/png.latex?v(%5Cxi,0)=1">,</p>
<p><img src="https://latex.codecogs.com/png.latex?v%20=%20%5Csum_%7Bn%5Cge0%7D%5Cfrac%7B2%7D%7B%5Clambda_n%7D%5Csin(%5Clambda_n%5Cxi)%5C,e%5E%7B-%5CLambda%5Clambda_n%5E%7B2%7D%5Czeta%7D,%0A%5Cqquad%20%5Clambda_n=(n+%5Ctfrac12)%5Cpi%0A%5Cqquad%5CLongrightarrow%5Cqquad%0A%5CPhi%20=%201-%5Csum_%7Bn%5Cge0%7D%5Cfrac%7B2%7D%7B%5Clambda_n%5E%7B2%7D%7De%5E%7B-%5CLambda%5Clambda_n%5E%7B2%7D%7D."></p>
<p>Its <img src="https://latex.codecogs.com/png.latex?%5CLambda%5Cto0"> limit is <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda/%5Cpi%7D">, which is a real check on both: the series is built from sines and the closed form from an error function.</p>
<div id="81fdba3a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:37.394910Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:37.394722Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:38.130471Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:38.129394Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">WALL_LAMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-1</span>)</span>
<span id="cb19-2"></span>
<span id="cb19-3"></span>
<span id="cb19-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> wall_errors(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NT, extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, wall<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noflux"</span>):</span>
<span id="cb19-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Relative deviation of the plug-flow-with-wall cup from the series."""</span></span>
<span id="cb19-6">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb19-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Lam <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WALL_LAMS:</span>
<span id="cb19-8">        ph <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi_extrapolated(Lam, n_t, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_x, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR, profile<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, wall<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>wall)</span>
<span id="cb19-9">        out.append(rel(ph[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> extrapolate <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ph[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"raw"</span>], phi_wall_series(Lam)))</span>
<span id="cb19-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array(out)</span>
<span id="cb19-11"></span>
<span id="cb19-12"></span>
<span id="cb19-13">WERR, WERR_2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> wall_errors(), wall_errors(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NX)</span>
<span id="cb19-14">WRATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(WERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WERR_2)</span>
<span id="cb19-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_series_vs_pymrm_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(WERR).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb19-16">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_series_err_ratio_grid_doubled_min"</span>, WRATIO.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>,</span>
<span id="cb19-17">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second-order grid error: 4 when n_x doubles"</span>)</span>
<span id="cb19-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Lambda'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel dev, '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(NX) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' cells'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;20}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel dev, '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>NX) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' cells'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;21}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ratio'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'wall effect (series)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;21}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Lam, e1, e2 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(WALL_LAMS, WERR, WERR_2):</span>
<span id="cb19-21">    we <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_wall(Lam)</span>
<span id="cb19-22">    shown <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>we<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:21.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> we <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'below 1e-12'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;21}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-23">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Lam<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:20.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:21.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>shown<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-24"></span>
<span id="cb19-25">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb19-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Worst deviation between the finite-volume march and the exact series over three</span></span>
<span id="cb19-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">decades of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(WERR)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It is the grid</span></span>
<span id="cb19-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">error: doubling the cells divides it by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WRATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WRATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span></span>
<span id="cb19-29"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at every </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, the second-order factor 4, while the marching error is removed</span></span>
<span id="cb19-30"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">by the step extrapolation </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Validation 3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The last column is why the wall</span></span>
<span id="cb19-31"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">effect comes from the series in </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Results 7</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda=10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-3</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb19-32"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the series puts it at round-off </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">below 1e-12</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda=0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> it is below the</span></span>
<span id="cb19-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">production grid error</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb19-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  Lambda   rel dev, 600 cells   rel dev, 1200 cells  ratio  wall effect (series)
   1e-03            -7.15e-06             -1.81e-06   3.95           below 1e-12
   1e-02            -6.56e-06             -1.66e-06   3.94           below 1e-12
   1e-01            -6.38e-06             -1.62e-06   3.95             3.987e-06</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Worst deviation between the finite-volume march and the exact series over three decades of <img src="https://latex.codecogs.com/png.latex?%5CLambda">: <strong>7.15e-06</strong> on 600 cells. It is the grid error: doubling the cells divides it by 3.94 to 3.95 at every <img src="https://latex.codecogs.com/png.latex?%5CLambda">, the second-order factor 4, while the marching error is removed by the step extrapolation (<em>Validation 3</em>). The last column is why the wall effect comes from the series in <em>Results 7</em>: at <img src="https://latex.codecogs.com/png.latex?%5CLambda=10%5E%7B-3%7D"> and <img src="https://latex.codecogs.com/png.latex?10%5E%7B-2%7D"> the series puts it at round-off (below 1e-12), and at <img src="https://latex.codecogs.com/png.latex?%5CLambda=0.1"> it is below the production grid error.</p>
</div>
</div>
</section>
<section id="both-axes-refined-with-observed-orders-and-the-integrator" class="level3">
<h3 class="anchored" data-anchor-id="both-axes-refined-with-observed-orders-and-the-integrator">3. Both axes refined, with observed orders, and the integrator</h3>
<p>The marching step and the grid are refined separately, on the <em>Validation 1</em> case, and each order is taken from <strong>successive differences</strong> of three levels (<code>pymrm.checks.observed_orders</code>), which cancel the other axis’s error as long as it is the same on every rung: the step ladder runs on one grid, and the grid ladder uses the step-extrapolated <img src="https://latex.codecogs.com/png.latex?%5CPhi"> at fixed step counts. The reference for the step error is the limit of a ladder of <em>extrapolated</em> values (order 2), not a first-order fit to the raw values. This case is the deep plug-flow solve of <em>Validation 1</em>; the production film is measured after it.</p>
<div id="cf6a939c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:38.132538Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:38.132362Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:39.832841Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:39.831745Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">STEP_LADDER, GRID_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)</span>
<span id="cb21-2">ROUNDOFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-13</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># relative round-off of a mixing cup: n_x eps, 2e-14..2e-13 for n_x 1e2..1e3</span></span>
<span id="cb21-3"></span>
<span id="cb21-4"></span>
<span id="cb21-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> step_ladder(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NXV):</span>
<span id="cb21-6">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_V, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>: n_x})</span>
<span id="cb21-7">    cache <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: f.march(n)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STEP_LADDER}</span>
<span id="cb21-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: cache[n], STEP_LADDER), cache</span>
<span id="cb21-9"></span>
<span id="cb21-10"></span>
<span id="cb21-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> grid_ladder(stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, against_exact<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb21-12">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cup(n):</span>
<span id="cb21-13">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> against_exact:     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the raw cup, read against the exact value below</span></span>
<span id="cb21-14">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Film(LAM_V, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>: n, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stretch"</span>: stretch}).march(n_t)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]</span>
<span id="cb21-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> phi_extrapolated(LAM_V, n_t, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>: n, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stretch"</span>: stretch})[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]</span>
<span id="cb21-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> observed_orders(cup, GRID_LADDER)</span>
<span id="cb21-17"></span>
<span id="cb21-18"></span>
<span id="cb21-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> orders_vs_exact(values, ns):</span>
<span id="cb21-20">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The tempting alternative: orders from errors against the exact value."""</span></span>
<span id="cb21-21">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.array(values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(LAM_V) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb21-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.log(e[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log(ns[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ns[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-23"></span>
<span id="cb21-24"></span>
<span id="cb21-25">SL, SL_CUPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> step_ladder()</span>
<span id="cb21-26">RICH_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> STEP_LADDER[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb21-27">RL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SL_CUPS[n], RICH_LADDER)</span>
<span id="cb21-28">REF_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the step limit on this grid, from order-2 values</span></span>
<span id="cb21-29">GL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grid_ladder()</span>
<span id="cb21-30">TIME_ERR_1600 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb21-31">SPACE_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(GRID_LADDER, GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>])}</span>
<span id="cb21-32">RICH_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SL_CUPS[n]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)}</span>
<span id="cb21-33">GL_LIMIT_VS_EXACT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(LAM_V) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb21-34"></span>
<span id="cb21-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"steps, n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NXV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (raw backward Euler):"</span>)</span>
<span id="cb21-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(STEP_LADDER):</span>
<span id="cb21-37">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>][i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb21-38">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SL_CUPS[n]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"grid, steps extrapolated from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">:"</span>)</span>
<span id="cb21-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(GRID_LADDER):</span>
<span id="cb21-41">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>][i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span></span>
<span id="cb21-42">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'values'</span>][i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-43"></span>
<span id="cb21-44">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order"</span>, SL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-45">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler, successive differences, n_t 1600/3200/6400"</span>)</span>
<span id="cb21-46">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order_extrapolated"</span>, RL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-47">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated values 2 Phi(2n) - Phi(n), n 400/800/1600 to 3200"</span>)</span>
<span id="cb21-48">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order_min"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(SL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-49">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all triples from n_t = 200"</span>)</span>
<span id="cb21-50">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_order"</span>, GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-51">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"successive differences, n_x 400/800/1600"</span>)</span>
<span id="cb21-52">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_order_min"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb21-53">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all triples from n_x = 100"</span>)</span>
<span id="cb21-54">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_ladder_finest_diff_over_roundoff"</span>,</span>
<span id="cb21-55">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (ROUNDOFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>,</span>
<span id="cb21-56">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finest step difference against round-off of the cup"</span>)</span>
<span id="cb21-57">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_ladder_finest_diff_over_roundoff"</span>,</span>
<span id="cb21-58">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (ROUNDOFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>,</span>
<span id="cb21-59">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finest grid difference against round-off of the cup"</span>)</span>
<span id="cb21-60">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_err_n1600"</span>, TIME_ERR_1600)</span>
<span id="cb21-61">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_err_n400"</span>, SPACE_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>])</span>
<span id="cb21-62">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_err_n800"</span>, SPACE_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>])</span>
<span id="cb21-63">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_err_extrapolated_n1600"</span>, RICH_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb21-64">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2 Phi(3200) - Phi(1600) against the limit of the extrapolated ladder"</span>)</span>
<span id="cb21-65">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_err_extrapolated_n800"</span>, RICH_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb21-66">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the production pair 800/1600, same reference"</span>)</span>
<span id="cb21-67">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid_ladder_limit_vs_exact"</span>, GL_LIMIT_VS_EXACT, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb21-68">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the grid ladder's limit against sqrt(4 Lam/pi): what neither axis removes"</span>)</span>
<span id="cb21-69"></span>
<span id="cb21-70">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb21-71"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Observed orders: </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the marching step </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">backward Euler,</span></span>
<span id="cb21-72"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">first order; every triple from </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n_t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 200 within</span></span>
<span id="cb21-73"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(SL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(SL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span></span>
<span id="cb21-74"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">in the grid </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">second order on the stretched mesh; every triple within</span></span>
<span id="cb21-75"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb21-76"></span>
<span id="cb21-77"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Which error is the larger depends on whether the step is extrapolated</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Raw,</span></span>
<span id="cb21-78"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the marching step dominates: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TIME_ERR_1600<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n_t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1600, against a grid</span></span>
<span id="cb21-79"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">error of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SPACE_ERR[NXV]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NXV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells used here</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Extrapolated, the</span></span>
<span id="cb21-80"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">step error converges at order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and is below 1e-7 for both</span></span>
<span id="cb21-81"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the 800/1600 pair the page uses in production </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RICH_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span></span>
<span id="cb21-82"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1600/3200 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RICH_ERR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the grid error is what is left</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The grid ladder's own limit agrees with</span></span>
<span id="cb21-83"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda/</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pi</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to below 1e-7 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GL_LIMIT_VS_EXACT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so neither</span></span>
<span id="cb21-84"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the far boundary nor anything else the ladders cannot see is larger</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb21-85"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>steps, n_x = 800 (raw backward Euler):
   n_t =   200   Phi = 0.1127436870   
   n_t =   400   Phi = 0.1127906143   
   n_t =   800   Phi = 0.1128141001     0.999
   n_t =  1600   Phi = 0.1128258485     0.999
   n_t =  3200   Phi = 0.1128317241     1.000
   n_t =  6400   Phi = 0.1128346622     1.000
grid, steps extrapolated from 1600/3200:
   n_x =   100   Phi = 0.1128177484   
   n_x =   200   Phi = 0.1128328647   
   n_x =   400   Phi = 0.1128366519     1.997
   n_x =   800   Phi = 0.1128375997     1.999
   n_x =  1600   Phi = 0.1128378367     1.999</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Observed orders: <strong>1.000</strong> in the marching step (backward Euler, first order; every triple from <img src="https://latex.codecogs.com/png.latex?n_t"> = 200 within 0.999 to 1.000) and <strong>1.999</strong> in the grid (second order on the stretched mesh; every triple within 1.997 to 1.999).</p>
<p><strong>Which error is the larger depends on whether the step is extrapolated.</strong> Raw, the marching step dominates: 1.04e-04 at <img src="https://latex.codecogs.com/png.latex?n_t"> = 1600, against a grid error of 2.80e-06 on the 800 cells used here. Extrapolated, the step error converges at order 2.00 and is below 1e-7 for both the 800/1600 pair the page uses in production (here 3.3e-08) and 1600/3200 (here 8.1e-09), and the grid error is what is left. The grid ladder’s own limit agrees with <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda/%5Cpi%7D"> to below 1e-7 (here 7.9e-09), so neither the far boundary nor anything else the ladders cannot see is larger.</p>
</div>
</div>
<p><strong>The same budget on the production film.</strong> For the full film on 600 cells with steps 800/1600, the step error of the extrapolated value is estimated from the change between the 800/1600 and 1600/3200 pairs, and the grid error from the change between 600 and 1200 cells, both scaled by their order (2 and 2), over <img src="https://latex.codecogs.com/png.latex?%5CLambda"> from <img src="https://latex.codecogs.com/png.latex?10%5E%7B-4%7D"> to 0.2.</p>
<div id="3fc29d6e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:39.835905Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:39.835708Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:42.174198Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:42.173171Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1">BUDGET_LAMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span>
<span id="cb23-2"></span>
<span id="cb23-3"></span>
<span id="cb23-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> production_budget(Lam, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NT):</span>
<span id="cb23-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(grid error, step error) of the extrapolated full-film cup at production settings."""</span></span>
<span id="cb23-6">    f6, f12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(Lam, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR), Film(Lam, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NX, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR)</span>
<span id="cb23-7">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: f6.march(n)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (n_t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t)}</span>
<span id="cb23-8">    e1, e2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c[n_t], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t]</span>
<span id="cb23-9">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f12.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f12.march(n_t)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]</span>
<span id="cb23-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e1, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> e2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e1</span>
<span id="cb23-11"></span>
<span id="cb23-12"></span>
<span id="cb23-13">BUDGET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([production_budget(l) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BUDGET_LAMS])</span>
<span id="cb23-14">BUDGET_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BUDGET[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BUDGET[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb23-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Lambda'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'grid err'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'step err'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ratio'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l, (ge, se), r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(BUDGET_LAMS, BUDGET, BUDGET_RATIO):</span>
<span id="cb23-17">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>l<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ge<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>se<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-18">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"production_grid_over_step_err_min"</span>, BUDGET_RATIO.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb23-19">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"full film, 600 cells, steps 800/1600 extrapolated, Lambda 1e-4 to 0.2"</span>)</span>
<span id="cb23-20">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb23-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">At every </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Lambda</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the sweep the grid error of the production value is more than</span></span>
<span id="cb23-22"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">10 times its extrapolated step error </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here at least </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BUDGET_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> times</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb23-23"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the statement of the case above holds for the production film too</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb23-24"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  Lambda   grid err   step err    ratio
 1.0e-04    9.0e-06    3.3e-08      276
 4.6e-04    7.5e-06    3.3e-08      231
 2.1e-03    6.9e-06    3.3e-08      210
 9.6e-03    6.5e-06    3.3e-08      199
 4.4e-02    6.4e-06    3.2e-08      198
 2.0e-01    5.8e-06    1.2e-07       46</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>At every <img src="https://latex.codecogs.com/png.latex?%5CLambda"> of the sweep the grid error of the production value is more than 10 times its extrapolated step error (here at least 46 times): the statement of the case above holds for the production film too.</p>
</div>
</div>
<p><strong>The integrator, measured.</strong> Backward Euler with Richardson extrapolation costs three solves per step of the coarse level (<img src="https://latex.codecogs.com/png.latex?n_t"> and <img src="https://latex.codecogs.com/png.latex?2n_t">). The same number of solves buys BDF2 or Crank-Nicolson at <img src="https://latex.codecogs.com/png.latex?3n_t"> steps. Measured on the full film at <img src="https://latex.codecogs.com/png.latex?%5CLambda%20=%200.1"> (production grid), against the same grid’s limit in the step, for the outlet mixing cup and for the outlet profile:</p>
<div id="521cac0b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:42.176886Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:42.176705Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:43.506326Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:43.505358Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1">INT_LAM, INT_NT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb25-2">f_int <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(INT_LAM, n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NX, stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STR)</span>
<span id="cb25-3">_ref_a, _ref_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_int.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6400</span>), f_int.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12800</span>)</span>
<span id="cb25-4">REF_CUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _ref_b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _ref_a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]</span>
<span id="cb25-5">REF_U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _ref_b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _ref_a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]</span>
<span id="cb25-6"></span>
<span id="cb25-7"></span>
<span id="cb25-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> integrator_errors(n_t, n_start<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, bdf2_steps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb25-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Cup and profile errors of the three integrators at 3 n_t solves each."""</span></span>
<span id="cb25-10">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f_int.march(n_t), f_int.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t)</span>
<span id="cb25-11">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]),</span>
<span id="cb25-12">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF2"</span>: f_int.march(bdf2_steps <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t, scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bdf2"</span>),</span>
<span id="cb25-13">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>: f_int.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n_t, scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn"</span>, n_start<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_start)}</span>
<span id="cb25-14">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF2"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF2"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>])</span>
<span id="cb25-15">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>])</span>
<span id="cb25-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {k: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_CUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_U).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, (c, u) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> out.items()}</span>
<span id="cb25-17"></span>
<span id="cb25-18"></span>
<span id="cb25-19">INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: integrator_errors(n) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INT_NT}</span>
<span id="cb25-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'solves'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'integrator'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;20}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cup rel err'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'profile max err'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INT_NT:</span>
<span id="cb25-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, (ce, ue) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> INT[n].items():</span>
<span id="cb25-23">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;20}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ce<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ue<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-24">E0, E1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> INT[INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], INT[INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb25-25">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bdf2_over_euler_extrap_cup_err"</span>, E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF2"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb25-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn_over_euler_extrap_cup_err"</span>, E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb25-27">CN_PROF_DROP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb25-28">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn_profile_err_drop_4x_steps"</span>, CN_PROF_DROP)</span>
<span id="cb25-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler_extrap_profile_err_drop_4x_steps"</span>,</span>
<span id="cb25-30">             E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb25-31"></span>
<span id="cb25-32">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb25-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">At </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> solves, BDF2's cup error is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bdf2_over_euler_extrap_cup_err"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span></span>
<span id="cb25-34"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">times and Crank-Nicolson's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn_over_euler_extrap_cup_err"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> times that of</span></span>
<span id="cb25-35"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">extrapolated backward Euler</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Pointwise, four times the steps divide the</span></span>
<span id="cb25-36"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">extrapolated backward-Euler profile error by</span></span>
<span id="cb25-37"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler_extrap_profile_err_drop_4x_steps"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">second order</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> but the</span></span>
<span id="cb25-38"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Crank-Nicolson one only by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CN_PROF_DROP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and Crank-Nicolson needs backward-Euler</span></span>
<span id="cb25-39"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">start-up steps </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the break table runs it without</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> So on the cup Crank-Nicolson gains</span></span>
<span id="cb25-40"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn_over_euler_extrap_cup_err"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at equal cost and BDF2 loses</span></span>
<span id="cb25-41"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bdf2_over_euler_extrap_cup_err"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; neither changes what the</span></span>
<span id="cb25-42"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">page can resolve</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The page keeps backward Euler: it needs no start-up rule, its two</span></span>
<span id="cb25-43"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">levels give an error estimate, and its plain sum of step fluxes is the quadrature</span></span>
<span id="cb25-44"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">that closes the mixing-cup identity of </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Validation 1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb25-45"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> solves           integrator  cup rel err  profile max err
    600  euler, extrapolated     2.19e-07         2.19e-06
    600                 BDF2     6.35e-07         1.01e-06
    600       Crank-Nicolson     1.58e-07         9.46e-07
   2400  euler, extrapolated     1.29e-08         1.38e-07
   2400                 BDF2     3.98e-08         6.20e-08
   2400       Crank-Nicolson     1.00e-08         3.95e-07</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>At 600 solves, BDF2’s cup error is 2.9 times and Crank-Nicolson’s 0.72 times that of extrapolated backward Euler. Pointwise, four times the steps divide the extrapolated backward-Euler profile error by 15.9 (second order) but the Crank-Nicolson one only by 2.4, and Crank-Nicolson needs backward-Euler start-up steps (the break table runs it without). So on the cup Crank-Nicolson gains a factor 1.4 at equal cost and BDF2 loses a factor 2.9; neither changes what the page can resolve. The page keeps backward Euler: it needs no start-up rule, its two levels give an error estimate, and its plain sum of step fluxes is the quadrature that closes the mixing-cup identity of <em>Validation 1</em>.</p>
</div>
</div>
</section>
<section id="froments-eq.-6.4.2-8-re-derived-from-his-eq.-6.4.2-4" class="level3">
<h3 class="anchored" data-anchor-id="froments-eq.-6.4.2-8-re-derived-from-his-eq.-6.4.2-4">4. Froment’s Eq. 6.4.2-8 re-derived from his Eq. 6.4.2-4</h3>
<p>Froment prints both the instantaneous element flux for a pseudo-first-order reaction at surface age <img src="https://latex.codecogs.com/png.latex?t"> (Eq. 6.4.2-4),</p>
<p><img src="https://latex.codecogs.com/png.latex?N_A(t)=%5Csqrt%7BkD_A%7D%5C,C_%7BAi%7D%5Cleft%5B%5Coperatorname%7Berf%7D%5Csqrt%7Bkt%7D%0A%20%20%20%20%20%20+%20%5Cfrac%7Be%5E%7B-kt%7D%7D%7B%5Csqrt%7B%5Cpi%20kt%7D%7D%5Cright%5D,"></p>
<p>and the enhancement factor Higbie’s <em>uniform</em> age gives (Eq. 6.4.2-8). The second must be the average of the first over <img src="https://latex.codecogs.com/png.latex?0%3Ct%3C%5Cbar%20t">, divided by <img src="https://latex.codecogs.com/png.latex?k_LC_%7BAi%7D=2C_%7BAi%7D%5Csqrt%7BD_A/%5Cpi%5Cbar%20t%7D">, and with <img src="https://latex.codecogs.com/png.latex?%5Cgamma%5E2=D_Ak/k_L%5E2"> that means <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t=4%5Cgamma%5E2/%5Cpi">, which is exactly the argument of the exponential Froment prints. Doing the quadrature checks both transcriptions at once, and it is what makes the disagreement between Eq. 6.4.2-8 and the numbers printed underneath it a defect in the table rather than in the reading.</p>
<div id="1dbd7938" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:43.508407Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:43.508279Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:43.520577Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:43.519722Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> FA_penetration_quadrature(g, epsrel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>):</span>
<span id="cb27-2">    U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.pi                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># = k tbar</span></span>
<span id="cb27-3">    integrand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: erf(np.sqrt(v)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v)</span>
<span id="cb27-4">    I, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quad(integrand, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, U, limit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, epsabs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, epsrel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>epsrel)</span>
<span id="cb27-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> U) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U))</span>
<span id="cb27-6"></span>
<span id="cb27-7"></span>
<span id="cb27-8">gg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>])</span>
<span id="cb27-9">qq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([FA_penetration_quadrature(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> gg])</span>
<span id="cb27-10">QGAP_LOOSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FA_penetration(gg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.array([FA_penetration_quadrature(x, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb27-11">                                                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> gg]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb27-12">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_eq6428_closed_vs_quadrature_worst"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(FA_penetration(gg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> qq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb27-13">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb27-14">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"round-off: the same at quad epsrel 1e-10 and 1e-13"</span>)</span>
<span id="cb27-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_penetration_vs_renewal_at_gamma_1"</span>, rel(FA_penetration(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), FA_renewal(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb27-16">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_penetration_vs_film_at_gamma_1"</span>, rel(FA_penetration(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), FA_film(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb27-17"></span>
<span id="cb27-18">display(Markdown(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"""</span></span>
<span id="cb27-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 6</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2-8 as printed and the quadrature of Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 6</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2-4 agree to below 1e-12</span></span>
<span id="cb27-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">relative over eight </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, at round-off: tightening the quadrature tolerance from 1e-10 to 1e-13 leaves the gap </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QGAP_LOOSE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_eq6428_closed_vs_quadrature_worst"</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb27-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Both transcriptions are therefore right</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb27-22"></span>
<span id="cb27-23"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">At </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma=1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the penetration enhancement sits</span></span>
<span id="cb27-24"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_penetration_vs_renewal_at_gamma_1"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> from surface</span></span>
<span id="cb27-25"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">renewal's and </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_penetration_vs_film_at_gamma_1"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> from</span></span>
<span id="cb27-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the film's</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Those two numbers are the </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">whole</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the practical difference between the</span></span>
<span id="cb27-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">three models on this axis, and they are the reason Froment concludes that "the</span></span>
<span id="cb27-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">choice of the model matters little for design calculations: the predicted</span></span>
<span id="cb27-29"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">differences are negligible with respect to the uncertainties of prediction of some</span></span>
<span id="cb27-30"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">of the model or operating parameters"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb27-31"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Eq. 6.4.2-8 as printed and the quadrature of Eq. 6.4.2-4 agree to below 1e-12 relative over eight <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> from 0.05 to 10.0, at round-off: tightening the quadrature tolerance from 1e-10 to 1e-13 leaves the gap (here 2e-14 and 2e-14). Both transcriptions are therefore right.</p>
<p>At <img src="https://latex.codecogs.com/png.latex?%5Cgamma=1"> the penetration enhancement sits <strong>-2.51 %</strong> from surface renewal’s and <strong>+5.00 %</strong> from the film’s. Those two numbers are the <em>whole</em> of the practical difference between the three models on this axis, and they are the reason Froment concludes that “the choice of the model matters little for design calculations: the predicted differences are negligible with respect to the uncertainties of prediction of some of the model or operating parameters”.</p>
</div>
</div>
</section>
<section id="the-break-table" class="level3">
<h3 class="anchored" data-anchor-id="the-break-table">5. The break table</h3>
<p>Each row re-runs the affected computation with one thing deliberately wrong, injected through an argument, an input or a formula, and hands the result to <code>claims.breaks</code>, which records whether that claim’s own check fails. Rows that do not fail their claim are kept and printed: a blind spot left unstated is an implicit claim. Three kinds of row do not fail, and each says something:</p>
<ul>
<li><strong>The metric is blind to the injected quantity by construction.</strong> The <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D">, <img src="https://latex.codecogs.com/png.latex?%5Crho"> and <img src="https://latex.codecogs.com/png.latex?M">(Cl<img src="https://latex.codecogs.com/png.latex?_2">) rows inject into <code>pymrm_vs_eq18518_rel</code>, which cannot move, because <img src="https://latex.codecogs.com/png.latex?%5Cdelta_%7B%5Crm%20ref%7D"> carries the whole dimensional prefactor back out of the marching route. That is the demonstration behind <em>Results 1</em>: the cross-route agreement is evidence about <img src="https://latex.codecogs.com/png.latex?%5CPhi(%5CLambda)"> and not about <img src="https://latex.codecogs.com/png.latex?W">, <img src="https://latex.codecogs.com/png.latex?c_%7BA0%7D"> or the units.</li>
<li><strong>The defect is harmless at the settings used, and other rows show which setting is the assumption.</strong> A sink instead of a no-flux far boundary leaves the deep penetration solve unchanged, because it sits twelve penetration depths out where <img src="https://latex.codecogs.com/png.latex?u"> is already zero; truncating the domain to one penetration depth moves the same claims. The domain <strong>length</strong> is the assumption, the far boundary-condition <em>type</em> is not.</li>
<li><strong>A “worst over the table” metric can be pinned by one bad cell.</strong> Breaking the penetration formula does not move <code>froment_t6421_penetration_worst_rel</code>, which the printed 0.94 dominates; the transcription row and the quadrature check are what move it.</li>
</ul>
<div id="f8d9dfa0" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:43.522624Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:43.522497Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:50.311401Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:50.310317Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 1. the closed forms of Problem 18A.4</span></span>
<span id="cb28-2">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotten)"</span></span>
<span id="cb28-3">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>, rel(WA_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg), WA_printed))</span>
<span id="cb28-4">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>, rel(WA_pymrm_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg), WA_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg)))</span>
<span id="cb28-5">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_printed_18A4_rel"</span>, rel(WA_pymrm_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg), WA_printed))</span>
<span id="cb28-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_closed_gmol_per_hr"</span>, WA_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg)),</span>
<span id="cb28-7">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_rho999_gmol_per_hr"</span>, WA_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg, rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_ALT)),</span>
<span id="cb28-8">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_mw71_gmol_per_hr"</span>, WA_hr(vmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>v_avg, mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MW_ALT)),</span>
<span id="cb28-9">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_exposure_time_s"</span>, L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v_avg),</span>
<span id="cb28-10">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_penetration_depth_um"</span>, np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v_avg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>),</span>
<span id="cb28-11">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_kL_cm_s"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v_avg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L)))):</span>
<span id="cb28-12">    brk(_lab, _k, _v)</span>
<span id="cb28-13">_four <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb28-14">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the 4 of Eq. 18.5-18 replaced by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_four<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-15">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>, rel(WA_hr(four<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_four), WA_printed))</span>
<span id="cb28-16">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>, rel(WA_pymrm, WA_hr(four<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_four)))</span>
<span id="cb28-17">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rho_water = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_ALT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of the assumed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RHO_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> g/cm3"</span></span>
<span id="cb28-18">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18518_vs_printed_18A4_rel"</span>, rel(WA_hr(rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_ALT), WA_printed))</span>
<span id="cb28-19">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>, rel(WA_pymrm_hr(rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_ALT), WA_hr(rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_ALT)))</span>
<span id="cb28-20">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wa_excess_over_window_gmol_per_hr"</span>, WA_hr(rho<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RHO_ALT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (WA_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0005</span>))</span>
<span id="cb28-21">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"M(Cl2) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_ALT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of BSL Table E.1's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_Cl2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>,</span>
<span id="cb28-22">    rel(WA_pymrm_hr(mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MW_ALT), WA_hr(mw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MW_ALT)))</span>
<span id="cb28-23">_unit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span></span>
<span id="cb28-24">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rounding window taken as a whole unit (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_unit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) of the printed answer"</span>,</span>
<span id="cb28-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_window_rel"</span>, _unit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WA_printed)</span>
<span id="cb28-26">_dexp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb28-27">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"W_A taken proportional to D^</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_dexp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the film exponent) instead of D^0.5"</span>,</span>
<span id="cb28-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_half_unit_window_rel"</span>, D_window(d_exp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_dexp))</span>
<span id="cb28-29"></span>
<span id="cb28-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 2. the bubble</span></span>
<span id="cb28-31">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 18.5-20 used for 18A.7(a), as the problem statement instructs"</span>,</span>
<span id="cb28-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18519_vs_printed_18A7a_rel"</span>, rel(N20, Na_a))</span>
<span id="cb28-33">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the 3 dropped from Eq. 18.5-20, making it Eq. 18.5-19"</span></span>
<span id="cb28-34">_kl20b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kL_bubble(t_exp_bub, three<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb28-35">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18520_vs_printed_18A7a_rel"</span>, rel(_kl20b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cA0_bub, Na_a))</span>
<span id="cb28-36">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq18519_over_eq18520"</span>, kL_19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _kl20b)</span>
<span id="cb28-37">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kL_creep_cm_per_hr"</span>, _kl20b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span>)</span>
<span id="cb28-38">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"creeping_kL_vs_hg_measured_rel"</span>, three_way(three<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>])</span>
<span id="cb28-39">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_c left in cm/hr (the /3600 forgotten)"</span></span>
<span id="cb28-40">_TW_hr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> three_way(kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kc_meas_hr)</span>
<span id="cb28-41">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hg_measured_vs_printed_18A7b_rel"</span>, rel(kc_meas_hr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cA0_bub, Na_b))</span>
<span id="cb28-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_kL_vs_hg_measured_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_thickness_implied_um"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_um"</span>),</span>
<span id="cb28-43">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_rate_implied_s_inv"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_texp_times_renewal_rate"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s_texp"</span>),</span>
<span id="cb28-44">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_over_higbie_kL_at_measured"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>)):</span>
<span id="cb28-45">    brk(_lab, _k, _TW_hr[_key])</span>
<span id="cb28-46">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_mean_age_ms"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _TW_hr[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>])</span>
<span id="cb28-47">_fac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb28-48">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"exposure time taken as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_fac<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> D/v_t instead of D/v_t"</span></span>
<span id="cb28-49">_TW_2t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> three_way(texp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_fac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t_exp_bub)</span>
<span id="cb28-50">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bubble_exposure_time_s"</span>, _fac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t_exp_bub)</span>
<span id="cb28-51">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kL_higbie_cm_per_hr"</span>, kL_bubble(_fac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t_exp_bub) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3600</span>)</span>
<span id="cb28-52"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _k, _key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_kL_vs_hg_measured_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_rel"</span>),</span>
<span id="cb28-53">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"higbie_texp_times_renewal_rate"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s_texp"</span>),</span>
<span id="cb28-54">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_over_higbie_kL_at_measured"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio"</span>)):</span>
<span id="cb28-55">    brk(_lab, _k, _TW_2t[_key])</span>
<span id="cb28-56">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film thickness inverted from the predicted k_L instead of the measured one"</span>,</span>
<span id="cb28-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_thickness_implied_um"</span>, three_way(kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kL_19)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_um"</span>])</span>
<span id="cb28-58"></span>
<span id="cb28-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 3. the reproduced printed tables</span></span>
<span id="cb28-60">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the (1 + erf phi) factor dropped from Eq. 20.1-18"</span></span>
<span id="cb28-61">_dev, _off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_metrics(bsl_columns(np.array([phi_of_xA0(x, with_erf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xs])))</span>
<span id="cb28-62">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2011_phi_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-63">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_cells_off_rounding"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb28-64">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi taken as phi/x_A0 (the sqrt(pi) of the Table 20.1-1 head dropped)"</span></span>
<span id="cb28-65">_dev, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_metrics(bsl_columns(PHI, psi_from_phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb28-66">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2011_psi_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-67">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-68">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 22.8-41 written as (1 - x)/psi instead of (1 - x) psi"</span></span>
<span id="cb28-69">_dev, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_metrics(bsl_columns(PHI, pen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x, psi: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> psi))</span>
<span id="cb28-70">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-71">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_pen_minus_psi_dev"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"psi"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-72">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 22.8-42 written without the (1 - x)/x prefactor"</span></span>
<span id="cb28-73">_cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_columns(PHI, film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: np.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x)))</span>
<span id="cb28-74">_dev, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bsl_metrics(_cols)</span>
<span id="cb28-75">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_theta_film_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dev[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-76">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bsl_t2282_pen_film_gap_at_0p75"</span>,</span>
<span id="cb28-77">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _cols[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_pen"</span>][xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _cols[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_film"</span>][xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-78"></span>
<span id="cb28-79"></span>
<span id="cb28-80"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> froment_metrics(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FA_film, renew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FA_renewal, pen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FA_penetration, pen_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PEN_PR):</span>
<span id="cb28-81">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst deviations and off-rounding counts of Table 6.4.2.1 under other formulas."""</span></span>
<span id="cb28-82">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb28-83">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col, fn, pr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film"</span>, film, FILM_PR), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal"</span>, renew, REN_PR),</span>
<span id="cb28-84">                        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration"</span>, pen, pen_printed)):</span>
<span id="cb28-85">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fn(gam)</span>
<span id="cb28-86">        out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_worst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb28-87">        out[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_off"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pr) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> half_unit(fro_str[COLS[col][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-88">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_g10"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pen(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pen_printed[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb28-89">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bracket"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(bracket_test(pen_printed, FILM_PR, REN_PR)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb28-90">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb28-91"></span>
<span id="cb28-92"></span>
<span id="cb28-93">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma/tanh(gamma) written upside down as tanh(gamma)/gamma"</span></span>
<span id="cb28-94">_film_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: np.tanh(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> x</span>
<span id="cb28-95">_fm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> froment_metrics(film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_film_b)</span>
<span id="cb28-96">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_film_worst_rel"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_worst"</span>])</span>
<span id="cb28-97">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_film_cells_off_rounding"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film_off"</span>])</span>
<span id="cb28-98">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_penetration_vs_film_at_gamma_1"</span>, rel(FA_penetration(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), _film_b(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb28-99">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sqrt(1 + gamma^2) written as 1 + gamma^2"</span></span>
<span id="cb28-100">_ren_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> x</span>
<span id="cb28-101">_fm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> froment_metrics(renew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_ren_b)</span>
<span id="cb28-102">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_renewal_worst_rel"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_worst"</span>])</span>
<span id="cb28-103">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_renewal_cells_off_rounding"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"renewal_off"</span>])</span>
<span id="cb28-104">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_penetration_vs_renewal_at_gamma_1"</span>, rel(FA_penetration(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), _ren_b(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb28-105">_arg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb28-106">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"erf(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_arg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> gamma) for erf(2 gamma/sqrt(pi)) in Froment Eq. 6.4.2-8"</span></span>
<span id="cb28-107">_pen_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: FA_penetration(x, arg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_arg)</span>
<span id="cb28-108">_fm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> froment_metrics(pen<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_pen_b)</span>
<span id="cb28-109">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_penetration_worst_rel"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_worst"</span>])</span>
<span id="cb28-110">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_at_gamma_10_rel"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_g10"</span>])</span>
<span id="cb28-111">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_eq6428_closed_vs_quadrature_worst"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_pen_b(gg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> qq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-112">_tol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BRACKET_TOL</span>
<span id="cb28-113">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed penetration column tested against a bracket widened by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_tol<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb28-114">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_bracket_violations"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(bracket_test(PEN_PR, FILM_PR, REN_PR, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_tol)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()))</span>
<span id="cb28-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A transcription defect: the two anomalous cells read as the closed form rounds.</span></span>
<span id="cb28-116">_pen_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PEN_PR.copy()</span>
<span id="cb28-117">_pen_fixed[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(FA_penetration(gam[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb28-118">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gam[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gam[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> penetration cells transcribed as "</span></span>
<span id="cb28-119">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pen_fixed[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_pen_fixed[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-120">_fm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> froment_metrics(pen_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_pen_fixed)</span>
<span id="cb28-121">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_penetration_worst_rel"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_worst"</span>])</span>
<span id="cb28-122">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_at_gamma_10_rel"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_g10"</span>])</span>
<span id="cb28-123">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_pen_bracket_violations"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bracket"</span>])</span>
<span id="cb28-124">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment_t6421_penetration_cells_off_rounding"</span>, _fm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"penetration_off"</span>])</span>
<span id="cb28-125"></span>
<span id="cb28-126"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 4. the pymrm model</span></span>
<span id="cb28-127">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"far boundary of the deep penetration solve a sink (u = 0) instead of no flux"</span></span>
<span id="cb28-128">_fs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_V, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sink"</span>})</span>
<span id="cb28-129">_o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _fs.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)</span>
<span id="cb28-130">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_profile_vs_eq18516_max_abs"</span>, profile_err(_fs, _o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]))</span>
<span id="cb28-131">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_raw_rel"</span>, rel(_o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], phi_penetration(LAM_V)))</span>
<span id="cb28-132">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall of the film a sink (u = 0) instead of no flux"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_series_vs_pymrm_worst_rel"</span>,</span>
<span id="cb28-133">    np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(wall_errors(wall<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sink"</span>)).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-134">_depths <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb28-135">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"deep solve truncated at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_depths<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> penetration depth instead of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XIV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_V)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-136">_ft <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_V, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XI"</span>: _depths <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_V)})</span>
<span id="cb28-137">_o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _ft.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)</span>
<span id="cb28-138">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_profile_vs_eq18516_max_abs"</span>, profile_err(_ft, _o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]))</span>
<span id="cb28-139">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_raw_rel"</span>, rel(_o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], phi_penetration(LAM_V)))</span>
<span id="cb28-140">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_rel"</span>, rel(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _ft.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], phi_penetration(LAM_V)))</span>
<span id="cb28-141">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"solve for W_A truncated at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_depths<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> penetration depth instead of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>XI_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_REF)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-142">_ph <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi_extrapolated(LAM_REF, NT_REF, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>REF_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XI"</span>: _depths <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LAM_REF)})[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]</span>
<span id="cb28-143">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_printed_18A4_rel"</span>, rel(WA_pymrm_hr(phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_ph), WA_printed))</span>
<span id="cb28-144">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_rel"</span>, rel(WA_pymrm_hr(phi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_ph), WA_closed_hr))</span>
<span id="cb28-145">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"W_A march read raw at n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (no step extrapolation)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_vs_eq18518_grid_ratio"</span>,</span>
<span id="cb28-146">    ref_grid_ratio(which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"raw"</span>))</span>
<span id="cb28-147">_nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span></span>
<span id="cb28-148">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"marching step coarsened to n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (extrapolated over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb28-149">_oc, _oc2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fv.march(_nt), fv.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _nt)</span>
<span id="cb28-150">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_raw_rel"</span>, rel(_oc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], phi_penetration(LAM_V)))</span>
<span id="cb28-151">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_uptake_vs_eq18518_rel"</span>, rel(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _oc2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _oc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>], phi_penetration(LAM_V)))</span>
<span id="cb28-152">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_profile_vs_eq18516_max_abs"</span>, profile_err(fv, _oc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]))</span>
<span id="cb28-153">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_err_n1600"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_oc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-154">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_err_extrapolated_n1600"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _oc2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _oc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-155">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_err_extrapolated_n800"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _oc2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _oc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> REF_STEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-156">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"production budget at steps </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"production_grid_over_step_err_min"</span>,</span>
<span id="cb28-157">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(ge <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ge, se <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (production_budget(l, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nt) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> l <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BUDGET_LAMS)))</span>
<span id="cb28-158">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated step ladder formed from Phi(2n) alone (the Richardson combination dropped)"</span>,</span>
<span id="cb28-159">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order_extrapolated"</span>, observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: SL_CUPS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n], RICH_LADDER)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-160">_nx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span></span>
<span id="cb28-161">_f25 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Film(LAM_V, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>: _nx})</span>
<span id="cb28-162">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"grid coarsened to n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_profile_vs_eq18516_max_abs"</span>,</span>
<span id="cb28-163">    profile_err(_f25, _f25.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]))</span>
<span id="cb28-164">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid not stretched toward the interface (stretch = 0, uniform cells)"</span></span>
<span id="cb28-165">_GLu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grid_ladder(stretch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb28-166">_GLu_err <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(GRID_LADDER, _GLu[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>])}</span>
<span id="cb28-167">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_err_n400"</span>, _GLu_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>])</span>
<span id="cb28-168">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_err_n800"</span>, _GLu_err[NXV])</span>
<span id="cb28-169">_nx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb28-170">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"orders from errors against the exact value: step ladder on n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-171">_SLo, _SLx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> step_ladder(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nx)</span>
<span id="cb28-172">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"step ladder on n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (successive differences kept)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order"</span>, _SLo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-173">_ox <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> orders_vs_exact([_SLx[n] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STEP_LADDER], STEP_LADDER)</span>
<span id="cb28-174">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order"</span>, _ox[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-175">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_order_min"</span>, _ox.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb28-176">_nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span></span>
<span id="cb28-177">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"orders from errors against the exact value: grid ladder at raw n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-178">_GLx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grid_ladder(n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nt, against_exact<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb28-179">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"grid ladder at raw n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (successive differences kept)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_order"</span>,</span>
<span id="cb28-180">    _GLx[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-181">_ox <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> orders_vs_exact(_GLx[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>], GRID_LADDER)</span>
<span id="cb28-182">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_order"</span>, _ox[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-183">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_order_min"</span>, _ox.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb28-184">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"grid ladder at raw n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (step error left in)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid_ladder_limit_vs_exact"</span>,</span>
<span id="cb28-185">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_GLx[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(LAM_V) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-186">_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> STEP_LADDER[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb28-187">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"step ladder whose last rung repeats n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (no refinement)"</span>,</span>
<span id="cb28-188">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time_ladder_finest_diff_over_roundoff"</span>,</span>
<span id="cb28-189">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(fv.march(_n)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SL_CUPS[_n]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (ROUNDOFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SL_CUPS[_n]))</span>
<span id="cb28-190">_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GRID_LADDER[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb28-191">_rep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi_extrapolated(LAM_V, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V_FILM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_x"</span>: _n})[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]</span>
<span id="cb28-192">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"grid ladder whose last rung repeats n_x = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (no refinement)"</span>,</span>
<span id="cb28-193">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space_ladder_finest_diff_over_roundoff"</span>,</span>
<span id="cb28-194">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_rep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> GL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (ROUNDOFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _rep))</span>
<span id="cb28-195"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the integrator comparison</span></span>
<span id="cb28-196">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson with n_start = 0 (no backward-Euler start-up steps)"</span></span>
<span id="cb28-197">_e, _e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> integrator_errors(INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], n_start<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), integrator_errors(INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], n_start<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb28-198">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn_over_euler_extrap_cup_err"</span>, _e[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-199">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cn_profile_err_drop_4x_steps"</span>, _e[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _e1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-200">_e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> integrator_errors(INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], bdf2_steps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-201">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"BDF2 at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> steps, a third of the solves of the others"</span>,</span>
<span id="cb28-202">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bdf2_over_euler_extrap_cup_err"</span>, _e[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"BDF2"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler, extrapolated"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb28-203">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward-Euler profile compared raw (without the extrapolation)"</span>,</span>
<span id="cb28-204">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler_extrap_profile_err_drop_4x_steps"</span>,</span>
<span id="cb28-205">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f_int.march(INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_U).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-206">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f_int.march(INT_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> REF_U).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()))</span>
<span id="cb28-207"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the solver routes and the identity</span></span>
<span id="cb28-208">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LU of the first step reused for every step (the step matrix changes with dz)"</span>,</span>
<span id="cb28-209">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"banded_vs_splu_cup_gap"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(march_splu(_f, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, refactor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _f.march(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cup"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-210">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixing cup taken without the (1 - xi^2) weight in the full model"</span>,</span>
<span id="cb28-211">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixing_cup_vs_flux_integral_full_rel"</span>,</span>
<span id="cb28-212">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rel(OUT_FULL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flux_integral"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f_full.dx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> OUT_FULL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>]))))</span>
<span id="cb28-213">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"interfacial flux read from the first cell centre, -Lam (u_1 - 1)/xi_1, "</span></span>
<span id="cb28-214">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"instead of compute_boundary_values"</span>)</span>
<span id="cb28-215">_flux_cc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>LAM_V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (OUT_V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steps"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> fv.x_c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb28-216">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixing_cup_vs_flux_integral_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rel(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(OUT_V[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dz"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> _flux_cc), Phi_raw)))</span>
<span id="cb28-217"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Results 7</span></span>
<span id="cb28-218">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"velocity profile flattened to plug flow inside the full model"</span></span>
<span id="cb28-219">_pe_flat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> phi_film(L_MARK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_film(L_MARK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>)</span>
<span id="cb28-220">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile_effect_at_lambda_0p1"</span>, _pe_flat)</span>
<span id="cb28-221">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile_over_wall_effect_at_lambda_0p1"</span>, _pe_flat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WE)</span>
<span id="cb28-222">_flat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> l: r_wall(l) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, log<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb28-223">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_1pct"</span>, _flat)</span>
<span id="cb28-224">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_depth_over_delta_at_1pct"</span>, np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _flat))</span>
<span id="cb28-225">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_star_18A4_um"</span>, np.sqrt(D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (v_max <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _flat)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb28-226">_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span></span>
<span id="cb28-227">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"root search confined to [1e-3, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_roots_in_range"</span>,</span>
<span id="cb28-228">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> l: r_full(l) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, _hi, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, log<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]))</span>
<span id="cb28-229"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _lab, _ls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"threshold read off the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lams<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-point sweep by interpolation"</span>, lam_star_swept),</span>
<span id="cb28-230">                  (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"threshold read off a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lams_coarse<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-point sweep by interpolation"</span>,</span>
<span id="cb28-231">                   lam_star_swept_coarse)):</span>
<span id="cb28-232">    brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_1pct"</span>, _ls)</span>
<span id="cb28-233">    brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pen_depth_over_delta_at_1pct"</span>, np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _ls))</span>
<span id="cb28-234">    brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_star_18A4_um"</span>, np.sqrt(D_cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (v_max <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _ls)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb28-235">_terms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb28-236">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"wall series truncated after </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_terms<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> terms"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_series_at_lambda_0p1"</span>,</span>
<span id="cb28-237">    <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_wall(L_MARK, _terms))</span>
<span id="cb28-238">_nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb28-239">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"solver wall effect at n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (its marching error swamps the effect)"</span>,</span>
<span id="cb28-240">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_solver_at_lambda_0p1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> phi_film(L_MARK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(L_MARK))</span>
<span id="cb28-241">_WLc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> wall_ladder(n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nt)</span>
<span id="cb28-242">_we_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _WLc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> phi_penetration(L_MARK)</span>
<span id="cb28-243">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"wall ladder at n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (step error left in)"</span></span>
<span id="cb28-244">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_solver_refined_at_lambda_0p1"</span>, _we_c)</span>
<span id="cb28-245">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_effect_refined_vs_series_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_we_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-246">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"second wall ladder at the same steps </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WALL_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> WALL_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (no step refinement)"</span>,</span>
<span id="cb28-247">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_refined_gap_drop_steps_x4"</span>, WE_GAP[WALL_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WE_GAP[WALL_NT[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]])</span>
<span id="cb28-248">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall ladder refining the steps with the grid (n_t = n_x/3), without extrapolation"</span>,</span>
<span id="cb28-249">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_ladder_grid_order"</span>, wall_ladder(joint<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb28-250">_nxp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span></span>
<span id="cb28-251">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two solves of r_profile on different grids (parabolic </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, plug </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nxp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells)"</span>,</span>
<span id="cb28-252">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"profile_effect_grid_change_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_profile(L_MARK, n_x_plug<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nxp)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb28-253">_nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb28-254">brk(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"r_full at Lambda* from raw backward Euler at n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (no extrapolation)"</span>,</span>
<span id="cb28-255">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_star_grid_shift_rel"</span>, lam_star_shift(n_t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_nt, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"raw"</span>))</span>
<span id="cb28-256">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall branch compared raw (no step extrapolation)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wall_series_err_ratio_grid_doubled_min"</span>,</span>
<span id="cb28-257">    np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(wall_errors(extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> wall_errors(n_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NX, extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))))</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="20">
<pre><code>True</code></pre>
</div>
</div>
<div id="008f81a6" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:50.314409Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:50.314230Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:50.321068Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:50.320106Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The break table, as recorded by claims.breaks.</span></span>
<span id="cb30-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'injected defect'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;64}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'claim'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;42}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'clean'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'broken'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  caught"</span>)</span>
<span id="cb30-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, metric, clean, broken, caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb30-4">    is_bound <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[metric][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span></span>
<span id="cb30-5">    shown <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>clean<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> is_bound <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>clean<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;64}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>metric[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;42}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>shown<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>broken<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb30-7">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'yes'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> caught <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'NO'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-8">_caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, m, _, _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c}</span>
<span id="cb30-9">_structural <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb30-10">_open <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _structural)</span>
<span id="cb30-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_caught)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims are failed by at "</span></span>
<span id="cb30-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"least one row; structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_structural) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb30-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"open: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_open) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-14">_uncaught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(n, m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, m, _, _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> c]</span>
<span id="cb30-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that do not fail their claim: "</span></span>
<span id="cb30-16">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _uncaught) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>injected defect                                                  claim                                            clean      broken  caught
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte eq18518_vs_printed_18A4_rel                   0.001878      -0.182  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte pymrm_vs_eq18518_rel                        -4.646e-06  -4.646e-06  NO
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte pymrm_vs_printed_18A4_rel                     0.001874      -0.182  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte wa_closed_gmol_per_hr                           0.2735      0.2233  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte wa_rho999_gmol_per_hr                           0.2732      0.2231  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte wa_mw71_gmol_per_hr                             0.2731       0.223  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte film_exposure_time_s                            0.4896      0.7345  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte film_penetration_depth_um                        49.68       60.84  yes
v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotte film_kL_cm_s                                  0.005724    0.004674  yes
the 4 of Eq. 18.5-18 replaced by 1                               eq18518_vs_printed_18A4_rel                   0.001878     -0.4991  yes
the 4 of Eq. 18.5-18 replaced by 1                               pymrm_vs_eq18518_rel                        -4.646e-06           1  yes
rho_water = 0.999 instead of the assumed 1.000 g/cm3             eq18518_vs_printed_18A4_rel                   0.001878   0.0008765  yes
rho_water = 0.999 instead of the assumed 1.000 g/cm3             pymrm_vs_eq18518_rel                        -4.646e-06  -4.646e-06  NO
rho_water = 0.999 instead of the assumed 1.000 g/cm3             wa_excess_over_window_gmol_per_hr             1.28e-05  -0.0002607  yes
M(Cl2) = 71.0 instead of BSL Table E.1's 70.905                  pymrm_vs_eq18518_rel                        -4.646e-06  -4.646e-06  NO
rounding window taken as a whole unit (0.001) of the printed ans rounding_window_rel                           0.001832    0.003663  yes
W_A taken proportional to D^1 (the film exponent) instead of D^0 D_half_unit_window_rel                        0.001986    0.003968  yes
Eq. 18.5-20 used for 18A.7(a), as the problem statement instruct eq18519_vs_printed_18A7a_rel                  0.002203     -0.4214  yes
the 3 dropped from Eq. 18.5-20, making it Eq. 18.5-19            eq18520_vs_printed_18A7a_rel                   -0.4214    0.002203  yes
the 3 dropped from Eq. 18.5-20, making it Eq. 18.5-19            eq18519_over_eq18520                       (here 1.7e+00)           1  yes
the 3 dropped from Eq. 18.5-20, making it Eq. 18.5-19            kL_creep_cm_per_hr                               59.44         103  yes
the 3 dropped from Eq. 18.5-20, making it Eq. 18.5-19            creeping_kL_vs_hg_measured_rel                 -0.4919       -0.12  yes
k_c left in cm/hr (the /3600 forgotten)                          hg_measured_vs_printed_18A7b_rel               0.00188        3606  yes
k_c left in cm/hr (the /3600 forgotten)                          higbie_kL_vs_hg_measured_rel                     -0.12     -0.9998  yes
k_c left in cm/hr (the /3600 forgotten)                          film_thickness_implied_um                        4.492    0.001248  yes
k_c left in cm/hr (the /3600 forgotten)                          renewal_rate_implied_s_inv                       72.35   9.376e+08  yes
k_c left in cm/hr (the /3600 forgotten)                          higbie_texp_times_renewal_rate                   1.644   2.131e+07  yes
k_c left in cm/hr (the /3600 forgotten)                          renewal_over_higbie_kL_at_measured               1.136        4091  yes
k_c left in cm/hr (the /3600 forgotten)                          renewal_mean_age_ms                              13.82   1.067e-06  yes
exposure time taken as 2 D/v_t instead of D/v_t                  bubble_exposure_time_s                         0.02273     0.04545  yes
exposure time taken as 2 D/v_t instead of D/v_t                  kL_higbie_cm_per_hr                                103        72.8  yes
exposure time taken as 2 D/v_t instead of D/v_t                  higbie_kL_vs_hg_measured_rel                     -0.12     -0.3778  yes
exposure time taken as 2 D/v_t instead of D/v_t                  higbie_texp_times_renewal_rate                   1.644       3.288  yes
exposure time taken as 2 D/v_t instead of D/v_t                  renewal_over_higbie_kL_at_measured               1.136       1.607  yes
film thickness inverted from the predicted k_L instead of the me film_thickness_implied_um                        4.492       5.105  yes
the (1 + erf phi) factor dropped from Eq. 20.1-18                bsl_t2011_phi_worst_rel                      9.962e-05      0.2789  yes
the (1 + erf phi) factor dropped from Eq. 20.1-18                bsl_cells_off_rounding                               0           9  yes
psi taken as phi/x_A0 (the sqrt(pi) of the Table 20.1-1 head dro bsl_t2011_psi_worst_rel                      0.0004156       0.436  yes
psi taken as phi/x_A0 (the sqrt(pi) of the Table 20.1-1 head dro bsl_t2282_theta_pen_worst_rel                0.0004156       0.436  yes
Eq. 22.8-41 written as (1 - x)/psi instead of (1 - x) psi        bsl_t2282_theta_pen_worst_rel                0.0004156      0.5912  yes
Eq. 22.8-41 written as (1 - x)/psi instead of (1 - x) psi        bsl_t2282_theta_pen_minus_psi_dev          (here 1.1e-16)      0.5911  yes
Eq. 22.8-42 written without the (1 - x)/x prefactor              bsl_t2282_theta_film_worst_rel               0.0002124       2.001  yes
Eq. 22.8-42 written without the (1 - x)/x prefactor              bsl_t2282_pen_film_gap_at_0p75                  0.1539       0.718  yes
gamma/tanh(gamma) written upside down as tanh(gamma)/gamma       froment_t6421_film_worst_rel                  0.009787        0.99  yes
gamma/tanh(gamma) written upside down as tanh(gamma)/gamma       froment_t6421_film_cells_off_rounding                2           4  yes
gamma/tanh(gamma) written upside down as tanh(gamma)/gamma       froment_penetration_vs_film_at_gamma_1         0.05002      0.8103  yes
sqrt(1 + gamma^2) written as 1 + gamma^2                         froment_t6421_renewal_worst_rel               0.004988        9.05  yes
sqrt(1 + gamma^2) written as 1 + gamma^2                         froment_t6421_renewal_cells_off_rounding             0           5  yes
sqrt(1 + gamma^2) written as 1 + gamma^2                         froment_penetration_vs_renewal_at_gamma_1      -0.0251     -0.3106  yes
erf(1 gamma) for erf(2 gamma/sqrt(pi)) in Froment Eq. 6.4.2-8    froment_t6421_penetration_worst_rel            0.06387     0.05833  yes
erf(1 gamma) for erf(2 gamma/sqrt(pi)) in Froment Eq. 6.4.2-8    froment_t6421_pen_at_gamma_10_rel             -0.03376    -0.03376  NO
erf(1 gamma) for erf(2 gamma/sqrt(pi)) in Froment Eq. 6.4.2-8    froment_eq6428_closed_vs_quadrature_worst  (here 1.9e-14)     0.06084  yes
printed penetration column tested against a bracket widened by 0 froment_t6421_pen_bracket_violations                 2           1  yes
the gamma = 0.01 and 10 penetration cells transcribed as 1.00 an froment_t6421_penetration_worst_rel            0.06387    0.006359  yes
the gamma = 0.01 and 10 penetration cells transcribed as 1.00 an froment_t6421_pen_at_gamma_10_rel             -0.03376  -7.272e-05  yes
the gamma = 0.01 and 10 penetration cells transcribed as 1.00 an froment_t6421_pen_bracket_violations                 2           0  yes
the gamma = 0.01 and 10 penetration cells transcribed as 1.00 an froment_t6421_penetration_cells_off_roundi           6           4  yes
far boundary of the deep penetration solve a sink (u = 0) instea pen_profile_vs_eq18516_max_abs               0.0001148   0.0001148  NO
far boundary of the deep penetration solve a sink (u = 0) instea pen_uptake_vs_eq18518_raw_rel                -0.000107   -0.000107  NO
wall of the film a sink (u = 0) instead of no flux               wall_series_vs_pymrm_worst_rel               7.153e-06      0.0221  yes
deep solve truncated at 1 penetration depth instead of 12        pen_profile_vs_eq18516_max_abs               0.0001148      0.1561  yes
deep solve truncated at 1 penetration depth instead of 12        pen_uptake_vs_eq18518_raw_rel                -0.000107     -0.0036  yes
deep solve truncated at 1 penetration depth instead of 12        pen_uptake_vs_eq18518_rel                   -2.834e-06   -0.003469  yes
solve for W_A truncated at 1 penetration depth instead of 10     pymrm_vs_printed_18A4_rel                     0.001874   -0.001598  yes
solve for W_A truncated at 1 penetration depth instead of 10     pymrm_vs_eq18518_rel                        -4.646e-06    -0.00347  yes
W_A march read raw at n_t = 800 (no step extrapolation)          pymrm_vs_eq18518_grid_ratio                (here 3.9e+00)       1.017  yes
marching step coarsened to n_t = 50 (extrapolated over 50/100)   pen_uptake_vs_eq18518_raw_rel                -0.000107   -0.003319  yes
marching step coarsened to n_t = 50 (extrapolated over 50/100)   pen_uptake_vs_eq18518_rel                   -2.834e-06  -1.126e-05  yes
marching step coarsened to n_t = 50 (extrapolated over 50/100)   pen_profile_vs_eq18516_max_abs               0.0001148    0.003657  yes
marching step coarsened to n_t = 50 (extrapolated over 50/100)   time_err_n1600                               0.0001042    0.003317  yes
marching step coarsened to n_t = 50 (extrapolated over 50/100)   time_err_extrapolated_n1600                (here 8.1e-09)    8.46e-06  yes
marching step coarsened to n_t = 50 (extrapolated over 50/100)   time_err_extrapolated_n800                 (here 3.3e-08)    8.46e-06  yes
production budget at steps 50/100                                production_grid_over_step_err_min          (here 4.6e+01)      0.1865  yes
extrapolated step ladder formed from Phi(2n) alone (the Richards time_order_extrapolated                    (here 2.0e+00)      0.9998  yes
grid coarsened to n_x = 25                                       pen_profile_vs_eq18516_max_abs               0.0001148     0.00077  yes
grid not stretched toward the interface (stretch = 0, uniform ce space_err_n400                                1.12e-05   7.617e-08  yes
grid not stretched toward the interface (stretch = 0, uniform ce space_err_n800                               2.802e-06   5.016e-09  yes
step ladder on n_x = 100 (successive differences kept)           time_order                                 (here 1.0e+00)      0.9998  NO
orders from errors against the exact value: step ladder on n_x = time_order                                 (here 1.0e+00)      0.1727  yes
orders from errors against the exact value: step ladder on n_x = time_order_min                             (here 1.0e+00)      0.1727  yes
grid ladder at raw n_t = 800 (successive differences kept)       space_order                                (here 2.0e+00)       1.999  NO
orders from errors against the exact value: grid ladder at raw n space_order                                (here 2.0e+00)     0.01443  yes
orders from errors against the exact value: grid ladder at raw n space_order_min                            (here 2.0e+00)     0.01443  yes
grid ladder at raw n_t = 800 (step error left in)                grid_ladder_limit_vs_exact                 (here 7.9e-09)   0.0002083  yes
step ladder whose last rung repeats n_t = 3200 (no refinement)   time_ladder_finest_diff_over_roundoff      (here 2.6e+08)           0  yes
grid ladder whose last rung repeats n_x = 800 (no refinement)    space_ladder_finest_diff_over_roundoff     (here 1.1e+07)           0  yes
Crank-Nicolson with n_start = 0 (no backward-Euler start-up step cn_over_euler_extrap_cup_err                    0.7184       39.14  yes
Crank-Nicolson with n_start = 0 (no backward-Euler start-up step cn_profile_err_drop_4x_steps                     2.399       1.244  yes
BDF2 at 200 steps, a third of the solves of the others           bdf2_over_euler_extrap_cup_err                   2.896       26.17  yes
backward-Euler profile compared raw (without the extrapolation)  euler_extrap_profile_err_drop_4x_steps           15.89       4.005  yes
LU of the first step reused for every step (the step matrix chan banded_vs_splu_cup_gap                     (here 1.0e-14)      0.9989  yes
mixing cup taken without the (1 - xi^2) weight in the full model mixing_cup_vs_flux_integral_full_rel       (here 2.8e-12)     0.09911  yes
interfacial flux read from the first cell centre, -Lam (u_1 - 1) mixing_cup_vs_flux_integral_rel            (here 3.4e-13)   0.0004964  yes
velocity profile flattened to plug flow inside the full model    profile_effect_at_lambda_0p1                   0.01918           0  yes
velocity profile flattened to plug flow inside the full model    profile_over_wall_effect_at_lambda_0p1            4810           0  yes
velocity profile flattened to plug flow inside the full model    lambda_star_1pct                               0.05643      0.3196  yes
velocity profile flattened to plug flow inside the full model    pen_depth_over_delta_at_1pct                    0.4751       1.131  yes
velocity profile flattened to plug flow inside the full model    delta_star_18A4_um                               104.6       43.94  yes
root search confined to [1e-3, 0.02]                             lambda_star_roots_in_range                           1           0  yes
threshold read off the 12-point sweep by interpolation           lambda_star_1pct                               0.05643     0.05583  yes
threshold read off the 12-point sweep by interpolation           pen_depth_over_delta_at_1pct                    0.4751      0.4726  yes
threshold read off the 12-point sweep by interpolation           delta_star_18A4_um                               104.6       105.1  yes
threshold read off a 5-point sweep by interpolation              lambda_star_1pct                               0.05643     0.04701  yes
threshold read off a 5-point sweep by interpolation              pen_depth_over_delta_at_1pct                    0.4751      0.4337  yes
threshold read off a 5-point sweep by interpolation              delta_star_18A4_um                               104.6       114.6  yes
wall series truncated after 2 terms                              wall_effect_series_at_lambda_0p1             3.987e-06  -0.0001866  yes
solver wall effect at n_t = 100 (its marching error swamps the e wall_effect_solver_at_lambda_0p1             1.036e-05   1.213e-05  yes
wall ladder at n_t = 100/200 (step error left in)                wall_effect_solver_refined_at_lambda_0p1     3.988e-06   5.784e-06  yes
wall ladder at n_t = 100/200 (step error left in)                wall_effect_refined_vs_series_rel          (here 1.0e-04)      0.4507  yes
second wall ladder at the same steps 1600/3200 (no step refineme wall_refined_gap_drop_steps_x4             (here 1.7e+01)           1  yes
wall ladder refining the steps with the grid (n_t = n_x/3), with wall_ladder_grid_order                     (here 2.0e+00)       1.004  yes
the two solves of r_profile on different grids (parabolic 600, p profile_effect_grid_change_rel             (here 5.4e-06)   0.0003044  yes
r_full at Lambda* from raw backward Euler at n_t = 100 (no extra lambda_star_grid_shift_rel                 (here 1.4e-06)    0.007944  yes
wall branch compared raw (no step extrapolation)                 wall_series_err_ratio_grid_doubled_min     (here 3.9e+00)       1.023  yes

114 rows; 85 of 85 claims are failed by at least one row; structural: none; open: none
rows that do not fail their claim: v_max taken as the printed &lt;v&gt; (the 3/2 from Eq. 18.5-1 forgotten) -&gt; pymrm_vs_eq18518_rel; rho_water = 0.999 instead of the assumed 1.000 g/cm3 -&gt; pymrm_vs_eq18518_rel; M(Cl2) = 71.0 instead of BSL Table E.1's 70.905 -&gt; pymrm_vs_eq18518_rel; erf(1 gamma) for erf(2 gamma/sqrt(pi)) in Froment Eq. 6.4.2-8 -&gt; froment_t6421_pen_at_gamma_10_rel; far boundary of the deep penetration solve a sink (u = 0) instead of no flux -&gt; pen_profile_vs_eq18516_max_abs; far boundary of the deep penetration solve a sink (u = 0) instead of no flux -&gt; pen_uptake_vs_eq18518_raw_rel; step ladder on n_x = 100 (successive differences kept) -&gt; time_order; grid ladder at raw n_t = 800 (successive differences kept) -&gt; space_order</code></pre>
</div>
</div>
<p><strong>A break table measures sensitivity, never correctness.</strong> Nothing in it can catch a wrong baseline. That is what the independent routes are for: the finite-volume march against Eq. 18.5-18 in <em>Results 1</em> and against Eq. 18.5-16 in <em>Validation 1</em>, and the exact eigenfunction series against the solver in <em>Validation 2</em>. Which quantities have such a second route, and which do not: <img src="https://latex.codecogs.com/png.latex?%5CPhi"> for plug flow (closed form, series); the wall effect (series, and the refined solver). The profile effect, <img src="https://latex.codecogs.com/png.latex?%5CLambda%5E%7B%5Cast%7D"> and the full-film profiles have <strong>no</strong> second route: they rest on the same solver, checked on the plug-flow branches and refined in <em>Results 7</em>.</p>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>1. The equation BSL declines to solve.</strong> Section 18.5 sets up Eq. 18.5-7 in full and then says its analytic solution is “in the form of an infinite series” in Pigford’s 1941 thesis, which it does not print and which is not on disk. Solving it directly turns BSL’s two-sentence justification for Eq. 18.5-11 into a number: the penetration formula is within 1 % of the full equation whenever the penetration depth stays below <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B4%5CLambda%5E%7B%5Cast%7D%7D"> of the film thickness, a threshold that is root-found rather than read off a sweep.</p>
<p><strong>2. The two halves of that justification are not equal.</strong> BSL offers two reasons for Eq. 18.5-11 (the solute does not sense the wall, and it thinks the film moves at <img src="https://latex.codecogs.com/png.latex?v_%7B%5Cmax%7D">) as though they were the same argument. They are not: where the front has crossed most of the film, the velocity profile is worth a couple of percent and the wall a few parts per million, measured with the exact series and confirmed by the refined solver. A reflecting wall returns solute that a semi-infinite film would have retained anyway, whereas slower liquid below the surface has genuinely longer to load. <strong>That decomposition is not in either book.</strong></p>
<p><strong>3. The three-way comparison, taken, with its limits stated.</strong> Froment’s Table 6.4.2.1 puts all three enhancement factors side by side (and its penetration column disagrees with its own printed formula); Hammerton &amp; Garner’s single measured <img src="https://latex.codecogs.com/png.latex?k_c"> is the one datum on which the penetration model is the only one of the three that predicts without a fitted constant. <strong>The exponent question is not closed</strong>: one <img src="https://latex.codecogs.com/png.latex?(k_L,%5Cmathscr%7BD%7D)"> pair cannot resolve <img src="https://latex.codecogs.com/png.latex?n">.</p>
<p><strong>4. Two printed defects, proved from the sources’ own numbers.</strong> Problem 18A.7(a) names Eq. 18.5-20 and prints Eq. 18.5-19’s answer, a factor <img src="https://latex.codecogs.com/png.latex?%5Csqrt3"> apart; and two cells of Froment’s Table 6.4.2.1 are impossible against the printed digits of the other two columns of their own rows. Both are reported and neither is repaired.</p>
<p><strong>Which parts are pymrm.</strong> The transverse diffusion operator and its boundary terms (<code>construct_grad</code>, <code>construct_div</code>), the interfacial flux (<code>compute_boundary_values</code>), the capacity matrix of the sparse-LU check (<code>construct_coefficient_matrix</code>), the refinement studies (<code>pymrm.checks.observed_orders</code>) and the threshold search (<code>pymrm.checks.find_roots</code>). The marching loop, the Richardson extrapolation and the banded solves are numpy and scipy. The closed forms of section 18.5, the reproductions in <em>Results 1, 2, 3, 5 and 6</em>, the exact series and the quadrature are arithmetic and scipy and need no solver. The Arnold functions of Table 20.1-1 are <code>A4.8</code>’s subject and are used here only as inputs to Eq. 22.8-41.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>If you want a liquid-side coefficient for a short-contact device</strong>, this is the page: <img src="https://latex.codecogs.com/png.latex?k_L=2%5Csqrt%7B%5Cmathscr%7BD%7D/%5Cpi%20t_%7B%5Crm%20exp%7D%7D"> with <img src="https://latex.codecogs.com/png.latex?t_%7B%5Crm%20exp%7D"> from the geometry, <img src="https://latex.codecogs.com/png.latex?L/v_%7B%5Cmax%7D"> for a wetted wall and <img src="https://latex.codecogs.com/png.latex?D/v_t"> for a circulating bubble. On the one measurement BSL quotes it runs low by the amount <em>Results 3</em> prints, with no adjustable constant. Use Eq. 18.5-19 for a mobile interface and Eq. 18.5-20 for creeping flow, and note that a surfactant skin moves you off this page entirely: BSL says the exponent then becomes <img src="https://latex.codecogs.com/png.latex?%5Cmathscr%7BD%7D%5E%7B1/3%7D">, as for a rigid sphere.</p>
<p><strong>If you are choosing between film, penetration and surface renewal</strong>, read <em>Results 3</em> and <em>4</em> before <em>Results 5</em>. On the practical axis (an enhancement factor for a pseudo-first-order reaction) the three differ by a few percent at <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20=%201"> (<em>Validation 4</em>), which is Froment’s own conclusion; the choice is not worth agonising over for design. On the <em>scientific</em> axis, the exponent on diffusivity, nothing on disk settles it, and the sibling pages <a href="../A3.1-whitman-two-film/"><code>A3.1</code></a> and <a href="../A3.3-danckwerts-surface-renewal/"><code>A3.3</code></a> explain from their own sources why. What does distinguish the three is how many free constants they need: two of them need one each, and penetration needs none.</p>
<p><strong>If you are building a falling-film or wetted-wall model</strong>, <code>Film</code> in <code>model.py</code> is the skeleton: a capacity times a marching derivative, <code>construct_grad</code> and <code>construct_div</code> for the transverse operator assembled once, boundary conditions on the outward normal, the interfacial flux from <code>compute_boundary_values</code>. Substituting a first-order reaction adds a diagonal term to the step matrix; a nonlinear reaction or a second species turns the step into a <code>newton</code> solve with the same constant operator. <code>A3.3</code> marches the same structure in surface age rather than axial distance, and <code>F3.1</code> (Hatta) is where reaction enhancement in this geometry belongs. Extrapolate a backward-Euler march in the step, and then refine the grid: after the extrapolation the grid error is the one left.</p>
<p><strong>Do not take from this page</strong>: a validated diffusivity exponent (none is established); an error bar on the comparison with Hammerton &amp; Garner (BSL prints none for their number and none is invented); a film thickness for Problem 18A.4’s column (not printed, not inferred); or Froment’s Table 6.4.2.1 penetration column as data (<em>Results 5</em>).</p>
<p><strong>Cite the sources, not this page.</strong> The origin is R. Higbie, <em>Trans. AIChE</em> <strong>31</strong>, 365-389 (1935), which <strong>was not consulted</strong>. The model as used here is read from Bird, Stewart &amp; Lightfoot, <em>Transport Phenomena</em>, 2nd edn (Wiley, 2002), section 18.5, with the worked problems 18A.4 and 18A.7 and Tables 20.1-1 and 22.8-2; the cross-check is Froment, De Wilde &amp; Bischoff, <em>Chemical Reactor Analysis and Design</em>, 3rd edn (Wiley, 2011), section 6.4 and Table 6.4.2.1, the last of which Froment himself takes from Beek (1968), also not consulted. Hammerton &amp; Garner, <em>Trans. Inst. Chem. Engrs. (London)</em> <strong>32</strong>, S18-S24 (1954) supplies the one measurement and is quoted only as BSL quotes it.</p>
<div id="f2278f46" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T19:44:50.322820Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T19:44:50.322690Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T19:44:50.330694Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T19:44:50.330066Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: every registered number printed, agreement.json written for CI, and an</span></span>
<span id="cb32-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exception raised when a claim fails its own check or has no break row.</span></span>
<span id="cb32-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for A3.2:
  banded_vs_splu_cup_gap                       = (here 1.0e-14)   bound  bound &lt;= 1e-12 [identity]
  eq18518_vs_printed_18A4_rel                  = 0.0018784        value  rtol 0.05
  pymrm_vs_printed_18A4_rel                    = 0.0018737        value  rtol 0.05
  pymrm_vs_eq18518_rel                         = -4.6456e-06      value  rtol 0.05
  wa_closed_gmol_per_hr                        = 0.27351          value  rtol 0.05
  pymrm_vs_eq18518_grid_ratio                  = (here 3.9e+00)   bound  bound [3.5, 4.5] [theory]
  rounding_window_rel                          = 0.0018315        value  rtol 0.05
  wa_rho999_gmol_per_hr                        = 0.27324          value  rtol 0.05
  wa_mw71_gmol_per_hr                          = 0.27315          value  rtol 0.05
  D_half_unit_window_rel                       = 0.0019861        value  rtol 0.05
  wa_excess_over_window_gmol_per_hr            = 1.2796e-05       value  rtol 0.05
  film_exposure_time_s                         = 0.48964          value  rtol 0.05
  film_penetration_depth_um                    = 49.677           value  rtol 0.05
  film_kL_cm_s                                 = 0.005724         value  rtol 0.05
  eq18519_vs_printed_18A7a_rel                 = 0.0022033        value  rtol 0.05
  eq18520_vs_printed_18A7a_rel                 = -0.42138         value  rtol 0.05
  eq18519_over_eq18520                         = (here 1.7e+00)   bound  bound [1.73205, 1.73205] [identity]
  hg_measured_vs_printed_18A7b_rel             = 0.0018797        value  rtol 0.05
  bubble_exposure_time_s                       = 0.022727         value  rtol 0.05
  kL_higbie_cm_per_hr                          = 102.96           value  rtol 0.05
  kL_creep_cm_per_hr                           = 59.443           value  rtol 0.05
  higbie_kL_vs_hg_measured_rel                 = -0.12002         value  rtol 0.05
  creeping_kL_vs_hg_measured_rel               = -0.49194         value  rtol 0.05
  film_thickness_implied_um                    = 4.4923           value  rtol 0.05
  renewal_rate_implied_s_inv                   = 72.346           value  rtol 0.05
  renewal_mean_age_ms                          = 13.822           value  rtol 0.05
  higbie_texp_times_renewal_rate               = 1.6442           value  rtol 0.05
  renewal_over_higbie_kL_at_measured           = 1.1364           value  rtol 0.05
  froment_t6421_film_worst_rel                 = 0.009787         value  rtol 0.05
  froment_t6421_renewal_worst_rel              = 0.0049876        value  rtol 0.05
  froment_t6421_penetration_worst_rel          = 0.063875         value  rtol 0.05
  froment_t6421_pen_at_gamma_10_rel            = -0.033757        value  rtol 0.05
  froment_t6421_pen_bracket_violations         = 2                exact  exact, margin 0.005
  froment_t6421_film_cells_off_rounding        = 2                exact  exact, margin 0.0181
  froment_t6421_renewal_cells_off_rounding     = 0                exact  exact, margin 0.00249
  froment_t6421_penetration_cells_off_rounding = 6                exact  exact, margin 0.523
  bsl_t2011_phi_worst_rel                      = 9.962e-05        value  rtol 0.05
  bsl_t2011_psi_worst_rel                      = 0.00041562       value  rtol 0.05
  bsl_t2282_theta_pen_worst_rel                = 0.00041562       value  rtol 0.05
  bsl_t2282_theta_film_worst_rel               = 0.00021238       value  rtol 0.05
  bsl_t2282_theta_pen_minus_psi_dev            = (here 1.1e-16)   bound  bound &lt;= 1e-14 [identity]
  bsl_t2282_pen_film_gap_at_0p75               = 0.1539           value  rtol 0.05
  bsl_cells_off_rounding                       = 0                exact  exact, margin 0.0191
  profile_effect_at_lambda_0p1                 = 0.019179         value  rtol 0.05
  wall_effect_series_at_lambda_0p1             = 3.9873e-06       value  rtol 0.05
  profile_over_wall_effect_at_lambda_0p1       = 4810             value  rtol 0.05
  wall_effect_solver_at_lambda_0p1             = 1.0365e-05       value  rtol 0.05
  lambda_star_roots_in_range                   = 1                exact  exact
  lambda_star_1pct                             = 0.056426         value  rtol 0.001
  pen_depth_over_delta_at_1pct                 = 0.47508          value  rtol 0.001
  delta_star_18A4_um                           = 104.56           value  rtol 0.001
  wall_ladder_grid_order                       = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  wall_effect_solver_refined_at_lambda_0p1     = 3.9877e-06       value  rtol 0.001
  wall_effect_refined_vs_series_rel            = (here 1.0e-04)   bound  bound &lt;= 0.001 [chosen]
  wall_refined_gap_drop_steps_x4               = (here 1.7e+01)   bound  bound [8, 32] [theory]
  profile_effect_grid_change_rel               = (here 5.4e-06)   bound  bound &lt;= 0.0001 [chosen]
  lambda_star_grid_shift_rel                   = (here 1.4e-06)   bound  bound &lt;= 0.0001 [chosen]
  pen_profile_vs_eq18516_max_abs               = 0.00011482       value  rtol 0.05
  pen_uptake_vs_eq18518_rel                    = -2.834e-06       value  rtol 0.05
  pen_uptake_vs_eq18518_raw_rel                = -0.00010695      value  rtol 0.05
  mixing_cup_vs_flux_integral_rel              = (here 3.4e-13)   bound  bound &lt;= 1e-11 [identity]
  mixing_cup_vs_flux_integral_full_rel         = (here 2.8e-12)   bound  bound &lt;= 1e-10 [identity]
  wall_series_vs_pymrm_worst_rel               = 7.1527e-06       value  rtol 0.05
  wall_series_err_ratio_grid_doubled_min       = (here 3.9e+00)   bound  bound [3.5, 4.5] [theory]
  time_order                                   = (here 1.0e+00)   bound  bound [0.95, 1.05] [theory]
  time_order_extrapolated                      = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  time_order_min                               = (here 1.0e+00)   bound  bound [0.95, 1.05] [theory]
  space_order                                  = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  space_order_min                              = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  time_ladder_finest_diff_over_roundoff        = (here 2.6e+08)   bound  bound &gt;= 1000 [theory]
  space_ladder_finest_diff_over_roundoff       = (here 1.1e+07)   bound  bound &gt;= 1000 [theory]
  time_err_n1600                               = 0.00010415       value  rtol 0.05
  space_err_n400                               = 1.1201e-05       value  rtol 0.05
  space_err_n800                               = 2.8017e-06       value  rtol 0.05
  time_err_extrapolated_n1600                  = (here 8.1e-09)   bound  bound &lt;= 1e-07 [chosen]
  time_err_extrapolated_n800                   = (here 3.3e-08)   bound  bound &lt;= 1e-07 [chosen]
  grid_ladder_limit_vs_exact                   = (here 7.9e-09)   bound  bound &lt;= 1e-07 [chosen]
  production_grid_over_step_err_min            = (here 4.6e+01)   bound  bound &gt;= 10 [chosen]
  bdf2_over_euler_extrap_cup_err               = 2.8955           value  rtol 0.05
  cn_over_euler_extrap_cup_err                 = 0.71842          value  rtol 0.05
  cn_profile_err_drop_4x_steps                 = 2.3986           value  rtol 0.05
  euler_extrap_profile_err_drop_4x_steps       = 15.895           value  rtol 0.05
  froment_eq6428_closed_vs_quadrature_worst    = (here 1.9e-14)   bound  bound &lt;= 1e-12 [identity]
  froment_penetration_vs_renewal_at_gamma_1    = -0.025104        value  rtol 0.05
  froment_penetration_vs_film_at_gamma_1       = 0.050018         value  rtol 0.05</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:A</category>
  <category>struct:S4</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.2-higbie-penetration/</guid>
  <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The van Deemter equation: the three terms, the constants they were read off, and what the Gaussian costs</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.10-van-deemter-plate-height/</link>
  <description><![CDATA[ 




<section id="the-van-deemter-equation-the-three-terms-the-constants-they-were-read-off-and-what-the-gaussian-costs" class="level1">
<h1>The van Deemter equation: the three terms, the constants they were read off, and what the Gaussian costs</h1>
<p><strong>Catalog ID:</strong> <code>J1.10</code> · <strong>Structures:</strong> <code>S4</code> (1-D transient PDE) · <strong>Tier:</strong> T0</p>
<p>Every chromatography textbook prints</p>
<p><img src="https://latex.codecogs.com/png.latex?H%20=%20A%20+%20%5Cfrac%7BB%7D%7Bu%7D%20+%20C%20u,"></p>
<p>attributes it to van Deemter, Zuiderweg and Klinkenberg (1956), and moves on. The 1956 paper does not start there. It starts from a two-phase material balance, reduces it to a Gaussian, and only then — on page 286, from twelve measured points — writes down three numbers. This page rebuilds that chain, end to end, and reports what each step actually supports.</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>A band injected into a chromatographic column comes out wider than it went in. The plate theory of Martin and Synge describes <em>how much</em> wider with one empirical number per column, the height equivalent to a theoretical plate, and says nothing about where that number comes from. The rate theory of Lapidus and Amundson describes the mechanisms — longitudinal diffusion, finite mass transfer — but its solution is an integral over a Bessel function, which in 1956 was not something you evaluated for a design.</p>
<p>The 1956 paper is the join. Its abstract lists the three causes it treats:</p>
<blockquote class="blockquote">
<p>axial molecular diffusion, axial eddy diffusion, finiteness of transfer coefficient</p>
</blockquote>
<p>and its contribution is that under conditions it states explicitly, the rate theory collapses to a Gaussian whose width is <em>additive</em> in those three mechanisms. That additivity is the van Deemter equation. It is why the familiar <img src="https://latex.codecogs.com/png.latex?A%20+%20B/u%20+%20Cu"> has one term per mechanism and no cross terms.</p>
<p>Three things about the paper are easy to miss and matter here.</p>
<ol type="1">
<li><strong>Two experiments, not one.</strong> Sections apply the theory to <em>ion exclusion</em> (Simpson and Wheaton’s data, restated in Table 2, reduced to plate heights in Table 3) and to <em>gas–liquid partition chromatography</em> (the authors’ own Table 4). Only the second produces the famous three-term formula; the first produces the particle diffusivity and the packing factor <img src="https://latex.codecogs.com/png.latex?%5Clambda"> that the second then reuses.</li>
<li><strong>The constants were read off graphs.</strong> Eq. (54) is a description of Fig. 11, and the paper says so — “the values of the constants in (54) are highly uncertain, owing to the relatively small number of experimental data that were available”.</li>
<li><strong>The paper criticises its own fit.</strong> The eddy term “should obviously have the same value for both components. The formulae (54) do not agree with theory in this respect” — 0.3 mm for <em>n</em>-butane against 0.8 mm for iso-butane.</li>
</ol>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p><strong>The balance (eqs. 29 and 30, p.&nbsp;278),</strong> per unit cross-sectional area, with <img src="https://latex.codecogs.com/png.latex?F_I"> and <img src="https://latex.codecogs.com/png.latex?F_%7BII%7D"> the fractional volumes of the mobile and immobile phases, <img src="https://latex.codecogs.com/png.latex?K%20=%20(c_I/c_%7BII%7D)_%7B%5Ctext%7Bequilibrium%7D%7D"> the distribution factor, <img src="https://latex.codecogs.com/png.latex?%5Calpha"> the mass transfer coefficient per unit volume of packing, and <img src="https://latex.codecogs.com/png.latex?u"> the <strong>interstitial</strong> velocity (the paper’s own List of Symbols, p.&nbsp;288):</p>
<p><img src="https://latex.codecogs.com/png.latex?F_I%5Cfrac%7B%5Cpartial%20c_I%7D%7B%5Cpartial%20t%7D%0A%20%20=%20F_I%20D%5Cfrac%7B%5Cpartial%5E2%20c_I%7D%7B%5Cpartial%20z%5E2%7D%0A%20%20-%20F_I%20u%5Cfrac%7B%5Cpartial%20c_I%7D%7B%5Cpartial%20z%7D%0A%20%20+%20%5Calpha%5C,(K%20c_%7BII%7D%20-%20c_I),%0A%5Cqquad%0AF_%7BII%7D%5Cfrac%7B%5Cpartial%20c_%7BII%7D%7D%7B%5Cpartial%20t%7D%20=%20%5Calpha%5C,(c_I%20-%20K%20c_%7BII%7D)."></p>
<p><strong>The Gaussian (eqs. 33 and 34, p.&nbsp;279).</strong> For <img src="https://latex.codecogs.com/png.latex?z"> much larger than both <img src="https://latex.codecogs.com/png.latex?2D/u"> and <img src="https://latex.codecogs.com/png.latex?F_I%20u/%5Calpha">, the Lapidus–Amundson solution reduces to</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7Bc_I%7D%7Bc_0%7D%20=%20%5Cfrac%7B%5Cbeta%20t_0%7D%7B%5Csqrt%7B2%5Cpi(%5Csigma_1%5E2+%5Csigma_2%5E2)%7D%7D%0A%20%20%20%5Cexp%5C!%5Cleft%5B-%5Cfrac%7B(z/u-%5Cbeta%20t)%5E2%7D%7B2(%5Csigma_1%5E2+%5Csigma_2%5E2)%7D%5Cright%5D,%0A%5Cqquad%0A%5Cfrac%7B1%7D%7B%5Cbeta%7D%20=%201%20+%20%5Cfrac%7BF_%7BII%7D%7D%7BF_I%20K%7D,%5Cquad%0A%5Csigma_1%5E2%20=%20%5Cfrac%7B2Dz%7D%7Bu%5E3%7D,%5Cquad%0A%5Csigma_2%5E2%20=%202%5Cbeta%5E2%5Cfrac%7BF_%7BII%7D%5E2%20z%7D%7B%5Calpha%20F_I%20K%5E2%20u%7D."></p>
<p><strong>The plate height (eq. 38, p.&nbsp;279).</strong> Comparing that Gaussian with the plate theory’s gives</p>
<p><img src="https://latex.codecogs.com/png.latex?H%20=%202%5Cfrac%7BD%7D%7Bu%7D%20+%202%5C,%5Cfrac%7Bu%20F_I/%5Calpha%7D%7B%5Cleft(1%20+%20K%5Cdfrac%7BF_I%7D%7BF_%7BII%7D%7D%5Cright)%5E2%7D."></p>
<p><strong>The three terms (eqs. 47, 48 and 53, pp.&nbsp;282–283).</strong> Writing the longitudinal diffusivity as <img src="https://latex.codecogs.com/png.latex?D%20=%20%5Cgamma%20D_I%20+%20%5Clambda%20u%20d_p"> and the transfer resistance as diffusion into a liquid film of thickness <img src="https://latex.codecogs.com/png.latex?d_f"> (eqs. 50–52):</p>
<p><img src="https://latex.codecogs.com/png.latex?H%20=%20%5Cunderbrace%7B2%5Cgamma%5Cfrac%7BD_I%7D%7Bu%7D%7D_%7BB/u%7D%0A%20%20%20%20+%20%5Cunderbrace%7B2%5Clambda%20d_p%7D_%7BA%7D%0A%20%20%20%20+%20%5Cunderbrace%7B%5Cfrac%7B8%7D%7B%5Cpi%5E2%7D%5C,%0A%20%20%20%20%20%20%5Cfrac%7BK%20F_I%20d_f%5E2%7D%7B%5Cleft(1+K%5Cfrac%7BF_I%7D%7BF_%7BII%7D%7D%5Cright)%5E2%20D_%7BII%7D%20F_%7BII%7D%7D%5C;u%7D_%7BCu%7D."></p>
<p>That is the van Deemter equation. Each of the three constants is a <em>product of printed quantities</em>, which is what makes the rest of this page possible: the paper inverts the relation to obtain <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20D_I">, <img src="https://latex.codecogs.com/png.latex?%5Clambda"> and <img src="https://latex.codecogs.com/png.latex?d_f">, and each inversion can be redone.</p>
<p><strong>The particle form (eq. 49, p.&nbsp;282)</strong>, used for the ion-exclusion column, where the resistance is inside a solid particle rather than a film:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BH%7D%7Bd_p%7D%20=%202%5Cgamma%5Cfrac%7BD_I%7D%7Bu%20d_p%7D%20+%202%5Clambda%20+%20C%5C,%5Cfrac%7Bu%20d_p%7D%7BD_I%7D,%0A%5Cqquad%0AC%20=%20%5Cfrac%7B%5Cdfrac%7BF_I%5E%7B2%7D%7D%7B75(1-F_I)%5E%7B2%7D%7D%0A%20%20%20%20%20%20%20%20+%20%5Cdfrac%7BF_I%20K%20D_I%7D%7B2%5Cpi%5E%7B2%7D(1-F_I)D_%7BII%7D%7D%7D%0A%20%20%20%20%20%20%20%20%7B%5Cleft(1+K%5Cdfrac%7BF_I%7D%7BF_%7BII%7D%7D%5Cright)%5E%7B2%7D%7D."></p>
<div id="b2d19a13" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:15.561724Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:15.561452Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:16.003122Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:16.002257Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-2">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb1-4">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm pyyaml</span></code></pre></div></div>
</div>
<div id="955dfe19" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:16.005084Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:16.004850Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:16.510700Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:16.509227Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys, urllib.request</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> p <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.path):</span>
<span id="cb2-5">    local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path.cwd()</span>
<span id="cb2-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>):</span>
<span id="cb2-7">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb2-8">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb2-9">        local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> local.parent</span>
<span id="cb2-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb2-11">        url <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb2-12">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>)</span>
<span id="cb2-13">        urllib.request.urlretrieve(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb2-14">        sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)</span>
<span id="cb2-15"></span>
<span id="cb2-16"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-17"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-18"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-19"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> eye_array, bmat</span>
<span id="cb2-20"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse.linalg <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> splu</span>
<span id="cb2-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.special <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> erf, erfinv</span>
<span id="cb2-22"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb2-23"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (construct_grad, construct_div, construct_convflux_upwind,</span>
<span id="cb2-24">                   interp_cntr_to_stagg_tvd, vanleer)</span>
<span id="cb2-25"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, load_data, load_meta, cite_data</span>
<span id="cb2-26"></span>
<span id="cb2-27">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J1.10-van-deemter-plate-height"</span></span>
<span id="cb2-28">np.random.seed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nothing here is stochastic; pinned anyway</span></span>
<span id="cb2-29">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-30">SQ2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb2-31"></span>
<span id="cb2-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Deviations are reported ONE way everywhere on this page:</span></span>
<span id="cb2-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     dev = (computed - printed) / printed</span></span>
<span id="cb2-34"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dev(computed, printed):</span>
<span id="cb2-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.asarray(computed, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.asarray(printed, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span></code></pre></div></div>
</div>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>What is printed, and what is not.</strong> The gas–liquid columns are described completely enough to evaluate eq. (53): both are 1.80 m long and 6 mm in internal diameter, the Celite carrier averages 30 µm and the Sterchamol 240 µm, <img src="https://latex.codecogs.com/png.latex?K%20F_I/F_%7BII%7D"> is given for all three column/solute combinations, and <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D"> in the oil film is estimated from its viscosity as <img src="https://latex.codecogs.com/png.latex?0.3%5Ctimes10%5E%7B-10%7D"> m² s⁻¹. What is <strong>not</strong> printed for those columns is <img src="https://latex.codecogs.com/png.latex?F_I"> itself. That matters, and the page returns to it.</p>
<p>The ion-exclusion column is described the other way round: <img src="https://latex.codecogs.com/png.latex?F_I%20=%20F_%7BII%7D%20=%200.4"> and <img src="https://latex.codecogs.com/png.latex?K%20=%201.3"> are printed (p.&nbsp;282), but its <strong>length is not</strong>, anywhere. The length this page uses is recovered from Table 3’s own columns - the value is computed and printed in <em>Table 3 checked against itself</em>, below - and is labelled an inference every time it appears.</p>
<p><strong>Assumptions carried from the paper, unchanged.</strong> Linear isotherm; constant <img src="https://latex.codecogs.com/png.latex?F_I">, <img src="https://latex.codecogs.com/png.latex?F_%7BII%7D"> and <img src="https://latex.codecogs.com/png.latex?u">; a single solute at low concentration; eddy diffusivity <img src="https://latex.codecogs.com/png.latex?E%20=%20%5Clambda%20u%20d_p"> (eq. 47); gas-phase transfer resistance neglected in the gas–liquid case, which the paper checks afterwards with its eq. (56).</p>
<p><strong>One convention this page does not adopt silently.</strong> The List of Symbols defines <img src="https://latex.codecogs.com/png.latex?u"> as the interstitial velocity and eqs. (29)/(30) use it that way, but Tables 2, 3 and 4 and Figs. 11–14 are all headed <em>superficial</em> velocity. Fig. 9 converts (its abscissa is <img src="https://latex.codecogs.com/png.latex?u%20F_I%20d_p">); the gas–liquid section does not appear to. The page carries both readings explicitly wherever the difference changes a number.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Five files, all transcription, no digitisation. The paper has <strong>four</strong> printed tables, not two — a point worth stating because the case notes for this build said two, and the ones that carry the plate height are Tables 3 and 4.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>file</th>
<th>what it is</th>
<th>who measured it</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>…table1-feed-volume</code></td>
<td>Table 1, p.&nbsp;277: elution-curve width and height against feed volume, 24 rows</td>
<td>the authors</td>
</tr>
<tr class="even">
<td><code>…table2-simpson-wheaton</code></td>
<td>Table 2, p.&nbsp;280: ion-exclusion elution curves, 13 rows</td>
<td><strong>Simpson &amp; Wheaton</strong>, restated</td>
</tr>
<tr class="odd">
<td><code>…table3-hetp</code></td>
<td>Table 3, p.&nbsp;281: plate heights derived from Table 2, 10 rows (one printed twice)</td>
<td>derived by the authors</td>
</tr>
<tr class="even">
<td><code>…table4-glc-hetp</code></td>
<td>Table 4, p.&nbsp;286: plate height against gas velocity, two columns, 24 rows</td>
<td>the authors</td>
</tr>
<tr class="odd">
<td><code>…printed-scalars</code></td>
<td>56 scalars from pp.&nbsp;277–287, tagged <code>input</code> or <code>result</code></td>
<td>—</td>
</tr>
</tbody>
</table>
<p><strong>How they were read.</strong> Every numeric cell was read on a 2× digit-scale crop of a 300 ppi render — the scan’s native resolution, checked with <code>pdfimages -list</code>. The text layer was used for nothing numeric: it misreads the journal <em>volume</em> in the document’s first line, printing <code>Vol 6</code> where the page prints <code>Vol. 5</code>. The 1956 Pergamon face sets the decimal point as a raised mid-dot which the scan drops to a space, so a cell reading <code>0 163 1100 0 27 0 30</code> is <code>0</code> <code>163</code> <code>1100</code> <code>0.27</code> <code>0.30</code>.</p>
<p><strong>Five readings were settled by arithmetic constraints the tables impose on themselves, not by pixel shape</strong>, and the sidecars name the constraint for each:</p>
<ul>
<li>Table 2’s velocity column is a <strong>doubling series</strong> — 0.046, 0.091, 0.182, 0.365, 0.73, each twice the last to within the printed rounding. That fixes <code>0 365</code> as 0.365 and not 0.865.</li>
<li>The 23 ml base width on that same row is the only reading consistent with the 125–156 plates Table 3 prints for it.</li>
<li>Table 3’s <code>11 -18</code> could be 11–18 or 1.1–1.8. <img src="https://latex.codecogs.com/png.latex?H"> divided by <img src="https://latex.codecogs.com/png.latex?H/d_p"> is the particle diameter, and it must agree with the mesh: 0.56/11 = 0.051 mm is a 200–400 mesh particle, 0.56/1.1 = 0.51 mm is a 30–40 mesh one. The row is 200–400 mesh.</li>
<li>The same test fixes <code>13 -14</code> and <code>16 -20</code> as integer pairs.</li>
<li>Table 3’s <code>0 56- 0 93</code> keeps its decimal points where <img src="https://latex.codecogs.com/png.latex?nH"> — the column length, which must be the same in every row — puts them.</li>
</ul>
<p><strong>Figs. 11 and 13 were consulted for three readings, spanning five cells of Table 4</strong>: the Celite <code>3 4</code>/<code>3 5</code> pair, the Sterchamol <code>3 2</code>/<code>3 3</code> pair, and <code>31</code> against <code>81</code> (the 1956 face sets <code>3</code> with a nearly flat top). No point was taken off either figure; what was used is that neither carries a point between <img src="https://latex.codecogs.com/png.latex?u%20=%205"> and 15 mm s⁻¹, and that Fig. 13’s rightmost point sits at <img src="https://latex.codecogs.com/png.latex?u%20%5Capprox%2031"> on an axis stopping just past it. <strong>All three are also forced from inside Table 4 alone</strong> — the stronger statement, and the one checked in code below. The check is run on the cells <em>not</em> in dispute, because testing whether the transcribed column ascends would assume the reading it is offered as evidence for: the undisputed cells of each block ascend, and of the four candidate readings of the disputed pair only the printed one can be inserted at its two positions without breaking that order. Position does <strong>not</strong> decide the third cell — 81 is larger than everything above it either way — and the page does not claim it does; eq. (55), which the authors fitted to these very rows, overshoots the printed plate height by more than a factor two at <img src="https://latex.codecogs.com/png.latex?u%20=%2081"> while landing within a few per cent of it at <img src="https://latex.codecogs.com/png.latex?u%20=%2031">.</p>
<p>Two of the 56 scalars, <img src="https://latex.codecogs.com/png.latex?n%20=%20240"> and <img src="https://latex.codecogs.com/png.latex?n%20=%20277">, are numbers <strong>printed as curve labels</strong> on Fig. 8 (p.&nbsp;280). They are read as printed text, not as point coordinates, and are used in exactly one place: to identify which of Table 3’s two printed endpoints came from which of the paper’s two routes.</p>
<p><strong>Simpson &amp; Wheaton’s paper is not on disk and was not consulted.</strong> Table 2 is van Deemter et al.’s restatement of it. Nothing on this page claims anything about the original.</p>
<div id="52006c67" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:16.513636Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:16.513002Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:16.649570Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:16.648832Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">T1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vandeemter-1956-table1-feed-volume.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-2">T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vandeemter-1956-table2-simpson-wheaton.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-3">T3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vandeemter-1956-table3-hetp.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-4">T4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vandeemter-1956-table4-glc-hetp.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-5">SC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vandeemter-1956-printed-scalars.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-6">P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(SC.quantity, SC.value))                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every printed scalar, by key</span></span>
<span id="cb3-7"></span>
<span id="cb3-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vandeemter-1956-table3-hetp.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb3-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table 1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows   Table 2 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows   "</span></span>
<span id="cb3-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 3 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows   Table 4 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T4)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows"</span>)</span>
<span id="cb3-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed scalars: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SC)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(SC.kind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'input'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inputs, "</span></span>
<span id="cb3-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(SC.kind<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'result'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> stated results), journal pp. "</span></span>
<span id="cb3-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(SC.page.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(SC.page.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-14"></span>
<span id="cb3-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The Celite sieve analysis printed inside Table 4's carrier column.</span></span>
<span id="cb3-16">sieve <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;40 um"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">24.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"40-20 um"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">52.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"20-10 um"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10-6 um"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;6 um"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>}</span>
<span id="cb3-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Celite sieve analysis as printed sums to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sieve.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb3-18"></span>
<span id="cb3-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The two constraints INTERNAL to Table 4 that settle its three ambiguous</span></span>
<span id="cb3-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># readings without Figs. 11/13 (see the text above).</span></span>
<span id="cb3-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#</span></span>
<span id="cb3-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The monotonicity test must be run on the cells NOT in dispute, otherwise it is</span></span>
<span id="cb3-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># circular: asking whether the transcribed column ascends, when the transcription</span></span>
<span id="cb3-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># already contains 3.4/3.5, can only ever answer True. So: establish the order on</span></span>
<span id="cb3-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the undisputed cells, then insert each candidate reading at its printed</span></span>
<span id="cb3-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># position and see which candidates survive.</span></span>
<span id="cb3-27">DISPUTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite"</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3</span>)}</span>
<span id="cb3-28">ALTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite"</span>:     [(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.5</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.5</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>)],   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the leading 3 read</span></span>
<span id="cb3-29">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>: [(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.3</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.3</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3</span>)]}   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># as an 8, in either cell</span></span>
<span id="cb3-30">ascends <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(np.asarray(v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb3-31"></span>
<span id="cb3-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Table 4's velocity column, tested on the cells that are NOT in dispute:"</span>)</span>
<span id="cb3-33">BLOCKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb3-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T4.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"solid_carrier"</span>):</span>
<span id="cb3-35">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g.superficial_velocity_mm_s.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb3-36">    pos <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.flatnonzero(np.isclose(v, x))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DISPUTED[c]]</span>
<span id="cb3-37">    keep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.delete(v, pos)</span>
<span id="cb3-38">    BLOCKS[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (v, pos, keep)</span>
<span id="cb3-39">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;11s}{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(keep)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> undisputed cells "</span></span>
<span id="cb3-40">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> keep)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  ascending: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ascends(keep)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-41"></span>
<span id="cb3-42">POS_SETTLES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb3-43"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c, (v, pos, keep) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BLOCKS.items():</span>
<span id="cb3-44">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: inserting each candidate reading at its two printed positions"</span>)</span>
<span id="cb3-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cand <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [DISPUTED[c]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ALTS[c]:</span>
<span id="cb3-46">        w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> w[pos[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]], w[pos[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cand</span>
<span id="cb3-47">        ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ascends(w)</span>
<span id="cb3-48">        POS_SETTLES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;=</span> (ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> DISPUTED[c]))</span>
<span id="cb3-49">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cand[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cand[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  whole column ascending: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ok<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-50">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'   &lt;- the reading used'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> DISPUTED[c] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   -&gt; position alone settles both pairs, and only the printed reading "</span></span>
<span id="cb3-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"survives: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>POS_SETTLES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-53"></span>
<span id="cb3-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The third ambiguous cell is NOT settled by position, and the page does not</span></span>
<span id="cb3-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pretend otherwise: 81 is larger than every cell above it either way. Same</span></span>
<span id="cb3-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># undisputed column as above, with only its last cell varied.</span></span>
<span id="cb3-57">v_31 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BLOCKS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb3-58">v_81 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v_31.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> v_81[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">81.0</span></span>
<span id="cb3-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   The last Sterchamol cell: reading it 31 leaves the undisputed column "</span></span>
<span id="cb3-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ascending (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ascends(v_31)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span>)</span>
<span id="cb3-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      and so does reading it 81 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ascends(v_81)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) - position does NOT decide "</span></span>
<span id="cb3-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"this one."</span>)</span>
<span id="cb3-63">h55 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq55_B_sterchamol"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq55_C_sterchamol"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u</span>
<span id="cb3-64">h31 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T4[(T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>)</span>
<span id="cb3-65">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T4.superficial_velocity_mm_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>)].hetp_n_butane_mm.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb3-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   eq (55), fitted by the authors to these rows, gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h55(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm at "</span></span>
<span id="cb3-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"u = 31 against the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h31<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(h55(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">31</span>), h31)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span>)</span>
<span id="cb3-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h55(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">81</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm at u = 81 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(h55(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">81</span>), h31)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) - which excludes "</span></span>
<span id="cb3-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the 81 reading from inside the table."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>van Deemter, J. J.; Zuiderweg, F. J.; Klinkenberg, A. (1956) — Chemical Engineering Science 5(6) 271-289 — doi:10.1016/0009-2509(56)80003-1 — table

Table 1  24 rows   Table 2  13 rows   Table 3  10 rows   Table 4  24 rows
printed scalars: 56 (35 inputs, 21 stated results), journal pp. 278-287

Celite sieve analysis as printed sums to 100.0 %

Table 4's velocity column, tested on the cells that are NOT in dispute:
   celite     10 undisputed cells [1.7, 2, 4.8, 5, 15, 15, 15, 15, 23, 23]  ascending: True
   sterchamol 10 undisputed cells [1.8, 2, 5, 5, 5, 17, 17, 17, 17, 31]  ascending: True
   celite: inserting each candidate reading at its two printed positions
       3.4 / 3.5   whole column ascending: True   &lt;- the reading used
       8.4 / 8.5   whole column ascending: False
       3.4 / 8.5   whole column ascending: False
       8.4 / 3.5   whole column ascending: False
   sterchamol: inserting each candidate reading at its two printed positions
       3.2 / 3.3   whole column ascending: True   &lt;- the reading used
       8.2 / 8.3   whole column ascending: False
       3.2 / 8.3   whole column ascending: False
       8.2 / 3.3   whole column ascending: False
   -&gt; position alone settles both pairs, and only the printed reading survives: True

   The last Sterchamol cell: reading it 31 leaves the undisputed column ascending (True),
      and so does reading it 81 (True) - position does NOT decide this one.
   eq (55), fitted by the authors to these rows, gives 1.79 mm at u = 31 against the printed 1.7 mm (+5%),
      and 4.14 mm at u = 81 (+144%) - which excludes the 81 reading from inside the table.</code></pre>
</div>
</div>
<section id="table-3-checked-against-itself-before-anything-is-fitted-to-it" class="level3">
<h3 class="anchored" data-anchor-id="table-3-checked-against-itself-before-anything-is-fitted-to-it">Table 3 checked against itself, before anything is fitted to it</h3>
<p>Table 3 prints <img src="https://latex.codecogs.com/png.latex?n">, <img src="https://latex.codecogs.com/png.latex?H"> and <img src="https://latex.codecogs.com/png.latex?H/d_p"> for the same experiment. Two of those three are enough to determine the third, so the table constrains itself twice over:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?nH"> is the column length, and must be the <strong>same in every row</strong> — even though no column length is printed anywhere in the paper;</li>
<li><img src="https://latex.codecogs.com/png.latex?H%20%5Cdiv%20(H/d_p)"> is the particle diameter, and must be the <strong>same for a given mesh</strong>, whatever the flow rate.</li>
</ul>
<p>Neither identity is used to build anything below. They are here because they are the only check available on a transcription of a table whose every cell is a range.</p>
<div id="c5de9b45" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:16.651825Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:16.651532Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:16.662579Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:16.661753Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Both printed ranges in a row run in OPPOSITE senses: the larger plate number</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pairs with the smaller plate height. That is what makes the product sharp.</span></span>
<span id="cb5-3">Lhi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3.n_plates_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T3.hetp_hi_mm</span>
<span id="cb5-4">Llo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3.n_plates_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T3.hetp_lo_mm</span>
<span id="cb5-5">L_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([Lhi.to_numpy(), Llo.to_numpy()])</span>
<span id="cb5-6">L_SW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(L_all))</span>
<span id="cb5-7"></span>
<span id="cb5-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Recovered column length  l = n H   (mm)"</span>)</span>
<span id="cb5-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mesh'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'u'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_lo*H_hi'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_hi*H_lo'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (_, r), a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(T3.iterrows(), Lhi, Llo):</span>
<span id="cb5-11">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>particle_mesh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>superficial_velocity_mm_s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7.3f}{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.1f}{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_SW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm, spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_all<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_all<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm "</span></span>
<span id="cb5-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(L_all.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>L_all.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % wide, against 2-sig-fig rounding "</span></span>
<span id="cb5-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on H of up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>T3.hetp_lo_mm)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)"</span>)</span>
<span id="cb5-15"></span>
<span id="cb5-16">dp_row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(T3.hetp_lo_mm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> T3.hetp_hi_mm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(T3.h_over_dp_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> T3.h_over_dp_hi))</span>
<span id="cb5-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Recovered particle diameter  d_p = H / (H/d_p)   (mm)"</span>)</span>
<span id="cb5-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> mesh, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> dp_row.groupby(T3.particle_mesh):</span>
<span id="cb5-19">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> mesh.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)]</span>
<span id="cb5-20">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mesh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mesh : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'  '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> g)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-21">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(g)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> row(s))"</span>)</span>
<span id="cb5-22">uniq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>T3.duplicated(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"particle_mesh"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial_velocity_mm_s"</span>])</span>
<span id="cb5-23">DP_50_100 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dp_row[(T3.particle_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50-100"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> uniq].mean())</span>
<span id="cb5-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  50-100 mesh, the only series with a flow sweep: d_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DP_50_100<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm "</span></span>
<span id="cb5-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(five distinct flow rates, row spread "</span></span>
<span id="cb5-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dp_row[(T3.particle_mesh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'50-100'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> uniq]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-"</span></span>
<span id="cb5-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dp_row[(T3.particle_mesh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'50-100'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> uniq]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Recovered column length  l = n H   (mm)
    mesh      u  n_lo*H_hi  n_hi*H_lo
 200-400  0.091      558.0      560.0
  50-100  0.091      552.0      554.0
   50-70  0.091      560.0      549.0
   30-40  0.091      561.0      558.0
   16-20  0.091      560.0      539.0
  50-100  0.046      577.5      555.6
  50-100  0.091      552.0      554.0
  50-100  0.182      566.4      567.0
  50-100  0.365      562.5      561.6
  50-100  0.730      561.6      560.7

  mean 558.5 mm, spread 539-578 mm (7.1 % wide, against 2-sig-fig rounding on H of up to 8.9 %)

Recovered particle diameter  d_p = H / (H/d_p)   (mm)
     16-20 mesh : 1.0000   (mean 1.0000, 1 row(s))
   200-400 mesh : 0.0514   (mean 0.0514, 1 row(s))
     30-40 mesh : 0.5000   (mean 0.5000, 1 row(s))
    50-100 mesh : 0.2161  0.2231  0.2161  0.2185  0.2250  0.2177   (mean 0.2194, 6 row(s))
     50-70 mesh : 0.2484   (mean 0.2484, 1 row(s))

  50-100 mesh, the only series with a flow sweep: d_p = 0.2201 mm (five distinct flow rates, row spread 0.2161-0.2250)</code></pre>
</div>
</div>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Two things are built here. The first is a <strong>symbolic</strong> reconstruction of the paper’s chain of equations, which needs no solver and is what most of this page rests on. The second is the <strong>transient two-phase column</strong> of eqs. (29)/(30), solved with pymrm, which is the only thing on the page that can test eq. (38) without using eq. (38).</p>
<section id="the-column" class="level3">
<h3 class="anchored" data-anchor-id="the-column">The column</h3>
<p><code>Column</code> assembles the operators once, in <code>__init__</code>, and never inside a time step. Only <img src="https://latex.codecogs.com/png.latex?c_I"> carries a spatial operator; <img src="https://latex.codecogs.com/png.latex?c_%7BII%7D"> exchanges with it pointwise, so the two fields are assembled monolithically with <code>bmat</code> rather than through a shared axis — the immobile phase has no flux and no gradient, and giving it one would be a modelling error dressed as convenience.</p>
<p>The inlet is a Danckwerts condition, written on the <strong>outward</strong> normal (<img src="https://latex.codecogs.com/png.latex?n%20=%20-z"> at the left face, so <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20c/%5Cpartial%20n%20=%20-%5Cpartial%20c/%5Cpartial%20z">):</p>
<p><img src="https://latex.codecogs.com/png.latex?u%20c_I%20-%20D%5Cfrac%7B%5Cpartial%20c_I%7D%7B%5Cpartial%20z%7D%5Cbigg%7C_%7B0%7D%20=%20u%5C,c_%7B%5Ctext%7Bin%7D%7D(t)%0A%5C;%5CLongrightarrow%5C;%0AD%5Cfrac%7B%5Cpartial%20c_I%7D%7B%5Cpartial%20n%7D%20+%20u%5C,c_I%20=%20u%5C,c_%7B%5Ctext%7Bin%7D%7D(t)%0A%5C;%5CLongrightarrow%5C;%20a%20=%20D,%5C;%20b%20=%20u,%5C;%20d%20=%20u%5C,c_%7B%5Ctext%7Bin%7D%7D."></p>
<p>Only <img src="https://latex.codecogs.com/png.latex?d"> varies in time, and the boundary vectors are linear in <img src="https://latex.codecogs.com/png.latex?d">, so they are built once for <img src="https://latex.codecogs.com/png.latex?c_%7B%5Ctext%7Bin%7D%7D%20=%201"> and scaled — the matrices stay constant, which is the whole point of the convention.</p>
<div id="cced8982" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:16.663965Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:16.663758Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:16.674877Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:16.674117Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> Column:</span>
<span id="cb7-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""van Deemter eqs (29)-(30): a linear two-phase chromatographic column.</span></span>
<span id="cb7-3"></span>
<span id="cb7-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Fields are (n_z, 1) per phase - never a bare (n_z,) - and the two phases are</span></span>
<span id="cb7-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    stacked into one 2 n_z system.  Convection is upwind with an optional van</span></span>
<span id="cb7-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Leer deferred correction; time stepping is Crank-Nicolson.</span></span>
<span id="cb7-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb7-8"></span>
<span id="cb7-9">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__init__</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, u, D, alpha, K, F_I, F_II, L, n_z, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>vanleer,</span>
<span id="cb7-10">                 nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, bc_left<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb7-11">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.__dict__.update(u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>u, D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alpha, K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K, F_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>F_I, F_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>F_II,</span>
<span id="cb7-12">                             L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>L, n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>limiter)</span>
<span id="cb7-13">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, L, n_z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb7-14">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb7-15">        shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (n_z, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># never (n_z,): see AGENTS.md</span></span>
<span id="cb7-16">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># outward normal, so both dicts read   a dc/dn + b c = d</span></span>
<span id="cb7-17">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = 0  Danckwerts inflow  u c - D dc/dz = u c_in  -&gt; a=D, b=u, d=u*1</span></span>
<span id="cb7-18">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   z = L  zero-gradient outflow                      -&gt; a=1, b=0, d=0</span></span>
<span id="cb7-19">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (bc_left <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: D, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: u, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: u},</span>
<span id="cb7-20">                   {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>})</span>
<span id="cb7-21">        conv, conv_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_convflux_upwind(shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c,</span>
<span id="cb7-22">                                                  <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>u)</span>
<span id="cb7-23">        grad, grad_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_grad(shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc)</span>
<span id="cb7-24">        div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> construct_div(shape, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nu=0: Cartesian slab</span></span>
<span id="cb7-25">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> div</span>
<span id="cb7-26">        T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (conv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> grad)                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># transport of c_I</span></span>
<span id="cb7-27">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bvec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.asarray((div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (conv_bc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> grad_bc)).todense()).ravel()</span>
<span id="cb7-28">        I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eye_array(n_z, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)</span>
<span id="cb7-29">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d/dt [c_I ; c_II] = M [c_I ; c_II] + b(t)</span></span>
<span id="cb7-30">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bmat([[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_I) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> I, (alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_I) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> I],</span>
<span id="cb7-31">                       [(alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_II) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> I, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> F_II) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> I]], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)</span>
<span id="cb7-32">        <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.v_face <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.full((n_z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), u)</span>
<span id="cb7-33"></span>
<span id="cb7-34">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _corr(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, cI):</span>
<span id="cb7-35">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""van Leer deferred correction on the convective flux (0 if limiter None)."""</span></span>
<span id="cb7-36">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.limiter <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb7-37">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.zeros(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.n_z)</span>
<span id="cb7-38">        _, dg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> interp_cntr_to_stagg_tvd(cI.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_f, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c,</span>
<span id="cb7-39">                                         <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bc, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.v_face,</span>
<span id="cb7-40">                                         tvd_limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.limiter)</span>
<span id="cb7-41">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.asarray(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.div <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.v_face <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dg.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))).ravel()</span>
<span id="cb7-42"></span>
<span id="cb7-43">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>, t_end, dt, t_sig, stations, sweeps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb7-44">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Gaussian inlet pulse of width t_sig centred at 5 t_sig (so that it is</span></span>
<span id="cb7-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        smooth, resolved, and negligible at t = 0); record c_I at the stations.</span></span>
<span id="cb7-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        The two-station reading is independent of the pulse, but a SMOOTH one</span></span>
<span id="cb7-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        keeps the time quadrature from being O(dt) on a discontinuity.</span></span>
<span id="cb7-48"></span>
<span id="cb7-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        theta = 0.5 is Crank-Nicolson and is the only setting used for a</span></span>
<span id="cb7-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        reported number; theta = 1 (backward Euler) exists so that the time</span></span>
<span id="cb7-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">        order can be broken deliberately in the refinement study."""</span></span>
<span id="cb7-52">        n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.n_z</span>
<span id="cb7-53">        lu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> splu((eye_array(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.M).tocsc())</span>
<span id="cb7-54">        c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n)</span>
<span id="cb7-55">        idx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> z))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> stations]</span>
<span id="cb7-56">        zs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.x_c[idx]</span>
<span id="cb7-57">        nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(t_end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dt))</span>
<span id="cb7-58">        rec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(idx)))</span>
<span id="cb7-59">        ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.arange(nt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dt</span>
<span id="cb7-60">        cin <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t_sig) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t_sig) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb7-61">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n)</span>
<span id="cb7-62">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(nt):</span>
<span id="cb7-63">            b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bvec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cin(k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dt), np.zeros(n)])</span>
<span id="cb7-64">            b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.bvec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cin((k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dt), np.zeros(n)])</span>
<span id="cb7-65">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(sweeps):</span>
<span id="cb7-66">                rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> theta) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>.M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> g</span>
<span id="cb7-67">                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> theta) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b1))</span>
<span id="cb7-68">                cn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lu.solve(rhs)</span>
<span id="cb7-69">                g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">self</span>._corr(cn[:n]), np.zeros(n)])</span>
<span id="cb7-70">            c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cn</span>
<span id="cb7-71">            rec[k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c[:n][idx]</span>
<span id="cb7-72">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ts, rec, zs</span>
<span id="cb7-73"></span>
<span id="cb7-74"></span>
<span id="cb7-75"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cumulants(ts, y):</span>
<span id="cb7-76">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""m0, mean, variance, third and fourth central-moment cumulants of a curve."""</span></span>
<span id="cb7-77">    m0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.trapezoid(y, ts)</span>
<span id="cb7-78">    m1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.trapezoid(ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y, ts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m0</span>
<span id="cb7-79">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m1</span>
<span id="cb7-80">    k2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.trapezoid(d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y, ts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m0</span>
<span id="cb7-81">    k3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.trapezoid(d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y, ts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m0</span>
<span id="cb7-82">    m4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.trapezoid(d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y, ts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m0</span>
<span id="cb7-83">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m0, m1, k2, k3, m4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> k2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb7-84"></span>
<span id="cb7-85"></span>
<span id="cb7-86"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> plate_height(Kc, zs):</span>
<span id="cb7-87">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""H from TWO stations: differences cancel every entrance and exit effect."""</span></span>
<span id="cb7-88">    dz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb7-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> dz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span></code></pre></div></div>
</div>
</section>
<section id="the-papers-chain-verified-symbolically" class="level3">
<h3 class="anchored" data-anchor-id="the-papers-chain-verified-symbolically">The paper’s chain, verified symbolically</h3>
<p>Four steps. For each of them the paper names the route — which equations are introduced into which — but never prints the manipulation, and none of the four is checked anywhere in the source. All four are exact.</p>
<div id="44b6a57f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:16.677127Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:16.676944Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:17.772895Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:17.772083Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1">s_, D_, u_, z_, a_, FI_, FII_, K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(</span>
<span id="cb8-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s D u z alpha F_I F_II K"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-3">dp_, DI_, DII_, g_, l_, df_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(</span>
<span id="cb8-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p D_I D_II gamma lambda d_f"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-5"></span>
<span id="cb8-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- what the paper prints -------------------------------------------------</span></span>
<span id="cb8-7">beta_34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> FII_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_))                                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (34)</span></span>
<span id="cb8-8">sig1sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> z_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>                                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (34)</span></span>
<span id="cb8-9">sig2sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> beta_34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FII_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> z_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u_)    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (34)</span></span>
<span id="cb8-10">H_38 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FII_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (38)</span></span>
<span id="cb8-11">C_49 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">75</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb8-12">         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_))</span>
<span id="cb8-13">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FII_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)                                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (49)</span></span>
<span id="cb8-14">H_49 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> l_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> C_49 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DI_         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (49)</span></span>
<span id="cb8-15">H_52 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> df_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-16">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FII_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FII_))                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (52)</span></span>
<span id="cb8-17"></span>
<span id="cb8-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 1. (38) is what (34) implies, through H = z sigma_t^2 / t_R^2 ---------</span></span>
<span id="cb8-19">t_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> z_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> beta_34)</span>
<span id="cb8-20">H_from_34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(z_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((sig1sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sig2sq) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> beta_34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t_R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb8-21">r1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(H_from_34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H_38)</span>
<span id="cb8-22"></span>
<span id="cb8-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 2. (49) and its C are (38) with (45), (46) and (48) substituted -------</span></span>
<span id="cb8-24">a_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dp_                                                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (46)</span></span>
<span id="cb8-25">inv_alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (DI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb8-26">             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (DII_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_p))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (45)</span></span>
<span id="cb8-27">D_48 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> l_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_                                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (47),(48)</span></span>
<span id="cb8-28">r2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.simplify(H_38.subs({D_: D_48, a_: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> inv_alpha}) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dp_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H_49)</span>
<span id="cb8-29"></span>
<span id="cb8-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 3. (52) is (38) with the film resistance (41),(50),(51) --------------</span></span>
<span id="cb8-31">alpha_II <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Rational(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FII_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> df_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (51)</span></span>
<span id="cb8-32">r3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(H_38.subs(a_, alpha_II <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> K_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H_52)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1/alpha = K/alpha_II</span></span>
<span id="cb8-33"></span>
<span id="cb8-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- 4. a route the paper never takes: Laplace transform of (29)/(30) ------</span></span>
<span id="cb8-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># c_I(z,s) ~ exp(-lambda(s) z) with  D lam^2 + u lam - Phi(s) = 0, so the</span></span>
<span id="cb8-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cumulants of the residence time are exactly linear in z.  H = kappa2/kappa1^2.</span></span>
<span id="cb8-37">Phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FI_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (s_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FII_))</span>
<span id="cb8-38">lam_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.sqrt(u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Phi)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_)</span>
<span id="cb8-39">ser <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.expand(sp.series(lam_s, s_, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>).removeO())</span>
<span id="cb8-40">kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [sp.simplify(ser.coeff(s_, m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.factorial(m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-41">       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)]                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kappa_1..kappa_4 per unit length</span></span>
<span id="cb8-42">r4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(kap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H_38)</span>
<span id="cb8-43"></span>
<span id="cb8-44">CHAIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(34) -&gt; (38)   H = z sigma_t^2 / t_R^2"</span>, r1),</span>
<span id="cb8-45">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(38)+(45,46,48) -&gt; (49) and its C"</span>, r2),</span>
<span id="cb8-46">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(38)+(41,50,51) -&gt; (52)"</span>, r3),</span>
<span id="cb8-47">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Laplace cumulants of (29),(30) -&gt; (38)"</span>, r4)]</span>
<span id="cb8-48"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CHAIN:</span>
<span id="cb8-49">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;42s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> residual = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-50">CHAIN_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CHAIN))</span>
<span id="cb8-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CHAIN_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CHAIN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact"</span>)</span>
<span id="cb8-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  kappa_1 / z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>simplify(kap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  kappa_3 / z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>factor(kap[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  kappa_4 / z comes out of the same expansion (taken to s^4); it is used in"</span>)</span>
<span id="cb8-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  *What pymrm adds*, so the excess kurtosis there rests on no PDE cumulant."</span>)</span>
<span id="cb8-56">kap_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.lambdify((D_, u_, a_, FI_, FII_, K_), kap, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numpy"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  (34) -&gt; (38)   H = z sigma_t^2 / t_R^2     residual = 0
  (38)+(45,46,48) -&gt; (49) and its C          residual = 0
  (38)+(41,50,51) -&gt; (52)                    residual = 0
  Laplace cumulants of (29),(30) -&gt; (38)     residual = 0

  4 of 4 exact

  kappa_1 / z = (F_I*K + F_II)/(F_I*K*u)
  kappa_3 / z = 6*(2*D**2*F_I**3*K**3*alpha**2 + 6*D**2*F_I**2*F_II*K**2*alpha**2 + 6*D**2*F_I*F_II**2*K*alpha**2 + 2*D**2*F_II**3*alpha**2 + 2*D*F_I**2*F_II**2*K*alpha*u**2 + 2*D*F_I*F_II**3*alpha*u**2 + F_I**2*F_II**3*u**4)/(F_I**3*K**3*alpha**2*u**5)
  kappa_4 / z comes out of the same expansion (taken to s^4); it is used in
  *What pymrm adds*, so the excess kurtosis there rests on no PDE cumulant.</code></pre>
</div>
</div>
</section>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="eq.-54-against-table-4-a-goodness-of-fit-and-a-null-baseline-beside-it" class="level3">
<h3 class="anchored" data-anchor-id="eq.-54-against-table-4-a-goodness-of-fit-and-a-null-baseline-beside-it">1. Eq. (54) against Table 4 — a goodness of fit, and a null baseline beside it</h3>
<p><strong>The coefficients of eqs. (54) and (55) were fitted to these very rows.</strong> Nothing below is a test of the van Deemter equation; it is a measure of how well three numbers describe twelve points, and it is reported that way. The null baseline is the best constant <img src="https://latex.codecogs.com/png.latex?H"> — the model you get by ignoring velocity entirely, which is the thing the paper’s Fig. 11 exists to refute.</p>
<p>The minimum of each curve is <strong>root-found</strong> on <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DH/%5Cmathrm%7Bd%7Du%20=%200"> and then checked against the closed form <img src="https://latex.codecogs.com/png.latex?u_%7B%5Ctext%7Bopt%7D%7D%20=%20%5Csqrt%7BB/C%7D">, <img src="https://latex.codecogs.com/png.latex?H_%7B%5Cmin%7D%20=%20A%20+%202%5Csqrt%7BBC%7D">. That agreement is an identity, not evidence, and is labelled as one; its only job is to guarantee no reported optimum is a sampled maximum of a sweep.</p>
<div id="2b7e57ab" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:17.774442Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:17.774289Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:17.785288Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:17.784576Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">FITS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb10-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>:    (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_n_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_A_n_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_n_butane"</span>]),</span>
<span id="cb10-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>:  (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_iso_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_A_iso_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_iso_butane"</span>]),</span>
<span id="cb10-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>: (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq55_B_sterchamol"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq55_C_sterchamol"</span>]),</span>
<span id="cb10-5">}</span>
<span id="cb10-6">SERIES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb10-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>: (T4[T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite"</span>].superficial_velocity_mm_s.to_numpy(),</span>
<span id="cb10-8">                         T4[T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite"</span>].hetp_n_butane_mm.to_numpy()),</span>
<span id="cb10-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>: (T4[T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite"</span>].superficial_velocity_mm_s.to_numpy(),</span>
<span id="cb10-10">                           T4[T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite"</span>].hetp_iso_butane_mm.to_numpy()),</span>
<span id="cb10-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>: (T4[T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>].superficial_velocity_mm_s.to_numpy(),</span>
<span id="cb10-12">                             T4[T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>].hetp_n_butane_mm.to_numpy()),</span>
<span id="cb10-13">}</span>
<span id="cb10-14">vd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u, B, A, C: B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u</span>
<span id="cb10-15"></span>
<span id="cb10-16">fitstat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb10-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'series'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;22}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rmse'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bias'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max|r|'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'null rmse'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'R^2'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'u_opt'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H_min'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, (B, A, C) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FITS.items():</span>
<span id="cb10-20">    u, h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SERIES[name]</span>
<span id="cb10-21">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vd(u, B, A, C) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h</span>
<span id="cb10-22">    rmse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt((r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb10-23">    null <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(((h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h.mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb10-24">    uo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> C, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb10-25">    Hm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vd(uo, B, A, C)</span>
<span id="cb10-26">    fitstat[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(rmse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rmse, bias<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.mean()), maxr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb10-27">                         null<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>null, R2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h.mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(),</span>
<span id="cb10-28">                         u_opt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(uo), H_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Hm), N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(u),</span>
<span id="cb10-29">                         u_closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> C)), H_closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> C)))</span>
<span id="cb10-30">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fitstat[name]</span>
<span id="cb10-31">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;22}{</span>f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3}{</span>rmse<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.3f}{</span>f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bias'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+8.3f}{</span>f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'maxr'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-32">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>null<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.3f}{</span>f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'R2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.3f}{</span>uo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.3f}{</span>Hm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-33"></span>
<span id="cb10-34">u17 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_hetp_at_17"</span>]</span>
<span id="cb10-35">h17 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vd(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">17.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>FITS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>])</span>
<span id="cb10-36">rows17 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T4[(T4.solid_carrier <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T4.superficial_velocity_mm_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">17</span>)]</span>
<span id="cb10-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   The p. 286 footnote says the Sterchamol H.E.T.P. at ~17 mm/s is 'about "</span></span>
<span id="cb10-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>u17<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm'."</span>)</span>
<span id="cb10-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Eq (55) at u = 17 gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h17<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm; Table 4's four rows at that velocity "</span></span>
<span id="cb10-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"average </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rows17<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>hetp_n_butane_mm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm."</span>)</span>
<span id="cb10-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   The footnote quotes the measurement, not the formula "</span></span>
<span id="cb10-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(h17, u17)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> apart)."</span>)</span>
<span id="cb10-43"></span>
<span id="cb10-44">ROOT_ID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_opt"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_closed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.values())</span>
<span id="cb10-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  root-found vs closed-form optimum: max relative difference </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROOT_ID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (STRUCTURAL - same three constants both ways)"</span>)</span>
<span id="cb10-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  every fit beats the best constant H by a factor "</span></span>
<span id="cb10-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'null'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rmse'</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to "</span></span>
<span id="cb10-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'null'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rmse'</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in rmse"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>series                  N    rmse    bias  max|r|  null rmse     R^2   u_opt   H_min
Celite, n-butane       12   0.245  -0.001   0.417      1.259   0.962  13.416   1.642
Celite, iso-butane     12   0.282  +0.046   0.512      0.921   0.906  10.000   2.400
Sterchamol, n-butane   12   0.150  +0.113   0.350      0.930   0.974  12.247   1.225

   The p. 286 footnote says the Sterchamol H.E.T.P. at ~17 mm/s is 'about 1.2 mm'.
   Eq (55) at u = 17 gives 1.291 mm; Table 4's four rows at that velocity average 1.175 mm.
   The footnote quotes the measurement, not the formula (+8% apart).

  root-found vs closed-form optimum: max relative difference 2.22e-16  (STRUCTURAL - same three constants both ways)
  every fit beats the best constant H by a factor 3.3 to 6.2 in rmse</code></pre>
</div>
</div>
<section id="the-one-term-the-paper-says-it-could-not-determine" class="level4">
<h4 class="anchored" data-anchor-id="the-one-term-the-paper-says-it-could-not-determine">The one term the paper says it could not determine</h4>
<p>Eq. (55) has no constant: “the absence of a constant in the right hand member is not a definite proof that eddy diffusion does not in principle occur … the constant could not be determined accurately. It should not differ much from zero, however.”</p>
<p>That is a checkable statement, and the Sterchamol rows are enough to check it. Refitting all three constants freely gives a value and a standard error for <img src="https://latex.codecogs.com/png.latex?A">.</p>
<div id="46c14323" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:17.786613Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:17.786462Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:17.793104Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:17.792346Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> refit(u, h, terms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)):</span>
<span id="cb12-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Least squares on H = B/u + A + C u, with standard errors."""</span></span>
<span id="cb12-3">    cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> u, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>: np.ones_like(u), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>: u}</span>
<span id="cb12-4">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([cols[t] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> terms]).T</span>
<span id="cb12-5">    beta, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, h, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb12-6">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> beta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h</span>
<span id="cb12-7">    dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X.shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb12-8">    s2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dof</span>
<span id="cb12-9">    se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(np.diag(np.linalg.inv(X.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> X)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s2)</span>
<span id="cb12-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(terms, beta)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(terms, se)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt((r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb12-11"></span>
<span id="cb12-12">us_, hs_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SERIES[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>]</span>
<span id="cb12-13">b3, se3, rms3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> refit(us_, hs_)</span>
<span id="cb12-14">b2, se2, rms2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> refit(us_, hs_, (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>))</span>
<span id="cb12-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, refitted freely (this page's fit, not the paper's):"</span>)</span>
<span id="cb12-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>):</span>
<span id="cb12-17">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+9.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>se3[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3[k]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>se3[k]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb12-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   rmse </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rms3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm, against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rms2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm with A forced to zero, "</span></span>
<span id="cb12-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fitstat[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sterchamol, n-butane'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rmse'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm for eq (55) as printed"</span>)</span>
<span id="cb12-20">A_STER_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>])</span>
<span id="cb12-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +/- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>se3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm: consistent with zero "</span></span>
<span id="cb12-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(|t| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(A_STER_T)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), so the paper's statement stands. It is also "</span></span>
<span id="cb12-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"consistent with the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq54_A_n_butane'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm of the Celite column, "</span></span>
<span id="cb12-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"which is the comparison the paper actually wants to make and cannot."</span>)</span>
<span id="cb12-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Eq (55) as printed sits </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fitstat[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Sterchamol, n-butane'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bias'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm "</span></span>
<span id="cb12-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"above the rows on average - a systematic offset a free constant absorbs."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Sterchamol, refitted freely (this page's fit, not the paper's):
   B =   +7.1325 +/- 0.2925   (t = +24.38)
   A =   +0.0149 +/- 0.1178   (t = +0.13)
   C =   +0.0452 +/- 0.0056   (t = +8.02)
   rmse 0.0902 mm, against 0.0903 mm with A forced to zero, and 0.1495 mm for eq (55) as printed

  A = +0.015 +/- 0.118 mm: consistent with zero (|t| = 0.13), so the paper's statement stands. It is also consistent with the 0.3 mm of the Celite column, which is the comparison the paper actually wants to make and cannot.
  Eq (55) as printed sits +0.113 mm above the rows on average - a systematic offset a free constant absorbs.</code></pre>
</div>
</div>
<div id="4b7046cd" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:17.794320Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:17.794168Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.173865Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.173466Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.3</span>))</span>
<span id="cb14-2">ufine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">33.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb14-3">cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>,</span>
<span id="cb14-4">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>}</span>
<span id="cb14-5">mk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>}</span>
<span id="cb14-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, (B, A, C) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FITS.items():</span>
<span id="cb14-7">    u, h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SERIES[name]</span>
<span id="cb14-8">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(u, h, mk[name], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cols[name], ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Table 4)"</span>)</span>
<span id="cb14-9">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(ufine, vd(ufine, B, A, C), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cols[name], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>)</span>
<span id="cb14-10">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fitstat[name]</span>
<span id="cb14-11">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_opt"</span>], f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H_min"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cols[name], ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span>
<span id="cb14-12">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial gas velocity $u$  (mm s$^{-1}$)"</span>,</span>
<span id="cb14-13">            ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H.E.T.P.  $H$  (mm)"</span>, ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>),</span>
<span id="cb14-14">            title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 and eqs. (54)/(55) — a FIT, not a test"</span>)</span>
<span id="cb14-15">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb14-16"></span>
<span id="cb14-17">B, A, C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FITS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>]</span>
<span id="cb14-18">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ufine, np.full_like(ufine, A), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ mm (eddy)"</span>)</span>
<span id="cb14-19">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ufine, B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ufine, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$B/u$, $B = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ mm$^2$s$^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-1</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>)</span>
<span id="cb14-20">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ufine, C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ufine, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-."</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$Cu$, $C = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s"</span>)</span>
<span id="cb14-21">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ufine, vd(ufine, B, A, C), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sum"</span>)</span>
<span id="cb14-22">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(fitstat[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_opt"</span>], fitstat[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H_min"</span>],</span>
<span id="cb14-23">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>)</span>
<span id="cb14-24">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial gas velocity $u$  (mm s$^{-1}$)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"contribution (mm)"</span>,</span>
<span id="cb14-25">            ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>), title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite / $n$-butane: the three terms separately"</span>)</span>
<span id="cb14-26">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb14-27">plt.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.10-van-deemter-plate-height/index_files/figure-html/cell-10-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="the-film-thickness-three-times" class="level3">
<h3 class="anchored" data-anchor-id="the-film-thickness-three-times">2. The film thickness, three times</h3>
<p>The paper inverts the <img src="https://latex.codecogs.com/png.latex?C"> term of eq. (53) to get the effective liquid film thickness, and reports it twice — “It is found from both curves that <img src="https://latex.codecogs.com/png.latex?d_f%20%5Capprox%2010%5C%20%5Cmu">” for the Celite column, and <img src="https://latex.codecogs.com/png.latex?d_f%20=%209%5C%20%5Cmu"> for Sterchamol. Since <img src="https://latex.codecogs.com/png.latex?KF_I/F_%7BII%7D"> is printed for all three cases and <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D"> for the oil is printed once, each inversion can be redone from printed numbers only:</p>
<p><img src="https://latex.codecogs.com/png.latex?d_f%5E2%20=%20%5Cfrac%7B%5Cpi%5E2%7D%7B8%7D%5C,%5Cfrac%7BC%5C,(1+x)%5E2%5C,D_%7BII%7D%7D%7Bx%7D,%0A%5Cqquad%20x%20%5Cequiv%20K%5Cfrac%7BF_I%7D%7BF_%7BII%7D%7D."></p>
<p>The three cases share <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D"> but have three different <img src="https://latex.codecogs.com/png.latex?x"> and two different <img src="https://latex.codecogs.com/png.latex?C">, so they are three genuinely different arithmetic routes to the same physical quantity.</p>
<div id="1b623fed" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.175934Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.175773Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.180452Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.179929Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">DII_FILM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_II_liquid_film"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># m2/s -&gt; mm2/s</span></span>
<span id="cb15-2">CASES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_n_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_n_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f_celite"</span>]),</span>
<span id="cb15-3">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_iso_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_iso_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f_celite"</span>]),</span>
<span id="cb15-4">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq55_C_sterchamol"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_sterchamol"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f_sterchamol"</span>])]</span>
<span id="cb15-5"></span>
<span id="cb15-6">df_um <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb15-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'case'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;22}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'C (s)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'K F_I/F_II'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'d_f (um)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, C, x, printed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES:</span>
<span id="cb15-9">    df2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_FILM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> x</span>
<span id="cb15-10">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(df2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mm -&gt; um</span></span>
<span id="cb15-11">    df_um[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d)</span>
<span id="cb15-12">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;22}{</span>C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.2f}{</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12.3f}{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10.3f}{</span>printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9.0f}{</span>dev(d, printed)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+9.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-13"></span>
<span id="cb15-14">DF_MAX_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(df_um[n], p)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, _, _, p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES)</span>
<span id="cb15-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  worst deviation from the printed value: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DF_MAX_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the two Celite determinations differ from each other by "</span></span>
<span id="cb15-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Celite, iso-butane'</span>], df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Celite, n-butane'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - "</span></span>
<span id="cb15-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"which is what 'found from both curves that d_f approx 10 mu' means, "</span></span>
<span id="cb15-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"quantified."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>case                     C (s)  K F_I/F_II  d_f (um)  printed      dev
Celite, n-butane          0.05       0.019    10.057       10    +0.6%
Celite, iso-butane        0.08       0.028    10.571       10    +5.7%
Sterchamol, n-butane      0.05       0.026     8.656        9    -3.8%

  worst deviation from the printed value: 5.7%
  the two Celite determinations differ from each other by 5.1% - which is what 'found from both curves that d_f approx 10 mu' means, quantified.</code></pre>
</div>
</div>
</section>
<section id="eq.-56-where-the-resistance-sits-and-the-papers-own-check-on-it" class="level3">
<h3 class="anchored" data-anchor-id="eq.-56-where-the-resistance-sits-and-the-papers-own-check-on-it">3. Eq. (56): where the resistance sits, and the paper’s own check on it</h3>
<p>Having assumed the gas-phase resistance away, the paper checks it on p.&nbsp;287 with</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7B100%7D%5Cleft(%5Cfrac%7Bd_p%7D%7Bd_f%7D%5Cright)%5E2%5Cfrac%7BD_%7BII%7D%7D%7BD_I%7D,"></p>
<p>reporting the coefficient as <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D/(100%20D_I)%20=%203.3%5Ctimes10%5E%7B-8%7D"> and the two ratios as <img src="https://latex.codecogs.com/png.latex?3%5Ctimes10%5E%7B-7%7D"> and <img src="https://latex.codecogs.com/png.latex?2.5%5Ctimes10%5E%7B-5%7D">. All three come out of printed numbers with no freedom at all, so they are the cleanest transcription check on the page — and the Sterchamol one is sharper when this page’s own <img src="https://latex.codecogs.com/png.latex?d_f"> is used than when the paper’s rounded 9 µm is.</p>
<div id="e8311f94" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.182140Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.181993Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.187037Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.186529Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">coef <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_II_liquid_film"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_I_gilliland"</span>])</span>
<span id="cb17-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"D_II / (100 D_I) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>coef<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'D_II_over_100_D_I'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-3">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(coef, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'D_II_over_100_D_I'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-4"></span>
<span id="cb17-5">R56 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb17-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, dp_um, df_used, printed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (</span>
<span id="cb17-7">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite,     d_f = 10 um printed"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite_dp"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f_celite"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio56_celite"</span>]),</span>
<span id="cb17-8">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite,     d_f from eq (53)"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite_dp"</span>], df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio56_celite"</span>]),</span>
<span id="cb17-9">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, d_f = 9 um printed"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_dp"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f_sterchamol"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio56_sterchamol"</span>]),</span>
<span id="cb17-10">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, d_f from eq (53)"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_dp"</span>], df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio56_sterchamol"</span>])):</span>
<span id="cb17-11">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> coef <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (dp_um <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> df_used) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb17-12">    R56[label] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r)</span>
<span id="cb17-13">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;34}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ratio = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(r, printed)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+7.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-14"></span>
<span id="cb17-15">d_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(coef)</span>
<span id="cb17-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  film thickness at which the two resistances are EQUAL: "</span></span>
<span id="cb17-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"d_f/d_p = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d_eq<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  What that tests is an ORDER-OF-MAGNITUDE sentence quoted to one significant"</span>)</span>
<span id="cb17-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  figure: 'the two resistances become of equal order of magnitude in the case"</span>)</span>
<span id="cb17-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  of a film thickness smaller than about 0 0001 of the particle diameter'"</span>)</span>
<span id="cb17-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (p. 287), i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'df_over_dp_equal_resistance'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Eq (56) set to unity gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d_eq<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, a factor"</span>)</span>
<span id="cb17-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d_eq<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'df_over_dp_equal_resistance'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> larger - the SAME order of magnitude, which is all the sentence"</span>)</span>
<span id="cb17-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  claims. Recorded as a rounding of a one-significant-figure statement, not as"</span>)</span>
<span id="cb17-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  an error: the conclusion it carries (both columns far from that regime, at"</span>)</span>
<span id="cb17-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ratio56_celite'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ratio56_sterchamol'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) holds on either number."</span>)</span>
<span id="cb17-26">EQ56_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(R56[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite,     d_f from eq (53)"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio56_celite"</span>])))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>D_II / (100 D_I) = 3.3333e-08   printed 3.3e-08   dev +1.01%
  Celite,     d_f = 10 um printed    ratio = 3.000e-07   printed 3.0e-07   dev   +0.0%
  Celite,     d_f from eq (53)       ratio = 2.966e-07   printed 3.0e-07   dev   -1.1%
  Sterchamol, d_f = 9 um printed     ratio = 2.370e-05   printed 2.5e-05   dev   -5.2%
  Sterchamol, d_f from eq (53)       ratio = 2.563e-05   printed 2.5e-05   dev   +2.5%

  film thickness at which the two resistances are EQUAL: d_f/d_p = 1.826e-04
  What that tests is an ORDER-OF-MAGNITUDE sentence quoted to one significant
  figure: 'the two resistances become of equal order of magnitude in the case
  of a film thickness smaller than about 0 0001 of the particle diameter'
  (p. 287), i.e. 1e-04. Eq (56) set to unity gives 1.83e-04, a factor
  1.83 larger - the SAME order of magnitude, which is all the sentence
  claims. Recorded as a rounding of a one-significant-figure statement, not as
  an error: the conclusion it carries (both columns far from that regime, at
  3e-07 and 2.5e-05) holds on either number.</code></pre>
</div>
</div>
</section>
<section id="the-slope-ratio-which-is-the-papers-own-consistency-test" class="level3">
<h3 class="anchored" data-anchor-id="the-slope-ratio-which-is-the-papers-own-consistency-test">4. The slope ratio, which is the paper’s own consistency test</h3>
<p>The paper offers exactly one test of eq. (53) against eq. (54) that does not go through a fitted constant. The <img src="https://latex.codecogs.com/png.latex?C"> term depends on the component only through <img src="https://latex.codecogs.com/png.latex?x%20=%20KF_I/F_%7BII%7D">, as <img src="https://latex.codecogs.com/png.latex?x/(1+x)%5E2">, so the ratio of the two straight-part slopes of Fig. 11 is fixed by the two printed values of <img src="https://latex.codecogs.com/png.latex?x"> alone — no <img src="https://latex.codecogs.com/png.latex?d_f">, no <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D">, no velocity convention. The paper says this “must be about 1.5” and that eq. (54) gives 1.6.</p>
<div id="3b9ff541" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.188634Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.188491Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.192043Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.191588Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">shape <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb19-2">ratio_theory <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shape(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_iso_butane"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> shape(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_n_butane"</span>])</span>
<span id="cb19-3">ratio_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_iso_butane"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_n_butane"</span>]</span>
<span id="cb19-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"from eq (53) and the two printed x:   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ratio_theory<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb19-5">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(paper: 'about </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'slope_ratio_predicted'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">')  dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(ratio_theory, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'slope_ratio_predicted'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"from the two slopes of eq (54):       </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ratio_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb19-7">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(paper: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'slope_ratio_from_eq54'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)           dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(ratio_fit, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'slope_ratio_from_eq54'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  theory vs fit: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(ratio_fit, ratio_theory)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Note what this test is immune to: x is a ratio of volumes times K, so"</span>)</span>
<span id="cb19-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  the superficial/interstitial question below cannot touch it, and neither"</span>)</span>
<span id="cb19-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  can d_f or D_II. It is the strongest thing eq (53) says about Table 4."</span>)</span>
<span id="cb19-12">SLOPE_RATIO_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(ratio_theory, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_ratio_predicted"</span>])))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>from eq (53) and the two printed x:   1.4480   (paper: 'about 1.5')  dev -3.5%
from the two slopes of eq (54):       1.6000   (paper: 1.6)           dev -0.0%

  theory vs fit: +10.5%
  Note what this test is immune to: x is a ratio of volumes times K, so
  the superficial/interstitial question below cannot touch it, and neither
  can d_f or D_II. It is the strongest thing eq (53) says about Table 4.</code></pre>
</div>
</div>
</section>
<section id="the-velocity-convention-and-what-it-does-to-gamma" class="level3">
<h3 class="anchored" data-anchor-id="the-velocity-convention-and-what-it-does-to-gamma">5. The velocity convention, and what it does to <img src="https://latex.codecogs.com/png.latex?%5Cgamma"></h3>
<p>The paper reads <img src="https://latex.codecogs.com/png.latex?2%5Cgamma%20D_I"> off the <img src="https://latex.codecogs.com/png.latex?B"> coefficients of eq. (54) and gets <img src="https://latex.codecogs.com/png.latex?8%5Ctimes10%5E%7B-6%7D"> m² s⁻¹, then checks it: “This value is of the right order of magnitude as <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> lies between 0 5 and 1, and <img src="https://latex.codecogs.com/png.latex?D_I%20=%209%5Ctimes10%5E%7B-6%7D"> m²/sec as estimated from the well-known formula of GILLILAND”.</p>
<p>Two facts about that step, both arithmetic:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?8"> mm² s⁻¹ <strong>is</strong> <img src="https://latex.codecogs.com/png.latex?8%5Ctimes10%5E%7B-6%7D"> m² s⁻¹. The quoted <img src="https://latex.codecogs.com/png.latex?2%5Cgamma%20D_I"> is the iso-butane <img src="https://latex.codecogs.com/png.latex?B"> coefficient carried over unchanged, i.e.&nbsp;with <img src="https://latex.codecogs.com/png.latex?u"> taken as the velocity Table 4 tabulates — the <strong>superficial</strong> one — and no factor <img src="https://latex.codecogs.com/png.latex?F_I">.</li>
<li>The List of Symbols defines <img src="https://latex.codecogs.com/png.latex?u"> as <strong>interstitial</strong>. Under that reading, <img src="https://latex.codecogs.com/png.latex?B_%7B%5Ctext%7Bfitted%7D%7D%20=%202%5Cgamma%20D_I%20F_I">, so <img src="https://latex.codecogs.com/png.latex?2%5Cgamma%20D_I%20=%20B/F_I"> and <img src="https://latex.codecogs.com/png.latex?%5Cgamma%20=%200.5/F_I"> for <img src="https://latex.codecogs.com/png.latex?n">-butane.</li>
</ul>
<p><img src="https://latex.codecogs.com/png.latex?F_I"> is not printed for these columns, so the ambiguity cannot be closed. What <em>can</em> be done is to state the band of <img src="https://latex.codecogs.com/png.latex?F_I"> each reading requires, using the paper’s own bound <img src="https://latex.codecogs.com/png.latex?0.5%20%5Cle%20%5Cgamma%20%5Cle%201">.</p>
<div id="6eb736ed" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.193776Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.193630Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.199186Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.198654Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">DI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_I_gilliland"</span>]</span>
<span id="cb21-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reading'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;44}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'2 gamma D_I'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gamma'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, B <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial (F_I = 1), n-butane B = 9"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_n_butane"</span>]),</span>
<span id="cb21-4">               (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial (F_I = 1), iso-butane B = 8"</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_iso_butane"</span>])):</span>
<span id="cb21-5">    twogD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb21-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;42}{</span>twogD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14.2e}{</span>twogD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>DI)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-7">GAMMA_SUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_n_butane"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI)</span>
<span id="cb21-8">GAMMA_ISO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_iso_butane"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI)</span>
<span id="cb21-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the paper's quoted 2 gamma D_I = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_gamma_D_I'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s is the "</span></span>
<span id="cb21-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"iso-butane coefficient read this way, to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq54_B_iso_butane'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_gamma_D_I'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb21-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  It implies gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAMMA_ISO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which is BELOW the paper's own "</span></span>
<span id="cb21-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"stated range 0.5-1.0 by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gamma_lower'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>GAMMA_ISO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb21-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The n-butane coefficient gives gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAMMA_SUP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, exactly the lower bound."</span>)</span>
<span id="cb21-14"></span>
<span id="cb21-15">FI_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GAMMA_SUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_upper"</span>]</span>
<span id="cb21-16">FI_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GAMMA_SUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_lower"</span>]</span>
<span id="cb21-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Under the interstitial reading, gamma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAMMA_SUP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/F_I, so the paper's"</span>)</span>
<span id="cb21-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  own bound 0.5 &lt;= gamma &lt;= 1 requires  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FI_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;= F_I &lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FI_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb21-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Fig. 10 puts BOTH the intergranular space and the gas-filled pores in F_I,"</span>)</span>
<span id="cb21-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  so that band is physically reachable for these columns and the reading"</span>)</span>
<span id="cb21-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  cannot be excluded. What can be said is which way each constant moves, and"</span>)</span>
<span id="cb21-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  the two move in OPPOSITE directions:"</span>)</span>
<span id="cb21-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    gamma  = B/(2 D_I F_I), so the interstitial reading makes it LARGER by"</span>)</span>
<span id="cb21-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"             1/F_I - up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>FI_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x."</span>)</span>
<span id="cb21-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    d_f^2 ~ C, and the fitted C multiplies u_sup = F_I u_int, so eq (53)'s C"</span>)</span>
<span id="cb21-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"             is F_I times the fitted one: d_f^2 is SMALLER by F_I, down by up"</span>)</span>
<span id="cb21-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"             to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>FI_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x, i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(FI_lo)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x in d_f itself."</span>)</span>
<span id="cb21-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    x = K F_I/F_II is printed as one number, so it carries no ambiguity."</span>)</span>
<span id="cb21-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  The paper applies the conversion in Fig. 9 (abscissa u F_I d_p) but not in"</span>)</span>
<span id="cb21-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  eqs (53)-(55)."</span>)</span>
<span id="cb21-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  Unaffected by any of this: 2 lambda d_p, because the eddy term does not"</span>)</span>
<span id="cb21-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  contain u at all. lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'two_lambda_dp'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'celite_dp'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb21-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"from the printed 0.5 mm and 30 um, against the printed 'lambda approx 8'."</span>)</span>
<span id="cb21-34">LAMBDA_CELITE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_lambda_dp"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"celite_dp"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>reading                                        2 gamma D_I    gamma
  superficial (F_I = 1), n-butane B = 9           9.00e-06    0.500
  superficial (F_I = 1), iso-butane B = 8         8.00e-06    0.444

  the paper's quoted 2 gamma D_I = 8e-06 m2/s is the iso-butane coefficient read this way, to +0%.
  It implies gamma = 0.444, which is BELOW the paper's own stated range 0.5-1.0 by 12 %.
  The n-butane coefficient gives gamma = 0.500, exactly the lower bound.

  Under the interstitial reading, gamma = 0.5/F_I, so the paper's
  own bound 0.5 &lt;= gamma &lt;= 1 requires  0.50 &lt;= F_I &lt;= 1.00.
  Fig. 10 puts BOTH the intergranular space and the gas-filled pores in F_I,
  so that band is physically reachable for these columns and the reading
  cannot be excluded. What can be said is which way each constant moves, and
  the two move in OPPOSITE directions:
    gamma  = B/(2 D_I F_I), so the interstitial reading makes it LARGER by
             1/F_I - up to 2.0x.
    d_f^2 ~ C, and the fitted C multiplies u_sup = F_I u_int, so eq (53)'s C
             is F_I times the fitted one: d_f^2 is SMALLER by F_I, down by up
             to 2.0x, i.e. 1.41x in d_f itself.
    x = K F_I/F_II is printed as one number, so it carries no ambiguity.
  The paper applies the conversion in Fig. 9 (abscissa u F_I d_p) but not in
  eqs (53)-(55).

  Unaffected by any of this: 2 lambda d_p, because the eddy term does not
  contain u at all. lambda = 8.33 from the printed 0.5 mm and 30 um, against the printed 'lambda approx 8'.</code></pre>
</div>
</div>
</section>
<section id="table-3-refitted-the-particle-diffusivity-and-the-packing-factor" class="level3">
<h3 class="anchored" data-anchor-id="table-3-refitted-the-particle-diffusivity-and-the-packing-factor">6. Table 3 refitted: the particle diffusivity and the packing factor</h3>
<p>This is the paper’s <em>other</em> extraction, and it is the one that can be redone without any inferred input. From p.&nbsp;282:</p>
<blockquote class="blockquote">
<p>The particle diffusion coefficient <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D"> may be calculated from the slope of the straight line in Fig. 9 With <img src="https://latex.codecogs.com/png.latex?F_I%20=%20F_%7BII%7D%20=%200.4"> and <img src="https://latex.codecogs.com/png.latex?K%20=%201.3"> it is found that <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D%20=%201.3%5Ctimes10%5E%7B-10%7D"> m²/sec., a value which is about 10 times smaller than the diffusion coefficient in the free liquid.</p>
</blockquote>
<p>and</p>
<blockquote class="blockquote">
<p>The values found for <img src="https://latex.codecogs.com/png.latex?%5Clambda"> are 8 for 200-400 mesh, 3 for 50-100 mesh and practically zero for 20-40 mesh.</p>
</blockquote>
<p>Fig. 9 plots <img src="https://latex.codecogs.com/png.latex?H/d_p"> against <img src="https://latex.codecogs.com/png.latex?u%20F_I%20d_p"> — that is, against <strong>superficial</strong> velocity times particle diameter, since <img src="https://latex.codecogs.com/png.latex?u"> there is interstitial. Table 3 holds the same numbers, so the regression can be done on the table and the figure need never be touched. Five rows: the 50-100 mesh series at five flow rates.</p>
<p>Two things make this a real extraction rather than an algebraic rearrangement. The intercept gives <img src="https://latex.codecogs.com/png.latex?%5Clambda"> and the slope gives <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D">, and they are independent; and — because the first term of <img src="https://latex.codecogs.com/png.latex?C"> is small — the slope pins <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D"> <strong>almost without needing <img src="https://latex.codecogs.com/png.latex?D_I"></strong>, which the paper never states and never prints for this system.</p>
<div id="6886f5f4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.200852Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.200702Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.210287Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.209805Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1">FLOW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3[T3.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flow"</span>].sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"superficial_velocity_mm_s"</span>)</span>
<span id="cb23-2">Hmid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (FLOW.hetp_lo_mm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> FLOW.hetp_hi_mm)).to_numpy()</span>
<span id="cb23-3">Ymid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (FLOW.h_over_dp_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> FLOW.h_over_dp_hi)).to_numpy()</span>
<span id="cb23-4">u_sup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FLOW.superficial_velocity_mm_s.to_numpy()</span>
<span id="cb23-5">X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> u_sup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DP_50_100                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># = u_interstitial F_I d_p</span></span>
<span id="cb23-6"></span>
<span id="cb23-7">FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_I_ion_exclusion"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> FII <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_II_ion_exclusion"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_ion_exclusion"</span>]</span>
<span id="cb23-8">xK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FII</span>
<span id="cb23-9"></span>
<span id="cb23-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_eq49(X, Y, three_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb23-11">    cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> X, np.ones_like(X), X] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> three_term <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [np.ones_like(X), X]</span>
<span id="cb23-12">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack(cols).T</span>
<span id="cb23-13">    b, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(A, Y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb23-14">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Y</span>
<span id="cb23-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> b, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt((r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb23-16"></span>
<span id="cb23-17">(two_lam, S), rms2t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_eq49(X, Ymid)</span>
<span id="cb23-18">b3t, rms3t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_eq49(X, Ymid, three_term<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb23-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H/d_p = 2 lambda + S (u_sup d_p)      [molecular term dropped, as the paper does]"</span>)</span>
<span id="cb23-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   2 lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>two_lam<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  -&gt;  lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>two_lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb23-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lambda_50_100'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(two_lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lambda_50_100'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb23-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   slope    S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (mm^2/s)^-1        rmse </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rms2t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   with the 1/X term restored: B' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 2 lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb23-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, rmse </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rms3t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   B' is NEGATIVE and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (two_lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X.mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the "</span></span>
<span id="cb23-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"intercept term at the mean X - i.e. the five rows carry no molecular-diffusion"</span>)</span>
<span id="cb23-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   signal at all, which is what the paper asserts on p. 282 without measuring."</span>)</span>
<span id="cb23-28"></span>
<span id="cb23-29">a_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">75</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb23-30">b_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI))</span>
<span id="cb23-31"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> DII_from_slope(S, D_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb23-32">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Invert eq (49)'s C for D_II.  D_I=None -&gt; drop the (small) first term."""</span></span>
<span id="cb23-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> D_I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb23-34">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> b_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb23-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> b_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_I <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a_c)</span>
<span id="cb23-36"></span>
<span id="cb23-37">D_I_MM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3e-3</span>            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># = 10 x D_II, the paper's own "about 10 times smaller"</span></span>
<span id="cb23-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   a_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a_c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (viscous term),  b_c = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b_c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (particle term)"</span>)</span>
<span id="cb23-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'D_I assumed (mm2/s)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;26}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'D_II (m2/s)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev from printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-40">DII_ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb23-41"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, D_I <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.3e-3 (= 10 x D_II)"</span>, D_I_MM), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.0e-3"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-3</span>),</span>
<span id="cb23-42">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0e-3"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0e-3</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"infinite (term dropped)"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)):</span>
<span id="cb23-43">    d2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DII_from_slope(S, D_I) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mm2/s -&gt; m2/s</span></span>
<span id="cb23-44">    DII_ROWS[lab] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d2)</span>
<span id="cb23-45">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;26}{</span>d2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14.4e}{</span>dev(d2, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'D_II_ion_exclusion'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+18.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-46">DII_BEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DII_ROWS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.3e-3 (= 10 x D_II)"</span>]</span>
<span id="cb23-47">DII_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(DII_BEST, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_II_ion_exclusion"</span>])))</span>
<span id="cb23-48">DII_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(DII_ROWS.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(DII_ROWS.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb23-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   D_II = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_BEST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s against the printed "</span></span>
<span id="cb23-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'D_II_ion_exclusion'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb23-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Across a 2x change in the assumed D_I - and even with the term removed"</span>)</span>
<span id="cb23-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   entirely - D_II moves by only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The extraction is"</span>)</span>
<span id="cb23-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   essentially free of the one input the paper does not print."</span>)</span>
<span id="cb23-54">LAMBDA_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(two_lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_50_100"</span>])))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>H/d_p = 2 lambda + S (u_sup d_p)      [molecular term dropped, as the paper does]
   2 lambda = 5.9854  -&gt;  lambda = 2.9927   (printed 3, dev -0.24%)
   slope    S = 156.075 (mm^2/s)^-1        rmse 0.9872

   with the 1/X term restored: B' = -0.03427, 2 lambda = 8.295, S = 140.153, rmse 0.6358
   B' is NEGATIVE and 9.2 % of the intercept term at the mean X - i.e. the five rows carry no molecular-diffusion
   signal at all, which is what the paper asserts on p. 282 without measuring.

   a_c = 0.00593 (viscous term),  b_c = 0.04391 (particle term)
   D_I assumed (mm2/s)          D_II (m2/s)  dev from printed
   1.3e-3 (= 10 x D_II)          1.3481e-10            +3.70%
   1.0e-3                        1.3537e-10            +4.13%
   2.0e-3                        1.3415e-10            +3.19%
   infinite (term dropped)       1.3295e-10            +2.27%

   D_II = 1.348e-10 m2/s against the printed 1.3e-10 m2/s: 3.7%.
   Across a 2x change in the assumed D_I - and even with the term removed
   entirely - D_II moves by only 1.8%. The extraction is
   essentially free of the one input the paper does not print.</code></pre>
</div>
</div>
<div id="afc58fe4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.211947Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.211788Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:18.397365Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:18.396922Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.4</span>))</span>
<span id="cb25-2">xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, X.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb25-3">ax.plot(X, Ymid, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3, 50-100 mesh (midpoints)"</span>)</span>
<span id="cb25-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x0, lo, hi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(X, FLOW.h_over_dp_lo, FLOW.h_over_dp_hi):</span>
<span id="cb25-5">    ax.plot([x0, x0], [lo, hi], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)</span>
<span id="cb25-6">ax.plot(xx, two_lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xx, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>,</span>
<span id="cb25-7">        label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fit: $2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>two_lam<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, slope $</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>)</span>
<span id="cb25-8">ax.axhline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_50_100"</span>], ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>,</span>
<span id="cb25-9">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lambda$ from the printed $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lambda_50_100'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>)</span>
<span id="cb25-10">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$u_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{sup}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">,d_p = u F_I d_p$   (mm$^2$ s$^{-1}$)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$H/d_p$"</span>,</span>
<span id="cb25-11">       xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, xx.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span>),</span>
<span id="cb25-12">       title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. (49) on Table 3 — the vertical bars are the two printed determinations"</span>)</span>
<span id="cb25-13">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.5</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.10-van-deemter-plate-height/index_files/figure-html/cell-16-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="table-1s-calc-column-and-where-n-650-comes-from" class="level3">
<h3 class="anchored" data-anchor-id="table-1s-calc-column-and-where-n-650-comes-from">7. Table 1’s <code>calc</code> column, and where <img src="https://latex.codecogs.com/png.latex?n%20=%20650"> comes from</h3>
<p>Table 1’s last column is the authors’ own calculation, footnoted “*calculated for <img src="https://latex.codecogs.com/png.latex?n%20=%20650">“. The chain that produces it is short and entirely printed: <img src="https://latex.codecogs.com/png.latex?%5CDelta%20S_0%20=%204v%5Csqrt%7Bn%7D"> (eq. 24), <img src="https://latex.codecogs.com/png.latex?S_%7Brf%7D%20=%20nv%20+%200.31%5CDelta%20S_0"> (eq. 26), and <img src="https://latex.codecogs.com/png.latex?(c_%7BI,n%7D/c_0)_%7B%5Cmax%7D%20=%20%5Cmathrm%7Berf%7D%5C!%5Cleft(a/2%5Csqrt2%5Cright)"> with <img src="https://latex.codecogs.com/png.latex?a%20=%20A/(v%5Csqrt%20n)"> (eq. 20). Eq. (20) itself follows from eq. (19) in one line: the maximum of the band sits at the centre of the injected slug, so the integral runs symmetrically over <img src="https://latex.codecogs.com/png.latex?%5Cpm%20a/2">.</p>
<p>The whole <code>calc</code> column depends on <strong>one</strong> number, <img src="https://latex.codecogs.com/png.latex?v%5Csqrt%20n%20=%20%5CDelta%20S_0/4"> — not on <img src="https://latex.codecogs.com/png.latex?n"> and <img src="https://latex.codecogs.com/png.latex?v"> separately. So the eleven printed values pin <img src="https://latex.codecogs.com/png.latex?%5CDelta%20S_0">, and that is a sharper constraint than the paper’s own “<img src="https://latex.codecogs.com/png.latex?%5CDelta%20S_0%20=%20%5Csim%20165"> ml”.</p>
<div id="11e188ad" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:18.399502Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:18.399341Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:28.805695Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:28.804582Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq (20) derived from eq (19): the maximum is at the slug centre.</span></span>
<span id="cb26-2">xs_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, real<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> a_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb26-3">lhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.integrate(sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>xs_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi), (xs_, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>a_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, a_s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb26-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   eq (19) at the band maximum  -&gt;  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>simplify(lhs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   =  eq (20)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-5"></span>
<span id="cb26-6">cmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> a: erf(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SQ2))</span>
<span id="cb26-7">calc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.dropna(subset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmax_calc"</span>]).groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_volume_ml"</span>).cmax_calc.first()</span>
<span id="cb26-8">A_vals, printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> calc.index.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), calc.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb26-9"></span>
<span id="cb26-10">n_from_24 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nv_glc"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_S0_glc"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb26-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   n from eq (24) with the printed nv and dS0: (4 nv / dS0)^2 = "</span></span>
<span id="cb26-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(4 x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nv_glc'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_S0_glc'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)^2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_from_24<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb26-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (paper prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_glc'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(n_from_24, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_glc'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb26-14">S_rf_mean <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T1.final_retention_volume_ml.mean())</span>
<span id="cb26-15">nv_from_26 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_rf_mean <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.31</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_S0_glc"</span>]</span>
<span id="cb26-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   nv from eq (26) with the mean printed S_rf (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_rf_mean<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ml): "</span></span>
<span id="cb26-17">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nv_from_26<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ml  (paper: ~</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nv_glc'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb26-18"></span>
<span id="cb26-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> n_match(w):</span>
<span id="cb26-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(cmax(A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> w), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> A, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(A_vals, printed)))</span>
<span id="cb26-21"></span>
<span id="cb26-22">grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">38.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">46.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160001</span>)</span>
<span id="cb26-23">hits <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([n_match(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> grid])</span>
<span id="cb26-24">best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grid[hits <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> hits.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()]</span>
<span id="cb26-25">W_LO, W_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(best.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(best.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v sqrt(n)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'= dS0/4 from'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;26}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rows of 11 reproduced'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_S0_glc"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed dS0 = 165"</span>),</span>
<span id="cb26-28">               (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nv_glc"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_glc"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_glc"</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed nv and n"</span>),</span>
<span id="cb26-29">               (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (W_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> W_HI), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this page's window, centre"</span>)):</span>
<span id="cb26-30">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10.3f}{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;26}{</span>n_match(w)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   All </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed calc values are reproduced for "</span></span>
<span id="cb26-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"v sqrt(n) in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">],"</span>)</span>
<span id="cb26-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   i.e. dS0 in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>W_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>W_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] ml - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>W_LO, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_S0_glc'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to "</span></span>
<span id="cb26-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>W_HI, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_S0_glc'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the paper's own '~165 ml'."</span>)</span>
<span id="cb26-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   Nothing here is a defect: the paper writes both 165 and 1055 with a tilde."</span>)</span>
<span id="cb26-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   What the calc column pins is dS0 alone, and it pins it to 0.9 %."</span>)</span>
<span id="cb26-37">CALC_N_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(hits.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-38">CALC_FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CALC_N_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals)</span>
<span id="cb26-39"></span>
<span id="cb26-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A (ml)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'this page'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-41">w0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (W_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> W_HI)</span>
<span id="cb26-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> A, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(A_vals, printed):</span>
<span id="cb26-43">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.0f}{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9.2f}{</span>cmax(A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>w0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.4f}{</span>A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>w0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>   eq (19) at the band maximum  -&gt;  erf(sqrt(2)*a/4)   =  eq (20)

   n from eq (24) with the printed nv and dS0: (4 nv / dS0)^2 = (4 x 1055 / 165)^2 = 654.1   (paper prints 650, dev +0.6%)
   nv from eq (26) with the mean printed S_rf (1110.0 ml): 1058.8 ml  (paper: ~1055)

    v sqrt(n)              = dS0/4 from   rows of 11 reproduced
       41.250     the printed dS0 = 165                 9 / 11
       41.381      the printed nv and n                10 / 11
       41.674this page's window, centre                11 / 11

   All 11 printed calc values are reproduced for v sqrt(n) in [41.493, 41.855],
   i.e. dS0 in [166.0, 167.4] ml - +0.6% to +1.5% on the paper's own '~165 ml'.
   Nothing here is a defect: the paper writes both 165 and 1055 with a tilde.
   What the calc column pins is dS0 alone, and it pins it to 0.9 %.

     A (ml)  printed  this page       a
         32     0.30     0.2990   0.768
         62     0.54     0.5430   1.488
         92     0.73     0.7303   2.208
        122     0.86     0.8567   2.927
        151     0.93     0.9300   3.623
        180     0.97     0.9692   4.319
        210     0.99     0.9882   5.039
        240     1.00     0.9960   5.759
        269     1.00     0.9988   6.455
        300     1.00     0.9997   7.199
        600     1.00     1.0000  14.397</code></pre>
</div>
</div>
</section>
<section id="table-2-table-3-both-routes-and-eq.-21-as-printed-cannot-be-right" class="level3">
<h3 class="anchored" data-anchor-id="table-2-table-3-both-routes-and-eq.-21-as-printed-cannot-be-right">8. Table 2 → Table 3, both routes — and eq. (21) as printed cannot be right</h3>
<p>The paper says the plate number is obtainable “in two independent ways” (p.&nbsp;280) — from the <strong>height</strong> of the elution curve through eq. (20) and Fig. 3, and from its <strong>width</strong> through eqs. (21)/(22) and Fig. 4. Table 3’s printed ranges are those two determinations. With Table 2 and <img src="https://latex.codecogs.com/png.latex?nv%20=%2070"> ml, both can be redone.</p>
<p>The height route needs only eq. (20). The width route needs eq. (21), and <strong>eq. (21) as printed does not reproduce the paper’s own eqs. (24) and (25).</strong> It reads</p>
<p><img src="https://latex.codecogs.com/png.latex?%5CDelta%20s%20=%20a%20+%202%5Cdelta%20+%20%5Csqrt%7B2%5Cpi%7D%5C;%5Cfrac%7Ba+%5Cdelta%7D%7B%5Cdelta%7D%5C;e%5E%7B%5Cfrac12%5Cdelta%5E2%7D%0A%20%20%5Cleft(%5Cmathrm%7Berf%7D%5Cfrac%7Ba+%5Cdelta%7D%7B%5Csqrt2%7D%20-%20%5Cmathrm%7Berf%7D%5Cfrac%7B%5Cdelta%7D%7B%5Csqrt2%7D%5Cright)"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Cdelta"> from eq. (22). Pin what is <em>not</em> free first:</p>
<ul>
<li><strong>Eq. (22) is not free.</strong> It is exactly the condition that the second derivative of eq. (19) vanish — the inflection point, which is what <img src="https://latex.codecogs.com/png.latex?%5CDelta%20S"> is defined from (p.&nbsp;275, Fig. 2). Verified symbolically below.</li>
<li><strong>The <img src="https://latex.codecogs.com/png.latex?a%5Cto0"> limit is not free.</strong> Eq. (24) states <img src="https://latex.codecogs.com/png.latex?%5CDelta%20S_0%20=%204v%5Csqrt%20n">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5CDelta%20s%20%5Cto%204">, and the paper says why: “For the Gaussian curve this value of <img src="https://latex.codecogs.com/png.latex?%5CDelta%20S"> is just equal to 4 times the standard deviation”.</li>
<li><strong>The <img src="https://latex.codecogs.com/png.latex?a%5Cto%5Cinfty"> limit is not free.</strong> Eq. (25) states <img src="https://latex.codecogs.com/png.latex?%5CDelta%20S%20=%20A%20+%20v%5Csqrt%7B2%5Cpi%20n%7D"> for <img src="https://latex.codecogs.com/png.latex?a%3E3">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?%5CDelta%20s%20%5Cto%20a%20+%20%5Csqrt%7B2%5Cpi%7D">.</li>
</ul>
<p>The only thing left free is the denominator of the third term, and both limits force it to be <img src="https://latex.codecogs.com/png.latex?a">, not <img src="https://latex.codecogs.com/png.latex?%5Cdelta">. Deriving <img src="https://latex.codecogs.com/png.latex?%5CDelta%20s"> from eq. (19) directly gives <img src="https://latex.codecogs.com/png.latex?a">; and <img src="https://latex.codecogs.com/png.latex?(a+%5Cdelta)/a"> is what makes the <img src="https://latex.codecogs.com/png.latex?a%5Cto0"> limit finite at all, because the bracket vanishes linearly in <img src="https://latex.codecogs.com/png.latex?a">.</p>
<div id="1cdb0491" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:28.807445Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:28.807276Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:29.083029Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:29.082029Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- eq (22) IS the inflection condition of eq (19) -------------------------</span></span>
<span id="cb28-2">xv, av, dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x a delta"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb28-3">xr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xr"</span>, real<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb28-4">phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>xr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi)</span>
<span id="cb28-5">f19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.integrate(phi, (xr, sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y"</span>, real<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> av, sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y"</span>, real<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)))</span>
<span id="cb28-6">y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y"</span>, real<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb28-7">f19 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sp.erf(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.erf((y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> av) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb28-8">infl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(f19, y, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).subs(y, av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv))</span>
<span id="cb28-9">eq22 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb28-10">ratio22 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.simplify(infl) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq22)</span>
<span id="cb28-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   d2(eq 19)/dy2 at y = a + delta, divided by eq (22): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>simplify(ratio22)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   -&gt; eq (22) is exactly the inflection condition; it is not free.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-13"></span>
<span id="cb28-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- and the corrected denominator is what eq (19) gives, not a guess ---------</span></span>
<span id="cb28-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Delta s = 2 (y_R - a/2) + 2 f(y_R)/|f'(y_R)| with y_R = a + delta the right</span></span>
<span id="cb28-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># inflection point.  Write E = exp((a+delta)^2/2) and e = exp(delta^2/2); then</span></span>
<span id="cb28-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># f' = (1/E - 1/e)/sqrt(2 pi) and eq (22) reads delta E = (a + delta) e.</span></span>
<span id="cb28-18">E_, e_, Q_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E e Q"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Q = the erf difference</span></span>
<span id="cb28-19">tail_raw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Q_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi))</span>
<span id="cb28-20">tail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(tail_raw.subs(E_, (av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dv))          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># apply eq (22)</span></span>
<span id="cb28-21">tail_with_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Q_</span>
<span id="cb28-22">tail_with_delta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Q_</span>
<span id="cb28-23">r21 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(tail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tail_with_a)</span>
<span id="cb28-24">r21_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(tail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tail_with_delta)</span>
<span id="cb28-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   2 f / |f'| at the inflection, after eq (22):  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>simplify(tail)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     minus the third term with 'a'      underneath: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r21<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"     minus the third term with 'delta'  underneath: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>factor(r21_printed)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   -&gt; the denominator required by eq (19) is a. Not a guess, and not"</span>)</span>
<span id="cb28-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"      a choice made to fit the limits: the limits merely confirm it."</span>)</span>
<span id="cb28-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb28-31"></span>
<span id="cb28-32"></span>
<span id="cb28-33"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> delta_of(a):</span>
<span id="cb28-34">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Solve eq (22) in log form; the root lies in (0, 1)."""</span></span>
<span id="cb28-35">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: np.log(d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb28-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> brentq(h, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb28-37"></span>
<span id="cb28-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> width_red(a, denominator<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>):</span>
<span id="cb28-39">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eq (21). denominator='a' as derived; 'delta' exactly as printed."""</span></span>
<span id="cb28-40">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> delta_of(a)</span>
<span id="cb28-41">    den <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> denominator <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> d</span>
<span id="cb28-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> den <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d)</span>
<span id="cb28-43">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (erf((a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SQ2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> erf(d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SQ2)))</span>
<span id="cb28-44"></span>
<span id="cb28-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'with a'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq (24)/(25) requires'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-46"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, req <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi)),</span>
<span id="cb28-47">               (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi)), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi))):</span>
<span id="cb28-48">    pr, co <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> width_red(a, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta"</span>), width_red(a, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>)</span>
<span id="cb28-49">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> req <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>req<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-50">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10.2g}{</span>pr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16.4g}{</span>co<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10.4f}{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb28-51">EQ21_A0_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(width_red(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta"</span>))</span>
<span id="cb28-52">EQ21_A0_CORRECTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(width_red(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>))</span>
<span id="cb28-53">EQ21_LARGE_A_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(width_red(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi))))</span>
<span id="cb28-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   As printed:  a -&gt; 0 gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ21_A0_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, not the 4 of eq (24);"</span>)</span>
<span id="cb28-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                a -&gt; large DIVERGES instead of approaching a + sqrt(2 pi)."</span>)</span>
<span id="cb28-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   With a:      both limits are met, the second to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ21_LARGE_A_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at a = 5."</span>)</span>
<span id="cb28-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   REPORTED, NOT REPAIRED. The corrected form is used for the width route"</span>)</span>
<span id="cb28-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   below and every number that depends on it is labelled; nothing else on"</span>)</span>
<span id="cb28-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   this page uses eq (21) at all."</span>)</span>
<span id="cb28-60">EQ21_DERIVED_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r21 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>   d2(eq 19)/dy2 at y = a + delta, divided by eq (22): sqrt(2)/(2*sqrt(pi))
   -&gt; eq (22) is exactly the inflection condition; it is not free.

   2 f / |f'| at the inflection, after eq (22):  sqrt(2)*sqrt(pi)*Q*e*(a + delta)/a
     minus the third term with 'a'      underneath: 0
     minus the third term with 'delta'  underneath: -sqrt(2)*sqrt(pi)*Q*e*(a - delta)*(a + delta)/(a*delta)
   -&gt; the denominator required by eq (19) is a. Not a guess, and not
      a choice made to fit the limits: the limits merely confirm it.

            a      as printed    with a   eq (24)/(25) requires
        1e-08               2    4.0000                  4.0000
         0.01            2.02    4.0000                  4.0000
            1           5.916    4.1686                       -
            3           243.9    5.5266                  5.5066
            5       6.727e+05    7.5066                  7.5066
           10        4.92e+17   12.5066                 12.5066

   As printed:  a -&gt; 0 gives 2.0000, not the 4 of eq (24);
                a -&gt; large DIVERGES instead of approaching a + sqrt(2 pi).
   With a:      both limits are met, the second to 1.1e-06 at a = 5.
   REPORTED, NOT REPAIRED. The corrected form is used for the width route
   below and every number that depends on it is labelled; nothing else on
   this page uses eq (21) at all.</code></pre>
</div>
</div>
<div id="546e3f30" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:29.084520Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:29.084315Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:29.111053Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:29.110396Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1">NV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nv_ion_exclusion"</span>]</span>
<span id="cb30-2"></span>
<span id="cb30-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> n_from_height(A, hmax):</span>
<span id="cb30-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> hmax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>:</span>
<span id="cb30-5">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.nan</span>
<span id="cb30-6">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> SQ2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> erfinv(hmax)</span>
<span id="cb30-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (NV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb30-8"></span>
<span id="cb30-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> n_from_width(A, W):</span>
<span id="cb30-10">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: width_red(A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> w, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> W</span>
<span id="cb30-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (NV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> brentq(f, A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">25.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb30-12"></span>
<span id="cb30-13">single <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T2[T2.feed_volume_ml <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>]</span>
<span id="cb30-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3's plate numbers, recomputed from Table 2 (A = 5 ml rows only)"</span>)</span>
<span id="cb30-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mesh'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'u'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'from height'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'from width'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> |</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed lo'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed hi'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev lo'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev hi'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-17">recs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb30-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> single.iterrows():</span>
<span id="cb30-19">    nh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_from_height(r.feed_volume_ml, r.max_height_frac_c0)</span>
<span id="cb30-20">    nw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_from_width(r.feed_volume_ml, r.width_at_base_ml)</span>
<span id="cb30-21">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3[(T3.particle_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.particle_mesh)</span>
<span id="cb30-22">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (np.isclose(T3.superficial_velocity_mm_s, r.superficial_velocity_mm_s))].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb30-23">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(nh, nw), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(nh, nw)</span>
<span id="cb30-24">    dlo, dhi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev(lo, m.n_plates_lo), dev(hi, m.n_plates_hi)</span>
<span id="cb30-25">    recs.append((r.particle_mesh, r.superficial_velocity_mm_s, nh, nw, dlo, dhi))</span>
<span id="cb30-26">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>particle_mesh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>superficial_velocity_mm_s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7.3f}{</span>nh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13.0f}{</span>nw<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> |"</span></span>
<span id="cb30-27">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.0f}{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.0f}{</span>dlo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+9.1%}{</span>dhi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+9.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-28"></span>
<span id="cb30-29">devs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>([d <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_, dlo, dhi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> recs <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (dlo, dhi)])</span>
<span id="cb30-30">N_MED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(devs))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> N_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(devs.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb30-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   median |dev| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over "</span></span>
<span id="cb30-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(devs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> endpoints of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(recs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows"</span>)</span>
<span id="cb30-33"></span>
<span id="cb30-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Split by ROUTE, which is not the same as splitting by endpoint. The printed</span></span>
<span id="cb30-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pair is in ascending order and the paper does not say which determination is</span></span>
<span id="cb30-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># which; Fig. 8's own printed labels settle it for one condition, and the same</span></span>
<span id="cb30-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ascending convention assigns the rest. In most rows the height route gives the</span></span>
<span id="cb30-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># smaller n - but not in all of them, and where it inverts, so does the pairing.</span></span>
<span id="cb30-39">fig8 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3[(T3.particle_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50-100"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T3.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"particle"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb30-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Fig. 8's printed curve labels are n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_fig8_height'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (height) and "</span></span>
<span id="cb30-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_fig8_width'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (width), which are exactly"</span>)</span>
<span id="cb30-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   this table's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fig8<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fig8<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for 50-100 mesh at "</span></span>
<span id="cb30-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fig8<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>superficial_velocity_mm_s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm/s: low end = height, high end = width there."</span>)</span>
<span id="cb30-44">dev_h, dev_w, inverted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], []</span>
<span id="cb30-45"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> mesh, uu, nh, nw, dlo, dhi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> recs:</span>
<span id="cb30-46">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (dlo, dhi) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> nw <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (dhi, dlo)</span>
<span id="cb30-47">    dev_h.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> dev_w.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b))</span>
<span id="cb30-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> nw:</span>
<span id="cb30-49">        inverted.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mesh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>uu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm/s"</span>)</span>
<span id="cb30-50">N_MED_H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(dev_h))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> N_MED_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(dev_w))</span>
<span id="cb30-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   BY ROUTE, the height route is the accurate one: median </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MED_H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against "</span></span>
<span id="cb30-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MED_W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the width route."</span>)</span>
<span id="cb30-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   The two routes invert in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(inverted)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(recs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(inverted)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span>)</span>
<span id="cb30-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   where the height determination is therefore the printed HIGH endpoint;"</span>)</span>
<span id="cb30-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   sorting by size instead of by route would report "</span></span>
<span id="cb30-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>median([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> recs])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>median([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> recs])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb30-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   That asymmetry is expected: Table 2's widths are printed as integers, so"</span>)</span>
<span id="cb30-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   a +-0.5 ml read on the 200-400 mesh row's 10 ml is +-5 %, and n goes as"</span>)</span>
<span id="cb30-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   1/w^2. The height column carries two decimals."</span>)</span>
<span id="cb30-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">   The 50-100 / 0.091 row is the worst of the nine, and it is the one"</span>)</span>
<span id="cb30-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   condition carrying a five-point feed-volume sweep: the paper fitted n to"</span>)</span>
<span id="cb30-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   the WHOLE sweep in Fig. 8, not to the A = 5 ml pair the table above uses."</span>)</span>
<span id="cb30-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   Over that sweep the height route alone gives:"</span>)</span>
<span id="cb30-64"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T2[(T2.particle_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50-100"</span>)</span>
<span id="cb30-65">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (np.isclose(T2.superficial_velocity_mm_s, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.091</span>))].iterrows():</span>
<span id="cb30-66">    nh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_from_height(r.feed_volume_ml, r.max_height_frac_c0)</span>
<span id="cb30-67">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      A = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>feed_volume_ml<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ml, height </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>max_height_frac_c0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb30-68">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt;  n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   (saturated, no information)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isnan(nh) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb30-69">sw_row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3[(T3.particle_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50-100"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T3.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flow"</span>)</span>
<span id="cb30-70">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(T3.superficial_velocity_mm_s, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.091</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb30-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   which brackets the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sw_row<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sw_row<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Table 3's plate numbers, recomputed from Table 2 (A = 5 ml rows only)
    mesh      u  from height  from width | printed lo printed hi   dev lo   dev hi
  50-100  0.091          266         309 |        240        277   +11.0%   +11.4%
 200-400  0.091          604        1291 |        600       1000    +0.7%   +29.1%
   50-70  0.091          280         355 |        280        305    +0.0%   +16.5%
   30-40  0.091          108         158 |        110        155    -1.4%    +2.2%
   16-20  0.091           50          35 |         35         49    -1.3%    +2.7%
  50-100  0.046          391         490 |        385        463    +1.6%    +5.8%
  50-100  0.182          182         215 |        177        210    +2.8%    +2.2%
  50-100  0.365          125         158 |        125        156    -0.2%    +1.6%
  50-100  0.730           80          91 |         78         89    +2.1%    +1.7%

   median |dev| 2.1%, worst 29.1% over 18 endpoints of 9 rows

   Fig. 8's printed curve labels are n = 240 (height) and 277 (width), which are exactly
   this table's 240-277 for 50-100 mesh at 0.091 mm/s: low end = height, high end = width there.
   BY ROUTE, the height route is the accurate one: median 1.6% against 2.2% for the width route.
   The two routes invert in 1 of 9 rows (16-20 at 0.091 mm/s),
   where the height determination is therefore the printed HIGH endpoint;
   sorting by size instead of by route would report 1.4% and 2.7%.
   That asymmetry is expected: Table 2's widths are printed as integers, so
   a +-0.5 ml read on the 200-400 mesh row's 10 ml is +-5 %, and n goes as
   1/w^2. The height column carries two decimals.

   The 50-100 / 0.091 row is the worst of the nine, and it is the one
   condition carrying a five-point feed-volume sweep: the paper fitted n to
   the WHOLE sweep in Fig. 8, not to the A = 5 ml pair the table above uses.
   Over that sweep the height route alone gives:
      A =   30 ml, height 1.00  -&gt;  n =     nan   (saturated, no information)
      A =   20 ml, height 0.94  -&gt;  n =     173
      A =   10 ml, height 0.72  -&gt;  n =     229
      A =    5 ml, height 0.44  -&gt;  n =     266
      A =    2 ml, height 0.20  -&gt;  n =     315
   which brackets the printed 240-277.</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Eq. (38) is the hinge of the whole paper: everything after it — eq. (49), eq. (53), <img src="https://latex.codecogs.com/png.latex?%5Clambda">, <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D">, <img src="https://latex.codecogs.com/png.latex?d_f"> — is eq. (38) with substitutions. So the validation that matters is one that produces <img src="https://latex.codecogs.com/png.latex?H"> <strong>without using eq. (38)</strong>.</p>
<p>The route taken here is to integrate eqs. (29)/(30) in time with pymrm, record <img src="https://latex.codecogs.com/png.latex?c_I(t)"> at two interior stations, and form</p>
<p><img src="https://latex.codecogs.com/png.latex?H%20=%20(z_2-z_1)%5C,%5Cfrac%7B%5Csigma%5E2_%7Bt%7D(z_2)-%5Csigma%5E2_%7Bt%7D(z_1)%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%5Cleft%5B%5Cbar%20t(z_2)-%5Cbar%20t(z_1)%5Cright%5D%5E2%7D."></p>
<p>Taking <strong>differences between two stations</strong> is deliberate. For a linear system the cumulants of the response are exactly additive along the column, so every entrance effect, every exit effect and the entire shape of the injected pulse are constants that cancel in the difference. The number that comes out is the asymptotic plate height and nothing else — which is what eq. (38) claims to be.</p>
<section id="conditions" class="level3">
<h3 class="anchored" data-anchor-id="conditions">Conditions</h3>
<p>The ion-exclusion column, because it is the one whose <img src="https://latex.codecogs.com/png.latex?F_I">, <img src="https://latex.codecogs.com/png.latex?F_%7BII%7D"> and <img src="https://latex.codecogs.com/png.latex?K"> are printed. Everything else is printed too, except two quantities the paper itself declares immaterial; their contribution is measured rather than assumed.</p>
<div id="2bcec1e2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:29.112545Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:29.112349Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:29.120393Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:29.119689Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1">DP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DP_50_100                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># recovered from Table 3, an INFERENCE</span></span>
<span id="cb32-2">U_SUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.091</span>                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed, Tables 2 and 3</span></span>
<span id="cb32-3">U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> U_SUP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FI                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eqs (29)/(30) use interstitial u</span></span>
<span id="cb32-4">DII_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_II_ion_exclusion"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># m2/s -&gt; mm2/s, printed</span></span>
<span id="cb32-5">D_I_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_M                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "about 10 times smaller than in the free liquid"</span></span>
<span id="cb32-6">GAMMA_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_lower"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gamma_upper"</span>])   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># midpoint of the printed range</span></span>
<span id="cb32-7">LAM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_50_100"</span>]                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed</span></span>
<span id="cb32-8"></span>
<span id="cb32-9">D_LONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GAMMA_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_I_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> LAM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DP       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eqs (47),(48)</span></span>
<span id="cb32-10">a_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DP                                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq (46)</span></span>
<span id="cb32-11">INV_ALPHA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (D_I_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (DII_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_p)</span>
<span id="cb32-12">ALPHA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> INV_ALPHA                                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq (45)</span></span>
<span id="cb32-13">BETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> FII <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KK))                               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq (34)</span></span>
<span id="cb32-14"></span>
<span id="cb32-15">H38 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_LONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> INV_ALPHA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb32-16">MT_SHARE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> INV_ALPHA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> H38   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the transfer term's share of H</span></span>
<span id="cb32-17">mol_share <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> GAMMA_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_I_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> H38</span>
<span id="cb32-18">visc_share <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (D_I_ASSUMED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> INV_ALPHA</span>
<span id="cb32-19">VISC_SHARE_H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> visc_share <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> MT_SHARE                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and OF H, which is smaller</span></span>
<span id="cb32-20"></span>
<span id="cb32-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   d_p        = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm          (RECOVERED from Table 3, an inference)"</span>)</span>
<span id="cb32-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   u          = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm/s        (= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_SUP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> superficial / F_I)"</span>)</span>
<span id="cb32-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   D          = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_LONG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm2/s      (eq 48; molecular part is "</span></span>
<span id="cb32-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mol_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of H)"</span>)</span>
<span id="cb32-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   1/alpha    = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>INV_ALPHA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s           (eq 45; the D_I term is "</span></span>
<span id="cb32-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>visc_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of IT, and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VISC_SHARE_H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of H)"</span>)</span>
<span id="cb32-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   beta       = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">            band velocity </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>U_INT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm/s"</span>)</span>
<span id="cb32-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   H from eq (38) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H38<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>)</span>
<span id="cb32-29">ROW_091 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3[(T3.particle_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"50-100"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T3.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flow"</span>)</span>
<span id="cb32-30">             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> np.isclose(T3.superficial_velocity_mm_s, U_SUP)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb32-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Table 3 prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROW_091<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>hetp_lo_mm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROW_091<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>hetp_hi_mm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm for this row "</span></span>
<span id="cb32-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(50-100 mesh, u = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U_SUP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm/s), i.e. n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROW_091<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROW_091<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_plates_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb32-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   That agreement is NOT evidence: lambda and D_II were extracted FROM those"</span>)</span>
<span id="cb32-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   very rows in section 6. It is a closure check on the extraction only."</span>)</span>
<span id="cb32-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   H splits </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>MT_SHARE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> longitudinal / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MT_SHARE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mass transfer, so the"</span>)</span>
<span id="cb32-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   two assumed inputs carry </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mol_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of H (gamma D_I, directly) and"</span>)</span>
<span id="cb32-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VISC_SHARE_H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of H (the D_I term of 1/alpha, which is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>visc_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 1/alpha"</span>)</span>
<span id="cb32-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   but only its transfer share of H). 'Longitudinal molecular diffusion was of"</span>)</span>
<span id="cb32-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   no importance in SIMPSON and WHEATON's experiments' (p. 282) is confirmed,"</span>)</span>
<span id="cb32-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   quantitatively, and by a wider margin than the 1/alpha share alone suggests."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>   d_p        = 0.2201 mm          (RECOVERED from Table 3, an inference)
   u          = 0.2275 mm/s        (= 0.091 superficial / F_I)
   D          = 0.15119 mm2/s      (eq 48; molecular part is 0.42% of H)
   1/alpha    = 20.727 s           (eq 45; the D_I term is 1.33% of IT, and 0.465% of H)
   beta       = 0.56522            band velocity 0.12859 mm/s

   H from eq (38) = 2.04225 mm
   Table 3 prints 2.0-2.3 mm for this row (50-100 mesh, u = 0.091 mm/s), i.e. n = 240-277.
   That agreement is NOT evidence: lambda and D_II were extracted FROM those
   very rows in section 6. It is a closure check on the extraction only.

   H splits 65.08% longitudinal / 34.92% mass transfer, so the
   two assumed inputs carry 0.42% of H (gamma D_I, directly) and
   0.465% of H (the D_I term of 1/alpha, which is 1.33% of 1/alpha
   but only its transfer share of H). 'Longitudinal molecular diffusion was of
   no importance in SIMPSON and WHEATON's experiments' (p. 282) is confirmed,
   quantitatively, and by a wider margin than the 1/alpha share alone suggests.</code></pre>
</div>
</div>
<div id="d0d84aa2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:29.121889Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:29.121745Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:24:31.265912Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:24:31.265256Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1">L_TOT, Z1, Z2, T_END, T_SIG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">700.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">200.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">600.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7000.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span></span>
<span id="cb34-2"></span>
<span id="cb34-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>vanleer, t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_END, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb34-4">          alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ALPHA, K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KK, D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_LONG, bc_left<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, sweeps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>L_TOT,</span>
<span id="cb34-5">          stations<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(Z1, Z2), theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb34-6">    col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Column(U_INT, D, alpha, K, FI, FII, L, n_z, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>limiter,</span>
<span id="cb34-7">                 nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, bc_left<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bc_left)</span>
<span id="cb34-8">    ts, rec, zs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> col.run(t_end, dt, T_SIG, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(stations), sweeps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sweeps, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>theta)</span>
<span id="cb34-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ts, rec, zs, [cumulants(ts, rec[:, j]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(stations))]</span>
<span id="cb34-10"></span>
<span id="cb34-11">ts_r, rec_r, zs_r, Kc_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb34-12">H_PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(Kc_r, zs_r))</span>
<span id="cb34-13">H_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dev(H_PYMRM, H38))</span>
<span id="cb34-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   stations at z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>zs_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>zs_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm (cell centres)"</span>)</span>
<span id="cb34-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   H from the pymrm solution   = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H_PYMRM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>)</span>
<span id="cb34-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   H from eq (38)              = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H38<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>)</span>
<span id="cb34-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   relative difference         = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb34-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">   Nothing in this route uses eq (38), the Gaussian (33), or the plate"</span>)</span>
<span id="cb34-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   theory. It uses the balance (29)/(30) and two definitions."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>   stations at z = 199.7500 and 599.7500 mm (cell centres)
   H from the pymrm solution   = 2.042337 mm
   H from eq (38)              = 2.042252 mm
   relative difference         = +4.121e-05

   Nothing in this route uses eq (38), the Gaussian (33), or the plate
   theory. It uses the balance (29)/(30) and two definitions.</code></pre>
</div>
</div>
</section>
<section id="refinement-on-both-axes-and-a-coefficient-that-is-known-in-advance" class="level3">
<h3 class="anchored" data-anchor-id="refinement-on-both-axes-and-a-coefficient-that-is-known-in-advance">Refinement, on both axes, and a coefficient that is known in advance</h3>
<p>Bare first-order upwind adds a numerical dispersion of exactly <img src="https://latex.codecogs.com/png.latex?u%20h/2">, and eq. (38)’s first term is <img src="https://latex.codecogs.com/png.latex?2D/u">, so switching the limiter off must shift <img src="https://latex.codecogs.com/png.latex?H"> by <strong>exactly <img src="https://latex.codecogs.com/png.latex?h"></strong> — not “by order <img src="https://latex.codecogs.com/png.latex?h">”. That turns the grid study into a prediction with a known answer, which is a stronger check on the assembly than an observed order alone.</p>
<p>The time step is refined separately. It is honest to report in advance that the two-station <img src="https://latex.codecogs.com/png.latex?H"> is nearly <em>insensitive</em> to it: Crank–Nicolson is time-symmetric and the two stations are sampled identically, so the leading time error cancels in the difference. A metric that does move with <img src="https://latex.codecogs.com/png.latex?%5CDelta%20t"> is reported beside it, so the axis is not left unmeasured.</p>
<p>The <em>expected</em> time order needs care, and is measured rather than assumed. Crank–Nicolson is second order, but the van Leer correction here is <strong>deferred and lagged</strong>: <code>run</code> recomputes the correction from the field it has just solved for and applies it in the <em>next</em> step, which at <code>sweeps=1</code> is a perturbation of size <img src="https://latex.codecogs.com/png.latex?O(%5CDelta%20t)">. So the configuration this page runs should be asymptotically <em>first</em> order in time even though the underlying scheme is second order. Both are measured below with reference-free successive-difference orders, which need no converged reference and cannot be flattered by the choice of one.</p>
<p>The three-point order on <img src="https://latex.codecogs.com/png.latex?%5Cmu_1"> printed below is therefore claimed only as a range: between 1.5 and 2.5. It is a fit of differences of nearly equal first moments on the coarse end of the sequence, and with identical model code it moved by 18 % between two numerical environments (older and current NumPy/SciPy), both times inside that range. The range excludes backward Euler, which is what the break row below uses.</p>
<div id="0cf2e246" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:24:31.268534Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:24:31.268329Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:25.712585Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:25.711608Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb36-1">KAPZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (n_z, dt) -&gt; (kappa_3/z, kappa_4/z), kept for later</span></span>
<span id="cb36-2"></span>
<span id="cb36-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> kappas_per_z(Kc, zs):</span>
<span id="cb36-4">    dz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz, (Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz)</span>
<span id="cb36-6"></span>
<span id="cb36-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Grid, van Leer deferred correction (dt = 0.5 s throughout)"</span>)</span>
<span id="cb36-8">grid_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb36-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n_z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">350</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>):</span>
<span id="cb36-10">    _, _, zs, Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb36-11">    KAPZ[(n_z, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kappas_per_z(Kc, zs)</span>
<span id="cb36-12">    H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(Kc, zs))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L_TOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n_z</span>
<span id="cb36-13">    grid_rows.append((n_z, h, H, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(H, H38))))</span>
<span id="cb36-14">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   n_z </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  h = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm   H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   |dev| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(H,H38))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-15">ORD_GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log([r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> grid_rows]),</span>
<span id="cb36-16">                            np.log([r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> grid_rows]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb36-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_GRID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-18"></span>
<span id="cb36-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Grid, BARE UPWIND - predicted H_num = H + h exactly"</span>)</span>
<span id="cb36-20">up_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb36-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n_z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">350</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>):</span>
<span id="cb36-22">    _, _, zs, Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_z, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb36-23">    H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(Kc, zs))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L_TOT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n_z</span>
<span id="cb36-24">    up_rows.append((h, (H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H38) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> h))</span>
<span id="cb36-25">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   n_z </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  h = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm   H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (H - H_38)/h = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(H<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>H38)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-26">ORD_UPWIND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log([h <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> up_rows]),</span>
<span id="cb36-27">                              np.log([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> H38) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> up_rows]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb36-28">UPWIND_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean([c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> up_rows]))</span>
<span id="cb36-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_UPWIND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (first order, against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_GRID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with the limiter)"</span>)</span>
<span id="cb36-30">UPWIND_COEF_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(UPWIND_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb36-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   mean coefficient </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UPWIND_COEF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the predicted 1 "</span></span>
<span id="cb36-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(|error| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>UPWIND_COEF_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb36-33"></span>
<span id="cb36-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Time step (n_z = 700). Two metrics: the two-station H, and the absolute"</span>)</span>
<span id="cb36-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first moment at z2, which carries the time-quadrature error undifferenced."</span>)</span>
<span id="cb36-36"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dt_sweep(theta):</span>
<span id="cb36-37">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb36-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb36-39">        _, rec, zs, Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dt, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>theta)</span>
<span id="cb36-40">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>:</span>
<span id="cb36-41">            KAPZ[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kappas_per_z(Kc, zs)</span>
<span id="cb36-42">        rows.append((dt, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(Kc, zs)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Kc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb36-43">    H_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> M1_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows])</span>
<span id="cb36-44">    order <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log([r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]),</span>
<span id="cb36-45">                             np.log(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M1_[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M1_[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb36-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> rows, order, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(H_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> H_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M1_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> M1_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb36-47"></span>
<span id="cb36-48">dt_rows, ORD_DT, DT_SWING_H, DT_SWING_M1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dt_sweep(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb36-49"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt, H_, m1_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> dt_rows:</span>
<span id="cb36-50">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   dt </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s   H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   mu1(z2) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m1_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s"</span>)</span>
<span id="cb36-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   over an 8x change in dt:  H moves </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT_SWING_H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative,"</span>)</span>
<span id="cb36-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                             mu1(z2) moves </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT_SWING_M1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative"</span>)</span>
<span id="cb36-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   observed time order on mu1(z2): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_DT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (three-point fit on "</span></span>
<span id="cb36-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dt_rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dt_rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dt_rows[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s"</span>)</span>
<span id="cb36-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"      against the dt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dt_rows[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s value as the reference)"</span>)</span>
<span id="cb36-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   The two-station H is therefore NOT dt-limited at these settings; it is"</span>)</span>
<span id="cb36-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   grid-limited. Both axes are measured; only one carries the error."</span>)</span>
<span id="cb36-58"></span>
<span id="cb36-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># What order SHOULD that be? Not 2. The deferred correction is lagged one step</span></span>
<span id="cb36-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at sweeps=1, so it perturbs the scheme at O(dt) even though Crank-Nicolson is</span></span>
<span id="cb36-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second order. Measured REFERENCE-FREE, from successive differences alone:</span></span>
<span id="cb36-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># log2[(m(dt) - m(dt/2)) / (m(dt/2) - m(dt/4))] needs no converged value.</span></span>
<span id="cb36-63">DTS_RF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.125</span>)</span>
<span id="cb36-64">M1_RF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer"</span>, dt): m1 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt, _, m1 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> dt_rows}      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dt &gt;= 1 solved above</span></span>
<span id="cb36-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DTS_RF:</span>
<span id="cb36-66">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer"</span>, dt) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M1_RF:</span>
<span id="cb36-67">        M1_RF[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer"</span>, dt)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dt)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb36-68">    M1_RF[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limiter=None"</span>, dt)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dt, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb36-69"></span>
<span id="cb36-70"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ord_reffree(tag):</span>
<span id="cb36-71">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [M1_RF[(tag, dt)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DTS_RF]</span>
<span id="cb36-72">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2((m[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m[k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (m[k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m[k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])))</span>
<span id="cb36-73">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DTS_RF) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)]</span>
<span id="cb36-74"></span>
<span id="cb36-75">ORD_RF_VL, ORD_RF_NL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ord_reffree(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer"</span>), ord_reffree(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limiter=None"</span>)</span>
<span id="cb36-76">fmt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> o: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> o)</span>
<span id="cb36-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Reference-free successive-difference orders on mu1(z2), n_z = 700,"</span>)</span>
<span id="cb36-78"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DTS_RF[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DTS_RF[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s (no converged reference is used):"</span>)</span>
<span id="cb36-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   van Leer, sweeps = 1 (this page's setting):  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fmt(ORD_RF_VL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-80"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   limiter = None (Crank-Nicolson alone):       </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fmt(ORD_RF_NL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Crank-Nicolson IS second order here: the limiter-free control climbs to"</span>)</span>
<span id="cb36-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_RF_NL[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. What is first order is the DEFERRED CORRECTION, which is lagged"</span>)</span>
<span id="cb36-83"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   one step at sweeps = 1; with it on the last three orders are "</span></span>
<span id="cb36-84">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_RF_VL[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_RF_VL[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_RF_VL[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -"</span>)</span>
<span id="cb36-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   first order, not second. So </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_DT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> above is a PRE-ASYMPTOTIC three-point fit"</span>)</span>
<span id="cb36-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   on the coarse end of that sequence, not evidence of a second-order"</span>)</span>
<span id="cb36-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   integration in time."</span>)</span>
<span id="cb36-88"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   It is claimed only as a range, 1.5 to 2.5 (a fit of differences of nearly"</span>)</span>
<span id="cb36-89"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   equal moments, whose digits move with the numerical environment), it is the"</span>)</span>
<span id="cb36-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   metric the break row below moves, and no result on this page needs it to be 2."</span>)</span>
<span id="cb36-91"></span>
<span id="cb36-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The order is a claim about the SCHEME, so break the scheme: theta = 1 is</span></span>
<span id="cb36-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># backward Euler, first order in time, and nothing else changes.</span></span>
<span id="cb36-94">be_rows, ORD_DT_BE, DT_SWING_H_BE, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dt_sweep(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb36-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Same sweep with BACKWARD EULER (theta = 1) in place of Crank-Nicolson:"</span>)</span>
<span id="cb36-96"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt, H_, m1_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> be_rows:</span>
<span id="cb36-97">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   dt </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s   H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   mu1(z2) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m1_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s"</span>)</span>
<span id="cb36-98"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   observed time order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_DT_BE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_DT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and H itself now "</span></span>
<span id="cb36-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"swings </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT_SWING_H_BE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb36-100"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   over the same 8x, against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT_SWING_H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with Crank-Nicolson. The order and"</span>)</span>
<span id="cb36-101"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   the dt-insensitivity are both properties of the scheme, and both move when"</span>)</span>
<span id="cb36-102"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   the scheme does; theta = 0.5 is used for every reported number."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Grid, van Leer deferred correction (dt = 0.5 s throughout)
   n_z   350  h = 2.0000 mm   H = 2.047647   |dev| 2.642e-03
   n_z   700  h = 1.0000 mm   H = 2.042926   |dev| 3.300e-04
   n_z  1400  h = 0.5000 mm   H = 2.042337   |dev| 4.120e-05
   observed order 3.00

Grid, BARE UPWIND - predicted H_num = H + h exactly
   n_z   350  h = 2.0000 mm   H = 4.042210   (H - H_38)/h = 0.99998
   n_z   700  h = 1.0000 mm   H = 3.042252   (H - H_38)/h = 1.00000
   n_z  1400  h = 0.5000 mm   H = 2.542252   (H - H_38)/h = 1.00000
   observed order 1.00 (first order, against 3.00 with the limiter)
   mean coefficient 0.99999 against the predicted 1 (|error| 7.2e-06)

Time step (n_z = 700). Two metrics: the two-station H, and the absolute
first moment at z2, which carries the time-quadrature error undifferenced.
   dt   8.0 s   H = 2.0429244   mu1(z2) = 4728.056510 s
   dt   4.0 s   H = 2.0429269   mu1(z2) = 4728.122280 s
   dt   2.0 s   H = 2.0429261   mu1(z2) = 4728.139249 s
   dt   1.0 s   H = 2.0429263   mu1(z2) = 4728.143948 s

   over an 8x change in dt:  H moves 1.20e-06 relative,
                             mu1(z2) moves 1.85e-05 relative
   observed time order on mu1(z2): 2.11  (three-point fit on dt = 8/4/2 s
      against the dt = 1 s value as the reference)
   The two-station H is therefore NOT dt-limited at these settings; it is
   grid-limited. Both axes are measured; only one carries the error.

Reference-free successive-difference orders on mu1(z2), n_z = 700,
dt = 8 -&gt; 0.125 s (no converged reference is used):
   van Leer, sweeps = 1 (this page's setting):  +1.95 +1.85 +1.10 +1.00 +0.78
   limiter = None (Crank-Nicolson alone):       +1.85 +1.96 +1.99 +2.00 +2.00
   Crank-Nicolson IS second order here: the limiter-free control climbs to
   2.00. What is first order is the DEFERRED CORRECTION, which is lagged
   one step at sweeps = 1; with it on the last three orders are 1.10, 1.00, 0.78 -
   first order, not second. So 2.11 above is a PRE-ASYMPTOTIC three-point fit
   on the coarse end of that sequence, not evidence of a second-order
   integration in time.
   It is claimed only as a range, 1.5 to 2.5 (a fit of differences of nearly
   equal moments, whose digits move with the numerical environment), it is the
   metric the break row below moves, and no result on this page needs it to be 2.

Same sweep with BACKWARD EULER (theta = 1) in place of Crank-Nicolson:
   dt   8.0 s   H = 3.0713906   mu1(z2) = 4728.128265 s
   dt   4.0 s   H = 2.5571369   mu1(z2) = 4728.113103 s
   dt   2.0 s   H = 2.3000239   mu1(z2) = 4728.138017 s
   dt   1.0 s   H = 2.1714728   mu1(z2) = 4728.144698 s
   observed time order 0.65 against 2.11, and H itself now swings 4.1e-01
   over the same 8x, against 1.2e-06 with Crank-Nicolson. The order and
   the dt-insensitivity are both properties of the scheme, and both move when
   the scheme does; theta = 0.5 is used for every reported number.</code></pre>
</div>
</div>
</section>
<section id="break-table" class="level3">
<h3 class="anchored" data-anchor-id="break-table">Break table</h3>
<p>Every number this page reports needs something that moves it. The last row is a deliberate <em>non</em>-mover, included because the insensitivity is the design claim being made: the inlet condition moves the two-station <img src="https://latex.codecogs.com/png.latex?H"> by less than <img src="https://latex.codecogs.com/png.latex?10%5E%7B-5%7D"> relative. That claim is a bound, not a value, because it is a difference of two nearly equal plate heights; what breaks it is reading <img src="https://latex.codecogs.com/png.latex?H"> from ONE station, where the same change of inlet condition is no longer cancelled.</p>
<div id="8bada27f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:25.714880Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:25.714705Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:35.678220Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:35.677025Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1">brk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb38-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> add(label, value, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>):</span>
<span id="cb38-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Every row is judged against the BASELINE run, which is what 'does it move'</span></span>
<span id="cb38-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    means; the deviation from eq (38) is shown too, because that is the metric."""</span></span>
<span id="cb38-5">    base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brk[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> brk <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> value</span>
<span id="cb38-6">    brk.append((label, value, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(value, base)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(value, H38)), note))</span>
<span id="cb38-7"></span>
<span id="cb38-8">_, _, zsb, Kcb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb38-9">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline: H from pymrm (n_z=700, dt=2, van Leer)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(Kcb, zsb)))</span>
<span id="cb38-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bare upwind (limiter=None)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)),</span>
<span id="cb38-11">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"coarse grid, n_z = 175"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">175</span>)),</span>
<span id="cb38-12">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_II halved (a different phase ratio)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>()),</span>
<span id="cb38-13">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha halved"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ALPHA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)),</span>
<span id="cb38-14">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K perturbed by +1 %"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>)),</span>
<span id="cb38-15">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D perturbed by +1 %"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D_LONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>)),</span>
<span id="cb38-16">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time window truncated to 60 %"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T_END))):</span>
<span id="cb38-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lab.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F_II halved"</span>):</span>
<span id="cb38-18">        col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Column(U_INT, D_LONG, ALPHA, KK, FI, FII <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, L_TOT, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>)</span>
<span id="cb38-19">        ts_, rec_, zs_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> col.run(T_END, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, T_SIG, [Z1, Z2])</span>
<span id="cb38-20">        Kc_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [cumulants(ts_, rec_[:, j]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)]</span>
<span id="cb38-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb38-22">        kw2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> kw2.update(kw)</span>
<span id="cb38-23">        _, _, zs_, Kc_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw2)</span>
<span id="cb38-24">    add(lab, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(Kc_, zs_)))</span>
<span id="cb38-25"></span>
<span id="cb38-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nu is load-bearing and is stated in a comment in Column.__init__; on a slab</span></span>
<span id="cb38-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid that starts at z = 0 the cylindrical divergence is singular there, so the</span></span>
<span id="cb38-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># wrong nu does not perturb the answer - it destroys the solve outright.</span></span>
<span id="cb38-29"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> np.errstate(invalid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>, divide<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>):</span>
<span id="cb38-30">    _, _, zsN, KcN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb38-31">    H_nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(KcN, zsN))</span>
<span id="cb38-32">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"construct_div with nu=1 (cylindrical)"</span>, H_nu, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"singular at z=0: NaN, not a perturbation"</span>)</span>
<span id="cb38-33"></span>
<span id="cb38-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a single station instead of two: the entrance effect is no longer cancelled</span></span>
<span id="cb38-35">_, rec1, zs1, Kc1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb38-36">mu1_in, mu2_in <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T_SIG, T_SIG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exact for the Gaussian slug</span></span>
<span id="cb38-37">H_single <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(zs1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Kc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu2_in) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Kc1[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu1_in) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb38-38">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ONE station (z2 = 600 mm) instead of two"</span>, H_single)</span>
<span id="cb38-39">_, _, zsS, KcS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, stations<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, Z2))</span>
<span id="cb38-40">H_single_short <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(zsS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (KcS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu2_in) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (KcS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu1_in) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb38-41">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ONE station at z = 20 mm (a short column)"</span>, H_single_short)</span>
<span id="cb38-42"></span>
<span id="cb38-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a deliberate non-mover: the inlet condition, which the difference must cancel</span></span>
<span id="cb38-44">_, _, zsD, KcD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>,</span>
<span id="cb38-45">                       bc_left<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>})   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Dirichlet inlet</span></span>
<span id="cb38-46">H_DIR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(plate_height(KcD, zsD))</span>
<span id="cb38-47">add(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dirichlet inlet instead of Danckwerts"</span>, H_DIR, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DESIGNED non-mover"</span>)</span>
<span id="cb38-48">BC_MOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brk[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># against the BASELINE run</span></span>
<span id="cb38-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what breaks that insensitivity: the same inlet change read from ONE station</span></span>
<span id="cb38-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (z2), where nothing cancels it. Same two runs, no new solve.</span></span>
<span id="cb38-51">H_single_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(zsD[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (KcD[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu2_in) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (KcD[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu1_in) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb38-52">BC_MOVE_SINGLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(H_single_D, H_single)))</span>
<span id="cb38-53"></span>
<span id="cb38-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'break'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;44}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H (mm)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'move vs base'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|dev| eq (38)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  note"</span>)</span>
<span id="cb38-55"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, v, dbase, d38, note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> brk:</span>
<span id="cb38-56">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;44}{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10.5f}{</span>dbase<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14.2e}{</span>d38<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>note<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-57">moves <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [d <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, v, d, d38, note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> brk[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(d)]</span>
<span id="cb38-58">BREAK_MIN_MOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(moves))</span>
<span id="cb38-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   smallest move among the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(moves)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> genuine breaks: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BREAK_MIN_MOVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb38-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BREAK_MIN_MOVE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(H_REL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the baseline's own error against eq (38)"</span>)</span>
<span id="cb38-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   nu = 1 gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>H_nu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - the wrong geometry does not bias this model, it"</span>)</span>
<span id="cb38-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   removes it, which is a weaker kind of alarm and is labelled as one."</span>)</span>
<span id="cb38-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Changing the INLET CONDITION moves H by less than 1e-5 relative to the"</span>)</span>
<span id="cb38-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   baseline (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BC_MOVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) - the two-station difference cancels it, as"</span>)</span>
<span id="cb38-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   designed and claimed. Read from ONE station (z2) the same change moves H by"</span>)</span>
<span id="cb38-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BC_MOVE_SINGLE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: that is the row that breaks the claim."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>break                                           H (mm)  move vs base  |dev| eq (38)  note
baseline: H from pymrm (n_z=700, dt=2, van Leer)   2.04293      0.00e+00       3.30e-04  
bare upwind (limiter=None)                     3.04225      4.89e-01       4.90e-01  
coarse grid, n_z = 175                         2.08441      2.03e-02       2.06e-02  
F_II halved (a different phase ratio)          1.62107      2.06e-01       2.06e-01  
alpha halved                                   2.75586      3.49e-01       3.49e-01  
K perturbed by +1 %                            2.03494      3.91e-03       3.58e-03  
D perturbed by +1 %                            2.05621      6.50e-03       6.84e-03  
time window truncated to 60 %                 -1.18597      1.58e+00       1.58e+00  
construct_div with nu=1 (cylindrical)              nan           nan            nan  singular at z=0: NaN, not a perturbation
ONE station (z2 = 600 mm) instead of two       2.04341      2.36e-04       5.66e-04  
ONE station at z = 20 mm (a short column)      2.03265      5.03e-03       4.70e-03  
Dirichlet inlet instead of Danckwerts          2.04293      1.51e-06       3.31e-04  DESIGNED non-mover

   smallest move among the 9 genuine breaks: 2.4e-04, i.e. 6x the baseline's own error against eq (38)
   nu = 1 gives nan - the wrong geometry does not bias this model, it
   removes it, which is a weaker kind of alarm and is labelled as one.

   Changing the INLET CONDITION moves H by less than 1e-5 relative to the
   baseline (here 1.5e-06) - the two-station difference cancels it, as
   designed and claimed. Read from ONE station (z2) the same change moves H by
   3.9e-04: that is the row that breaks the claim.</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Not the plate height.</strong> Eq. (38) is exact for this model — the Laplace route in the implementation section proves it, and the PDE reproduces it to <img src="https://latex.codecogs.com/png.latex?4%5Ctimes10%5E%7B-5%7D">. Nothing here improves on it.</p>
<p>What the paper leaves open is the <em>other</em> half of eqs. (33)/(34). The Gaussian is stated to hold “for locations <img src="https://latex.codecogs.com/png.latex?z"> much larger than both <img src="https://latex.codecogs.com/png.latex?2D/u"> and <img src="https://latex.codecogs.com/png.latex?F_I%20u/%5Calpha">”, and the appendix restates the same two conditions as <img src="https://latex.codecogs.com/png.latex?2D/(uz)%20%5Cll%201"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta%5E2%20F_%7BII%7D%5E2%20%5C,%202u/(K%5E2%20F_I%20%5Calpha%20z)%20%5Cll%201">. How much smaller than 1 is never said, and it cannot be read off Table 3 or Table 4 — those record widths, not shapes.</p>
<p>It can be computed. The <strong>cumulants</strong> of the response are exactly additive along the column, so <img src="https://latex.codecogs.com/png.latex?%5Ckappa_2">, <img src="https://latex.codecogs.com/png.latex?%5Ckappa_3"> and <img src="https://latex.codecogs.com/png.latex?%5Ckappa_4"> <em>per unit length</em> fix the skewness and excess kurtosis of a column of any length in closed form:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cgamma_1(z)%20=%20%5Cfrac%7B%5Ckappa_3/z%7D%7B(%5Ckappa_2/z)%5E%7B3/2%7D%7D%5C,%5Cfrac%7B1%7D%7B%5Csqrt%20z%7D,%0A%5Cqquad%0A%5Cgamma_2(z)%20=%20%5Cfrac%7B%5Ckappa_4/z%7D%7B(%5Ckappa_2/z)%5E%7B2%7D%7D%5C,%5Cfrac%7B1%7D%7Bz%7D."></p>
<p>The Gaussian has <img src="https://latex.codecogs.com/png.latex?%5Cgamma_1%20=%20%5Cgamma_2%20=%200">, so these <em>are</em> the error the two conditions are supposed to control.</p>
<p><strong>Where the four cumulants come from matters, so it is stated plainly.</strong> <img src="https://latex.codecogs.com/png.latex?%5Ckappa_1"> to <img src="https://latex.codecogs.com/png.latex?%5Ckappa_4"> all come from the Laplace expansion of eqs. (29)/(30) in the implementation section — they are exact for this model, and every number quoted below is one of them. What the pymrm run adds is the <em>check</em>: the same two-station reading that produced <img src="https://latex.codecogs.com/png.latex?H"> also produces <img src="https://latex.codecogs.com/png.latex?%5Ckappa_3"> and <img src="https://latex.codecogs.com/png.latex?%5Ckappa_4"> numerically, and the agreement is reported below with the caveat it needs. The PDE’s <img src="https://latex.codecogs.com/png.latex?%5Ckappa_3"> and <img src="https://latex.codecogs.com/png.latex?%5Ckappa_4"> are used for <strong>nothing but that check</strong> — the comparison table and the two agreement metrics it feeds, and no shape number quoted anywhere on the page. Two printed numbers further down do use PDE moments, and are flagged where they appear: the peak-normalised <img src="https://latex.codecogs.com/png.latex?%5Cmax%7C%5Cmathrm%7Bcurve%7D-%5Cmathrm%7BGaussian%7D%7C"> under the figure below overlays each computed curve with a Gaussian built from <em>that curve’s own</em> mean and variance. Those two are a configuration-dependent scale, not agreement metrics, and nothing rests on them.</p>
<div id="994a846b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:35.679950Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:35.679782Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:36.768158Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:36.767336Z&quot;}}" data-execution_count="23">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1">kap_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kap_f(D_LONG, U_INT, ALPHA, FI, FII, KK)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># analytic, per unit length</span></span>
<span id="cb40-2">dz_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zs_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zs_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb40-3">k2_pdes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz_r</span>
<span id="cb40-4">k3_pdes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz_r</span>
<span id="cb40-5">k4_pdes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dz_r</span>
<span id="cb40-6"></span>
<span id="cb40-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'per unit length'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;18}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'analytic (Laplace)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm PDE'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, an, nu_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa_1  (s/mm)"</span>, kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], (Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>Kc_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>dz_r),</span>
<span id="cb40-9">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa_2 (s2/mm)"</span>, kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], k2_pdes),</span>
<span id="cb40-10">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa_3 (s3/mm)"</span>, kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], k3_pdes),</span>
<span id="cb40-11">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa_4 (s4/mm)"</span>, kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], k4_pdes)):</span>
<span id="cb40-12">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;18}{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(an)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22.6g}{</span>nu_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16.6g}{</span>dev(nu_, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(an))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+10.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-13">K3_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(k3_pdes, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))))</span>
<span id="cb40-14">K4_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(k4_pdes, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]))))</span>
<span id="cb40-15">k2a, k3a, k4a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_num[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb40-16"></span>
<span id="cb40-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Read those two deviations carefully: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K3_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K4_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are NOT"</span>)</span>
<span id="cb40-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   converged discretisation errors. The grid error on the higher cumulants is"</span>)</span>
<span id="cb40-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   POSITIVE and the time error NEGATIVE, so at fixed grid they cancel - and the"</span>)</span>
<span id="cb40-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   cancellation passes through zero inside the dt range used on this page:"</span>)</span>
<span id="cb40-21">_, _, zsK, KcK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb40-22">KAPZ[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kappas_per_z(KcK, zsK)</span>
<span id="cb40-23">KAPZ[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (k3_pdes, k4_pdes)</span>
<span id="cb40-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_z'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dt (s)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kappa_3 dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kappa_4 dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-25"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb40-26">    k3_, k4_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KAPZ[(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span>, dt)]</span>
<span id="cb40-27">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1400</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span>dt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9.1f}{</span>dev(k3_, k3a)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+14.2e}{</span>dev(k4_, k4a)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;+14.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   So </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K3_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is what the PDE gives AT THESE SETTINGS, and is an upper bound"</span>)</span>
<span id="cb40-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   on nothing: it must not be read as 'the third cumulant agrees to 0.2 %' in"</span>)</span>
<span id="cb40-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   general. The quantity that does converge cleanly here is H itself"</span>)</span>
<span id="cb40-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(H_REL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, grid order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_GRID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, moving only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DT_SWING_H<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over 8x in dt),"</span>)</span>
<span id="cb40-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   because the two-station difference cancels the time error and the higher"</span>)</span>
<span id="cb40-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   cumulants have no such protection. Everything quoted below is analytic."</span>)</span>
<span id="cb40-34"></span>
<span id="cb40-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Both quoted shape numbers use the ANALYTIC cumulants; the PDE's are the check.</span></span>
<span id="cb40-36">skew <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: k3a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k2a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(z))</span>
<span id="cb40-37">exk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: k4a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k2a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> z)</span>
<span id="cb40-38">G1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> D_LONG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> z)                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the paper's first condition</span></span>
<span id="cb40-39">G2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U_INT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> INV_ALPHA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> z                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># transfer-unit height / z</span></span>
<span id="cb40-40"></span>
<span id="cb40-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'z (mm)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'2D/(uz)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'F_I u/(alpha z)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'skewness'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ex. kurtosis'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, L_SW, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1800.0</span>):</span>
<span id="cb40-43">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9.0f}{</span>G1(z)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.4f}{</span>G2(z)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18.4f}{</span>skew(z)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11.4f}{</span>exk(z)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-44">SKEW_SW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(skew(L_SW))</span>
<span id="cb40-45">SKEW_GLC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(skew(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1800.0</span>))</span>
<span id="cb40-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   At the ion-exclusion column recovered from Table 3 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_SW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm) the"</span>)</span>
<span id="cb40-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   paper's two groups are </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G1(L_SW)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G2(L_SW)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - comfortably '&lt;&lt; 1' -"</span>)</span>
<span id="cb40-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   and the elution curve is still skewed by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SKEW_SW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb40-49"></span>
<span id="cb40-50">Z_SKEW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: skew(z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb40-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Root-found (not swept): skewness falls to 0.05 only at z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Z_SKEW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>)</span>
<span id="cb40-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Z_SKEW<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>L_SW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the column actually used, where the paper's groups"</span>)</span>
<span id="cb40-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   are </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G1(Z_SKEW)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G2(Z_SKEW)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb40-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">   The reason is in the exponents. Both of the paper's groups fall as 1/z;"</span>)</span>
<span id="cb40-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   the skewness falls only as 1/sqrt(z) and the excess kurtosis as 1/z, so"</span>)</span>
<span id="cb40-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   'the groups are small' and 'the curve is Gaussian' are not the same"</span>)</span>
<span id="cb40-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   statement and differ by a square root. Satisfying 2D/(uz) &lt; 1e-2 leaves"</span>)</span>
<span id="cb40-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   a skewness of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>skew(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: G1(z)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; reaching a"</span>)</span>
<span id="cb40-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   skewness of 0.05 needs it below 3e-4."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>per unit length       analytic (Laplace)       pymrm PDE       dev
kappa_1  (s/mm)                  7.77684         7.77684    -0.00%
kappa_2 (s2/mm)                  123.514         123.519    +0.00%
kappa_3 (s3/mm)                  4655.28            4665    +0.21%
kappa_4 (s4/mm)                   274360          278513    +1.51%

   Read those two deviations carefully: 2.1e-03 and 1.5e-02 are NOT
   converged discretisation errors. The grid error on the higher cumulants is
   POSITIVE and the time error NEGATIVE, so at fixed grid they cancel - and the
   cancellation passes through zero inside the dt range used on this page:
      n_z   dt (s)   kappa_3 dev   kappa_4 dev
     1400      0.5     +7.58e-03     +2.38e-02
     1400      1.0     +2.09e-03     +1.51e-02
     1400      2.0     -1.02e-02     -3.61e-03
   So 2.1e-03 is what the PDE gives AT THESE SETTINGS, and is an upper bound
   on nothing: it must not be read as 'the third cumulant agrees to 0.2 %' in
   general. The quantity that does converge cleanly here is H itself
   (4.1e-05, grid order 3.00, moving only 1.2e-06 over 8x in dt),
   because the two-station difference cancels the time error and the higher
   cumulants have no such protection. Everything quoted below is analytic.

   z (mm)    2D/(uz)   F_I u/(alpha z)   skewness  ex. kurtosis
        5     0.2658            0.3772     1.5167        3.5968
       20     0.0665            0.0943     0.7583        0.8992
      558     0.0024            0.0034     0.1435        0.0322
     1800     0.0007            0.0010     0.0799        0.0100

   At the ion-exclusion column recovered from Table 3 (558 mm) the
   paper's two groups are 0.0024 and 0.0034 - comfortably '&lt;&lt; 1' -
   and the elution curve is still skewed by 0.144.

   Root-found (not swept): skewness falls to 0.05 only at z = 4601 mm
   = 8.2 times the column actually used, where the paper's groups
   are 2.89e-04 and 4.10e-04.

   The reason is in the exponents. Both of the paper's groups fall as 1/z;
   the skewness falls only as 1/sqrt(z) and the excess kurtosis as 1/z, so
   'the groups are small' and 'the curve is Gaussian' are not the same
   statement and differ by a square root. Satisfying 2D/(uz) &lt; 1e-2 leaves
   a skewness of 0.294; reaching a
   skewness of 0.05 needs it below 3e-4.</code></pre>
</div>
</div>
<div id="73256df2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:36.770548Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:36.770264Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:37.367173Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:37.366634Z&quot;}}" data-execution_count="24">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb42-1">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>))</span>
<span id="cb42-2">zz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb42-3">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(zz, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(skew(zz)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"skewness </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma_1 </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">propto z</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1/2}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb42-4">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(zz, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(exk(zz)), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>,</span>
<span id="cb42-5">               label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"excess kurtosis </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">gamma_2 </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">propto z</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb42-6">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(zz, G1(zz), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2D/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">uz</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb42-7">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(zz, G2(zz), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">F_I u/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">lpha z</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb42-8">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axvline(L_SW, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb42-9">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ion-exclusion column</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(recovered, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_SW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm)"</span>, (L_SW, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-3</span>),</span>
<span id="cb42-10">                 fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"right"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.3"</span>)</span>
<span id="cb42-11">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-."</span>)</span>
<span id="cb42-12">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"column length $z$ (mm)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"magnitude"</span>,</span>
<span id="cb42-13">            ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The paper's two conditions fall faster than the error they bound"</span>)</span>
<span id="cb42-14">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower left"</span>)</span>
<span id="cb42-15"></span>
<span id="cb42-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>((Z1, Z2)):</span>
<span id="cb42-17">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rec_r[:, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.trapezoid(rec_r[:, j], ts_r)</span>
<span id="cb42-18">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ts_r, y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> y.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm, $z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>zs_r[j]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ mm"</span>)</span>
<span id="cb42-19">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((ts_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc_r[j][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(Kc_r[j][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb42-20">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(ts_r, g, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>,</span>
<span id="cb42-21">                 label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Gaussian, eq. (33)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb42-22">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time (s)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$c_I$, normalised to its own peak"</span>,</span>
<span id="cb42-23">            title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Elution curves and the Gaussian they are claimed to be"</span>)</span>
<span id="cb42-24">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb42-25">plt.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb42-26"></span>
<span id="cb42-27">gauss_err <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb42-28"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>):</span>
<span id="cb42-29">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rec_r[:, j]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> y.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb42-30">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((ts_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Kc_r[j][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(Kc_r[j][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb42-31">    gauss_err.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()))</span>
<span id="cb42-32">GAUSS_ERR_Z2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gauss_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb42-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   max |curve - Gaussian| (peak-normalised): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gauss_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>zs_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm,"</span></span>
<span id="cb42-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gauss_err[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>zs_r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>)</span>
<span id="cb42-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Each Gaussian uses that curve's OWN pymrm mean and variance - these two"</span>)</span>
<span id="cb42-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   numbers are the one place on the page where a PDE moment reaches print."</span>)</span>
<span id="cb42-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   Both curves carry the Danckwerts inlet and the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_SIG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s Gaussian slug, so"</span>)</span>
<span id="cb42-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   they are configuration-dependent in a way the cumulants are not; they are"</span>)</span>
<span id="cb42-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   shown for scale, and the skewness above is the transferable one."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.10-van-deemter-plate-height/index_files/figure-html/cell-25-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>   max |curve - Gaussian| (peak-normalised): 0.0563 at z = 200 mm, 0.0323 at z = 600 mm
   Each Gaussian uses that curve's OWN pymrm mean and variance - these two
   numbers are the one place on the page where a PDE moment reaches print.
   Both curves carry the Danckwerts inlet and the 12 s Gaussian slug, so
   they are configuration-dependent in a way the cumulants are not; they are
   shown for scale, and the skewness above is the transferable one.</code></pre>
</div>
</div>
<section id="break-table-part-2-the-algebra-and-the-extractions" class="level3">
<h3 class="anchored" data-anchor-id="break-table-part-2-the-algebra-and-the-extractions">Break table, part 2: the algebra and the extractions</h3>
<p>The table above moves the PDE. This one moves everything else. Each row names the metric it guards, so the coverage map below is generated from <strong>measured</strong> movers rather than asserted — a page whose own break table contradicts its coverage claim has happened in this repository before.</p>
<div id="d85d86d4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:37.369772Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:37.369614Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:39.941573Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:39.940833Z&quot;}}" data-execution_count="25">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb44-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Breaks on the algebra and on the extractions - no PDE involved."</span>)</span>
<span id="cb44-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Each row is a deliberate error; the last column is the size of the move.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb44-3">abrk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb44-4"></span>
<span id="cb44-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the symbolic chain: 75 -&gt; 80 in eq (49)'s viscous term ------------------</span></span>
<span id="cb44-6">C_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb44-7">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FI_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FII_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb44-8">H49_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DI_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> l_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> C_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DI_</span>
<span id="cb44-9">r2_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.simplify(H_38.subs({D_: D_48, a_: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> inv_alpha}) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dp_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H49_bad)</span>
<span id="cb44-10">CHAIN_BREAK_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r2_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb44-11">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_chain_residual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (49): 75 -&gt; 80 in the viscous term"</span>,</span>
<span id="cb44-12">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r2_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"non-zero"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0 -&gt; non-zero"</span>))</span>
<span id="cb44-13"></span>
<span id="cb44-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- D_II and lambda: the two inputs the regression actually depends on -------</span></span>
<span id="cb44-15">dp_mesh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.297</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.149</span>)                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># US 50 and 100 mesh openings, mm</span></span>
<span id="cb44-16">(twolam_mesh, S_mesh), _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_eq49(u_sup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dp_mesh, Ymid)</span>
<span id="cb44-17">DII_MESH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DII_from_slope(S_mesh, D_I_MM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb44-18">DII_MESH_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(DII_MESH, DII_BEST)))</span>
<span id="cb44-19">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_from_table3_rel_dev"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"d_p = mesh geo-mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dp_mesh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm, not Table 3's"</span>,</span>
<span id="cb44-20">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_MESH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_MESH_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-21">(twolam_drop, S_drop), _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_eq49(X[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], Ymid[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb44-22">DII_DROP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DII_from_slope(S_drop, D_I_MM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb44-23">DII_DROP_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(DII_DROP, DII_BEST)))</span>
<span id="cb44-24">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_from_table3_rel_dev"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"drop the fastest row (u = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>u_sup[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm/s)"</span>,</span>
<span id="cb44-25">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_DROP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m2/s"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DII_DROP_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _spread(ac):</span>
<span id="cb44-27">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [b_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ac) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0e-3</span>)]</span>
<span id="cb44-28">    vals.append(b_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> FI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xK) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb44-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(vals) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(vals) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb44-30">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_D_I_sensitivity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"75 -&gt; 7.5 in eq (49) (viscous term x10)"</span>,</span>
<span id="cb44-31">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_spread(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>a_c)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(_spread(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>a_c), DII_SPREAD))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-32">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_from_table3_rel_dev"</span>,</span>
<span id="cb44-33">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"restore the 1/X molecular term the paper drops"</span>,</span>
<span id="cb44-34">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, two_lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-35">(twolam_d, _), _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_eq49(X[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], Ymid[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb44-36">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_from_table3_rel_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop the slowest row"</span>,</span>
<span id="cb44-37">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"lambda = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>twolam_d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(twolam_d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, two_lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-38"></span>
<span id="cb44-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- d_f, eq (56), the slope ratio -------------------------------------------</span></span>
<span id="cb44-40">df_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_n_butane"</span>]</span>
<span id="cb44-41">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_iso_butane"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DII_FILM</span>
<span id="cb44-42">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_iso_butane"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span></span>
<span id="cb44-43">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"df_worst_rel_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iso-butane x used on the n-butane C"</span>,</span>
<span id="cb44-44">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>df_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> um"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(df_bad, df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Celite, n-butane'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-45">r56_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> coef <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_dp"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb44-46">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq56_celite_rel_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol d_p on the Celite d_f"</span>,</span>
<span id="cb44-47">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r56_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(r56_bad, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ratio56_celite'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>))</span>
<span id="cb44-48">ratio_swapped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> shape(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_n_butane"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> shape(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KFI_over_FII_iso_butane"</span>])</span>
<span id="cb44-49">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_ratio_rel_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two printed x exchanged"</span>,</span>
<span id="cb44-50">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ratio_swapped<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(ratio_swapped, ratio_theory))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-51"></span>
<span id="cb44-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Table 1 and Table 3 ------------------------------------------------------</span></span>
<span id="cb44-53">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_calc_frac_reproduced"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v sqrt(n) = 41.25 (dS0 = 165 exactly)"</span>,</span>
<span id="cb44-54">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_match(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_S0_glc'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-55">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(CALC_N_OK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>n_match(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'delta_S0_glc'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of rows lost"</span>))</span>
<span id="cb44-56">printed_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> printed_bad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.88</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A = 122 ml: 0.86 -&gt; 0.88</span></span>
<span id="cb44-57"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _match_bad(w):</span>
<span id="cb44-58">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(cmax(A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> w), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> A, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(A_vals, printed_bad))</span>
<span id="cb44-59">hits_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([_match_bad(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">38.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">46.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>)])</span>
<span id="cb44-60">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_dS0_window_lo_ml"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one printed calc cell altered (A = 122: 0.86 -&gt; 0.88)"</span>,</span>
<span id="cb44-61">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"best </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hits_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-62">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window empties"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> hits_bad.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> CALC_N_OK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no move"</span>))</span>
<span id="cb44-63">L_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([(T3.n_plates_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T3.hetp_hi_mm).to_numpy(),</span>
<span id="cb44-64">                        (T3.n_plates_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T3.hetp_lo_mm).to_numpy()])</span>
<span id="cb44-65">L_bad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3.n_plates_lo.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.3</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 0.93 mis-read as 9.3, a plausible slip</span></span>
<span id="cb44-66">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_recovered_length_mm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 cell 0.93 mis-read as 9.3 mm"</span>,</span>
<span id="cb44-67">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb44-68">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(L_bad.mean(), L_SW))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the band stops being a band"</span>))</span>
<span id="cb44-69">n_solvable <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb44-70"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> single.iterrows():</span>
<span id="cb44-71">    f_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: width_red(r.feed_volume_ml <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> w, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r.width_at_base_ml</span>
<span id="cb44-72">    ws_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(r.feed_volume_ml <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4000</span>)</span>
<span id="cb44-73">    vals_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([f_(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ws_])</span>
<span id="cb44-74">    n_solvable <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(np.diff(np.sign(vals_)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb44-75">EQ21_N_SOLVABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(n_solvable)</span>
<span id="cb44-76">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_n_median_rel_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (21) EXACTLY AS PRINTED for the width route"</span>,</span>
<span id="cb44-77">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ21_N_SOLVABLE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(single)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows solvable"</span>,</span>
<span id="cb44-78">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the width route ceases to exist"</span>))</span>
<span id="cb44-79"></span>
<span id="cb44-80">EQ21_LARGE_A_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(width_red(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta"</span>))</span>
<span id="cb44-81">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21_corrected_large_a_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (21) as printed at a = 5, vs eq (25)"</span>,</span>
<span id="cb44-82">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ21_LARGE_A_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-83">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(EQ21_LARGE_A_PRINTED, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.pi)))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>))</span>
<span id="cb44-84">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21_printed_a0_limit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the corrected denominator, a -&gt; 0"</span>,</span>
<span id="cb44-85">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ21_A0_CORRECTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ21_A0_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-86">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(EQ21_A0_CORRECTED, EQ21_A0_PRINTED))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-87"></span>
<span id="cb44-88"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the fit residual, and the Sterchamol constant ---------------------------</span></span>
<span id="cb44-89">u_nb, h_nb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SERIES[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>]</span>
<span id="cb44-90">u_ib, h_ib <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SERIES[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>]</span>
<span id="cb44-91">rmse_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(((vd(u_ib, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_B_iso_butane"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_A_iso_butane"</span>],</span>
<span id="cb44-92">                              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_C_iso_butane"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h_ib) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb44-93">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_fit_rmse_mm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C for iso-butane (the max-rmse series) x1.5"</span>,</span>
<span id="cb44-94">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rmse </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rmse_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>,</span>
<span id="cb44-95">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(rmse_bad, fitstat[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Celite, iso-butane'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rmse'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-96">u_keep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> u_nb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span></span>
<span id="cb44-97">null_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(((h_nb[u_keep] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h_nb[u_keep].mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).mean()))</span>
<span id="cb44-98">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_null_rmse_mm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two slowest Celite rows dropped"</span>,</span>
<span id="cb44-99">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"null rmse </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>null_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>,</span>
<span id="cb44-100">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(null_bad, fitstat[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Celite, n-butane'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'null'</span>]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-101">b3_off, se3_off, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> refit(us_, hs_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb44-102">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_free_A_t_stat"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.3 mm added to every Sterchamol H"</span>,</span>
<span id="cb44-103">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"|t| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b3_off[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>se3_off[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-104">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(A_STER_T)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-105"></span>
<span id="cb44-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the cumulant results -----------------------------------------------------</span></span>
<span id="cb44-107">kap_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kap_f(D_LONG, U_INT, ALPHA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, FI, FII, KK)</span>
<span id="cb44-108">skew_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_half[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_half[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(L_SW))</span>
<span id="cb44-109">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"skewness_at_recovered_column"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha halved (analytic kappa_3)"</span>,</span>
<span id="cb44-110">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"skew </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>skew_half<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(skew_half, SKEW_SW))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-111">Z_half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_half[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(kap_half[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.sqrt(z)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>)</span>
<span id="cb44-112">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z_for_skewness_0p05_mm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same, on the root-found length"</span>,</span>
<span id="cb44-113">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Z_half<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(Z_half, Z_SKEW))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-114">_, _, zsT, KcT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve(n_z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">700</span>, dt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, t_end<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T_END)</span>
<span id="cb44-115">k3_trunc, k4_trunc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kappas_per_z(KcT, zsT)</span>
<span id="cb44-116">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_kappa3_vs_laplace_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time window truncated to 60 %"</span>,</span>
<span id="cb44-117">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"kappa_3/z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k3_trunc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(k3_trunc, k3a))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-118">abrk.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_kappa4_vs_laplace_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time window truncated to 60 %"</span>,</span>
<span id="cb44-119">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"kappa_4/z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k4_trunc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(k4_trunc, k4a))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb44-120"></span>
<span id="cb44-121"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'metric'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;32}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'break'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;50}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;30}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   move"</span>)</span>
<span id="cb44-122"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m, lab, val, mv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> abrk:</span>
<span id="cb44-123">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;32}{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;50}{</span>val<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;30}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb44-124"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(abrk)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, covering "</span></span>
<span id="cb44-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> abrk))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the metrics reported below."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Breaks on the algebra and on the extractions - no PDE involved.
Each row is a deliberate error; the last column is the size of the move.

metric                          break                                                                      value   move
sym_chain_residual              eq (49): 75 -&gt; 80 in the viscous term                                   non-zero   0 -&gt; non-zero
DII_from_table3_rel_dev         d_p = mesh geo-mean 0.2104 mm, not Table 3's                      1.288e-10 m2/s   4.5%
DII_from_table3_rel_dev         drop the fastest row (u = 0.730 mm/s)                             1.325e-10 m2/s   1.7%
DII_D_I_sensitivity             75 -&gt; 7.5 in eq (49) (viscous term x10)                             spread 21.9%   1097%
lambda_from_table3_rel_dev      restore the 1/X molecular term the paper drops                   lambda = 4.1474   39%
lambda_from_table3_rel_dev      drop the slowest row                                             lambda = 3.5022   17%
df_worst_rel_dev                iso-butane x used on the n-butane C                                     8.357 um   16.9%
eq56_celite_rel_dev             Sterchamol d_p on the Celite d_f                                       1.898e-05   62x
slope_ratio_rel_dev             the two printed x exchanged                                               0.6906   52%
table1_calc_frac_reproduced     v sqrt(n) = 41.25 (dS0 = 165 exactly)                                    9 of 11   18% of rows lost
table1_dS0_window_lo_ml         one printed calc cell altered (A = 122: 0.86 -&gt; 0.88)                 best 10 of 11   window empties
table3_recovered_length_mm      Table 3 cell 0.93 mis-read as 9.3 mm                      mean 810 mm (539-5580)   45%, and the band stops being a band
table3_n_median_rel_dev         eq (21) EXACTLY AS PRINTED for the width route              2 of 9 rows solvable   the width route ceases to exist
eq21_corrected_large_a_dev      eq (21) as printed at a = 5, vs eq (25)                      6.727e+05 vs 7.5066   8.96e+04x
eq21_printed_a0_limit           the corrected denominator, a -&gt; 0                               4.0000 vs 2.0000   100%
eq54_fit_rmse_mm                C for iso-butane (the max-rmse series) x1.5                       rmse 0.5428 mm   92%
eq54_null_rmse_mm               the two slowest Celite rows dropped                          null rmse 0.3429 mm   73%
sterchamol_free_A_t_stat        +0.3 mm added to every Sterchamol H                                   |t| = 2.67   from 0.13
skewness_at_recovered_column    alpha halved (analytic kappa_3)                                      skew 0.1666   16%
z_for_skewness_0p05_mm          same, on the root-found length                                       z = 6198 mm   35%
pymrm_kappa3_vs_laplace_rel     time window truncated to 60 %                                  kappa_3/z = -4339   193%
pymrm_kappa4_vs_laplace_rel     time window truncated to 60 %                               kappa_4/z = 1.44e+05   48%

   22 rows, covering 20 of the metrics reported below.</code></pre>
</div>
</div>
</section>
<section id="claims" class="level3">
<h3 class="anchored" data-anchor-id="claims">Claims</h3>
<p>Every number above is registered once, with how it is checked (<code>docs/claims-design.md</code>): a <strong>value</strong> against the committed baseline within 5 %, a <strong>bound</strong> against its stated limits on every run and every machine, an <strong>exact</strong> result by equality. Residuals, identities, tolerance gaps and the fitted convergence orders are bounds, whatever their size.</p>
<p>Three are bounds for a reason worth stating. <code>pymrm_dt_order_mu1</code> is a three-point fit of differences of nearly equal first moments, claimed only as the range between 1.5 and 2.5 (see the refinement study). <code>pymrm_bc_insensitivity</code> is a difference of two nearly equal plate heights, claimed only as below <img src="https://latex.codecogs.com/png.latex?10%5E%7B-5%7D">. <code>pymrm_grid_order</code> is an observed order, claimed as the range between 2.5 and 3.5.</p>
<p>Two values need a different warning. <code>pymrm_kappa3_vs_laplace_rel</code> and <code>pymrm_kappa4_vs_laplace_rel</code> are <strong>cancellation-limited</strong>, not converged: the grid and time-step errors on the higher cumulants have opposite signs and the reported values sit near where they cancel; the dt table above shows both passing through zero. They are honest at the stated settings and are regression guards like any other, but neither is evidence that the PDE reproduces a cumulant to that precision. The converging companion is <code>pymrm_H_vs_eq38_rel</code>, which is grid-limited at observed order 3 and barely moves with <img src="https://latex.codecogs.com/png.latex?%5CDelta%20t">.</p>
<p>Every claim has a break row that fails its own check: break table 1, break table 2, the bare-upwind and backward-Euler runs of the refinement study, and, for the two identities, a deliberately wrong algebra (75 to 80 in eq. (49)) and a deliberately inverted closed form <img src="https://latex.codecogs.com/png.latex?u_%7B%5Ctext%7Bopt%7D%7D%20=%20%5Csqrt%7BC/B%7D">.</p>
<div id="c452196c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:25:39.943657Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:25:39.943384Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:25:39.973597Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:25:39.972806Z&quot;}}" data-execution_count="26">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE)</span>
<span id="cb46-2"></span>
<span id="cb46-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the second, independent computation of the headline ---------------------</span></span>
<span id="cb46-4">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_H_vs_eq38_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(H_REL),</span>
<span id="cb46-5">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discretisation error at n_z = 1400, dt = 1 s; grid-limited"</span>)</span>
<span id="cb46-6">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_grid_order"</span>, ORD_GRID, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb46-7">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order of the two-station H against eq (38) over a 4x grid"</span></span>
<span id="cb46-8">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" refinement with the van Leer correction; 3.00 measured, bare upwind"</span></span>
<span id="cb46-9">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" gives 1.00"</span>)</span>
<span id="cb46-10">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_upwind_dispersion_coeff_err"</span>, UPWIND_COEF_DEV,</span>
<span id="cb46-11">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|mean (H - H_38)/h - 1| with bare upwind; the prediction is exactly 1"</span>)</span>
<span id="cb46-12">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_dt_order_mu1"</span>, ORD_DT, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb46-13">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pre-asymptotic three-point fit of log|mu1(dt) - mu1(1 s)| on dt = 8, 4,"</span></span>
<span id="cb46-14">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" 2 s; the deferred correction lagged one step makes the scheme first"</span></span>
<span id="cb46-15">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" order asymptotically. A fit of differences of nearly equal moments: it"</span></span>
<span id="cb46-16">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" gives 1.79 and 2.11 under two numpy/scipy versions with identical model"</span></span>
<span id="cb46-17">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" code, so only the range is claimed. Backward"</span></span>
<span id="cb46-18">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" Euler gives 0.91 and 0.65 in the same two environments, below it"</span>)</span>
<span id="cb46-19">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_kappa3_vs_laplace_rel"</span>, K3_DEV,</span>
<span id="cb46-20">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cancellation-limited at n_z = 1400, dt = 1 s; a regression guard"</span>)</span>
<span id="cb46-21">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_kappa4_vs_laplace_rel"</span>, K4_DEV,</span>
<span id="cb46-22">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cancellation-limited at n_z = 1400, dt = 1 s; a regression guard"</span>)</span>
<span id="cb46-23">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_bc_insensitivity"</span>, BC_MOVE, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb46-24">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative move of the two-station H when the Danckwerts inlet is"</span></span>
<span id="cb46-25">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" replaced by a Dirichlet one; a difference of nearly equal plate"</span></span>
<span id="cb46-26">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" heights (1.45e-6 and 1.51e-6 in two numerical environments). The"</span></span>
<span id="cb46-27">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" bound keeps it 4x below the baseline's own error against eq (38)"</span>)</span>
<span id="cb46-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the paper's stated results, recomputed ----------------------------------</span></span>
<span id="cb46-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_from_table3_rel_dev"</span>, DII_DEV)</span>
<span id="cb46-30">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_D_I_sensitivity"</span>, DII_SPREAD)</span>
<span id="cb46-31">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_from_table3_rel_dev"</span>, LAMBDA_DEV)</span>
<span id="cb46-32">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"df_worst_rel_dev"</span>, DF_MAX_DEV)</span>
<span id="cb46-33">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq56_celite_rel_dev"</span>, EQ56_DEV)</span>
<span id="cb46-34">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_ratio_rel_dev"</span>, SLOPE_RATIO_DEV)</span>
<span id="cb46-35">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_n_median_rel_dev"</span>, N_MED)</span>
<span id="cb46-36">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_n_max_rel_dev"</span>, N_MAX)</span>
<span id="cb46-37">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_calc_frac_reproduced"</span>, CALC_FRAC,</span>
<span id="cb46-38">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fraction of Table 1's eleven printed calc values reproduced"</span>)</span>
<span id="cb46-39">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_dS0_window_lo_ml"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> W_LO, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ml"</span>)</span>
<span id="cb46-40">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_dS0_window_hi_ml"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> W_HI, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ml"</span>)</span>
<span id="cb46-41">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_recovered_length_mm"</span>, L_SW, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm"</span>)</span>
<span id="cb46-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- fit, not test: labelled as such everywhere it appears -------------------</span></span>
<span id="cb46-43">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_fit_rmse_mm"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmse"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.values()), unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm"</span>)</span>
<span id="cb46-44">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_null_rmse_mm"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.values()), unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm"</span>)</span>
<span id="cb46-45">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_free_A_t_stat"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(A_STER_T))</span>
<span id="cb46-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the printed defect ------------------------------------------------------</span></span>
<span id="cb46-47">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21_printed_a0_limit"</span>, EQ21_A0_PRINTED)</span>
<span id="cb46-48">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21_corrected_large_a_dev"</span>, EQ21_LARGE_A_DEV,</span>
<span id="cb46-49">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the corrected eq (21) at a = 5 against the a + sqrt(2 pi) of eq (25);"</span></span>
<span id="cb46-50">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" an asymptotic error, not round-off"</span>)</span>
<span id="cb46-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- what pymrm adds ---------------------------------------------------------</span></span>
<span id="cb46-52">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"skewness_at_recovered_column"</span>, SKEW_SW)</span>
<span id="cb46-53">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z_for_skewness_0p05_mm"</span>, Z_SKEW, unit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mm"</span>)</span>
<span id="cb46-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- identities --------------------------------------------------------------</span></span>
<span id="cb46-55">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_chain_residual"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb46-56">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sympy simplifies (38) with (45), (46), (48) substituted, minus (49), to 0;"</span></span>
<span id="cb46-57">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" recorded as 1 if it does not"</span>)</span>
<span id="cb46-58">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rootfind_vs_closed_form_optimum"</span>, ROOT_ID, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb46-59">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max relative gap between the root-found u_opt (brentq, xtol 1e-14,"</span></span>
<span id="cb46-60">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" rtol 8.9e-16) and sqrt(B/C); measured 2.2e-16"</span>)</span>
<span id="cb46-61"></span>
<span id="cb46-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- break rows: the value each claim takes with the defect injected ----------</span></span>
<span id="cb46-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Break table 1 moves the PDE at n_z = 700, dt = 2 s; each row is carried onto</span></span>
<span id="cb46-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the reported run as the relative move it causes there.</span></span>
<span id="cb46-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, v, dbase, d38, note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> brk[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]:</span>
<span id="cb46-66">    claims.breaks(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break table 1: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_H_vs_eq38_rel"</span>,</span>
<span id="cb46-67">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(H_PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> brk[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], H38)))</span>
<span id="cb46-68">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ONE station: Dirichlet inlet against Danckwerts"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_bc_insensitivity"</span>,</span>
<span id="cb46-69">              BC_MOVE_SINGLE)</span>
<span id="cb46-70">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bare upwind in place of van Leer"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_grid_order"</span>, ORD_UPWIND)</span>
<span id="cb46-71">VL_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean([(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> H38) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> grid_rows]))</span>
<span id="cb46-72">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer runs read as if bare upwind"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_upwind_dispersion_coeff_err"</span>,</span>
<span id="cb46-73">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(VL_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb46-74">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"backward Euler (theta = 1) in place of Crank-Nicolson"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_dt_order_mu1"</span>,</span>
<span id="cb46-75">              ORD_DT_BE)</span>
<span id="cb46-76">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time window truncated to 60 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_kappa3_vs_laplace_rel"</span>,</span>
<span id="cb46-77">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(k3_trunc, k3a)))</span>
<span id="cb46-78">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time window truncated to 60 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_kappa4_vs_laplace_rel"</span>,</span>
<span id="cb46-79">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(k4_trunc, k4a)))</span>
<span id="cb46-80">DII_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_II_ion_exclusion"</span>]</span>
<span id="cb46-81">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_p = mesh geometric mean"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_from_table3_rel_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(DII_MESH, DII_P)))</span>
<span id="cb46-82">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop the fastest row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_from_table3_rel_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(DII_DROP, DII_P)))</span>
<span id="cb46-83">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"75 -&gt; 7.5 in eq (49)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DII_D_I_sensitivity"</span>, _spread(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_c))</span>
<span id="cb46-84">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"restore the 1/X molecular term"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_from_table3_rel_dev"</span>,</span>
<span id="cb46-85">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(b3t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_50_100"</span>])))</span>
<span id="cb46-86">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop the slowest row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_from_table3_rel_dev"</span>,</span>
<span id="cb46-87">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(twolam_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda_50_100"</span>])))</span>
<span id="cb46-88">df_broken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(df_um, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>: df_bad})</span>
<span id="cb46-89">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"iso-butane x used on the n-butane C"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"df_worst_rel_dev"</span>,</span>
<span id="cb46-90">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(df_broken[n], p)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, _, _, p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES))</span>
<span id="cb46-91">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol d_p on the Celite d_f"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq56_celite_rel_dev"</span>,</span>
<span id="cb46-92">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(r56_bad, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ratio56_celite"</span>])))</span>
<span id="cb46-93">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two printed x exchanged"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_ratio_rel_dev"</span>,</span>
<span id="cb46-94">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(ratio_swapped, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_ratio_predicted"</span>])))</span>
<span id="cb46-95">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (21) exactly as printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_n_median_rel_dev"</span>,</span>
<span id="cb46-96">              N_MED <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> EQ21_N_SOLVABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(single) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb46-97">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (21) exactly as printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_n_max_rel_dev"</span>,</span>
<span id="cb46-98">              N_MAX <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> EQ21_N_SOLVABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(single) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb46-99">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v sqrt(n) = 41.25 (dS0 = 165 exactly)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_calc_frac_reproduced"</span>,</span>
<span id="cb46-100">              n_match(P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_S0_glc"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A_vals))</span>
<span id="cb46-101">grid_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">38.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">46.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>)</span>
<span id="cb46-102">win_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grid_bad[hits_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> CALC_N_OK]</span>
<span id="cb46-103">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one printed calc cell altered"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_dS0_window_lo_ml"</span>,</span>
<span id="cb46-104">              <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> win_bad.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> win_bad.size <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb46-105">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one printed calc cell altered"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_dS0_window_hi_ml"</span>,</span>
<span id="cb46-106">              <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> win_bad.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> win_bad.size <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb46-107">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 cell 0.93 mis-read as 9.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_recovered_length_mm"</span>,</span>
<span id="cb46-108">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(L_bad.mean()))</span>
<span id="cb46-109">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C for iso-butane x1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_fit_rmse_mm"</span>,</span>
<span id="cb46-110">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>([rmse_bad] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rmse"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>]))</span>
<span id="cb46-111">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two slowest Celite rows dropped"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq54_null_rmse_mm"</span>,</span>
<span id="cb46-112">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>([null_bad] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"null"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>]))</span>
<span id="cb46-113">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.3 mm on every Sterchamol H"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sterchamol_free_A_t_stat"</span>,</span>
<span id="cb46-114">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b3_off[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se3_off[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>]))</span>
<span id="cb46-115">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the corrected denominator, a -&gt; 0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21_printed_a0_limit"</span>, EQ21_A0_CORRECTED)</span>
<span id="cb46-116">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (21) as printed at a = 5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21_corrected_large_a_dev"</span>,</span>
<span id="cb46-117">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dev(EQ21_LARGE_A_PRINTED, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi))))</span>
<span id="cb46-118">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha halved"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"skewness_at_recovered_column"</span>, skew_half)</span>
<span id="cb46-119">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha halved"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z_for_skewness_0p05_mm"</span>, Z_half)</span>
<span id="cb46-120">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq (49): 75 -&gt; 80"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_chain_residual"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r2_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb46-121">ROOT_BAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u_opt"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(FITS[n][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FITS[n][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> fitstat.items())</span>
<span id="cb46-122">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form inverted, u_opt = sqrt(C/B)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rootfind_vs_closed_form_optimum"</span>,</span>
<span id="cb46-123">              ROOT_BAD)</span>
<span id="cb46-124"></span>
<span id="cb46-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- prose: every number the Markdown quotes for a claim ----------------------</span></span>
<span id="cb46-126">SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb46-127">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_dt_order_mu1"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"between 1.5 and 2.5"</span>],</span>
<span id="cb46-128">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_bc_insensitivity"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-5"</span>],</span>
<span id="cb46-129">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_grid_order"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"between 2.5 and 3.5"</span>],</span>
<span id="cb46-130">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_H_vs_eq38_rel"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4e-5"</span>],</span>
<span id="cb46-131">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"skewness_at_recovered_column"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.14"</span>],</span>
<span id="cb46-132">}</span>
<span id="cb46-133"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.items():</span>
<span id="cb46-134">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lits:</span>
<span id="cb46-135">        claims.says(lit, k)</span>
<span id="cb46-136"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># quoted numbers that are not claims, each checked to one unit of its last place</span></span>
<span id="cb46-137">OTHER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda = 2.99"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.99</span>, two_lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb46-138">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_II = 1.34e-10"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.34e-10</span>, DII_BEST, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01e-10</span>),</span>
<span id="cb46-139">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f = 10.1 um"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.1</span>, df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, n-butane"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb46-140">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f = 10.6 um"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.6</span>, df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Celite, iso-butane"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb46-141">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_f = 8.7 um"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.7</span>, df_um[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sterchamol, n-butane"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb46-142">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2D/(uz) = 2e-3 at the recovered column"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-3</span>, G1(L_SW), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>),</span>
<span id="cb46-143">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bare-upwind coefficient 0.99999"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99999</span>, UPWIND_COEF, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)]</span>
<span id="cb46-144"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, quoted, computed, unit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OTHER:</span>
<span id="cb46-145">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(quoted <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> computed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> unit, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: computed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>computed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb46-146"></span>
<span id="cb46-147">_kinds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {kd: [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kd]</span>
<span id="cb46-148">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)}</span>
<span id="cb46-149"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values, "</span></span>
<span id="cb46-150">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bound'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exact'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact. The bounds:"</span>)</span>
<span id="cb46-151"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>]:</span>
<span id="cb46-152">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[k]</span>
<span id="cb46-153">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>), c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>)</span>
<span id="cb46-154">    rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb46-155">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;34}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rng<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'basis'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb46-156"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose literals checked with claims.says, "</span></span>
<span id="cb46-157">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(OTHER)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> other quoted numbers checked explicitly</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb46-158">claims.report()</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>28 claims: 22 values, 5 bounds, 1 exact. The bounds:
  pymrm_grid_order                   [2.5, 3.5]   [chosen]  here 3
  pymrm_dt_order_mu1                 [1.5, 2.5]   [chosen]  here 2.11
  pymrm_bc_insensitivity             &lt;= 1e-05     [chosen]  here 1.51e-06
  sym_chain_residual                 &lt;= 0         [identity]  here 0
  rootfind_vs_closed_form_optimum    &lt;= 1e-12     [tolerance]  here 2.22e-16
5 prose literals checked with claims.says, 7 other quoted numbers checked explicitly

Claims for J1.10-van-deemter-plate-height:
  pymrm_H_vs_eq38_rel               = 4.121e-05        value  rtol 0.05
  pymrm_grid_order                  = (here 3.0e+00)   bound  bound [2.5, 3.5] [chosen]
  pymrm_upwind_dispersion_coeff_err = 7.244e-06        value  rtol 0.05
  pymrm_dt_order_mu1                = (here 2.1e+00)   bound  bound [1.5, 2.5] [chosen]
  pymrm_kappa3_vs_laplace_rel       = 0.0020872        value  rtol 0.05
  pymrm_kappa4_vs_laplace_rel       = 0.01514          value  rtol 0.05
  pymrm_bc_insensitivity            = (here 1.5e-06)   bound  bound &lt;= 1e-05 [chosen]
  DII_from_table3_rel_dev           = 0.036971         value  rtol 0.05
  DII_D_I_sensitivity               = 0.018271         value  rtol 0.05
  lambda_from_table3_rel_dev        = 0.0024334        value  rtol 0.05
  df_worst_rel_dev                  = 0.057121         value  rtol 0.05
  eq56_celite_rel_dev               = 0.01121          value  rtol 0.05
  slope_ratio_rel_dev               = 0.034671         value  rtol 0.05
  table3_n_median_rel_dev           = 0.021016         value  rtol 0.05
  table3_n_max_rel_dev              = 0.29115          value  rtol 0.05
  table1_calc_frac_reproduced       = 1                exact  exact
  table1_dS0_window_lo_ml           = 165.97           value  rtol 0.05
  table1_dS0_window_hi_ml           = 167.42           value  rtol 0.05
  table3_recovered_length_mm        = 558.5            value  rtol 0.05
  eq54_fit_rmse_mm                  = 0.28234          value  rtol 0.05
  eq54_null_rmse_mm                 = 0.9209           value  rtol 0.05
  sterchamol_free_A_t_stat          = 0.12648          value  rtol 0.05
  eq21_printed_a0_limit             = 2                value  rtol 0.05
  eq21_corrected_large_a_dev        = 1.0529e-06       value  rtol 0.05
  skewness_at_recovered_column      = 0.1435           value  rtol 0.05
  z_for_skewness_0p05_mm            = 4600.5           value  rtol 0.05
  sym_chain_residual                = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  rootfind_vs_closed_form_optimum   = (here 2.2e-16)   bound  bound &lt;= 1e-12 [tolerance]</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="26">
<pre><code>{'page': 'J1.10-van-deemter-plate-height',
 'format': 2,
 'env': {'pymrm': '3.2.0',
  'numpy': '2.5.4',
  'scipy': '1.18.1',
  'openblas_coretype': 'Haswell',
  'threads': '1'},
 'metrics': {'pymrm_H_vs_eq38_rel': {'kind': 'value',
   'value': 4.121012503999211e-05,
   'rtol': 0.05,
   'note': 'discretisation error at n_z = 1400, dt = 1 s; grid-limited'},
  'pymrm_grid_order': {'kind': 'bound',
   'value': 3.001238990885788,
   'min': 2.5,
   'max': 3.5,
   'basis': 'chosen',
   'note': 'observed order of the two-station H against eq (38) over a 4x grid refinement with the van Leer correction; 3.00 measured, bare upwind gives 1.00'},
  'pymrm_upwind_dispersion_coeff_err': {'kind': 'value',
   'value': 7.2440014061703195e-06,
   'rtol': 0.05,
   'note': '|mean (H - H_38)/h - 1| with bare upwind; the prediction is exactly 1'},
  'pymrm_dt_order_mu1': {'kind': 'bound',
   'value': 2.1089450563859167,
   'min': 1.5,
   'max': 2.5,
   'basis': 'chosen',
   'note': 'pre-asymptotic three-point fit of log|mu1(dt) - mu1(1 s)| on dt = 8, 4, 2 s; the deferred correction lagged one step makes the scheme first order asymptotically. A fit of differences of nearly equal moments: it gives 1.79 and 2.11 under two numpy/scipy versions with identical model code, so only the range is claimed. Backward Euler gives 0.91 and 0.65 in the same two environments, below it'},
  'pymrm_kappa3_vs_laplace_rel': {'kind': 'value',
   'value': 0.0020871830495707844,
   'rtol': 0.05,
   'note': 'cancellation-limited at n_z = 1400, dt = 1 s; a regression guard'},
  'pymrm_kappa4_vs_laplace_rel': {'kind': 'value',
   'value': 0.01514007239116566,
   'rtol': 0.05,
   'note': 'cancellation-limited at n_z = 1400, dt = 1 s; a regression guard'},
  'pymrm_bc_insensitivity': {'kind': 'bound',
   'value': 1.5067377738819943e-06,
   'max': 1e-05,
   'basis': 'chosen',
   'note': "relative move of the two-station H when the Danckwerts inlet is replaced by a Dirichlet one; a difference of nearly equal plate heights (1.45e-6 and 1.51e-6 in two numerical environments). The bound keeps it 4x below the baseline's own error against eq (38)"},
  'DII_from_table3_rel_dev': {'kind': 'value',
   'value': 0.03697116881713969,
   'rtol': 0.05},
  'DII_D_I_sensitivity': {'kind': 'value',
   'value': 0.018271375406853307,
   'rtol': 0.05},
  'lambda_from_table3_rel_dev': {'kind': 'value',
   'value': 0.002433389676793296,
   'rtol': 0.05},
  'df_worst_rel_dev': {'kind': 'value',
   'value': 0.05712075354647128,
   'rtol': 0.05},
  'eq56_celite_rel_dev': {'kind': 'value',
   'value': 0.011209658706663905,
   'rtol': 0.05},
  'slope_ratio_rel_dev': {'kind': 'value',
   'value': 0.03467109612666619,
   'rtol': 0.05},
  'table3_n_median_rel_dev': {'kind': 'value',
   'value': 0.021016244522443883,
   'rtol': 0.05},
  'table3_n_max_rel_dev': {'kind': 'value',
   'value': 0.2911532451179031,
   'rtol': 0.05},
  'table1_calc_frac_reproduced': {'kind': 'exact',
   'value': 1.0,
   'note': "fraction of Table 1's eleven printed calc values reproduced"},
  'table1_dS0_window_lo_ml': {'kind': 'value',
   'value': 165.974,
   'rtol': 0.05,
   'unit': 'ml'},
  'table1_dS0_window_hi_ml': {'kind': 'value',
   'value': 167.4188,
   'rtol': 0.05,
   'unit': 'ml'},
  'table3_recovered_length_mm': {'kind': 'value',
   'value': 558.4950000000001,
   'rtol': 0.05,
   'unit': 'mm'},
  'eq54_fit_rmse_mm': {'kind': 'value',
   'value': 0.28233807469253985,
   'rtol': 0.05,
   'unit': 'mm'},
  'eq54_null_rmse_mm': {'kind': 'value',
   'value': 0.9208993189027536,
   'rtol': 0.05,
   'unit': 'mm'},
  'sterchamol_free_A_t_stat': {'kind': 'value',
   'value': 0.12648035095967,
   'rtol': 0.05},
  'eq21_printed_a0_limit': {'kind': 'value',
   'value': 2.0000000299999985,
   'rtol': 0.05},
  'eq21_corrected_large_a_dev': {'kind': 'value',
   'value': 1.0529188869679018e-06,
   'rtol': 0.05,
   'note': 'the corrected eq (21) at a = 5 against the a + sqrt(2 pi) of eq (25); an asymptotic error, not round-off'},
  'skewness_at_recovered_column': {'kind': 'value',
   'value': 0.14350364730499396,
   'rtol': 0.05},
  'z_for_skewness_0p05_mm': {'kind': 'value',
   'value': 4600.501316255881,
   'rtol': 0.05,
   'unit': 'mm'},
  'sym_chain_residual': {'kind': 'bound',
   'value': 0.0,
   'max': 0.0,
   'basis': 'identity',
   'note': 'sympy simplifies (38) with (45), (46), (48) substituted, minus (49), to 0; recorded as 1 if it does not'},
  'rootfind_vs_closed_form_optimum': {'kind': 'bound',
   'value': 2.220446049250313e-16,
   'max': 1e-12,
   'basis': 'tolerance',
   'note': 'max relative gap between the root-found u_opt (brentq, xtol 1e-14, rtol 8.9e-16) and sqrt(B/C); measured 2.2e-16'}},
 'quoted': {'pymrm_dt_order_mu1': ['between 1.5 and 2.5'],
  'pymrm_bc_insensitivity': ['below 1e-5'],
  'pymrm_grid_order': ['between 2.5 and 3.5'],
  'pymrm_H_vs_eq38_rel': ['4e-5'],
  'skewness_at_recovered_column': ['0.14']},
 'breaks': {'pymrm_H_vs_eq38_rel': ['break table 1: bare upwind (limiter=None)',
   'break table 1: coarse grid, n_z = 175',
   'break table 1: F_II halved (a different phase ratio)',
   'break table 1: alpha halved',
   'break table 1: K perturbed by +1 %',
   'break table 1: D perturbed by +1 %',
   'break table 1: time window truncated to 60 %',
   'break table 1: construct_div with nu=1 (cylindrical)',
   'break table 1: ONE station (z2 = 600 mm) instead of two',
   'break table 1: ONE station at z = 20 mm (a short column)'],
  'pymrm_bc_insensitivity': ['ONE station: Dirichlet inlet against Danckwerts'],
  'pymrm_grid_order': ['bare upwind in place of van Leer'],
  'pymrm_upwind_dispersion_coeff_err': ['van Leer runs read as if bare upwind'],
  'pymrm_dt_order_mu1': ['backward Euler (theta = 1) in place of Crank-Nicolson'],
  'pymrm_kappa3_vs_laplace_rel': ['time window truncated to 60 %'],
  'pymrm_kappa4_vs_laplace_rel': ['time window truncated to 60 %'],
  'DII_from_table3_rel_dev': ['d_p = mesh geometric mean',
   'drop the fastest row'],
  'DII_D_I_sensitivity': ['75 -&gt; 7.5 in eq (49)'],
  'lambda_from_table3_rel_dev': ['restore the 1/X molecular term',
   'drop the slowest row'],
  'df_worst_rel_dev': ['iso-butane x used on the n-butane C'],
  'eq56_celite_rel_dev': ['Sterchamol d_p on the Celite d_f'],
  'slope_ratio_rel_dev': ['the two printed x exchanged'],
  'table3_n_median_rel_dev': ['eq (21) exactly as printed'],
  'table3_n_max_rel_dev': ['eq (21) exactly as printed'],
  'table1_calc_frac_reproduced': ['v sqrt(n) = 41.25 (dS0 = 165 exactly)'],
  'table1_dS0_window_lo_ml': ['one printed calc cell altered'],
  'table1_dS0_window_hi_ml': ['one printed calc cell altered'],
  'table3_recovered_length_mm': ['Table 3 cell 0.93 mis-read as 9.3'],
  'eq54_fit_rmse_mm': ['C for iso-butane x1.5'],
  'eq54_null_rmse_mm': ['the two slowest Celite rows dropped'],
  'sterchamol_free_A_t_stat': ['+0.3 mm on every Sterchamol H'],
  'eq21_printed_a0_limit': ['the corrected denominator, a -&gt; 0'],
  'eq21_corrected_large_a_dev': ['eq (21) as printed at a = 5'],
  'skewness_at_recovered_column': ['alpha halved'],
  'z_for_skewness_0p05_mm': ['alpha halved'],
  'sym_chain_residual': ['eq (49): 75 -&gt; 80'],
  'rootfind_vs_closed_form_optimum': ['closed form inverted, u_opt = sqrt(C/B)']}}</code></pre>
</div>
</div>
</section>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>What this page establishes.</strong></p>
<ul>
<li>The chain (34) → (38) → (49) → (52)/(53) is exact, all four steps, and an entirely separate route — the Laplace-transform cumulants of eqs. (29)/(30) — reproduces eq. (38) symbolically as well. The 1956 algebra is sound.</li>
<li>Solving eqs. (29)/(30) with pymrm and taking moments reproduces eq. (38) to <img src="https://latex.codecogs.com/png.latex?4%5Ctimes10%5E%7B-5%7D">, with the bare-upwind numerical dispersion coming out at exactly the predicted coefficient of 1.</li>
<li>Table 3 refitted through eq. (49) returns <img src="https://latex.codecogs.com/png.latex?%5Clambda%20=%202.99"> against the printed 3, and <img src="https://latex.codecogs.com/png.latex?D_%7BII%7D%20=%201.34%5Ctimes10%5E%7B-10%7D"> m² s⁻¹ against the printed <img src="https://latex.codecogs.com/png.latex?1.3%5Ctimes10%5E%7B-10%7D"> — and the extraction turns out to be almost independent of <img src="https://latex.codecogs.com/png.latex?D_I">, which the paper never prints for that system.</li>
<li>The film thickness comes back as 10.1, 10.6 and 8.7 µm against the printed <img src="https://latex.codecogs.com/png.latex?%5Capprox"> 10, <img src="https://latex.codecogs.com/png.latex?%5Capprox"> 10 and 9 µm.</li>
<li>Eq. (21) <strong>as printed cannot be right</strong>: with the printed <img src="https://latex.codecogs.com/png.latex?(a+%5Cdelta)/%5Cdelta"> it gives 2 in the limit its own eq. (24) fixes at 4, and it diverges where its own eq. (25) fixes it at <img src="https://latex.codecogs.com/png.latex?a%20+%20%5Csqrt%7B2%5Cpi%7D">. With <img src="https://latex.codecogs.com/png.latex?(a+%5Cdelta)/a"> both limits are met. Reported, not repaired; the corrected form is used and labelled.</li>
<li>The Gaussian’s shape error falls as <img src="https://latex.codecogs.com/png.latex?z%5E%7B-1/2%7D"> while both of the paper’s own sufficient conditions fall as <img src="https://latex.codecogs.com/png.latex?z%5E%7B-1%7D">, so satisfying them “<img src="https://latex.codecogs.com/png.latex?%5Cll%201">” is weaker than it looks: at the column that produced Table 3, the groups are <img src="https://latex.codecogs.com/png.latex?2%5Ctimes10%5E%7B-3%7D"> and the skewness is still 0.14 (both printed above).</li>
</ul>
<p><strong>What it cannot conclude.</strong></p>
<ul>
<li><strong>Nothing about whether eq. (53) is right.</strong> Its three constants were fitted to the twelve points they are compared with. Every residual in section 1 is a goodness of fit and is labelled as one; the closest thing to a test in the paper is the slope ratio of section 4, which is one number.</li>
<li><strong>Nothing about <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> or <img src="https://latex.codecogs.com/png.latex?d_f"> as physical quantities.</strong> They are the paper’s own inversions, redone, and the velocity-convention ambiguity of section 5 cannot be closed from what is printed: under the interstitial reading <img src="https://latex.codecogs.com/png.latex?%5Cgamma"> is <em>larger</em> by <img src="https://latex.codecogs.com/png.latex?1/F_I"> and <img src="https://latex.codecogs.com/png.latex?d_f%5E2"> <em>smaller</em> by <img src="https://latex.codecogs.com/png.latex?F_I">, both by up to a factor 2 (printed in section 5). <img src="https://latex.codecogs.com/png.latex?%5Clambda"> is the exception — the eddy term carries no <img src="https://latex.codecogs.com/png.latex?u">, so <img src="https://latex.codecogs.com/png.latex?2%5Clambda%20d_p"> is the one constant here the ambiguity cannot touch.</li>
<li><strong>Nothing about Simpson and Wheaton’s measurements.</strong> Their paper was not consulted; Table 2 is van Deemter et al.’s restatement.</li>
<li><strong>Nothing about the ion-exclusion column’s geometry.</strong> Its length is printed nowhere; the value used here is recovered from Table 3 (printed above) and is an inference, not a measurement.</li>
<li><strong>Nothing about eq. (53) in a real gas chromatograph.</strong> These columns run at 0.046 to 31 mm s⁻¹ with plate heights of 0.56 to 16 mm. Modern capillary columns are three orders of magnitude away in both.</li>
</ul>
<p><strong>How to reuse the solver.</strong> <code>Column</code> is eqs. (29)/(30) with nothing case-specific in it: give it <img src="https://latex.codecogs.com/png.latex?u">, <img src="https://latex.codecogs.com/png.latex?D">, <img src="https://latex.codecogs.com/png.latex?%5Calpha">, <img src="https://latex.codecogs.com/png.latex?K">, <img src="https://latex.codecogs.com/png.latex?F_I">, <img src="https://latex.codecogs.com/png.latex?F_%7BII%7D"> and a length. Any linear two-phase column with a first-order exchange is the same object — an adsorption breakthrough (<a href="../J1.5-ldf-breakthrough/"><code>J1.5</code></a>), an ion-exchange column, a simulated-moving-bed section. The two-station cumulant reading is the part worth copying: it gives the asymptotic plate height without ever needing to know what the inlet did, and it costs one extra recording station.</p>
<p><strong>The single-station form is in the break table</strong> rather than in the results. On this column it is only a few parts in <img src="https://latex.codecogs.com/png.latex?10%5E%7B4%7D"> out, because a Danckwerts inlet happens to put very little of an entrance effect into the first two moments here — but that is a property of <em>these</em> conditions and of <em>that</em> inlet condition, not a general one, and the two-station form costs one extra recording array.</p>
<p><strong>Related pages.</strong> <a href="../J1.5-ldf-breakthrough/"><code>J1.5</code></a> (the linear driving force that replaces <img src="https://latex.codecogs.com/png.latex?%5Calpha">), <code>J1.6</code>, <code>J1.8</code> (the general rate model), <a href="../A2.3-taylor-aris-dispersion/"><code>A2.3</code></a> and <a href="../A2.6-gunn-dispersion-correlations/"><code>A2.6</code></a> (where <img src="https://latex.codecogs.com/png.latex?D"> comes from), <a href="../A2.4-tanks-in-series/"><code>A2.4</code></a> (plates and dispersion as the same statement).</p>
<p><strong>Cite the source, not this page:</strong> van Deemter, J. J., Zuiderweg, F. J. &amp; Klinkenberg, A., <em>Longitudinal diffusion and resistance to mass transfer as causes of nonideality in chromatography</em>, Chem. Eng. Sci. <strong>5</strong>(6) 271–289 (1956), <a href="https://doi.org/10.1016/0009-2509(56)80003-1">doi:10.1016/0009-2509(56)80003-1</a>.</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S4</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-liquid</category>
  <category>phase:liquid-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.10-van-deemter-plate-height/</guid>
  <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Levenspiel’s four deactivation classes: which reactor can tell them apart</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.3-levenspiel-deactivation-classes/</link>
  <description><![CDATA[ 




<section id="levenspiels-four-deactivation-classes-which-reactor-can-tell-them-apart" class="level1">
<h1>Levenspiel’s four deactivation classes: which reactor can tell them apart</h1>
<p><strong>Catalog ID:</strong> <code>B2.3</code> · <strong>Structures:</strong> <code>S1</code>, <code>S5</code> · <strong>Tier:</strong> T0</p>
<p>A deactivating catalyst has three things going on at once (temperature, composition, and the activity of the pellet itself), and only two of them are under the experimenter’s control. Levenspiel’s 1972 paper is about the third. It writes the rate of a deactivating pellet as a product,</p>
<p><img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20f_1(%5Ctext%7Bfluid%20conditions%7D)%5Ccdot%20f_2(%5Ctext%7Bpresent%20activity%7D),%20%5Ctag%7B1%7D"></p>
<p>instantiates it as <img src="https://latex.codecogs.com/png.latex?n">th-order kinetics with <img src="https://latex.codecogs.com/png.latex?n'">-order, <img src="https://latex.codecogs.com/png.latex?d">-order decay in <strong>four broad classes</strong>: parallel, series, side-by-side, independent (its eqs. 4–7), and then asks the question this page is about:</p>
<blockquote class="blockquote">
<p><em>“We ask in particular whether experiments can be devised so as to give simply the orders and rate constants of these equations.”</em> (p.&nbsp;272)</p>
</blockquote>
<p>That is a question about <strong>experimental design</strong>, and the paper answers it in words: one particular contacting, it says, “alone allows decoupling of concentration and activity effects”. This page answers it with numbers. It solves all four classes in all four of the paper’s own batch-solids contactings, and then does the only thing that can settle a claim of discriminability: <strong>fits every class to every other class’s response</strong> and reports the conversion resolution an experiment would need to tell them apart.</p>
<p>The answer is harder than the taxonomy suggests, in two stages.</p>
<p><strong>First, the four devices are not merely poor at separating the classes: every one of them is <em>exactly</em> degenerate somewhere</strong>, by algebraic identities the page proves symbolically and then confirms by subtraction. In any well-mixed fluid at constant flow, series deactivation of order <img src="https://latex.codecogs.com/png.latex?(n',%20d)"> <strong>is</strong> parallel deactivation of order <img src="https://latex.codecogs.com/png.latex?(n%20n',%5C,%20d+n')">, for any reaction order <img src="https://latex.codecogs.com/png.latex?n">: same observable, every time. In the held-<img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> device Levenspiel recommends, parallel, series and independent are literally the same equation: decoupling concentration from activity is exactly what destroys the class distinction inside one run. And in a <strong>batch of fluid or a plug-flow bed</strong>, the two devices that do keep parallel, series and independent apart, side-by-side deactivation with poison group <img src="https://latex.codecogs.com/png.latex?%5Csigma"> <strong>is</strong> parallel deactivation with <img src="https://latex.codecogs.com/png.latex?n'%20%5Cto%20%5Clambda%5Csigma/%5Ckappa">, for <em>every</em> <img src="https://latex.codecogs.com/png.latex?%5Csigma">, at the base orders <img src="https://latex.codecogs.com/png.latex?n%20=%20n'%20=%20d%20=%201">. The bed is not the exception to the degeneracies; it is one of the two devices whose degeneracy is narrower.</p>
<p><strong>Second, the two devices that keep those three classes apart are still not enough.</strong> At a conversion resolution of 0.2 percentage points, the plug-flow bed separates one of the twelve class pairs, and no other device separates any. Parallel and series in a bed differ by 8.1e-4 in RMS conversion: real, but a tenth of a percentage point.</p>
<p>What <em>does</em> discriminate is not the outlet history at all, and it is the one thing only the bed has: an <strong>activity profile</strong>. After the same run, a bed decaying in parallel ends with its inlet at <img src="https://latex.codecogs.com/png.latex?a%20=%20e%5E%7B-%5Clambda%7D"> and its outlet near 0.19, while the same bed decaying in series ends with its inlet at <strong>exactly 1</strong> (no R has been made at the feed face, so nothing has decayed there) and its outlet near 0.18. Both inlet values are exact, not computed; the contrast reverses sign, and one assay of the spent catalyst reads it off. That is <code>B2.2</code>’s finding (the profile names the mechanism), arrived at from the opposite direction.</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p><strong>The source, precisely.</strong> Octave Levenspiel, <em>“Experimental Search for a Simple Rate Equation to Describe Deactivating Porous Catalyst Particles”</em>, <strong>Journal of Catalysis 25</strong>(2) 265–272 (1972), <a href="https://doi.org/10.1016/0021-9517(72)90227-8">doi:10.1016/0021-9517(72)90227-8</a>, Department of Chemical Engineering, Oregon State University, Corvallis, Oregon 97331; received September 28, 1971. Identified from the document’s own first page, running head “JOURNAL OF CATALYSIS 25, 265–272 (1972)”, display title, the single-author by-line “OCTAVE LEVENSPIEL”, the affiliation block, the received date and the abstract, on a native-resolution render. The scan is CCITT-G4 bilevel at <strong>300 ppi native</strong>, 8 pages, complete.</p>
<p><strong>The text layer of this file is not usable and was not used.</strong> Its OCR mangles the abstract into “the experimental detrrmination of the ordrrs of reaction and deactivation”, “deactivation of catalyst particlrs”, “parallrl”, “the various rractor types which may he usctf”. Every symbol, subscript, prime and exponent on this page was read from a cropped 300 ppi render at glyph scale, which matters more here than usual, because the whole paper turns on telling <img src="https://latex.codecogs.com/png.latex?n"> from <img src="https://latex.codecogs.com/png.latex?n'">, <img src="https://latex.codecogs.com/png.latex?k"> from <img src="https://latex.codecogs.com/png.latex?k'"> from <img src="https://latex.codecogs.com/png.latex?k_d"> from <img src="https://latex.codecogs.com/png.latex?k'_d">, and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> from <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D"> from <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20P%7D">.</p>
<p><strong>This is Levenspiel the author, not Levenspiel the book.</strong> <em>Chemical Reaction Engineering</em> is a different work (this paper cites its 2nd edition, Chap. 15, as its own ref. 3); it remains outstanding as a textbook-canonical source and is what <code>A2.4</code> is catalogued to. Nothing on this page closes that.</p>
<p><strong>Where it sits.</strong> Third of a ladder. <code>B2.1</code> is <a href="../B2.1-voorhies-coking-law/">Voorhies (1945)</a>: coke as a power of time-on-stream, <img src="https://latex.codecogs.com/png.latex?C_c%20=%20A%5Ctheta%5En">, activity correlated with the clock. <code>B2.2</code> is <a href="../B2.2-froment-bischoff-coking/">Froment &amp; Bischoff (1961)</a>: activity correlated with the carbon actually deposited, which becomes a <em>profile</em> along a bed whose direction names the fouling mechanism. This paper takes the third step: activity as a state variable <img src="https://latex.codecogs.com/png.latex?a"> with its own <img src="https://latex.codecogs.com/png.latex?n'">-, <img src="https://latex.codecogs.com/png.latex?d">-order rate law, and the question of what experiment could ever measure those orders. The connection to <code>B2.2</code> turns out to be sharper than a shared subject: the single device here that supports a spatial gradient is also the one whose exact degeneracy is narrowest, and the measurement that actually separates the classes in it is the shape of the deposit, which is <code>B2.2</code>’s finding arrived at from the opposite direction.</p>
<p><strong>What the paper contains, and what it does not.</strong> It contains 32 numbered equations, six figures and no measurements. There is <strong>no table anywhere in the eight pages</strong>; Figs. 2–6 are schematic test plots with unlabelled axes, no tick values, and open circles drawn to illustrate a straight line (“A straight line on this plot indicates that the guessed order of deactivation is correct”, Fig. 6 caption). The paper’s title word is <em>Search</em>, and its Discussion states the subject plainly: whether experiments <em>can be devised</em>. <strong>No comparison against any measured order is attempted or promised on this page, because the paper reports none.</strong></p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>All equation numbers are the paper’s. Every symbol below was read from a cropped native-resolution render.</p>
<section id="the-four-classes-eqs.-47-p.-266" class="level3">
<h3 class="anchored" data-anchor-id="the-four-classes-eqs.-47-p.-266">The four classes (eqs. 4–7, p.&nbsp;266)</h3>
<p>Each class pairs the same <img src="https://latex.codecogs.com/png.latex?n">th-order reaction rate with a different driving concentration for the decay. <img src="https://latex.codecogs.com/png.latex?a"> is the activity, defined in eq. (3) as the ratio of the pellet’s present rate to its rate when fresh, so <img src="https://latex.codecogs.com/png.latex?a(0)%20=%201">.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>eq.</th>
<th>class</th>
<th>scheme</th>
<th>rate of reaction</th>
<th>rate of decay</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>(4)</td>
<td><em>parallel</em></td>
<td>A→R, A→P↓</td>
<td><img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20k%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n%7D%20a"></td>
<td><img src="https://latex.codecogs.com/png.latex?-%5Cdfrac%7Bda%7D%7Bdt%7D%20=%20k_d%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n'%7D%20a%5E%7B%5C,d%7D"></td>
</tr>
<tr class="even">
<td>(5)</td>
<td><em>series</em></td>
<td>A→R→P↓</td>
<td><img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20k%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n%7D%20a"></td>
<td><img src="https://latex.codecogs.com/png.latex?-%5Cdfrac%7Bda%7D%7Bdt%7D%20=%20k_d%5C,C_%7B%5Crm%20R%7D%5E%7B%5C,n'%7D%20a%5E%7B%5C,d%7D"></td>
</tr>
<tr class="odd">
<td>(6)</td>
<td><em>side-by-side</em></td>
<td>A→R, P→P↓</td>
<td><img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20k%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n%7D%20a"></td>
<td><img src="https://latex.codecogs.com/png.latex?-%5Cdfrac%7Bda%7D%7Bdt%7D%20=%20k_d%5C,C_%7B%5Crm%20P%7D%5E%7B%5C,n'%7D%20a%5E%7B%5C,d%7D"></td>
</tr>
<tr class="even">
<td>(7)</td>
<td><em>independent</em></td>
<td>-</td>
<td><img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20k%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n%7D%20a"></td>
<td><img src="https://latex.codecogs.com/png.latex?-%5Cdfrac%7Bda%7D%7Bdt%7D%20=%20k_d%5C,a%5E%7B%5C,d%7D"></td>
</tr>
</tbody>
</table>
<p>A fifth scheme (eq. 8, A→R with both A and R poisoning) is dismissed by the paper in one line: <img src="https://latex.codecogs.com/png.latex?-da/dt%20=%20k_d(C_%7B%5Crm%20A%7D+C_%7B%5Crm%20R%7D)%5E%7Bn'%7Da%5Ed"> and “since <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D%20+%20C_%7B%5Crm%20R%7D"> remains constant for a specific feed, this type of deactivation reduces to the simple-to-treat independent deactivation of Eq. 7”. Verified below.</p>
<p>The Nomenclature (p.&nbsp;265) defines the shorthands that carry the rest of the paper: <img src="https://latex.codecogs.com/png.latex?k'%20=%20k%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n%7D">, <img src="https://latex.codecogs.com/png.latex?k'_d%20=%20k_d%5C,C_%7B%5Crm%20A%7D%5E%7B%5C,n'%7D">, <img src="https://latex.codecogs.com/png.latex?k''%20=%20kW/V">, and the <strong>weight-time</strong> <img src="https://latex.codecogs.com/png.latex?%5Ctau'%20=%20W%20C_%7B%5Crm%20A0%7D/F_%7B%5Crm%20A0%7D"> (g cat·sec/liter of fluid), the capacity factor that plays the role of space time for a fixed weight of catalyst.</p>
</section>
<section id="the-four-contactings-fig.-1-p.-268" class="level3">
<h3 class="anchored" data-anchor-id="the-four-contactings-fig.-1-p.-268">The four contactings (Fig. 1, p.&nbsp;268)</h3>
<p>Fig. 1’s top row is the batch-solids family this paper is “primarily concerned with”: <strong>(a)</strong> batch of both solid and fluid, <strong>(b)</strong> plug flow of fluid, <strong>(c)</strong> mixed flow of fluid, <strong>(d)</strong> recycle flow of fluid. (The bottom row, raining solids and a fluidised bed, is for deactivation “in the order of seconds or less” and is out of scope here, as is (d), which the paper itself says “offers no particular advantage”.) On top of the contacting pattern the paper adds a second axis: the flow rate may be held <strong>constant</strong>, or lowered continually so as to hold a concentration constant.</p>
<p>For the illustrative first-order, concentration-independent case (eq. 9, <img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20kC_%7B%5Crm%20A%7Da"> with <img src="https://latex.codecogs.com/png.latex?-da/dt%20=%20k_d%20a">) the paper works each contacting through to a straight-line test:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>contacting</th>
<th>performance relation</th>
<th>test plot</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>(a) batch fluid</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cln%5Cln%5Cdfrac%7BC_%7B%5Crm%20A%7D%7D%7BC_%7B%5Crm%20A%5Cinfty%7D%7D%20=%20%5Cln%5Cln%5Cdfrac%7BC_%7B%5Crm%20A0%7D%7D%7BC_%7B%5Crm%20A%5Cinfty%7D%7D%20-%20k_d%20t"> (15)</td>
<td>Fig. 2</td>
</tr>
<tr class="even">
<td>(c) mixed, constant flow</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cln%5C!%5Cleft(%5Cdfrac%7BC_%7B%5Crm%20A0%7D%7D%7BC_%7B%5Crm%20A%7D%7D-1%5Cright)%20=%20%5Cln(k%5Ctau')%20-%20k_d%20t"> (19)</td>
<td>Fig. 3</td>
</tr>
<tr class="odd">
<td>(b) plug, constant flow</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cln%5Cln%5Cdfrac%7BC_%7B%5Crm%20A0%7D%7D%7BC_%7B%5Crm%20A%7D%7D%20=%20%5Cln(k%5Ctau')%20-%20k_d%20t"> (22)</td>
<td>Fig. 4</td>
</tr>
<tr class="even">
<td>(c) mixed, <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> held</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cln%5Ctau'%20=%20k_d%20t%20+%20%5Cln%5Cdfrac%7BC_%7B%5Crm%20A0%7D-C_%7B%5Crm%20A%7D%7D%7Bk%5C,C_%7B%5Crm%20A%7D%7D"> (23)</td>
<td>Fig. 5</td>
</tr>
<tr class="odd">
<td>(b) plug, <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A,out%7D"> held</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cln%5Ctau'%20=%20k_d%20t%20+%20%5Cln%5C!%5Cleft(%5Cdfrac%7B1%7D%7Bk_d%7D%5Cln%5Cdfrac%7BC_%7B%5Crm%20A0%7D%7D%7BC_%7B%5Crm%20A%7D%7D%5Cright)"> (24)</td>
<td>Fig. 5, shifted</td>
</tr>
</tbody>
</table>
<p><strong>Eq. (24) is transcribed exactly as printed, and it is wrong as printed.</strong> The paper derives it from its own eq. (21) one line above, and eq. (21) gives <img src="https://latex.codecogs.com/png.latex?1/k"> where eq. (24) prints <img src="https://latex.codecogs.com/png.latex?1/k_d">. The discrepancy is settled symbolically and dimensionally below; it is <strong>reported, not repaired</strong>, and the CSV carries the printed form.</p>
</section>
<section id="the-general-order-analysis-eqs.-2532-p.-271" class="level3">
<h3 class="anchored" data-anchor-id="the-general-order-analysis-eqs.-2532-p.-271">The general-order analysis (eqs. 25–32, p.&nbsp;271)</h3>
<p>The paper’s recommendation. Hold <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> constant by lowering the flow rate; then <img src="https://latex.codecogs.com/png.latex?k'%20=%20kC_%7B%5Crm%20A%7D%5E%7B%5C,n%7D"> and <img src="https://latex.codecogs.com/png.latex?k'_d%20=%20k_dC_%7B%5Crm%20A%7D%5E%7B%5C,n'%7D"> are constants, eqs. (4) collapse to</p>
<p><img src="https://latex.codecogs.com/png.latex?-r'_%7B%5Crm%20A%7D%20=%20k'a%20%5Ctag%7B25%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?-%5Cfrac%7Bda%7D%7Bdt%7D%20=%20k'_d%5C,a%5E%7B%5C,d%7D%20%5Ctag%7B26%7D"></p>
<p>the mixed-flow performance relation becomes <img src="https://latex.codecogs.com/png.latex?%5Ctau'%20=%20(C_%7B%5Crm%20A0%7D-C_%7B%5Crm%20A%7D)/(k'a)"> (27), and integrating (26) for each <img src="https://latex.codecogs.com/png.latex?d"> gives the four printed straight lines (28)–(31) and their general form</p>
<p><img src="https://latex.codecogs.com/png.latex?(%5Ctau')%5E%7B%5C,d-1%7D%20=%20C_1%20+%20C_2%5C,t,%20%5Cqquad%0AC_1%20=%20%5Cleft(%5Cfrac%7BC_%7B%5Crm%20A0%7D-C_%7B%5Crm%20A%7D%7D%7Bk'%7D%5Cright)%5E%7Bd-1%7D,%20%5Cquad%0AC_2%20=%20C_1%5C,(d-1)%5C,k'_d%20%5Ctag%7B32%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?C_1">, <img src="https://latex.codecogs.com/png.latex?C_2"> printed on Fig. 6 as its intercept and slope. All of (28)–(32) are re-derived symbolically below.</p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Everything is dimensionless, and every group is a ratio the paper itself defines.</strong> Writing <img src="https://latex.codecogs.com/png.latex?c%20=%20C_%7B%5Crm%20A%7D/C_%7B%5Crm%20A0%7D">, <img src="https://latex.codecogs.com/png.latex?r%20=%201-c%20=%20C_%7B%5Crm%20R%7D/C_%7B%5Crm%20A0%7D"> (constant density, A→R one-for-one), <img src="https://latex.codecogs.com/png.latex?p%20=%20C_%7B%5Crm%20P%7D/C_%7B%5Crm%20P0%7D">, <img src="https://latex.codecogs.com/png.latex?s%20=%20w/W"> the fraction of the catalyst weight passed, and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20t/t_%7B%5Crm%20obs%7D"> the time in units of the observation window:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>group</th>
<th>definition</th>
<th>meaning</th>
<th>base value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Ckappa"></td>
<td><img src="https://latex.codecogs.com/png.latex?k%5C,C_%7B%5Crm%20A0%7D%5E%7B%5C,n-1%7D%5Ctau'"></td>
<td>Damköhler number on fresh catalyst</td>
<td>1.5</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Clambda"></td>
<td><img src="https://latex.codecogs.com/png.latex?k_d%5C,C_%7B%5Crm%20ref%7D%5E%7B%5C,n'%7D%5C,t_%7B%5Crm%20obs%7D"></td>
<td>decay rate × observation window</td>
<td>3.0</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?n"></td>
<td>-</td>
<td>reaction order (the paper’s own worked case is <img src="https://latex.codecogs.com/png.latex?n=1">)</td>
<td>1</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?n'"></td>
<td>-</td>
<td>concentration order of the decay</td>
<td>1</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?d"></td>
<td>-</td>
<td>order of the decay in activity</td>
<td>1</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Csigma"></td>
<td>see below</td>
<td>poison consumed per unit activity lost</td>
<td>0.8</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?c_%7B%5Crm%20set%7D"></td>
<td>-</td>
<td>the level <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> is held at in the constant-<img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> device</td>
<td>0.4</td>
</tr>
</tbody>
</table>
<p>The base point puts fresh-catalyst conversion at the values printed by the imports cell below, and runs until the activity has fallen by roughly an order of magnitude: i.e.&nbsp;a run an experimenter would actually design. <strong>Every conclusion below is stated with the <img src="https://latex.codecogs.com/png.latex?(n,%20n',%20d)"> it was computed at</strong>, and the ones that depend on those orders are mapped, not asserted.</p>
<p><strong><img src="https://latex.codecogs.com/png.latex?%5Csigma"> is not printed, and is declared here.</strong> Eq. (6) reads “P → P↓”: the poison is <em>consumed</em> by depositing, so a poison mass balance is unavoidable, but the paper never gives the stoichiometry. <img src="https://latex.codecogs.com/png.latex?%5Csigma"> is the dimensionless group multiplying it: moles of P removed from the fluid per unit of activity destroyed, scaled by <img src="https://latex.codecogs.com/png.latex?%5Ctau'/C_%7B%5Crm%20P0%7D">. It is a reconstruction, not a transcription; it is swept, and the <img src="https://latex.codecogs.com/png.latex?%5Csigma%20%5Cto%200"> limit (a poison in such excess that its concentration never moves) is reported separately because it is exactly degenerate with independent deactivation.</p>
<p><strong>Assumptions carried from the source.</strong></p>
<ul>
<li><strong>Pseudo-steady fluid</strong>, stated by the paper on p.&nbsp;269: <em>“this and the following derivations for a batch of solids are based on the pseudo-steady-state assumption … Since a batch of solids can only be used in experimentation if deactivation is not too rapid this assumption is reasonable.”</em> Everything except the last section assumes it. The last section drops it and measures what it costs.</li>
<li><strong>Isothermal, constant density, single reaction A→R</strong> with no volume change (<img src="https://latex.codecogs.com/png.latex?%5Cepsilon_%7B%5Crm%20A%7D%20=%200">), so <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D%20=%20C_%7B%5Crm%20A0%7D%20-%20C_%7B%5Crm%20A%7D"> everywhere. This is the paper’s own setting: it prints <img src="https://latex.codecogs.com/png.latex?%5Cepsilon_%7B%5Crm%20A%7D"> in the Nomenclature but never uses it.</li>
<li><img src="https://latex.codecogs.com/png.latex?a(0)%20=%201"> for the whole batch of solids (“The activity starts at unity”, p.&nbsp;266).</li>
</ul>
<p><strong>Measurement resolution.</strong> A discriminability claim is meaningless without one, so every separability number below is reported as a <strong>raw RMS deviation in fractional conversion</strong>: the resolution an experiment must have to refute the wrong class. For labelling only, <code>RES_X</code> = 2e-3 (0.2 conversion percentage points, a good laboratory chromatograph) and <code>RES_TAU</code> = 0.01 (1 % in flow rate) are used; the raw numbers are printed beside every verdict so a reader with a different instrument can rescale.</p>
<p><strong>Direction of the separability claim, stated once.</strong> <img src="https://latex.codecogs.com/png.latex?D(T%5C!%5Cto%5C!C)"> is the <em>minimum</em> misfit of class <img src="https://latex.codecogs.com/png.latex?C"> to a response generated by class <img src="https://latex.codecogs.com/png.latex?T">. An optimiser returns an <strong>upper bound</strong> on that minimum. So a large <img src="https://latex.codecogs.com/png.latex?D"> means “no fit this good was found”: separation could be worse than reported, never better. The claims that run the other way, <img src="https://latex.codecogs.com/png.latex?D%20=%200">, <em>not</em> separable, are therefore the safe ones, and every one of them is backed here by an exact algebraic identity rather than by an optimiser.</p>
<div id="eb4ad893" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:05.424299Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:05.424080Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:05.438955Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:05.438285Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B2.3-levenspiel-deactivation-classes"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="efccd11b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:05.442174Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:05.441931Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:06.418370Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:06.417254Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Imports, data, and the two ledgers (metrics M, break rows BREAKS)."""</span></span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_ivp</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq, least_squares, minimize_scalar</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> interp_cntr_to_stagg</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm.checks <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> observed_orders</span>
<span id="cb2-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, cite_data, load_claims, load_data, load_meta</span>
<span id="cb2-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (TH, PLUG, Bed, PlugExact, _cascade, _mixed_p, _pow, respond,</span>
<span id="cb2-13">                   run_batch, run_const_c, run_mixed)</span>
<span id="cb2-14"></span>
<span id="cb2-15">EQS    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-1972-printed-equations.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb2-16">EQS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EQS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq"</span>].astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb2-17">EQS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EQS.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq"</span>)</span>
<span id="cb2-18">CLAIMS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-1972-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claim_id"</span>)</span>
<span id="cb2-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-1972-printed-equations.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb2-20"></span>
<span id="cb2-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> md_table(df, index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb2-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""DataFrame -&gt; pipe table (no tabulate dependency; requirements.txt has none)."""</span></span>
<span id="cb2-23">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.reset_index() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> index <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> df</span>
<span id="cb2-24">    cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d.columns]</span>
<span id="cb2-25">    lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"| "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" | "</span>.join(cols) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" |"</span>,</span>
<span id="cb2-26">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span>.join([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"---"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(cols)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span>]</span>
<span id="cb2-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d.iterrows():</span>
<span id="cb2-28">        lines.append(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"| "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" | "</span>.join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r.values) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" |"</span>)</span>
<span id="cb2-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(lines)</span>
<span id="cb2-30"></span>
<span id="cb2-31">M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every published number, registered as a claim at the end</span></span>
<span id="cb2-32">BREAKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect-injection rows: (metric, base, injection, result, note)</span></span>
<span id="cb2-33">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb2-34"></span>
<span id="cb2-35">CLASSES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>)</span>
<span id="cb2-36">SHORT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"par"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ser"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s-b-s"</span>,</span>
<span id="cb2-37">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ind"</span>}</span>
<span id="cb2-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Okabe-Ito, colour-vision-deficiency safe; fixed order used on every figure</span></span>
<span id="cb2-39">COL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#E69F00"</span>,</span>
<span id="cb2-40">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009E73"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#CC79A7"</span>}</span>
<span id="cb2-41">DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 1a  batch fluid"</span>,</span>
<span id="cb2-42">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 1b  plug flow, constant rate"</span>,</span>
<span id="cb2-43">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 1c  mixed flow, constant rate"</span>,</span>
<span id="cb2-44">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 1c  mixed flow, $C_A$ held"</span>}</span>
<span id="cb2-45"></span>
<span id="cb2-46">RES_X   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0e-3</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># illustrative conversion resolution (0.2 percentage points)</span></span>
<span id="cb2-47">RES_TAU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e-2</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># illustrative resolution in ln(tau'), i.e. 1 % in flow rate</span></span>
<span id="cb2-48">BASE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(kappa<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, lam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nprime<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>)</span>
<span id="cb2-49"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> TH.size <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> TH[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> TH[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># observation times, theta = t/t_obs</span></span>
<span id="cb2-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EQS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed equations and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLAIMS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed claims loaded"</span>)</span>
<span id="cb2-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fresh-catalyst conversion at the base point: "</span></span>
<span id="cb2-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kappa'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (mixed flow), "</span></span>
<span id="cb2-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kappa'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (plug flow)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Levenspiel, O. (1972) — Journal of Catalysis 25(2) 265-272 — doi:10.1016/0021-9517(72)90227-8 — table
29 printed equations and 17 printed claims loaded
fresh-catalyst conversion at the base point: 0.60 (mixed flow), 0.78 (plug flow)</code></pre>
</div>
</div>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p><strong>There are none.</strong> This paper publishes no measurement of any kind, and that is a claim about the source, so here is the search that establishes it.</p>
<p>All eight pages (265–272) were rendered at the scan’s native 300 ppi and read as images. <strong>There is no table in the document</strong>: no <code>TABLE</code> head, no ruled block, no column of numbers anywhere in the eight pages. (The two-column Nomenclature on p.&nbsp;265 is a list of symbol definitions, not data.) The numeral density is 70–112 glyphs per page and is almost entirely equation numbers: the only numerals in the body text that are not equation numbers, figure or section cross-references, page numbers, dates or bibliographic detail are the two timescales on p.&nbsp;267 (“0.1–1 sec”, “minutes”) and the orders on p.&nbsp;272,</p>
<blockquote class="blockquote">
<p><img src="https://latex.codecogs.com/png.latex?n%20=%201;%5Cquad%20n'%20=%200,1;%5Cquad%20d%20=%201,3"></p>
</blockquote>
<p>and those are attributed to the paper’s refs. 3 and 4 (Levenspiel’s own monograph and Kunii &amp; Levenspiel’s <em>Fluidization Engineering</em>) as the orders <em>those</em> books show how to test, not as anything measured here. <strong>Neither was consulted</strong>, and no number from either appears on this page.</p>
<p>Figs. 2–6 are <strong>schematic</strong>, not data. Their abscissa is an unlabelled <img src="https://latex.codecogs.com/png.latex?t">; their ordinate is an algebraic expression, not a scale; there is not a single tick value on any of the ten axes; and the open circles are drawn to illustrate what a correct guess would look like. The Fig. 6 caption says so: <em>“A straight line on this plot indicates that the guessed order of deactivation is correct.”</em> Nothing was digitised, and nothing could have been.</p>
<p>The Discussion states the paper’s own subject in the same terms (p.&nbsp;272): <em>“We ask in particular whether experiments can be devised so as to give simply the orders and rate constants of these equations.”</em> The abstract’s damaged phrase “the experimental detrrmination of the ordrrs” means <em>how to determine</em> them; the title word is <strong>Search</strong>.</p>
<p><strong>Consequence for this page.</strong> Nothing here is fitted to measurement and nothing here is validated against measurement. Every number is one of three things, labelled wherever it appears: (i) exact reproduction of printed algebra; (ii) an exact algebraic identity between the paper’s own rate forms; (iii) a computed property of those rate forms in a reactor. The two CSVs under <code>data/</code> are transcriptions: the printed equations this page uses, and the printed claims it tests, quoted verbatim; both counts are printed by the bootstrap cell above rather than typed here.</p>
<p><strong>Data tier 6</strong> (model-defining constants transcribed from the source, no experimental dataset).</p>
<div id="82e7a819" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:06.421546Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:06.421359Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:06.430392Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:06.429442Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The transcription, and the one thing it can be checked against: the paper's</span></span>
<span id="cb4-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">own cross-references.  Each of eqs. (12)-(32) is derived by the paper from a</span></span>
<span id="cb4-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">numbered predecessor, so the transcription is re-derived, line by line, in the</span></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">symbolic section below rather than merely retyped."""</span></span>
<span id="cb4-5">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**The four classes as printed (eqs. 4-7):**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb4-6">                 md_table(EQS.loc[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>],</span>
<span id="cb4-7">                                  [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ascii_form"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"describes"</span>]], index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)))</span>
<span id="cb4-8">n_defect <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((EQS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"status"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"verified"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb4-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rows flagged as printed defects in the transcription: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_defect<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb4-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"-&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(EQS.index[EQS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'status'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'verified'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"claims tested: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLAIMS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  of these, "</span></span>
<span id="cb4-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(CLAIMS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tested_as'</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'not tested'</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> explicitly out of scope"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The four classes as printed (eqs. 4-7):</strong></p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>eq</th>
<th>ascii_form</th>
<th>describes</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>4</td>
<td>-r’A = k CA^n a ; -da/dt = kd CA^n’ a^d</td>
<td>parallel deactivation: A -&gt; R and A -&gt; P(down)</td>
</tr>
<tr class="even">
<td>5</td>
<td>-r’A = k CA^n a ; -da/dt = kd CR^n’ a^d</td>
<td>series deactivation: A -&gt; R -&gt; P(down)</td>
</tr>
<tr class="odd">
<td>6</td>
<td>-r’A = k CA^n a ; -da/dt = kd CP^n’ a^d</td>
<td>side-by-side deactivation: A -&gt; R and P -&gt; P(down)</td>
</tr>
<tr class="even">
<td>7</td>
<td>-r’A = k CA^n a ; -da/dt = kd a^d</td>
<td>independent deactivation (concentration independent)</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
rows flagged as printed defects in the transcription: 1 -&gt; ['24']
claims tested: 17;  of these, 1 explicitly out of scope</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Three of the four contactings are lumped systems (a batch of fluid, or a well-mixed fluid over a batch of solids) and are ODEs in <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> (<code>S1</code>). The fourth, plug flow of fluid over a batch of solids, is a one-dimensional convection problem in the catalyst-weight coordinate <img src="https://latex.codecogs.com/png.latex?s%20=%20w/W"> with a distributed activity <img src="https://latex.codecogs.com/png.latex?a(s,%5Ctheta)"> (<code>S5</code>), and that is the pymrm model:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%5C,%5Cfrac%7B%5Cpartial%20c%7D%7B%5Cpartial%20%5Ctheta%7D%20+%20%5Cfrac%7B%5Cpartial%20c%7D%7B%5Cpartial%20s%7D%0A%20%20%20=%20-%5Ckappa%5C,c%5E%7B%5C,n%7D%20a,%20%5Cqquad%0A%20%20%20%5Cfrac%7B%5Cpartial%20a%7D%7B%5Cpartial%20%5Ctheta%7D%20=%20-%5Clambda%5C,%5Cphi%5E%7B%5C,n'%7D%20a%5E%7B%5C,d%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Cphi%20=%20c">, <img src="https://latex.codecogs.com/png.latex?1-c">, <img src="https://latex.codecogs.com/png.latex?p"> or <img src="https://latex.codecogs.com/png.latex?1"> for the four classes, <img src="https://latex.codecogs.com/png.latex?c(0,%5Ctheta)%20=%201"> at the feed, and</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20%5C;=%5C;%20%5Cfrac%7B%5Ctext%7Bfluid%20residence%20time%7D%7D%7B%5Ctext%7Bobservation%20window%7D%7D"></p>
<p>the small parameter the paper’s pseudo-steady assumption sets to zero. The model code is in <code>model.py</code> next to this notebook (<code>Bed</code>, and the lumped contactings <code>run_batch</code>, <code>run_mixed</code>, <code>run_const_c</code>).</p>
<ul>
<li><strong>Transport assembled once</strong> in <code>Bed.__init__</code>: <code>ConvFluxTVD</code> with the van Leer limiter for the second-order face fluxes and their exact Jacobian, and <code>construct_div</code> with <code>nu=0</code> (Cartesian: <img src="https://latex.codecogs.com/png.latex?s"> is a <em>weight</em> fraction, not a radius, so there is no area factor).</li>
<li><strong>Boundary conditions on the outward normal.</strong> Inlet <code>{a:0, b:1, d:1}</code> is <img src="https://latex.codecogs.com/png.latex?c%20=%201"> (the feed). Outlet <code>{"outflow": True}</code>: the face carries the last cell value, which sits half a cell upstream of the face, so a constant correction matrix moves the outlet face to the linear extrapolation of the last two cells (the last row of <code>interp_cntr_to_stagg</code>). The outlet concentration is read on that face, the value the operators transported.</li>
<li><strong>Each fluid profile is one <code>newton</code> solve</strong> (<code>damping="monotone"</code>, <code>stagnation=True</code>, step tolerance 1e-12, an error when it does not report success), with the Jacobian <code>div @ jac</code> of <code>ConvFluxTVD</code> plus the reaction on the diagonal by <code>construct_coefficient_matrix</code>. At frozen <img src="https://latex.codecogs.com/png.latex?a"> the continuous fluid equation is linear for <img src="https://latex.codecogs.com/png.latex?n%20=%201">, but the limited face values are not, so the discrete system is nonlinear for every <img src="https://latex.codecogs.com/png.latex?n">; it converges in a few iterations (the count for one profile is printed below). The activity is a pointwise ODE at each cell centre with no neighbour coupling and is marched with Heun’s method (second order).</li>
<li><strong>The pseudo-steady route (<img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%200">)</strong> and the <strong>full transient (<img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20%3E%200">)</strong> use the same operators and the same boundary conditions; only the accumulation term differs. The transient is a method of lines in <img src="https://latex.codecogs.com/png.latex?(c,%20w)">, integrated by BDF with the exact Jacobian (the <code>ConvFluxTVD</code> Jacobian and coefficient matrices). That is what makes the cost of the paper’s assumption measurable rather than arguable.</li>
</ul>
<p><strong>Validation routes.</strong> For the pseudo-steady bed at frozen <img src="https://latex.codecogs.com/png.latex?a(s)"> the fluid equation is a first-order cascade in <img src="https://latex.codecogs.com/png.latex?s">, so <img src="https://latex.codecogs.com/png.latex?c(s)%20=%20%5B%5C,1-(1-n)%5Ckappa%5C!%5Cint_0%5Es%20a%5C,%5D%5E%7B1/(1-n)%7D"> exactly (and <img src="https://latex.codecogs.com/png.latex?e%5E%7B-%5Ckappa%5Cint%20a%7D"> for <img src="https://latex.codecogs.com/png.latex?n%20=%201">). <code>PlugExact</code> evaluates it by cumulative Simpson quadrature on its own nodes: no operator, no grid stencil and no linear solve in common with the finite-volume bed. It is the reference the bed is measured against, and, being much cheaper, the engine of the separability sweep once the bed has been checked against it. A second solver for the same discrete equations, van Leer deferred correction (the upwind operator implicit, the limiter correction of the previous sweep explicit, swept to a change below 1e-12), is <code>Bed(route="deferred")</code>; its agreement with the newton route is measured below.</p>
<div id="fb08a5bd" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:06.432864Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:06.432720Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:06.455678Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:06.454811Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The pymrm bed: operators assembled once, and the two solvers of its fluid</span></span>
<span id="cb6-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">equation on one frozen activity profile."""</span></span>
<span id="cb6-3">BED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb6-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm bed assembled: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells, ConvFluxTVD (van Leer) with an "</span></span>
<span id="cb6-5">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"extrapolated outlet face, construct_div(nu=0)"</span>)</span>
<span id="cb6-6">_a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BED.s_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a frozen activity profile</span></span>
<span id="cb6-7">_cn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BED.steady_c(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], _a)</span>
<span id="cb6-8">_nit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BED.last_nit</span>
<span id="cb6-9">_bd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, route<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred"</span>)</span>
<span id="cb6-10">_cd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _bd.steady_c(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], _a)</span>
<span id="cb6-11">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_frozen"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_cn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _cd)))</span>
<span id="cb6-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"newton: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> iterations; deferred correction: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>last_nit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sweeps; "</span></span>
<span id="cb6-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two profiles agree to below 1e-11 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_route_gap_frozen'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm bed assembled: 200 cells, ConvFluxTVD (van Leer) with an extrapolated outlet face, construct_div(nu=0)
newton: 3 iterations; deferred correction: 17 sweeps; the two profiles agree to below 1e-11 (here 1.5e-13)</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-printed-structure-proved" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-structure-proved">1. The printed structure, proved</h3>
<p>A symbolic identity per printed step: the count is printed by the cell below, not typed here. Each equation is re-derived from the numbered predecessor the paper derives it from, so the transcription is checked line by line rather than retyped: a mis-read subscript or prime surfaces as a nonzero residual instead of as a plausible wrong equation. These are <strong>identities</strong>: once the transcription is right they cannot fail, and they are labelled that way in the coverage map. What they protect against is the transcription itself, which on this scan is the real risk.</p>
<div id="cd2bef66" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:06.458072Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:06.457890Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:07.171790Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:07.171177Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Symbolic verification of eqs. (8), (12)-(15), (17), (19), (21)-(23),</span></span>
<span id="cb8-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(25)-(32) and the slope/intercept printed on Fig. 6."""</span></span>
<span id="cb8-3">t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>, nonnegative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-4">k, kd, kpp, kp, kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k k_d k'' k' k_d'"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-5">CA0, CA, CAinf, CR, Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_A0 C_A C_Ainf C_R Q"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-6">tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau'"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-7">npr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n'"</span>, nonnegative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-8">dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-9">aF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Function(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>)(t)</span>
<span id="cb8-10">av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-11">SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb8-12"></span>
<span id="cb8-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (8) -&gt; (7): C_A + C_R is constant for a specific feed</span></span>
<span id="cb8-14">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_reduces_to_eq7"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(</span>
<span id="cb8-15">    (kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (CA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> CR) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> npr).subs(CR, CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> npr)</span>
<span id="cb8-16"></span>
<span id="cb8-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (11) -&gt; (12) -&gt; (13) -&gt; (14) -&gt; (15): the batch-fluid chain</span></span>
<span id="cb8-18">a12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.dsolve(sp.Derivative(aF, t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> aF, aF, ics<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{aF.subs(t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>): <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>}).rhs</span>
<span id="cb8-19">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq12"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(a12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb8-20">CAt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.dsolve(sp.Derivative(sp.Function(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)(t), t)</span>
<span id="cb8-21">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kpp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.Function(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)(t),</span>
<span id="cb8-22">                sp.Function(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)(t),</span>
<span id="cb8-23">                ics<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{sp.Function(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>): CA0}).rhs</span>
<span id="cb8-24">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq13"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CAt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kpp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)))</span>
<span id="cb8-25">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq14"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.limit(sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CAt), t, sp.oo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kpp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kd)</span>
<span id="cb8-26">CAinf_e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kpp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kd)</span>
<span id="cb8-27">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq15"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.expand_log(</span>
<span id="cb8-28">    sp.log(sp.log(CAt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CAinf_e)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.log(sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CAinf_e)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t,</span>
<span id="cb8-29">    force<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>))</span>
<span id="cb8-30"></span>
<span id="cb8-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (16) -&gt; (17) -&gt; (18) -&gt; (19): mixed flow at constant flow rate</span></span>
<span id="cb8-32">XA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA0</span>
<span id="cb8-33">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq17"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (XA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> CA)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA)</span>
<span id="cb8-34">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq19"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.log((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-35">                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (sp.log(k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb8-36"></span>
<span id="cb8-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (20) -&gt; (21) -&gt; (22): plug flow at constant flow rate</span></span>
<span id="cb8-38">X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Symbol(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"X"</span>, nonnegative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-39">e20 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.integrate(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> av <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X)), (X, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, XA))</span>
<span id="cb8-40">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq21"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e20 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> av))</span>
<span id="cb8-41">tau21 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb8-42">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.log(sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (sp.log(k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau21) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb8-43"></span>
<span id="cb8-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (23): mixed flow with C_A held constant</span></span>
<span id="cb8-45">tau18 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb8-46">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq23"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.log(tau18)</span>
<span id="cb8-47">                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.log((CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> CA))))</span>
<span id="cb8-48"></span>
<span id="cb8-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (25)-(27) and (28)-(31): the general-order chain at constant C_A</span></span>
<span id="cb8-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (27): tau' = C_A0 (W/F_A0) with W/F_A0 = X_A/(-r'_A) and -r'_A = k' a  (eq. 25)</span></span>
<span id="cb8-51">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> av)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> av))</span>
<span id="cb8-52">a_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>: sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t),</span>
<span id="cb8-53">       <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sp.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)}</span>
<span id="cb8-54"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, expr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> a_d.items():</span>
<span id="cb8-55">    SYM[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq26_solution_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>j<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(expr, t) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> expr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> j)</span>
<span id="cb8-56">    SYM[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq26_ic_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>j<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(expr.subs(t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-57">taud <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {j: Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> a_d.items()}          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Q = (C_A0 - C_A)/k' , eq. 27</span></span>
<span id="cb8-58">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq28"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> taud[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA)</span>
<span id="cb8-59">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)</span>
<span id="cb8-60">                          ).subs(Q, (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp)</span>
<span id="cb8-61">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq28"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq28"</span>])</span>
<span id="cb8-62">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq29"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify((sp.log(taud[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (sp.log((CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)</span>
<span id="cb8-63">                           ).subs(Q, (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp))</span>
<span id="cb8-64">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq30"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify((taud[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)</span>
<span id="cb8-65">                           ).subs(Q, (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp))</span>
<span id="cb8-66">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq31"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify((taud[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (((CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-67">                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ((CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)</span>
<span id="cb8-68">                           ).subs(Q, (CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kp))</span>
<span id="cb8-69"></span>
<span id="cb8-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (32) and Fig. 6, for GENERAL d - via the substitution the paper itself uses</span></span>
<span id="cb8-71">SUB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {sp.Derivative(aF, t): <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> aF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> dd}</span>
<span id="cb8-72">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq32_substitution"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.powsimp(</span>
<span id="cb8-73">    sp.diff(aF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dd), t).subs(SUB) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kdp, force<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>))</span>
<span id="cb8-74">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig6_slope_general_d"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.powsimp(</span>
<span id="cb8-75">    sp.diff((Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> aF) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), t).subs(SUB) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kdp,</span>
<span id="cb8-76">    force<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>))</span>
<span id="cb8-77">SYM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig6_intercept_general_d"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.powsimp(</span>
<span id="cb8-78">    ((Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> aF) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)).subs(aF, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), force<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>))</span>
<span id="cb8-79"></span>
<span id="cb8-80">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [kk <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kk, vv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SYM.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> sp.simplify(vv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"symbolic identities checked: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SYM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  nonzero residuals: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-82">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_identities"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SYM))</span>
<span id="cb8-83">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_nonzero"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(bad))</span>
<span id="cb8-84"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> bad, bad</span>
<span id="cb8-85"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what the count is for: one mis-read rate constant in eq. (12) (k for k_d) is</span></span>
<span id="cb8-86"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># caught as a nonzero residual</span></span>
<span id="cb8-87">SYM_TYPO_NONZERO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(a12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>symbolic identities checked: 26;  nonzero residuals: none</code></pre>
</div>
</div>
</section>
<section id="eq.-24-is-wrong-as-printed-by-a-constant-offset" class="level3">
<h3 class="anchored" data-anchor-id="eq.-24-is-wrong-as-printed-by-a-constant-offset">2. Eq. (24) is wrong as printed, by a constant offset</h3>
<p>The paper introduces eq. (24) with <em>“At any instant in the plug flow reactor Eq. 21 applies. Also noting that <img src="https://latex.codecogs.com/png.latex?%5Ctau'"> and <img src="https://latex.codecogs.com/png.latex?t"> are the two variables we obtain on suitable rearrangement”</em>. Eq. (21) is <img src="https://latex.codecogs.com/png.latex?%5Ctau'%20=%20%5Cdfrac%7B1%7D%7Bk%5C,e%5E%7B-k_dt%7D%7D%5Cln%5Cdfrac%7BC_%7B%5Crm%20A0%7D%7D%7BC_%7B%5Crm%20A%7D%7D">, so the rearrangement is forced. Two independent arguments settle it, and the second does not use the first:</p>
<div id="8693779d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:07.174762Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:07.174568Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:07.368615Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:07.367885Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (24): printed vs required by the paper's own eq. (21) -- and the units."""</span></span>
<span id="cb10-2">printed_24  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.log(sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kd)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># AS PRINTED, p. 270</span></span>
<span id="cb10-3">required_24 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sp.log(sp.log(CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from eq. (21)</span></span>
<span id="cb10-4">gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.log(tau21) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed_24)</span>
<span id="cb10-5">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_residual_is_log_kd_over_k"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.log(kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb10-6">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_repaired_residual"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(sp.log(tau21) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> required_24) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb10-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break rows: each boolean flips when the other form is read in its place</span></span>
<span id="cb10-8">EQ24_BROKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(sp.simplify(sp.log(tau21) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> required_24)</span>
<span id="cb10-9">                                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.log(kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb10-10">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(sp.log(tau21) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed_24) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb10-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (21) minus eq. (24) as printed  =  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (21) minus eq. (24) with 1/k    =  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>simplify(sp.log(tau21) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> required_24)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-13"></span>
<span id="cb10-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the dimensional argument, from the paper's own Nomenclature -------------</span></span>
<span id="cb10-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k   : liter^n / (mol^(n-1) sec g cat)          -&gt; [k]  = L^n mol^(1-n) s^-1 g^-1</span></span>
<span id="cb10-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k_d : liter^n' / (sec mol^n')                  -&gt; [k_d] = L^n' mol^-n' s^-1</span></span>
<span id="cb10-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tau': g cat sec / liter of fluid</span></span>
<span id="cb10-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># At n = 1, n' = 0:  1/k = g s / L  = [tau']   while  1/k_d = s.</span></span>
<span id="cb10-19">dims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(</span>
<span id="cb10-20">    [[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/k   (eq. 21 requires)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"g cat sec / liter"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>],</span>
<span id="cb10-21">     [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/k_d (eq. 24 prints)"</span>,   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sec"</span>,               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no"</span>],</span>
<span id="cb10-22">     [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau'  (the quantity)"</span>,    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"g cat sec / liter"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>]],</span>
<span id="cb10-23">    columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"units at n = 1, n' = 0 (Nomenclature, p. 265)"</span>,</span>
<span id="cb10-24">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"can sit inside ln tau'?"</span>])</span>
<span id="cb10-25">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Eq. (24)'s printed argument is dimensionally impossible:**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb10-26">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(dims)))</span>
<span id="cb10-27"></span>
<span id="cb10-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- and numerically, on the device eq. (24) is the test plot for ------------</span></span>
<span id="cb10-29">_k, _kd, _CA0, _CA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span></span>
<span id="cb10-30">off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(np.log(_CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _kd) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(np.log(_CA0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _CA) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _k)</span>
<span id="cb10-31">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_numeric_offset"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(off)</span>
<span id="cb10-32">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_offset_expected"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(_k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _kd))</span>
<span id="cb10-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">intercept as printed minus intercept required, at k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, k_d = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_kd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: "</span></span>
<span id="cb10-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>off<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  vs  ln(k/k_d) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log(_k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_kd)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The slope of Fig. 5 is unaffected; only the intercept - i.e. only the "</span></span>
<span id="cb10-36">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recovered value of k - is. REPORTED, NOT REPAIRED: the CSV and the table "</span></span>
<span id="cb10-37">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"above carry the printed form."</span>)</span>
<span id="cb10-38">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_numeric_offset"</span>, off, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read eq. (24) as if it printed 1/k"</span>,</span>
<span id="cb10-39">               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the defect metric is exactly the printed-vs-required gap"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (21) minus eq. (24) as printed  =  log(k_d/k)
eq. (21) minus eq. (24) with 1/k    =  0</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Eq. (24)’s printed argument is dimensionally impossible:</strong></p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>quantity</th>
<th>units at n = 1, n’ = 0 (Nomenclature, p.&nbsp;265)</th>
<th>can sit inside ln tau’?</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1/k (eq. 21 requires)</td>
<td>g cat sec / liter</td>
<td>yes</td>
</tr>
<tr class="even">
<td>1/k_d (eq. 24 prints)</td>
<td>sec</td>
<td>no</td>
</tr>
<tr class="odd">
<td>tau’ (the quantity)</td>
<td>g cat sec / liter</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
intercept as printed minus intercept required, at k = 2.0, k_d = 0.7: 1.049822  vs  ln(k/k_d) = 1.049822
The slope of Fig. 5 is unaffected; only the intercept - i.e. only the recovered value of k - is. REPORTED, NOT REPAIRED: the CSV and the table above carry the printed form.</code></pre>
</div>
</div>
</section>
<section id="the-four-classes-in-the-four-devices" class="level3">
<h3 class="anchored" data-anchor-id="the-four-classes-in-the-four-devices">3. The four classes in the four devices</h3>
<p>Every class solved in every contacting, at the base orders <img src="https://latex.codecogs.com/png.latex?(n,%20n',%20d)%20=%20(1,%201,%201)">. The curves differ visibly. The rest of this page is about how much of that difference survives a fit.</p>
<div id="a120c723" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:07.371100Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:07.370909Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:07.881071Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:07.880210Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Figure 1: the observable of each device, for each class, at the base point."""</span></span>
<span id="cb13-2">RESP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb13-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb13-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES:</span>
<span id="cb13-5">        RESP[(cfg, cls)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb13-6">                                   BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>],</span>
<span id="cb13-7">                                   c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb13-8">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>), sharex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb13-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ax, cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(axes.ravel(), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>)):</span>
<span id="cb13-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES:</span>
<span id="cb13-11">        ax.plot(TH, RESP[(cfg, cls)], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>COL[cls], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>cls)</span>
<span id="cb13-12">    ax.set_title(DEV[cfg], fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb13-13">    ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au'/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">au'_0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"conversion </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X_A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-14">    ax.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb13-15">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = t/t_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m obs}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-16">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = t/t_{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\r</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m obs}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-17">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb13-18">fig.suptitle(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The four deactivation classes of eqs. (4)-(7), in the paper's own "</span></span>
<span id="cb13-19">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch-solids contactings"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb13-20">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb13-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb13-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES:</span>
<span id="cb13-23">        M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"span_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.ptp(RESP[(cfg, cls)]))</span>
<span id="cb13-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observable spans (the signal a fit has to reproduce):"</span>)</span>
<span id="cb13-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(pd.DataFrame({cfg: {cls: np.ptp(RESP[(cfg, cls)]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES}</span>
<span id="cb13-26">                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>)}).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb13-27">      .to_string())</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.3-levenspiel-deactivation-classes/index_files/figure-html/cell-8-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>observable spans (the signal a fit has to reproduce):
               batch    plug   mixed  constC
parallel      0.4372  0.6291  0.3946  1.2000
series        0.6274  0.3523  0.3050  1.8000
side-by-side  0.4751  0.5533  0.3041  0.8824
independent   0.3782  0.7049  0.5305  3.0000</code></pre>
</div>
</div>
</section>
<section id="five-exact-degeneracies-and-they-reach-every-device" class="level3">
<h3 class="anchored" data-anchor-id="five-exact-degeneracies-and-they-reach-every-device">4. Five exact degeneracies, and they reach every device</h3>
<p>Before any optimiser runs: <strong>every one of the four devices collapses some pair of classes onto another identically</strong>, and each collapse is a one-line algebraic fact about the device, not a numerical coincidence. Each is stated, proved symbolically, and then confirmed by running the two “different” classes and subtracting.</p>
<ol type="1">
<li><strong><img src="https://latex.codecogs.com/png.latex?n'%20=%200"> collapses all four, everywhere.</strong> With no concentration in the decay law, eqs. (4)–(6) <em>are</em> eq. (7). This is the paper’s own statement (p.&nbsp;267, <em>“When concentration independent (or <img src="https://latex.codecogs.com/png.latex?n'%20=%200">) then any type of batch-solids system may be used”</em>), and it is why the taxonomy has a fourth member at all.</li>
<li><strong>Mixed flow at constant rate: series <em>is</em> parallel, relabelled.</strong> The performance relation (16) is algebraic, so <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D/C_%7B%5Crm%20A0%7D%20=%20%5Ckappa%5C,(C_%7B%5Crm%20A%7D/C_%7B%5Crm%20A0%7D)%5E%7Bn%7D%20a"> <em>exactly</em> at every instant. Hence <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D%5E%7B%5C,n'%7D%20%5Cpropto%20C_%7B%5Crm%20A%7D%5E%7B%5C,n%20n'%7D%20a%5E%7B%5C,n'%7D">, and series with orders <img src="https://latex.codecogs.com/png.latex?(n',%20d)"> is <strong>identical</strong> to parallel with orders <img src="https://latex.codecogs.com/png.latex?(n%5C,n',%5C,%20d+n')"> and <img src="https://latex.codecogs.com/png.latex?k_d%20%5Cto%20k_d%20%5Ckappa%5E%7Bn'%7D">. Every observable, at every time. A well-mixed fluid cannot tell the two apart, ever.</li>
<li><strong>Held-<img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> mixed flow: everything is independent deactivation.</strong> That is what “decoupling” means. With <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> (hence <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D">) held fixed, <img src="https://latex.codecogs.com/png.latex?k'_d%20=%20k_dC_%7B%5Crm%20A%7D%5E%7Bn'%7D"> or <img src="https://latex.codecogs.com/png.latex?k_dC_%7B%5Crm%20R%7D%5E%7Bn'%7D"> or <img src="https://latex.codecogs.com/png.latex?k_d"> are all just <em>constants</em>, and eq. (26) is the same equation for all three classes. At <img src="https://latex.codecogs.com/png.latex?d%20=%201"> side-by-side joins them, because the poison consumed per unit time then goes as <img src="https://latex.codecogs.com/png.latex?a%5E%7Bd-1%7D"> = const and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20P%7D"> settles at a fixed value: <strong>all four classes are one equation there.</strong> <strong>The device Levenspiel recommends is the one in which, within a single run, the classes are least distinguishable.</strong></li>
<li><strong>Side-by-side <em>is</em> parallel wherever the poison profile equals the reactant profile.</strong> The poison obeys the same first-order form as the reactant, <img src="https://latex.codecogs.com/png.latex?-dp/d(%5Ccdot)%20=%20%5Csigma%5Clambda%5C,a%5E%7B%5C,d%7Dp%5E%7B%5C,n'%7D"> against <img src="https://latex.codecogs.com/png.latex?-dc/d(%5Ccdot)%20=%20%5Ckappa%5C,a%5C,c%5E%7B%5C,n%7D">, so at <img src="https://latex.codecogs.com/png.latex?d%20=%201">, <img src="https://latex.codecogs.com/png.latex?n'%20=%20n"> and <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%20%5Ckappa/%5Clambda"> the two are the <em>same</em> differential equation with the same initial value: <img src="https://latex.codecogs.com/png.latex?p%20%5Cequiv%20c">, identically, and eq. (6) becomes eq. (4) with the same constants. This holds in the batch, in the <strong>plug-flow bed</strong> and in the constant-flow mixed reactor alike: it is a property of the rate forms, not of the contacting.</li>
<li><strong>And with <img src="https://latex.codecogs.com/png.latex?%5Csigma"> free: side-by-side is parallel with a relabelled <img src="https://latex.codecogs.com/png.latex?n'">.</strong> At <img src="https://latex.codecogs.com/png.latex?n%20=%20n'%20=%20d%20=%201"> the two profiles are powers of one another: <img src="https://latex.codecogs.com/png.latex?p%20=%20c%5E%7B%5Clambda%5Csigma/%5Ckappa%7D"> in the bed (both are <img src="https://latex.codecogs.com/png.latex?%5Cexp(-%5Ctext%7Bconst%7D%0A%5Cint%20a)">), and <img src="https://latex.codecogs.com/png.latex?c%20=%20p%5E%7B%5Ckappa/(%5Clambda%5Csigma)%7D"> in a batch of fluid (where <img src="https://latex.codecogs.com/png.latex?p%20=%201-%5Csigma(1-a)"> is exactly affine in the activity). So the side-by-side driver is a <em>power of the parallel driver</em>, and side-by-side with <strong>any</strong> <img src="https://latex.codecogs.com/png.latex?%5Csigma"> is parallel with <img src="https://latex.codecogs.com/png.latex?n'%20%5Cto%20%5Clambda%5Csigma/%5Ckappa">, same <img src="https://latex.codecogs.com/png.latex?%5Ckappa,%5Clambda,d">. Degeneracy 4 is the equal-parameter slice of this family (<img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%20%5Ckappa/%5Clambda"> makes the relabelled order 1 again). <strong>This one holds in the batch and the bed and nowhere else</strong>: in the two well-mixed devices the profiles are not powers of each other, and the measurement below shows the identity failing there by more than 1e-1.</li>
</ol>
<p><strong>So the plug-flow bed is not the one device without an exact degeneracy.</strong> It carries degeneracies 1, 4 and 5, exactly as the batch of fluid does. What separates the bed and the batch from the two well-mixed devices is narrower and still real: they are the two devices in which <strong>parallel, series and independent remain algebraically distinct</strong>. What separates the bed from the batch is narrower again, and is what §6 is about: it is the only contacting with a spatial coordinate, so it is the only one whose activity carries a <em>profile</em>.</p>
<p>Each identity is checked <strong>on</strong> its condition and <strong>off</strong> it.</p>
<div id="14e8c6a2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:07.883831Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:07.883698Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:41:08.930846Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:41:08.929977Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The degeneracies: predicted from algebra, then measured by subtraction."""</span></span>
<span id="cb15-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> below(v, b):</span>
<span id="cb15-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A round-off or tolerance-sized number, printed as the bound it is checked</span></span>
<span id="cb15-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    against; its digits differ between machines and are given only as 'here'."""</span></span>
<span id="cb15-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb15-6">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb15-7"></span>
<span id="cb15-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1) n' = 0 collapses the four classes in every device</span></span>
<span id="cb15-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb15-10">    ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb15-11">    worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb15-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>):</span>
<span id="cb15-13">        y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, cls, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb15-14">        worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref))))</span>
<span id="cb15-15">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_nprime0_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst</span>
<span id="cb15-16">    rows.append([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"n' = 0: all four classes identical"</span>, DEV[cfg], below(worst, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)])</span>
<span id="cb15-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and the control: give the decay a concentration order and it stops holding</span></span>
<span id="cb15-18">worst_np0, OFF_NP0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, {}</span>
<span id="cb15-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb15-20">    ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb15-21">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb15-22">    OFF_NP0[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref)))</span>
<span id="cb15-23">    worst_np0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst_np0, OFF_NP0[cfg])</span>
<span id="cb15-24">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_nprime0_off_condition"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst_np0</span>
<span id="cb15-25">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...the same comparison at n' = 0.7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"worst of the four"</span>,</span>
<span id="cb15-26">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst_np0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb15-27"></span>
<span id="cb15-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (2) mixed flow: series(n', d) == parallel(n n', d + n'), lam -&gt; lam kappa^n'</span></span>
<span id="cb15-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _degen2(rtol):</span>
<span id="cb15-30">    worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb15-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb15-32">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> npv, dv, lm, kp_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>),</span>
<span id="cb15-33">                                 (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)):</span>
<span id="cb15-34">            ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_mixed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, kp_, lm, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-35">            yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_mixed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kp_, lm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> kp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> npv, dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> npv, nn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> npv,</span>
<span id="cb15-36">                           n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-37">            worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yp))))</span>
<span id="cb15-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> worst</span>
<span id="cb15-39">worst2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _degen2(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the production tolerance</span></span>
<span id="cb15-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break row: the same nine comparisons WITHOUT the relabelling of the orders</span></span>
<span id="cb15-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and of lam (series(n', d) against parallel(n', d)) are not an identity at all</span></span>
<span id="cb15-42">DEGEN2_UNMAPPED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb15-43">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(run_mixed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, kp_, lm, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-44">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> run_mixed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kp_, lm, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])))</span>
<span id="cb15-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb15-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> npv, dv, lm, kp_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>),</span>
<span id="cb15-47">                             (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)))</span>
<span id="cb15-48">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst2</span>
<span id="cb15-49">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel_rtol1e-13"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _degen2(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb15-50">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series(n',d) == parallel(n n', d+n')"</span>, DEV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>], below(worst2, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>)])</span>
<span id="cb15-51"></span>
<span id="cb15-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (3) held-C_A device: parallel == series == independent after relabelling lam,</span></span>
<span id="cb15-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     and at d = 1 side-by-side joins them (consumption ~ a^(d-1) = const, so</span></span>
<span id="cb15-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     C_P settles and its driver is a constant like the other three)</span></span>
<span id="cb15-55">cs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> worst3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb15-56"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> npv, dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)):</span>
<span id="cb15-57">    t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, dv, npv, cs)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-58">    t2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (cs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cs)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> npv, dv, npv, cs)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-59">    t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> npv, dv, npv, cs)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-60">    worst3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst3, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t2)), np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t3)))))</span>
<span id="cb15-61">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_constC_par_ser_ind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst3</span>
<span id="cb15-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break row: series WITHOUT the relabelling lam -&gt; lam (c/(1-c))^n'</span></span>
<span id="cb15-63">DEGEN3_UNMAPPED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb15-64">    np.log(run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, cs)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-65">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, cs)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))))</span>
<span id="cb15-66">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel == series == independent"</span>, DEV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>], below(worst3, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)])</span>
<span id="cb15-67"></span>
<span id="cb15-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (4) side-by-side(sigma = kappa/lambda, n' = n, d = 1) == parallel, IDENTICAL</span></span>
<span id="cb15-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     parameters, because the poison then solves the reactant's own equation.</span></span>
<span id="cb15-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     Checked in every device that has one, not just the batch.</span></span>
<span id="cb15-71">KA, LA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span></span>
<span id="cb15-72">famA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb15-73"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg, runner <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, run_batch), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, PLUG.run),</span>
<span id="cb15-74">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, run_mixed)):</span>
<span id="cb15-75">    on <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb15-76">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn, dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)):     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># n' = n on condition</span></span>
<span id="cb15-77">        yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> runner(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, KA, LA, dv, nn, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-78">        ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> runner(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, KA, LA, dv, nn, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn, sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> LA)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-79">        on <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(on, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ys))))</span>
<span id="cb15-80">    famA[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> on</span>
<span id="cb15-81">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_sbs_is_parallel_famA_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> on</span>
<span id="cb15-82">    rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side(sig=kappa/lam) == parallel, n'=n and d=1"</span>,</span>
<span id="cb15-83">                 DEV[cfg], below(on, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)])</span>
<span id="cb15-84">OFF_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}                                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># per device</span></span>
<span id="cb15-85"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg, runner <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, run_batch), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, PLUG.run),</span>
<span id="cb15-86">                    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, run_mixed)):</span>
<span id="cb15-87">    OFF_A[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb15-88">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn, npv, dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)):  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d != 1, or n' != n</span></span>
<span id="cb15-89">        yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> runner(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, KA, LA, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-90">        ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> runner(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, KA, LA, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn, sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>KA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> LA)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-91">        OFF_A[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(OFF_A[cfg], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ys))))</span>
<span id="cb15-92">off_cond <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> OFF_A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>]</span>
<span id="cb15-93">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_batch_sbs_is_parallel_on_condition"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> famA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>]</span>
<span id="cb15-94">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_batch_sbs_off_condition"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> off_cond</span>
<span id="cb15-95">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...the same comparison OFF that condition (d = 2, or n' != n)"</span>,</span>
<span id="cb15-96">             DEV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>], <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>off_cond<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb15-97"></span>
<span id="cb15-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (5) sigma FREE: at n = n' = d = 1 the poison profile is a POWER of the</span></span>
<span id="cb15-99"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     reactant profile, so side-by-side(sigma) == parallel(n' -&gt; lam sig/kap).</span></span>
<span id="cb15-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     Bed:   p = exp(-sig lam I), c = exp(-kap I)  -&gt;  p = c^(sig lam/kap).</span></span>
<span id="cb15-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     Batch: p = 1 - sig(1-a) and dln c/dln p = kap/(lam sig) -&gt; c = p^(kap/lam sig).</span></span>
<span id="cb15-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     True in those two devices ONLY; the control below is the other two.</span></span>
<span id="cb15-103">SIG_FAM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb15-104">famB, famB_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, []</span>
<span id="cb15-105"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb15-106">    worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb15-107">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_FAM:</span>
<span id="cb15-108">        ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, KA, LA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, sv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb15-109">                     c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb15-110">        yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, KA, LA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, LA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> KA, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb15-111">                     c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb15-112">        worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yp))))</span>
<span id="cb15-113">    famB[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst</span>
<span id="cb15-114">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_sbs_is_parallel_famB_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> worst</span>
<span id="cb15-115">famB_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># off the n = n' = d = 1 condition, in the bed</span></span>
<span id="cb15-116"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn, npv, dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)):</span>
<span id="cb15-117">    ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PLUG.run(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, KA, LA, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn, sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-118">    yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PLUG.run(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, KA, LA, dv, npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> LA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> KA, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nn)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-119">    famB_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(famB_off, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yp))))</span>
<span id="cb15-120">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_famB_off_condition"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> famB_off</span>
<span id="cb15-121"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>):</span>
<span id="cb15-122">    rows.append([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"side-by-side(any sig) == parallel(n' = lam sig/kap), n=n'=d=1"</span>,</span>
<span id="cb15-123">                 DEV[cfg], below(famB[cfg], {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>}[cfg])])</span>
<span id="cb15-124">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...the same identity in the two WELL-MIXED devices (it fails)"</span>,</span>
<span id="cb15-125">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed / constC"</span>,</span>
<span id="cb15-126">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> / </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb15-127">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"...and in the bed OFF the n = n' = d = 1 condition"</span>, DEV[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>],</span>
<span id="cb15-128">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>famB_off<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb15-129"></span>
<span id="cb15-130">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Exact degeneracies, measured as max |difference| in the "</span></span>
<span id="cb15-131">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device's observable:**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb15-132">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device"</span>,</span>
<span id="cb15-133">                                                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max |difference|"</span>]))))</span>
<span id="cb15-134"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A ratio to a round-off residual is a ratio to noise, so every control is</span></span>
<span id="cb15-135"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stated against the BOUND the identity is checked at, never divided by it.</span></span>
<span id="cb15-136"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Controls. Degeneracy 4 holds to below 1e-12 on its condition and off "</span></span>
<span id="cb15-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"it (d = 2, or n' != n) separates by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>off_cond<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, more than 1e10 times "</span></span>
<span id="cb15-138">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"that bound. Degeneracy 5 holds in the batch (below 1e-7) and the bed "</span></span>
<span id="cb15-139">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(below 1e-8, the integrator tolerance) over sigma = "</span></span>
<span id="cb15-140">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SIG_FAM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SIG_FAM[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and FAILS in the mixed reactor "</span></span>
<span id="cb15-141">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) and the held-C_A device (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), "</span></span>
<span id="cb15-142">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"each more than 1e6 times the bed's bound, and in the bed itself off "</span></span>
<span id="cb15-143">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"n = n' = d = 1 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>famB_off<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). The identities are sharp, not "</span></span>
<span id="cb15-144">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"approximate."</span>)</span>
<span id="cb15-145"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(off_cond <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed'</span>], famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC'</span>], famB_off) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span></span>
<span id="cb15-146"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Degeneracy 2 is reported at the production integrator tolerance "</span></span>
<span id="cb15-147">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(rtol 1e-9): below 1e-8 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). It is a TOLERANCE, not a "</span></span>
<span id="cb15-148">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"separation - re-integrating the same nine order combinations at rtol "</span></span>
<span id="cb15-149">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1e-13 gives below 1e-11 (here "</span></span>
<span id="cb15-150">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'degen_mixed_series_is_parallel_rtol1e-13'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), i.e. the identity "</span></span>
<span id="cb15-151">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"is exact and the printed number measures the ODE solver."</span>)</span>
<span id="cb15-152">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_batch_sbs_is_parallel_on_condition"</span>, famA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>],</span>
<span id="cb15-153">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step off the n' = n, d = 1 condition (d = 2)"</span>, off_cond,</span>
<span id="cb15-154">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shows the identity is conditional, not a numerical artefact"</span>))</span>
<span id="cb15-155">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_plug"</span>, famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>],</span>
<span id="cb15-156">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evaluate the same sigma-family identity in the MIXED reactor"</span>,</span>
<span id="cb15-157">               famB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>],</span>
<span id="cb15-158">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 5 is a property of the batch and the bed only"</span>))</span>
<span id="cb15-159">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel"</span>, worst2,</span>
<span id="cb15-160">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tighten the integrator from rtol 1e-9 to 1e-13"</span>,</span>
<span id="cb15-161">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel_rtol1e-13"</span>],</span>
<span id="cb15-162">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the metric measures the ODE tolerance; the identity itself is exact"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Exact degeneracies, measured as max |difference| in the device’s observable:</strong></p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>identity</th>
<th>device</th>
<th>max</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>n’ = 0: all four classes identical</td>
<td>Fig. 1a batch fluid</td>
<td>below 1e-12 (here 0.0e+00)</td>
</tr>
<tr class="even">
<td>n’ = 0: all four classes identical</td>
<td>Fig. 1b plug flow, constant rate</td>
<td>below 1e-12 (here 0.0e+00)</td>
</tr>
<tr class="odd">
<td>n’ = 0: all four classes identical</td>
<td>Fig. 1c mixed flow, constant rate</td>
<td>below 1e-12 (here 0.0e+00)</td>
</tr>
<tr class="even">
<td>n’ = 0: all four classes identical</td>
<td>Fig. 1c mixed flow, <img src="https://latex.codecogs.com/png.latex?C_A"> held</td>
<td>below 1e-12 (here 0.0e+00)</td>
</tr>
<tr class="odd">
<td>…the same comparison at n’ = 0.7</td>
<td>worst of the four</td>
<td>1.42e+00</td>
</tr>
<tr class="even">
<td>series(n’,d) == parallel(n n’, d+n’)</td>
<td>Fig. 1c mixed flow, constant rate</td>
<td>below 1e-08 (here 1.3e-09)</td>
</tr>
<tr class="odd">
<td>parallel == series == independent</td>
<td>Fig. 1c mixed flow, <img src="https://latex.codecogs.com/png.latex?C_A"> held</td>
<td>below 1e-12 (here 8.9e-16)</td>
</tr>
<tr class="even">
<td>side-by-side(sig=kappa/lam) == parallel, n’=n and d=1</td>
<td>Fig. 1a batch fluid</td>
<td>below 1e-12 (here 0.0e+00)</td>
</tr>
<tr class="odd">
<td>side-by-side(sig=kappa/lam) == parallel, n’=n and d=1</td>
<td>Fig. 1b plug flow, constant rate</td>
<td>below 1e-12 (here 0.0e+00)</td>
</tr>
<tr class="even">
<td>side-by-side(sig=kappa/lam) == parallel, n’=n and d=1</td>
<td>Fig. 1c mixed flow, constant rate</td>
<td>below 1e-12 (here 7.3e-15)</td>
</tr>
<tr class="odd">
<td>…the same comparison OFF that condition (d = 2, or n’ != n)</td>
<td>Fig. 1a batch fluid</td>
<td>1.66e-02</td>
</tr>
<tr class="even">
<td>side-by-side(any sig) == parallel(n’ = lam sig/kap), n=n’=d=1</td>
<td>Fig. 1a batch fluid</td>
<td>below 1e-07 (here 2.5e-09)</td>
</tr>
<tr class="odd">
<td>side-by-side(any sig) == parallel(n’ = lam sig/kap), n=n’=d=1</td>
<td>Fig. 1b plug flow, constant rate</td>
<td>below 1e-08 (here 1.9e-11)</td>
</tr>
<tr class="even">
<td>…the same identity in the two WELL-MIXED devices (it fails)</td>
<td>mixed / constC</td>
<td>1.19e-01 / 3.53e-01</td>
</tr>
<tr class="odd">
<td>…and in the bed OFF the n = n’ = d = 1 condition</td>
<td>Fig. 1b plug flow, constant rate</td>
<td>1.12e-01</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Controls. Degeneracy 4 holds to below 1e-12 on its condition and off it (d = 2, or n' != n) separates by 1.66e-02, more than 1e10 times that bound. Degeneracy 5 holds in the batch (below 1e-7) and the bed (below 1e-8, the integrator tolerance) over sigma = 0.2-3, and FAILS in the mixed reactor (1.2e-01) and the held-C_A device (3.5e-01), each more than 1e6 times the bed's bound, and in the bed itself off n = n' = d = 1 (1.1e-01). The identities are sharp, not approximate.

Degeneracy 2 is reported at the production integrator tolerance (rtol 1e-9): below 1e-8 (here 1.3e-09). It is a TOLERANCE, not a separation - re-integrating the same nine order combinations at rtol 1e-13 gives below 1e-11 (here 1.1e-13), i.e. the identity is exact and the printed number measures the ODE solver.</code></pre>
</div>
</div>
</section>
<section id="separability-measured" class="level3">
<h3 class="anchored" data-anchor-id="separability-measured">5. Separability, measured</h3>
<p>The only honest test of a discriminability claim is to <strong>inject the wrong class and see whether anything moves</strong>. For every device and every pair <img src="https://latex.codecogs.com/png.latex?(T,%20C)"> of classes, the response generated by <img src="https://latex.codecogs.com/png.latex?T"> is handed to a fitter that is free to choose <img src="https://latex.codecogs.com/png.latex?C">’s parameters (<img src="https://latex.codecogs.com/png.latex?%5Ckappa">, <img src="https://latex.codecogs.com/png.latex?%5Clambda">, <img src="https://latex.codecogs.com/png.latex?d">, <img src="https://latex.codecogs.com/png.latex?n'"> and, for side-by-side, <img src="https://latex.codecogs.com/png.latex?%5Csigma">), and the residual it cannot remove is reported.</p>
<p><img src="https://latex.codecogs.com/png.latex?D(T%5C!%5Cto%5C!C)"> is therefore <strong>the RMS conversion resolution an experiment needs before it can refute <img src="https://latex.codecogs.com/png.latex?C"></strong>. Read it against your own instrument: 2e-3 is a good laboratory chromatograph, 1e-4 is not achievable.</p>
<p><strong>An optimiser bound is not a measurement, and where §4 supplies an exact twin the twin is used instead.</strong> Each of the five degeneracies names a <em>specific</em> parameter vector at which some candidate reproduces some truth exactly: <img src="https://latex.codecogs.com/png.latex?n'=0"> for degeneracy 1, <img src="https://latex.codecogs.com/png.latex?(nn',%20d+n')"> with <img src="https://latex.codecogs.com/png.latex?%5Clambda%5Ckappa%5E%7Bn'%7D"> for degeneracy 2, and so on. Those points are inside the fitter’s own bounds and next to its own seed grid, and yet the optimiser does not always find them: with the fit alone, an entry whose exact minimum is <strong>zero</strong> can come out well above it. The count and the size are printed below, not typed here. So every entry is evaluated <strong>both</strong> ways (the multistart fit, and the identity twin where §4 predicts one), and the matrix reports the smaller, flagged as an identity. An entry with no predicted twin is the fit alone and is an upper bound; the table below says which is which.</p>
<p><strong>The diagonal’s exact minimum is zero by construction</strong>, since it is a class fitted to its own response with every parameter free. Any non-zero diagonal is therefore an <strong>optimiser stall</strong>, not a null and not a result, and the twin (the truth itself) sets those entries to zero exactly. The fit alone is still reported, with one caveat stated up front: for parallel, series and independent the seed grid contains the truth (to the last bit of its log transform), so those twelve diagonal fits only evaluate the truth and test nothing about recovery. The side-by-side column is the real test, because <img src="https://latex.codecogs.com/png.latex?%5Csigma"> is seeded at 1 and the truth is 0.8: from that off-truth start the fit gets below <img src="https://latex.codecogs.com/png.latex?10%5E%7B-9%7D">, the integrator’s own tolerance, on all four devices, so the fitter’s floor sits six orders below the instrument resolution and no threshold on this page needs anything beyond the instrument.</p>
<p><strong>That the five constants of eq. (6) trade against each other is measured with a profile, not read off where an optimiser stopped.</strong> One constant is held away from the truth, the other four are refitted, and the smallest residual left is reported; it is compared with what a +1 % move of a single constant costs when the other four are held at the truth. Both tables are printed below.</p>
<div id="c462e4ea" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:41:08.933720Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:41:08.933587Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:14.666775Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:14.665998Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The separability matrices.  Two-stage multistart: screen every seed cheaply,</span></span>
<span id="cb17-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">then polish the best two.  Deterministic - a fixed seed list, no randomness."""</span></span>
<span id="cb17-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _unpack(cls, x):</span>
<span id="cb17-4">    kappa, lam, d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb17-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:</span>
<span id="cb17-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kappa, lam, d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb17-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>:</span>
<span id="cb17-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kappa, lam, d, x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>])</span>
<span id="cb17-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> kappa, lam, d, x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb17-10"></span>
<span id="cb17-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _bounds(cls):</span>
<span id="cb17-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># deliberately physical: d and n' are ORDERS in eqs. (4)-(7), kappa and lam</span></span>
<span id="cb17-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are a Damkoehler number and a decay-per-window.  Wider boxes only add</span></span>
<span id="cb17-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pathological corners where the ODE is expensive and no fit ever lands.</span></span>
<span id="cb17-15">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>), np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], [np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e1</span>), np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6e1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>]</span>
<span id="cb17-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:</span>
<span id="cb17-17">        lo.append(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> hi.append(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb17-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>:</span>
<span id="cb17-19">        lo.append(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> hi.append(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e1</span>))</span>
<span id="cb17-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array(lo), np.array(hi)</span>
<span id="cb17-21"></span>
<span id="cb17-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _seeds(cls, kappa0, lam0):</span>
<span id="cb17-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A fixed, class-independent seed grid over the two ORDERS - the parameters</span></span>
<span id="cb17-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the landscape is nonconvex in.  It contains the base point (d, n') = (1, 1)</span></span>
<span id="cb17-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    for every candidate alike, which is what makes the diagonal (the fitter</span></span>
<span id="cb17-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    recovering the truth) a meaningful null rather than a lucky start."""</span></span>
<span id="cb17-27">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb17-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>):</span>
<span id="cb17-29">        base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.log(kappa0), np.log(lam0), dv]</span>
<span id="cb17-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:</span>
<span id="cb17-31">            out.append(base)</span>
<span id="cb17-32">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>:</span>
<span id="cb17-33">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sigma is a smooth scale, not an order: one seed, found by descent</span></span>
<span id="cb17-34">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [npv, np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> npv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)]</span>
<span id="cb17-35">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb17-36">            out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [npv] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> npv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)]</span>
<span id="cb17-37">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb17-38"></span>
<span id="cb17-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">class</span> _Budget(<span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>):</span>
<span id="cb17-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Raised inside the residual to cap the cost of one fit."""</span></span>
<span id="cb17-41"></span>
<span id="cb17-42">CAPPED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># entries whose evaluation budget bound</span></span>
<span id="cb17-43">EVALS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tag -&gt; share of the budget that fit used</span></span>
<span id="cb17-44"></span>
<span id="cb17-45"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_class(config, target, cls, kappa0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, lam0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb17-46">              theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TH, nfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>, keep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, rounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, seeds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, budget<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>,</span>
<span id="cb17-47">              tag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb17-48">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Best fit of one class to one response.  Deterministic: a fixed seed grid</span></span>
<span id="cb17-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    over the two ORDERS (the parameters the landscape is nonconvex in), ranked</span></span>
<span id="cb17-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    by a direct residual evaluation, then the best `keep` polished with</span></span>
<span id="cb17-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    x_scale='jac'.</span></span>
<span id="cb17-52"></span>
<span id="cb17-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The Jacobian is a CENTRAL difference with a relative step of 1e-4. The</span></span>
<span id="cb17-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    residual is an ODE solution, accurate to rtol 1e-9 and not smooth below</span></span>
<span id="cb17-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    that, so scipy's default (a one-sided step of about 1.5e-8) differentiates</span></span>
<span id="cb17-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the integrator's error rather than the model, and on an ill-conditioned</span></span>
<span id="cb17-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    valley the trust region then stops at a point set by round-off. With the</span></span>
<span id="cb17-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    step well above the integrator noise the side-by-side diagonal (the fitter</span></span>
<span id="cb17-59"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    recovering the truth from off-truth seeds) is measured below.</span></span>
<span id="cb17-60"></span>
<span id="cb17-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    `budget` caps the residual evaluations of ONE fit, Jacobian evaluations</span></span>
<span id="cb17-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    included.  The best value seen is kept, so a capped fit can only report a</span></span>
<span id="cb17-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    residual that is too LARGE.  Capped entries are listed, and the summary</span></span>
<span id="cb17-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    below refuses to call anything separable on one; the largest share of the</span></span>
<span id="cb17-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    budget any fit used is a claim of its own."""</span></span>
<span id="cb17-66">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _bounds(cls)</span>
<span id="cb17-67">    state <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>: np.inf, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"capped"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bx"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>}</span>
<span id="cb17-68">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(x):</span>
<span id="cb17-69">        state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb17-70">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> budget:</span>
<span id="cb17-71">            state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"capped"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb17-72">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> _Budget</span>
<span id="cb17-73">        kk, ll, dv, npv, sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _unpack(cls, x)</span>
<span id="cb17-74">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb17-75">            y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(config, cls, kk, ll, dv, npv, sg, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c_set,</span>
<span id="cb17-76">                        theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>theta)</span>
<span id="cb17-77">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>:</span>
<span id="cb17-78">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.full(target.size, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e2</span>)</span>
<span id="cb17-79">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> target) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.isfinite(y)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.full(target.size, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e2</span>)</span>
<span id="cb17-80">        v_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb17-81">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>]:          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># keep the ARGMIN, not just the minimum:</span></span>
<span id="cb17-82">            state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v_          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the recovered parameters are a result</span></span>
<span id="cb17-83">            state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bx"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array(x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb17-84">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> r</span>
<span id="cb17-85">    grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.clip(np.asarray(x0, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb17-86">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (seeds <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> _seeds(cls, kappa0, lam0))]</span>
<span id="cb17-87">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb17-88">        ranked <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(grid, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x0: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(res(x0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))))</span>
<span id="cb17-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> _Budget:</span>
<span id="cb17-90">        ranked <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> grid</span>
<span id="cb17-91">    bx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ranked[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb17-92">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ranked[:keep]:</span>
<span id="cb17-93">        x, prev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> x0, np.inf</span>
<span id="cb17-94">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(rounds):</span>
<span id="cb17-95">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a trust-region solve can stall well short of the minimum; restart</span></span>
<span id="cb17-96">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># it from its own answer while it keeps gaining.  This is what takes</span></span>
<span id="cb17-97">            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the exact degeneracies from ~1e-6 to machine zero.</span></span>
<span id="cb17-98">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb17-99">                r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(res, x, bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo, hi), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>,</span>
<span id="cb17-100">                                  gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, max_nfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nfev, x_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"jac"</span>,</span>
<span id="cb17-101">                                  jac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3-point"</span>, diff_step<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-102">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> _Budget:</span>
<span id="cb17-103">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb17-104">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span>:</span>
<span id="cb17-105">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb17-106">            v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(r.fun <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb17-107">            x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.x</span>
<span id="cb17-108">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>:</span>
<span id="cb17-109">                bx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.x</span>
<span id="cb17-110">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> prev:</span>
<span id="cb17-111">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb17-112">            prev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb17-113">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"capped"</span>]:</span>
<span id="cb17-114">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb17-115">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tag <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb17-116">        EVALS[tag] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], budget <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> budget</span>
<span id="cb17-117">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"capped"</span>] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> tag <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb17-118">        CAPPED.append(tag)</span>
<span id="cb17-119">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best"</span>], (bx <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bx"</span>] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> state[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bx"</span>])</span>
<span id="cb17-120"></span>
<span id="cb17-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------- the identity twins, sec. 4</span></span>
<span id="cb17-122"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _in_bounds(cls, p):</span>
<span id="cb17-123">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Is this parameter vector inside the box the fitter is allowed to search?</span></span>
<span id="cb17-124"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    A twin the optimiser could not legally reach is NOT a fair replacement."""</span></span>
<span id="cb17-125">    kk, ll, dv, npv, sg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p</span>
<span id="cb17-126">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.log(kk), np.log(ll), dv]</span>
<span id="cb17-127">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:</span>
<span id="cb17-128">        x.append(npv)</span>
<span id="cb17-129">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>:</span>
<span id="cb17-130">        x.append(np.log(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sg, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)))</span>
<span id="cb17-131">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _bounds(cls)</span>
<span id="cb17-132">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.asarray(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb17-133">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.asarray(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb17-134"></span>
<span id="cb17-135"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> twin_params(config, truth, cand, kap, lam, d, npv, sig, n, c_set):</span>
<span id="cb17-136">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The parameter vector at which `cand` reproduces `truth` EXACTLY, from the</span></span>
<span id="cb17-137"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    identities of section 4 - or None where no identity predicts one.  This is</span></span>
<span id="cb17-138"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    an algebraic prediction; the residual it produces is measured, not asserted."""</span></span>
<span id="cb17-139">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> truth:                                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># its own truth: exact</span></span>
<span id="cb17-140">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam, d, npv, sig)</span>
<span id="cb17-141">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 1: n' = 0</span></span>
<span id="cb17-142">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam, d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-143">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> config <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb17-144">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 3: every driver is a CONSTANT, so only lam' = lam f^n' shows</span></span>
<span id="cb17-145">        f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>: c_set, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_set,</span>
<span id="cb17-146">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>}.get(truth)</span>
<span id="cb17-147">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># side-by-side at d = 1: C_P settles at a fixed value</span></span>
<span id="cb17-148">            f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _mixed_p(sig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_set) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _pow(c_set, n)), npv)</span>
<span id="cb17-149">        lam_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _pow(f, npv)</span>
<span id="cb17-150">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>:</span>
<span id="cb17-151">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c_set, d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-152">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>:</span>
<span id="cb17-153">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_set), d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-154">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:</span>
<span id="cb17-155">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam_eff, d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-156">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam_eff, d, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># s-b-s with n' = 0</span></span>
<span id="cb17-157">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> config <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>:</span>
<span id="cb17-158">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _pow(kap, npv), d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> npv, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> npv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 2</span></span>
<span id="cb17-159">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> config <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>:</span>
<span id="cb17-160">        ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n                                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the twin needs d_s &gt;= 0</span></span>
<span id="cb17-161">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (kap, lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _pow(kap, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n), ds,</span>
<span id="cb17-162">                                      npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-163">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>:</span>
<span id="cb17-164">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n:                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 4: p == c</span></span>
<span id="cb17-165">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam, d, npv, kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam)</span>
<span id="cb17-166">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> config <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>:</span>
<span id="cb17-167">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 5</span></span>
<span id="cb17-168">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb17-169">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> cand <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>:</span>
<span id="cb17-170">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> sig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam:  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 4</span></span>
<span id="cb17-171">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam, d, npv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-172">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> config <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>:</span>
<span id="cb17-173">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (kap, lam, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> kap, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># degeneracy 5</span></span>
<span id="cb17-174">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb17-175">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb17-176"></span>
<span id="cb17-177"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> twin_residual(config, truth, cand, base, n, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TH):</span>
<span id="cb17-178">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""RMS residual of the identity twin, or (None, None) if none is predicted."""</span></span>
<span id="cb17-179">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> twin_params(config, truth, cand, base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb17-180">                    base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n, base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-181">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> _in_bounds(cand, p):</span>
<span id="cb17-182">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, p</span>
<span id="cb17-183">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(config, truth, base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb17-184">                base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>],</span>
<span id="cb17-185">                theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>theta)</span>
<span id="cb17-186">    yt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(config, cand, p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n,</span>
<span id="cb17-187">                 c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>], theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>theta)</span>
<span id="cb17-188">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((yt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))), p</span>
<span id="cb17-189"></span>
<span id="cb17-190"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sep_matrix(config, base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb17-191">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""D[i, j] = min(multistart fit, identity twin).  FIT records what the</span></span>
<span id="cb17-192"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    optimiser alone found; TWIN records the identity, where section 4 predicts</span></span>
<span id="cb17-193"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    one; BX records the parameters the optimiser recovered."""</span></span>
<span id="cb17-194">    n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> n</span>
<span id="cb17-195">    D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.zeros((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> TWIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.full((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), np.nan)</span>
<span id="cb17-196">    BX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb17-197">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, truth <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb17-198">        y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(config, truth, base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb17-199">                    base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-200">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, cand <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb17-201">            v, bx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_class(config, y, cand, base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n,</span>
<span id="cb17-202">                              c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>base[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>], tag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(config, truth, cand),</span>
<span id="cb17-203">                              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb17-204">            FIT[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> BX[(truth, cand)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _unpack(cand, bx)</span>
<span id="cb17-205">            tw, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> twin_residual(config, truth, cand, base, n)</span>
<span id="cb17-206">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb17-207">                TWIN[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tw</span>
<span id="cb17-208">            D[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v, tw)</span>
<span id="cb17-209">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> D, FIT, TWIN, BX</span>
<span id="cb17-210"></span>
<span id="cb17-211"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 64 fits: 4 devices x 4 truths x 4 candidates.  No timing is printed - two</span></span>
<span id="cb17-212"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># executions of this notebook must produce byte-identical content.</span></span>
<span id="cb17-213">SEP, SEP_FIT, SEP_TWIN, SEP_BX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}, {}, {}</span>
<span id="cb17-214"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb17-215">    SEP[cfg], SEP_FIT[cfg], SEP_TWIN[cfg], SEP_BX[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sep_matrix(cfg)</span>
<span id="cb17-216"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLASSES) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> fits done "</span></span>
<span id="cb17-217">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_seeds(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'side-by-side'</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> seeds for the 5-parameter "</span></span>
<span id="cb17-218">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"side-by-side candidate, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_seeds(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'parallel'</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the "</span></span>
<span id="cb17-219">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"others, no randomness anywhere)"</span>)</span>
<span id="cb17-220"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg, D <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP.items():</span>
<span id="cb17-221">    lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(np.isfinite(SEP_TWIN[cfg]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>)</span>
<span id="cb17-222">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># identity-backed entries are at the integrator's round-off, whose digits</span></span>
<span id="cb17-223">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># differ between machines: they are printed as the bound they are checked at</span></span>
<span id="cb17-224">    df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0*"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> D[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;1e-8*"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lab[i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span></span>
<span id="cb17-225">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D[i, j]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)]</span>
<span id="cb17-226">                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)],</span>
<span id="cb17-227">                      index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"truth: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES],</span>
<span id="cb17-228">                      columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[c]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES])</span>
<span id="cb17-229">    display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV[cfg]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** - min(multistart fit, identity twin); "</span></span>
<span id="cb17-230">                     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"`*` marks an entry whose minimum is an EXACT identity of "</span></span>
<span id="cb17-231">                     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"section 4, not a measured separation (units: "</span></span>
<span id="cb17-232">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ln tau'"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fractional conversion"</span>)</span>
<span id="cb17-233">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(df, index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)))</span>
<span id="cb17-234">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, tr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb17-235">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, cd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb17-236">            M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[tr]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_vs_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cd]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(D[i, j])</span>
<span id="cb17-237"></span>
<span id="cb17-238"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- how much of the matrix is identity, and how far the optimiser alone was --</span></span>
<span id="cb17-239">tw_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([SEP_TWIN[c].ravel() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP])</span>
<span id="cb17-240">ft_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([SEP_FIT[c].ravel() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP])</span>
<span id="cb17-241">has <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.isfinite(tw_all)</span>
<span id="cb17-242">over <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ft_all[has] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tw_all[has]</span>
<span id="cb17-243">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_identity_backed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(has.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb17-244">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_identity_twin_worst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(tw_all[has]))</span>
<span id="cb17-245"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># registered as a thresholded count with its margin; differences below 1e-8 are</span></span>
<span id="cb17-246"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the integrator's round-off and are recorded as 0, so the margin is not noise</span></span>
<span id="cb17-247">SEP_OVER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.where(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(over) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, over)</span>
<span id="cb17-248">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_optimiser_worst_overstatement"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(over))</span>
<span id="cb17-249">ov_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [[DEV[cfg], <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"truth </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cd]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb17-250">            <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP_FIT[cfg][i, j]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;1e-8"</span>]</span>
<span id="cb17-251">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, tr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES)</span>
<span id="cb17-252">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, cd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES)</span>
<span id="cb17-253">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(SEP_TWIN[cfg][i, j])</span>
<span id="cb17-254">           <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> SEP_FIT[cfg][i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SEP_TWIN[cfg][i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>]</span>
<span id="cb17-255">display(Markdown(</span>
<span id="cb17-256">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_identity_backed'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 64 entries have an exact identity "</span></span>
<span id="cb17-257">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"behind them** (every twin residual below 1e-8, the ODE tolerance, not a "</span></span>
<span id="cb17-258">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"separation; here at worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_identity_twin_worst'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). For "</span></span>
<span id="cb17-259">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((over <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them the multistart alone stopped "</span></span>
<span id="cb17-260">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"more than 1e-6 short - the entries a fit-only matrix would have "</span></span>
<span id="cb17-261">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed as measured separations:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-262">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(ov_rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"truth"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"candidate"</span>,</span>
<span id="cb17-263">                                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"multistart fit alone"</span>,</span>
<span id="cb17-264">                                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity twin"</span>]))))</span>
<span id="cb17-265"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Every such error is in the SAFE direction (an optimiser bound is an "</span></span>
<span id="cb17-266">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"upper bound on a minimum), and none crosses a threshold below: the "</span></span>
<span id="cb17-267">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"largest, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_optimiser_worst_overstatement'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, is under the "</span></span>
<span id="cb17-268">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> conversion resolution. But printed as a fit it would have read "</span></span>
<span id="cb17-269">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"as the measurement of a separation that is exactly zero."</span>)</span>
<span id="cb17-270"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_optimiser_worst_overstatement"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> RES_X, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-271">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an optimiser shortfall now crosses the instrument resolution - a verdict "</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb17-272">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"would change, and the sentence above would be false"</span></span>
<span id="cb17-273"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break row: the worst entry refitted with the twin's own parameters added</span></span>
<span id="cb17-274"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># as a seed</span></span>
<span id="cb17-275">_worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(((cfg, i, j) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb17-276">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(SEP_TWIN[cfg][i, j])),</span>
<span id="cb17-277">             key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> e: SEP_FIT[e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]][e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SEP_TWIN[e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]][e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]])</span>
<span id="cb17-278">_cfg, _i, _j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _worst</span>
<span id="cb17-279">_tw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> twin_params(_cfg, CLASSES[_i], CLASSES[_j], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>],</span>
<span id="cb17-280">                  BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-281">_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.log(_tw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), np.log(_tw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), _tw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]]</span>
<span id="cb17-282"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> CLASSES[_j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>:</span>
<span id="cb17-283">    _x.append(_tw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb17-284"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> CLASSES[_j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>:</span>
<span id="cb17-285">    _x.append(np.log(_tw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]))</span>
<span id="cb17-286">_y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(_cfg, CLASSES[_i], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>],</span>
<span id="cb17-287">             BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-288">OVER_TWIN_SEEDED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fit_class(_cfg, _y, CLASSES[_j], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>],</span>
<span id="cb17-289">                                   n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>],</span>
<span id="cb17-290">                                   seeds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_seeds(CLASSES[_j], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>])</span>
<span id="cb17-291">                                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [_x])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SEP_TWIN[_cfg][_i, _j])</span>
<span id="cb17-292"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The largest shortfall (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV[_cfg]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, truth </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLASSES[_i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, candidate "</span></span>
<span id="cb17-293">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLASSES[_j]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) is a wrong basin, not noise: with the twin's parameters "</span></span>
<span id="cb17-294">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"added to the seed list the same fit closes it to below 1e-8 (here "</span></span>
<span id="cb17-295">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(OVER_TWIN_SEEDED)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb17-296"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the twin bound's break row: degeneracy 2's twin WITHOUT the lam mapping</span></span>
<span id="cb17-297">_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE</span>
<span id="cb17-298">_ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-299">_yp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>],</span>
<span id="cb17-300">              _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb17-301">TWIN_UNMAPPED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((_ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _yp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb17-302"></span>
<span id="cb17-303"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------------------------- the optimiser's stall</span></span>
<span id="cb17-304"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The diagonal is a class fitted to its OWN response with every parameter free,</span></span>
<span id="cb17-305"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so its exact minimum is identically zero: any non-zero diagonal is an</span></span>
<span id="cb17-306"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># optimiser stall, not a null and not a result.  The twin (the truth itself)</span></span>
<span id="cb17-307"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sets the diagonal of the matrix above to zero; what is reported here is how</span></span>
<span id="cb17-308"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># far the multistart ALONE got.  It is a BOUND, below 1e-9, the ODE tolerance.</span></span>
<span id="cb17-309"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb17-310">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_stall_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.diag(SEP_FIT[cfg])))</span>
<span id="cb17-311">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_stall_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP))</span>
<span id="cb17-312">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst_not_sbs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb17-313">    SEP_FIT[cfg][i, i] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES)</span>
<span id="cb17-314">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>))</span>
<span id="cb17-315"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed as the bound each entry is checked at: the digits are round-off</span></span>
<span id="cb17-316">stall_df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({DEV[cfg]: {c: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;1e-9"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> SEP_FIT[cfg][i, i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span></span>
<span id="cb17-317">                                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEP_FIT[cfg][i, i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-318">                                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (seed = truth)"</span>)</span>
<span id="cb17-319">                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES)} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP})</span>
<span id="cb17-320">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**The multistart on the diagonal** - the same machinery asked "</span></span>
<span id="cb17-321">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"to recover the truth, whose exact minimum is 0 by "</span></span>
<span id="cb17-322">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"construction. Only the side-by-side row starts off the truth "</span></span>
<span id="cb17-323">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(sigma seeded at 1, truth 0.8); the other three rows only "</span></span>
<span id="cb17-324">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evaluate it:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(stall_df, index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)))</span>
<span id="cb17-325"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"every side-by-side diagonal fit, started off the truth, reaches below "</span></span>
<span id="cb17-326">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1e-9 (here at worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(SEP_FIT[c][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), so the "</span></span>
<span id="cb17-327">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fitter's own floor is six orders below the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> conversion "</span></span>
<span id="cb17-328">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"resolution and binds nowhere."</span>)</span>
<span id="cb17-329"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the fitter no longer recovers the truth"</span></span>
<span id="cb17-330"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break row for the stall bounds: the same diagonal fits stopped after</span></span>
<span id="cb17-331"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># three evaluations of the polish, i.e. an optimiser that quits early.  The</span></span>
<span id="cb17-332"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># parallel seed grid contains the truth itself, so that fit starts from one</span></span>
<span id="cb17-333"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># seed off it, (kappa, lam) x (1.2, 0.8) and (d, n') = (1.5, 1.5)</span></span>
<span id="cb17-334">STALL_EARLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb17-335"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb17-336">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>):</span>
<span id="cb17-337">        y_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb17-338">                     BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-339">        sd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ([[np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>]), np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>]]</span>
<span id="cb17-340">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb17-341">        STALL_EARLY[(cfg, cls)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_class(cfg, y_, cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>],</span>
<span id="cb17-342">                                            n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>],</span>
<span id="cb17-343">                                            nfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, keep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, rounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, seeds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sd)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb17-344"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break row for the shortfall count: the same count recomputed with the</span></span>
<span id="cb17-345"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># early-stopped diagonal fits in place of the converged ones</span></span>
<span id="cb17-346">_fit_e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {c: SEP_FIT[c].copy() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP}</span>
<span id="cb17-347"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (c, cl), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STALL_EARLY.items():</span>
<span id="cb17-348">    _fit_e[c][CLASSES.index(cl), CLASSES.index(cl)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v</span>
<span id="cb17-349">_over_e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.concatenate([_fit_e[c].ravel() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP])[has] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tw_all[has])</span>
<span id="cb17-350">OVER_COUNT_EARLY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_over_e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()))</span>
<span id="cb17-351"></span>
<span id="cb17-352"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ------------------------------------- identifiability: a profile, not a stall</span></span>
<span id="cb17-353"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Whether eq. (6)'s five constants trade against each other is a property of</span></span>
<span id="cb17-354"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the model, so it is measured as one: hold ONE constant away from the truth,</span></span>
<span id="cb17-355"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># refit the other four (central-difference Jacobian, the response integrated at</span></span>
<span id="cb17-356"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rtol 1e-12), and report the smallest residual that is left.  Each profile is</span></span>
<span id="cb17-357"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># walked outward from the truth on either side, every point started from the</span></span>
<span id="cb17-358"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># previous one and from the truth.  A profile value is an optimiser UPPER bound</span></span>
<span id="cb17-359"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># on that minimum, which is the safe direction for a non-identifiability claim.</span></span>
<span id="cb17-360">PROF_RTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span></span>
<span id="cb17-361">X_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([np.log(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>]), np.log(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>]), BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb17-362">                   BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], np.log(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>])])</span>
<span id="cb17-363">TRU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>]])</span>
<span id="cb17-364">PNAMES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lambda"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n'"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma"</span>)</span>
<span id="cb17-365"></span>
<span id="cb17-366"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _sbs_resp(cfg, x, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PROF_RTOL):</span>
<span id="cb17-367">    runner <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_batch <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cfg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> run_mixed</span>
<span id="cb17-368">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> runner(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>],</span>
<span id="cb17-369">                  n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb17-370"></span>
<span id="cb17-371"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> profile(cfg, q, values):</span>
<span id="cb17-372">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Min RMS residual over the four other constants, constant q held fixed."""</span></span>
<span id="cb17-373">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _bounds(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>)</span>
<span id="cb17-374">    y0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _sbs_resp(cfg, X_TRUE)</span>
<span id="cb17-375">    free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> q]</span>
<span id="cb17-376">    out, xprev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, X_TRUE.copy()</span>
<span id="cb17-377">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> values:</span>
<span id="cb17-378">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_TRUE[q]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (xprev[q] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_TRUE[q]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb17-379">            xprev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X_TRUE.copy()                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the other side: restart</span></span>
<span id="cb17-380">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r(z, val<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>val):</span>
<span id="cb17-381">            x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X_TRUE.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> x[free] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> x[q] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val</span>
<span id="cb17-382">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (_sbs_resp(cfg, x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(y0.size)</span>
<span id="cb17-383">        best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb17-384">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (xprev[free], X_TRUE[free]):</span>
<span id="cb17-385">            s_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(r, z0, bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo[free], hi[free]), jac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3-point"</span>,</span>
<span id="cb17-386">                               diff_step<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, x_scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"jac"</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>,</span>
<span id="cb17-387">                               ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, max_nfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb17-388">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> s_.cost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> best.cost:</span>
<span id="cb17-389">                best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s_</span>
<span id="cb17-390">        xprev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X_TRUE.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> xprev[free] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> best.x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> xprev[q] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val</span>
<span id="cb17-391">        out[val] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> best.cost)), xprev.copy())</span>
<span id="cb17-392">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the break row: the end of the range with the other four NOT refitted</span></span>
<span id="cb17-393">    far <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(values, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X_TRUE[q]))</span>
<span id="cb17-394">    x_far <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X_TRUE.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> x_far[q] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> far</span>
<span id="cb17-395">    unfit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((_sbs_resp(cfg, x_far) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb17-396">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out, unfit</span>
<span id="cb17-397"></span>
<span id="cb17-398">PROFILES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claim name -&gt; (device, constant held, values, bound)</span></span>
<span id="cb17-399">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_profile_d_batch"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.35</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb17-400">                                          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-4</span>),</span>
<span id="cb17-401">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_profile_d_mixed"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.35</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb17-402">                                          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-4</span>),</span>
<span id="cb17-403">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_profile_nprime_mixed"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.35</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>,</span>
<span id="cb17-404">                                               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-4</span>),</span>
<span id="cb17-405">}</span>
<span id="cb17-406">_plo, _phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _bounds(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>)</span>
<span id="cb17-407">PROF, PROF_UNFIT, prof_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}, []</span>
<span id="cb17-408"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, (cfg, q, vals, bnd) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROFILES.items():</span>
<span id="cb17-409">    PROF[name], PROF_UNFIT[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> profile(cfg, q, vals)</span>
<span id="cb17-410">    M[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROF[name].values()))</span>
<span id="cb17-411">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> val <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(PROF[name]):</span>
<span id="cb17-412">        v, x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PROF[name][val]</span>
<span id="cb17-413">        p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>], np.exp(x[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>])]</span>
<span id="cb17-414">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a free constant pinned at the edge of the fitter's box: that point is</span></span>
<span id="cb17-415">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># an upper bound limited by the box, not by the model</span></span>
<span id="cb17-416">        edge <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [PNAMES[i] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> q</span>
<span id="cb17-417">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(x[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _plo[i], _phi[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x[i]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>]</span>
<span id="cb17-418">        prof_rows.append([DEV[cfg], <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PNAMES[q]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>val<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb17-419">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> p_]</span>
<span id="cb17-420">                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(edge) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> edge <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>])</span>
<span id="cb17-421">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Profiles of the side-by-side self-fit** (one constant held, "</span></span>
<span id="cb17-422">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the other four refitted; truth "</span></span>
<span id="cb17-423">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(PNAMES, TRU))</span>
<span id="cb17-424">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-425">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(prof_rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"held"</span>,</span>
<span id="cb17-426">                                                             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min RMS residual"</span>]</span>
<span id="cb17-427">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(PNAMES)</span>
<span id="cb17-428">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free constant at the box edge"</span>]))))</span>
<span id="cb17-429"></span>
<span id="cb17-430"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... against what a move along a single coordinate costs when nothing refits</span></span>
<span id="cb17-431">cost_rows, COST_2PCT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}</span>
<span id="cb17-432"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>):</span>
<span id="cb17-433">    y0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>TRU, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-434">    costs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb17-435">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>):</span>
<span id="cb17-436">        p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRU.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> p[q] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span></span>
<span id="cb17-437">        y1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>p, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-438">        costs.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((y1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))))</span>
<span id="cb17-439">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_stall_1pct_cheapest_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(costs))</span>
<span id="cb17-440">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break row: the cheapest constant moved by 2 % instead of 1 %</span></span>
<span id="cb17-441">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TRU.copy()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> p[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(costs))] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span></span>
<span id="cb17-442">    y2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>p, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb17-443">    COST_2PCT[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((y2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb17-444">    cost_rows.append([DEV[cfg]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> costs])</span>
<span id="cb17-445">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**What a move along a single coordinate costs** (+1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% i</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">n one "</span></span>
<span id="cb17-446">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constant, the others held at the truth, RMS change in the "</span></span>
<span id="cb17-447">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"response):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-448">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(cost_rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device"</span>]</span>
<span id="cb17-449">                                         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"+1 % </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PNAMES]))))</span>
<span id="cb17-450">_edge <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> prof_rows <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>]</span>
<span id="cb17-451"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Read the two tables together. Holding d anywhere in [0.5, 1.5], in "</span></span>
<span id="cb17-452">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"either device, or n' anywhere in [0.5, 1.5] (mixed flow), the other four "</span></span>
<span id="cb17-453">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"constants refit to an RMS residual below 2e-4, a tenth of the "</span></span>
<span id="cb17-454">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"conversion resolution (here at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_profile_d_batch'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb17-455">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"batch d, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_profile_d_mixed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mixed d, "</span></span>
<span id="cb17-456">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_profile_nprime_mixed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mixed n'), while +1 % on any single "</span></span>
<span id="cb17-457">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"constant with the other four held at the truth costs at least "</span></span>
<span id="cb17-458">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_stall_1pct_cheapest_batch'</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_stall_1pct_cheapest_mixed'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. "</span></span>
<span id="cb17-459">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"That is what 'the five constants of eq. (6) trade against each other' "</span></span>
<span id="cb17-460">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"means quantitatively: an ORDER held up to 50 % away from the truth is "</span></span>
<span id="cb17-461">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"absorbed by the other constants to below what a 1 % move of one "</span></span>
<span id="cb17-462">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"constant costs, so the constants of eq. (6) are not separately "</span></span>
<span id="cb17-463">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"identifiable from one run in either device. The profile values are "</span></span>
<span id="cb17-464">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"optimiser upper bounds on a minimum, the safe direction for that "</span></span>
<span id="cb17-465">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"claim; where a free constant ends on the edge of the fitter's box "</span></span>
<span id="cb17-466">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'; '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _edge) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _edge <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nowhere'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) the "</span></span>
<span id="cb17-467">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bound is set by the box, which can only make it larger."</span>)</span>
<span id="cb17-468"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[n] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROFILES) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_stall_1pct_cheapest_batch'</span>],</span>
<span id="cb17-469">                                         M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_stall_1pct_cheapest_mixed'</span>])</span>
<span id="cb17-470">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fits_capped"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CAPPED))</span>
<span id="cb17-471"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break row: the same machinery with a budget of 50 evaluations is recorded</span></span>
<span id="cb17-472">_n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CAPPED)</span>
<span id="cb17-473">fit_class(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>TRU, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>,</span>
<span id="cb17-474">          BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], budget<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, tag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"budget-break"</span>,))</span>
<span id="cb17-475">FITS_CAPPED_BROKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CAPPED))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">del</span> CAPPED[_n0:]</span>
<span id="cb17-476"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">fits whose evaluation budget bound: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CAPPED)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 64"</span></span>
<span id="cb17-477">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CAPPED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> CAPPED <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>64 fits done (12 seeds for the 5-parameter side-by-side candidate, 12 for the others, no randomness anywhere)</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Fig. 1a batch fluid</strong> - min(multistart fit, identity twin); <code>*</code> marks an entry whose minimum is an EXACT identity of section 4, not a measured separation (units: fractional conversion)</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>index</th>
<th>fit par</th>
<th>fit ser</th>
<th>fit s-b-s</th>
<th>fit ind</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>truth: parallel</td>
<td>0*</td>
<td>1.59e-04</td>
<td>&lt;1e-8*</td>
<td>1.59e-04</td>
</tr>
<tr class="even">
<td>truth: series</td>
<td>1.76e-03</td>
<td>0*</td>
<td>1.76e-03</td>
<td>1.76e-03</td>
</tr>
<tr class="odd">
<td>truth: side-by-side</td>
<td>&lt;1e-8*</td>
<td>1.03e-04</td>
<td>0*</td>
<td>1.03e-04</td>
</tr>
<tr class="even">
<td>truth: independent</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Fig. 1b plug flow, constant rate</strong> - min(multistart fit, identity twin); <code>*</code> marks an entry whose minimum is an EXACT identity of section 4, not a measured separation (units: fractional conversion)</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>index</th>
<th>fit par</th>
<th>fit ser</th>
<th>fit s-b-s</th>
<th>fit ind</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>truth: parallel</td>
<td>0*</td>
<td>8.07e-04</td>
<td>0*</td>
<td>2.20e-03</td>
</tr>
<tr class="even">
<td>truth: series</td>
<td>3.74e-05</td>
<td>0*</td>
<td>1.39e-05</td>
<td>2.55e-04</td>
</tr>
<tr class="odd">
<td>truth: side-by-side</td>
<td>&lt;1e-8*</td>
<td>9.85e-04</td>
<td>0*</td>
<td>1.92e-03</td>
</tr>
<tr class="even">
<td>truth: independent</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Fig. 1c mixed flow, constant rate</strong> - min(multistart fit, identity twin); <code>*</code> marks an entry whose minimum is an EXACT identity of section 4, not a measured separation (units: fractional conversion)</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>index</th>
<th>fit par</th>
<th>fit ser</th>
<th>fit s-b-s</th>
<th>fit ind</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>truth: parallel</td>
<td>0*</td>
<td>&lt;1e-8*</td>
<td>0*</td>
<td>9.35e-04</td>
</tr>
<tr class="even">
<td>truth: series</td>
<td>&lt;1e-8*</td>
<td>0*</td>
<td>3.45e-05</td>
<td>4.02e-04</td>
</tr>
<tr class="odd">
<td>truth: side-by-side</td>
<td>7.36e-06</td>
<td>8.13e-05</td>
<td>0*</td>
<td>3.98e-04</td>
</tr>
<tr class="even">
<td>truth: independent</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Fig. 1c mixed flow, <img src="https://latex.codecogs.com/png.latex?C_A"> held</strong> - min(multistart fit, identity twin); <code>*</code> marks an entry whose minimum is an EXACT identity of section 4, not a measured separation (units: ln tau’)</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>index</th>
<th>fit par</th>
<th>fit ser</th>
<th>fit s-b-s</th>
<th>fit ind</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>truth: parallel</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
</tr>
<tr class="even">
<td>truth: series</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
</tr>
<tr class="odd">
<td>truth: side-by-side</td>
<td>&lt;1e-8*</td>
<td>&lt;1e-8*</td>
<td>0*</td>
<td>&lt;1e-8*</td>
</tr>
<tr class="even">
<td>truth: independent</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
<td>0*</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>44 of 64 entries have an exact identity behind them</strong> (every twin residual below 1e-8, the ODE tolerance, not a separation; here at worst 1.5e-09). For 1 of them the multistart alone stopped more than 1e-6 short - the entries a fit-only matrix would have printed as measured separations:</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>device</th>
<th>truth</th>
<th>candidate</th>
<th>multistart fit alone</th>
<th>identity twin</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fig. 1b plug flow, constant rate</td>
<td>truth independent</td>
<td>fit ser</td>
<td>1.31e-03</td>
<td>&lt;1e-8</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Every such error is in the SAFE direction (an optimiser bound is an upper bound on a minimum), and none crosses a threshold below: the largest, 1.31e-03, is under the 0.002 conversion resolution. But printed as a fit it would have read as the measurement of a separation that is exactly zero.
The largest shortfall (Fig. 1b  plug flow, constant rate, truth independent, candidate series) is a wrong basin, not noise: with the twin's parameters added to the seed list the same fit closes it to below 1e-8 (here 6e-11).</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The multistart on the diagonal</strong> - the same machinery asked to recover the truth, whose exact minimum is 0 by construction. Only the side-by-side row starts off the truth (sigma seeded at 1, truth 0.8); the other three rows only evaluate it:</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>index</th>
<th>Fig. 1a batch fluid</th>
<th>Fig. 1b plug flow, constant rate</th>
<th>Fig. 1c mixed flow, constant rate</th>
<th>Fig. 1c mixed flow, <img src="https://latex.codecogs.com/png.latex?C_A"> held</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>parallel</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
</tr>
<tr class="even">
<td>series</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
</tr>
<tr class="odd">
<td>side-by-side</td>
<td>&lt;1e-9</td>
<td>&lt;1e-9</td>
<td>&lt;1e-9</td>
<td>&lt;1e-9</td>
</tr>
<tr class="even">
<td>independent</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
<td>&lt;1e-9 (seed = truth)</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>every side-by-side diagonal fit, started off the truth, reaches below 1e-9 (here at worst 5.1e-11), so the fitter's own floor is six orders below the 0.002 conversion resolution and binds nowhere.</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Profiles of the side-by-side self-fit</strong> (one constant held, the other four refitted; truth kappa = 1.5, lambda = 3, d = 1, n’ = 1, sigma = 0.8):</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
<col style="width: 11%">
</colgroup>
<thead>
<tr class="header">
<th>device</th>
<th>held</th>
<th>min RMS residual</th>
<th>kappa</th>
<th>lambda</th>
<th>d</th>
<th>n’</th>
<th>sigma</th>
<th>free constant at the box edge</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>d = 0.5</td>
<td>2.6e-06</td>
<td>1.500</td>
<td>2.992</td>
<td>0.500</td>
<td>1.432</td>
<td>0.899</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1a batch fluid</td>
<td>d = 0.65</td>
<td>2.1e-06</td>
<td>1.500</td>
<td>2.994</td>
<td>0.650</td>
<td>1.293</td>
<td>0.881</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>d = 0.8</td>
<td>1.4e-06</td>
<td>1.500</td>
<td>2.996</td>
<td>0.800</td>
<td>1.160</td>
<td>0.856</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1a batch fluid</td>
<td>d = 0.9</td>
<td>7.8e-07</td>
<td>1.500</td>
<td>2.998</td>
<td>0.900</td>
<td>1.076</td>
<td>0.833</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>d = 0.95</td>
<td>4.2e-07</td>
<td>1.500</td>
<td>2.999</td>
<td>0.950</td>
<td>1.037</td>
<td>0.818</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1a batch fluid</td>
<td>d = 1.05</td>
<td>4.9e-07</td>
<td>1.500</td>
<td>3.002</td>
<td>1.050</td>
<td>0.967</td>
<td>0.779</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>d = 1.1</td>
<td>1.1e-06</td>
<td>1.500</td>
<td>3.003</td>
<td>1.100</td>
<td>0.938</td>
<td>0.752</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1a batch fluid</td>
<td>d = 1.2</td>
<td>2.6e-06</td>
<td>1.500</td>
<td>3.009</td>
<td>1.200</td>
<td>0.911</td>
<td>0.675</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>d = 1.35</td>
<td>6.6e-06</td>
<td>1.501</td>
<td>3.024</td>
<td>1.350</td>
<td>1.216</td>
<td>0.406</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1a batch fluid</td>
<td>d = 1.5</td>
<td>3.9e-05</td>
<td>1.498</td>
<td>2.972</td>
<td>1.500</td>
<td>3.000</td>
<td>0.099</td>
<td>n’</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 0.5</td>
<td>1.6e-04</td>
<td>1.499</td>
<td>0.994</td>
<td>0.500</td>
<td>0.023</td>
<td>1.160</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 0.65</td>
<td>4.3e-05</td>
<td>1.500</td>
<td>1.315</td>
<td>0.650</td>
<td>0.169</td>
<td>1.037</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 0.8</td>
<td>1.5e-05</td>
<td>1.500</td>
<td>1.844</td>
<td>0.800</td>
<td>0.450</td>
<td>0.916</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 0.9</td>
<td>6.0e-06</td>
<td>1.500</td>
<td>2.344</td>
<td>0.900</td>
<td>0.702</td>
<td>0.853</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 0.95</td>
<td>2.7e-06</td>
<td>1.500</td>
<td>2.650</td>
<td>0.950</td>
<td>0.845</td>
<td>0.825</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 1.05</td>
<td>2.3e-06</td>
<td>1.500</td>
<td>3.400</td>
<td>1.050</td>
<td>1.165</td>
<td>0.777</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 1.1</td>
<td>4.2e-06</td>
<td>1.500</td>
<td>3.858</td>
<td>1.100</td>
<td>1.339</td>
<td>0.756</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 1.2</td>
<td>7.4e-06</td>
<td>1.500</td>
<td>4.977</td>
<td>1.200</td>
<td>1.716</td>
<td>0.719</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 1.35</td>
<td>1.1e-05</td>
<td>1.500</td>
<td>7.324</td>
<td>1.350</td>
<td>2.343</td>
<td>0.673</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>d = 1.5</td>
<td>1.3e-05</td>
<td>1.500</td>
<td>10.766</td>
<td>1.500</td>
<td>3.000</td>
<td>0.640</td>
<td>n’</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 0.5</td>
<td>1.3e-05</td>
<td>1.500</td>
<td>1.943</td>
<td>0.823</td>
<td>0.500</td>
<td>0.902</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 0.65</td>
<td>7.4e-06</td>
<td>1.500</td>
<td>2.240</td>
<td>0.882</td>
<td>0.650</td>
<td>0.864</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 0.8</td>
<td>3.6e-06</td>
<td>1.500</td>
<td>2.552</td>
<td>0.935</td>
<td>0.800</td>
<td>0.834</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 0.9</td>
<td>1.7e-06</td>
<td>1.500</td>
<td>2.772</td>
<td>0.968</td>
<td>0.900</td>
<td>0.816</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 1.1</td>
<td>1.4e-06</td>
<td>1.500</td>
<td>3.239</td>
<td>1.031</td>
<td>1.100</td>
<td>0.786</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 1.2</td>
<td>2.7e-06</td>
<td>1.500</td>
<td>3.488</td>
<td>1.060</td>
<td>1.200</td>
<td>0.772</td>
<td>-</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 1.35</td>
<td>4.3e-06</td>
<td>1.500</td>
<td>3.883</td>
<td>1.102</td>
<td>1.350</td>
<td>0.755</td>
<td>-</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>n’ = 1.5</td>
<td>5.7e-06</td>
<td>1.500</td>
<td>4.306</td>
<td>1.143</td>
<td>1.500</td>
<td>0.739</td>
<td>-</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>What a move along a single coordinate costs</strong> (+1 % in one constant, the others held at the truth, RMS change in the response):</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th>device</th>
<th>+1 % kappa</th>
<th>+1 % lambda</th>
<th>+1 % d</th>
<th>+1 % n’</th>
<th>+1 % sigma</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>2.66e-03</td>
<td>1.16e-03</td>
<td>5.35e-04</td>
<td>3.93e-04</td>
<td>5.15e-04</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, constant rate</td>
<td>2.39e-03</td>
<td>7.93e-04</td>
<td>3.99e-04</td>
<td>7.30e-04</td>
<td>1.23e-03</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Read the two tables together. Holding d anywhere in [0.5, 1.5], in either device, or n' anywhere in [0.5, 1.5] (mixed flow), the other four constants refit to an RMS residual below 2e-4, a tenth of the conversion resolution (here at most 3.9e-05 batch d, 1.6e-04 mixed d, 1.3e-05 mixed n'), while +1 % on any single constant with the other four held at the truth costs at least 3.9e-04. That is what 'the five constants of eq. (6) trade against each other' means quantitatively: an ORDER held up to 50 % away from the truth is absorbed by the other constants to below what a 1 % move of one constant costs, so the constants of eq. (6) are not separately identifiable from one run in either device. The profile values are optimiser upper bounds on a minimum, the safe direction for that claim; where a free constant ends on the edge of the fitter's box (Fig. 1a  batch fluid, d = 1.5; Fig. 1c  mixed flow, constant rate, d = 1.5) the bound is set by the box, which can only make it larger.

fits whose evaluation budget bound: 0 of 64</code></pre>
</div>
</div>
<div id="e22533b6" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:14.669278Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:14.669135Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:14.676761Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:14.675931Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Read the matrices: which pairs are separable, and at what resolution."""</span></span>
<span id="cb22-2">res_of <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>: RES_TAU}</span>
<span id="cb22-3">rows, SEP_OFF, N_SEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}, {}</span>
<span id="cb22-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg, D <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP.items():</span>
<span id="cb22-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The threshold is the INSTRUMENT RESOLUTION, and nothing else: the</span></span>
<span id="cb22-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fitter's own floor (the diagonal, above) is below 1e-9 on every device.</span></span>
<span id="cb22-7">    thr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> res_of.get(cfg, RES_X)</span>
<span id="cb22-8">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_threshold_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(thr)</span>
<span id="cb22-9">    off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(CLASSES[i], CLASSES[j], D[i, j]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb22-10">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> j]</span>
<span id="cb22-11">    sep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [o <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> off <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> thr]</span>
<span id="cb22-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sep:</span>
<span id="cb22-13">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> (cfg, o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CAPPED, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb22-14">            <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"separability claimed on a capped fit: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(cfg, o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb22-15">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(off, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> o: o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb22-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every pair within 1e-4 relative of the largest is listed: ties (the batch</span></span>
<span id="cb22-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># has three at 1.764e-3) are decided by round-off, so no one of them is</span></span>
<span id="cb22-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "the" pair; and where every entry is at round-off there is no pair at all</span></span>
<span id="cb22-19">    tied <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [o <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> off <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> best[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)]</span>
<span id="cb22-20">    rnd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;1e-8"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb22-21">    rows.append([DEV[cfg], <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>thr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sep)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/12"</span>, rnd(best[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]),</span>
<span id="cb22-22">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none (all at round-off)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb22-23">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> tied),</span>
<span id="cb22-24">                 rnd(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> off))])</span>
<span id="cb22-25">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_best_pair"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(best[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb22-26">    SEP_OFF[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> o[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> off]  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># round-off as 0</span></span>
<span id="cb22-27">    N_SEP[cfg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sep))</span>
<span id="cb22-28">display(Markdown(</span>
<span id="cb22-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Which devices can separate anything at all?**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb22-30">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[</span>
<span id="cb22-31">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"threshold used"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs above it"</span>,</span>
<span id="cb22-32">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hardest-to-confuse pair (RMS)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"which pair"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"easiest confusion"</span>]))))</span>
<span id="cb22-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"threshold = the instrument resolution: conversion </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb22-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ln tau' </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_TAU<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Raw residuals are in the matrices above - rescale "</span></span>
<span id="cb22-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at will."</span>)</span>
<span id="cb22-36"></span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Which devices can separate anything at all?</strong></p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th>device</th>
<th>threshold used</th>
<th>pairs above it</th>
<th>hardest-to-confuse pair (RMS)</th>
<th>which pair</th>
<th>easiest confusion</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Fig. 1a batch fluid</td>
<td>2.0e-03</td>
<td>0/12</td>
<td>1.76e-03</td>
<td>series vs parallel; series vs side-by-side; series vs independent</td>
<td>&lt;1e-8</td>
</tr>
<tr class="even">
<td>Fig. 1b plug flow, constant rate</td>
<td>2.0e-03</td>
<td>1/12</td>
<td>2.20e-03</td>
<td>parallel vs independent</td>
<td>&lt;1e-8</td>
</tr>
<tr class="odd">
<td>Fig. 1c mixed flow, constant rate</td>
<td>2.0e-03</td>
<td>0/12</td>
<td>9.35e-04</td>
<td>parallel vs independent</td>
<td>&lt;1e-8</td>
</tr>
<tr class="even">
<td>Fig. 1c mixed flow, <img src="https://latex.codecogs.com/png.latex?C_A"> held</td>
<td>1.0e-02</td>
<td>0/12</td>
<td>&lt;1e-8</td>
<td>none (all at round-off)</td>
<td>&lt;1e-8</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>threshold = the instrument resolution: conversion 0.002, ln tau' 0.01. Raw residuals are in the matrices above - rescale at will.</code></pre>
</div>
</div>
</section>
<section id="why-the-bed-is-different-the-profile" class="level3">
<h3 class="anchored" data-anchor-id="why-the-bed-is-different-the-profile">6. Why the bed is different: the profile</h3>
<p>The plug-flow bed is the only one of the four contactings in which <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D"> vary <em>along</em> the catalyst, so it is the only one whose activity is a <strong>field</strong> rather than a number. And the two classes lay down opposite profiles: under <strong>parallel</strong> decay the inlet, richest in A, dies first; under <strong>series</strong> decay the inlet stays fresh, because no R has been made yet, and the damage starts at the outlet. That is <code>B2.2</code>’s “descending vs ascending” signature reappearing one level of abstraction up, and it is what a well-mixed fluid throws away.</p>
<p><strong>Both inlet values are exact, and neither needs the grid.</strong> At <img src="https://latex.codecogs.com/png.latex?s%20=%200"> the feed is imposed, so <img src="https://latex.codecogs.com/png.latex?c(0,%5Ctheta)%20=%201"> and <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20R%7D(0,%5Ctheta)%20=%200"> at every time. Hence</p>
<ul>
<li><strong>parallel:</strong> <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20a/%5Cpartial%5Ctheta%20=%20-%5Clambda%5C,c%5E%7Bn'%7Da%5E%7Bd%7D%20=%20-%5Clambda%20a"> at the feed face, so <img src="https://latex.codecogs.com/png.latex?a(0,%5Ctheta)%20=%20e%5E%7B-%5Clambda%5Ctheta%7D"> exactly;</li>
<li><strong>series:</strong> <img src="https://latex.codecogs.com/png.latex?%5Cpartial%20a/%5Cpartial%5Ctheta%20=%20-%5Clambda(1-c)%5E%7Bn'%7Da%5E%7Bd%7D%20=%200"> at the feed face for any <img src="https://latex.codecogs.com/png.latex?n'%20%3E%200">, so <img src="https://latex.codecogs.com/png.latex?a(0,%5Ctheta)%20%5Cequiv%201"> exactly, at every time.</li>
</ul>
<p>A finite-volume bed does not carry either number: its first unknown sits at the cell <em>centre</em> <img src="https://latex.codecogs.com/png.latex?s%20=%201/2m">, and that value approaches the face value at <strong>first order</strong> in <img src="https://latex.codecogs.com/png.latex?1/m">. The refinement is measured below, and the exact values are what the page reports.</p>
<p><strong>The outlet has no closed form in the bed, so it is read on the outlet face and extrapolated twice.</strong> The activity is read where the outlet concentration is read, on the linear extrapolation of the last two cells to <img src="https://latex.codecogs.com/png.latex?s%20=%201">, which is second order in <img src="https://latex.codecogs.com/png.latex?1/m">. It is Richardson-extrapolated in space from the two finest grids, and then in <strong>time</strong>, because the space extrapolation is performed at a fixed step count and Heun’s temporal error there is larger than what the space extrapolation leaves behind. Both refinements are printed below with their observed orders, and the result is compared with the quadrature route, which has a node at <img src="https://latex.codecogs.com/png.latex?s%20=%201"> and shares no operator with the bed.</p>
<p><strong>This, and not the conversion history, is where the bed’s information is.</strong> The outlet histories of the two classes are a fitted RMS conversion apart that §5 printed (<code>sep_plug_par_vs_ser</code>, a tenth of a percentage point), while the inlet activities differ by more than an order of magnitude and the <em>sign</em> of the gradient differs. An assay of the spent catalyst that resolves 10 % (coke burn-off, a crushed-and-retested activity) reads that inlet contrast directly.</p>
<p><strong>One caveat carried from <code>B2.2</code>.</strong> <code>B2.2</code> measured its own <em>within-bed</em> coke contrast at its operating point and found the descending (parallel) signature too weak for 10 % carbon assays (its numbers are loaded below). That does not contradict what is claimed here, because the two are different quantities: <code>B2.2</code>’s discriminator is the <em>gradient</em> of the deposit along the bed, this page’s is the <strong>inlet activity itself</strong>, at one sampling point. But a reader taking the “one assay is enough” advice to a real bed should size the contrast they can actually reach, <code>B2.2</code>-style, before designing on it. The recommendation this page ends on is therefore not about which reactor to run but about <strong>what to measure in it</strong>.</p>
<div id="8de9d327" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:14.678799Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:14.678669Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:33.004479Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:33.003640Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Figure 2: activity profiles down the pymrm bed, parallel vs series."""</span></span>
<span id="cb24-2">NT_PROF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the march grid the profiles are recorded on</span></span>
<span id="cb24-3">prof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb24-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb24-5">    Xb, Ab, tsb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BED.march(cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb24-6">                            BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NT_PROF, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TH)</span>
<span id="cb24-7">    prof[cls] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Xb, Ab)</span>
<span id="cb24-8">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2</span>))</span>
<span id="cb24-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ax, cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(axes, (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>)):</span>
<span id="cb24-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb24-11">        j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NT_PROF))</span>
<span id="cb24-12">        ax.plot(BED.s_c, prof[cls][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][:, j], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>COL[cls],</span>
<span id="cb24-13">                alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tt, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>,</span>
<span id="cb24-14">                label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> NT_PROF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-15">    ax.set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> deactivation (eq. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'parallel'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb24-16">                 fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb24-17">    ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$s = w/W$  (fraction of the catalyst passed)"</span>)</span>
<span id="cb24-18">    ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"activity $a$"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.set_ylim(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.02</span>)</span>
<span id="cb24-19">    ax.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb24-20">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb24-21"></span>
<span id="cb24-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the inlet is EXACT, and is not read off the grid -----------------------</span></span>
<span id="cb24-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># At s = 0 the feed is imposed: c = 1, so C_R = 0.  Hence</span></span>
<span id="cb24-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   parallel: da/dtheta = -lam c^n' a^d = -lam a  -&gt;  a(0, theta) = exp(-lam t)</span></span>
<span id="cb24-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   series:   da/dtheta = -lam (1-c)^n' a^d = 0   -&gt;  a(0, theta) = 1, exactly</span></span>
<span id="cb24-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The first finite-volume unknown sits at s = 1/2m, not at s = 0, and converges</span></span>
<span id="cb24-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to these at FIRST order.  The exact values are what is reported.</span></span>
<span id="cb24-28">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_end_par"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb24-29">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_end_ser"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb24-30">GRIDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb24-31">NT_CONV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># base step count of the refinement study; the outlet is</span></span>
<span id="cb24-32">                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># extrapolated in nt as well, and the break table halves</span></span>
<span id="cb24-33">                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># NT_CONV to show what that is worth.</span></span>
<span id="cb24-34">INL, OUT, OUTC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}, {}   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (class, m, nt, scheme) -&gt; floats at theta = 1</span></span>
<span id="cb24-35"></span>
<span id="cb24-36"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bed_ends(cls, m, nt, scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vanleer"</span>):</span>
<span id="cb24-37">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""a at theta = 1: first cell centre, outlet face (linear extrapolation of</span></span>
<span id="cb24-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the last two cells), last cell centre.  Cached, and returned as floats."""</span></span>
<span id="cb24-39">    key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (cls, m, nt, scheme, limiter)</span>
<span id="cb24-40">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OUT:</span>
<span id="cb24-41">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> limiter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vanleer"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> Bed(m, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb24-42">        _, Ag, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b.march(cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>],</span>
<span id="cb24-43">                           n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nt, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TH[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>scheme)</span>
<span id="cb24-44">        INL[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Ag[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-45">        OUT[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(interp_cntr_to_stagg(Ag[:, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:], b.s_f, b.s_c, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb24-46">        OUTC[key] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Ag[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> INL[key], OUT[key]</span>
<span id="cb24-48"></span>
<span id="cb24-49">gr, INLET_ERRS, OUT_ORD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}, {}</span>
<span id="cb24-50">FINEST6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet"</span>: [], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space"</span>: [], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>: []}   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># finest changes of the section-6 ladders</span></span>
<span id="cb24-51"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb24-52">    ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb24-53">    errs, outs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb24-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GRIDS:</span>
<span id="cb24-55">        ain, aout <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bed_ends(cls, m, NT_CONV)</span>
<span id="cb24-56">        errs.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ain <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ex))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> outs.append(aout)</span>
<span id="cb24-57">        gr.append([cls, m, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ain<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-58">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(errs) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log2(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-59">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>outs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.8f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-60">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(outs) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>outs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>outs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb24-61">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_err_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-62">    INLET_ERRS[cls] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> errs</span>
<span id="cb24-63">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb24-64">        np.log2(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb24-65">    d_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.diff(outs))</span>
<span id="cb24-66">    FINEST6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet"</span>].append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb24-67">    FINEST6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space"</span>].append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d_out[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb24-68">    OUT_ORD[cls] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log2(d_out[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d_out[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb24-69">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(OUT_ORD[cls][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-70">display(Markdown(</span>
<span id="cb24-71">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**The bed's first cell centre and outlet face, refined in SPACE** (the inlet "</span></span>
<span id="cb24-72">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"column is measured against the EXACT face value; the outlet, which has no "</span></span>
<span id="cb24-73">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"closed form in the bed, is read on the outlet face at nt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_CONV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and "</span></span>
<span id="cb24-74">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Richardson-extrapolated from the last pair, then extrapolated again, in "</span></span>
<span id="cb24-75">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time, in the table below):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-76">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(gr, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[</span>
<span id="cb24-77">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells m"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a at s = 1/2m"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|error| vs the exact inlet"</span>,</span>
<span id="cb24-78">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a at the outlet face"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"change in it"</span>]))))</span>
<span id="cb24-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order of the outlet-face activity from the changes between grids: "</span></span>
<span id="cb24-80">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OUT_ORD[c])</span>
<span id="cb24-81">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>)))</span>
<span id="cb24-82"></span>
<span id="cb24-83"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the INLET study is spatial; the OUTLET reading is not -------------------</span></span>
<span id="cb24-84">MF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb24-85">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_inlet_time_sensitivity"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb24-86">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bed_ends(c, MF, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NT_CONV)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bed_ends(c, MF, NT_CONV)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb24-87">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>)))</span>
<span id="cb24-88">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_profile_time_sensitivity"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb24-89">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bed_ends(c, MF, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NT_CONV)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bed_ends(c, MF, NT_CONV)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-90">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>)))</span>
<span id="cb24-91"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed order of the cell-centre error: "</span></span>
<span id="cb24-92">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_inlet_cellcentre_order_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (parallel), "</span></span>
<span id="cb24-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_inlet_cellcentre_order_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (series): first order, "</span></span>
<span id="cb24-94">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"which is what a 1/2m offset from the face demands."</span>)</span>
<span id="cb24-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The INLET study is purely spatial: doubling nt at m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> moves "</span></span>
<span id="cb24-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"either inlet reading by below 1e-7 (here "</span></span>
<span id="cb24-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_inlet_time_sensitivity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), against a parallel cell-centre "</span></span>
<span id="cb24-98">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"error of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_inlet_cellcentre_err_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and a series one of "</span></span>
<span id="cb24-99">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_inlet_cellcentre_err_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb24-100"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The OUTLET reading is NOT: the same doubling moves it by "</span></span>
<span id="cb24-101">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_profile_time_sensitivity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. So the outlet is extrapolated a "</span></span>
<span id="cb24-102">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"SECOND time, in nt."</span>)</span>
<span id="cb24-103"></span>
<span id="cb24-104"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- second extrapolation: in TIME ------------------------------------------</span></span>
<span id="cb24-105"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Richardson in space (the face reading is second order, ratio 2, so the</span></span>
<span id="cb24-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># correction is the last change over 3) at each of three step counts, then</span></span>
<span id="cb24-107"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Richardson in time (Heun is second order: the last change over 3 again).</span></span>
<span id="cb24-108"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> space_rich(cls, nt, pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb24-109">    o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [bed_ends(cls, m, nt)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pair <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> pair)]</span>
<span id="cb24-110">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> o[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (o[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> o[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span></span>
<span id="cb24-111"></span>
<span id="cb24-112">NT_SET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (NT_CONV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, NT_CONV, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> NT_CONV)</span>
<span id="cb24-113">QREF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the quadrature route, a(s = 1, theta = 1)</span></span>
<span id="cb24-114"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb24-115">    _q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PlugExact(ns).run(cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>],</span>
<span id="cb24-116">                                  BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-117">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ns <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">161</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">321</span>)]</span>
<span id="cb24-118">    QREF[cls] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb24-119">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_quadrature_change_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb24-120">RR, tr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, []</span>
<span id="cb24-121"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb24-122">    sh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SHORT[cls]</span>
<span id="cb24-123">    R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [space_rich(cls, nt) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NT_SET]</span>
<span id="cb24-124">    RR[cls] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R</span>
<span id="cb24-125">    dR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-126">    FINEST6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>].append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb24-127">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb24-128">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_spaceonly_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb24-129">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb24-130">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_altpair_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(R[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb24-131">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_bias_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb24-132">        M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_spaceonly_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb24-133">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># how far the SPACE extrapolation itself can still be off: the two grid</span></span>
<span id="cb24-134">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pairs available disagree by this much, at the base step count</span></span>
<span id="cb24-135">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_spread_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb24-136">        space_rich(cls, NT_CONV, GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> space_rich(cls, NT_CONV)))</span>
<span id="cb24-137">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_residual_bound_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb24-138">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>), M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_spread_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]))</span>
<span id="cb24-139">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_vs_quadrature_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> QREF[cls]))</span>
<span id="cb24-140">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_profile_contrast_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb24-141">        M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb24-142">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, (nt, r) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(NT_SET, R)):</span>
<span id="cb24-143">        tr.append([cls, nt, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[j<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-144">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'bed_a_outlet_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb24-145">    tr.append([cls, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-146">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dR[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>])</span>
<span id="cb24-147">    tr.append([cls, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature route"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QREF[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-148">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QREF[cls] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>])</span>
<span id="cb24-149">display(Markdown(</span>
<span id="cb24-150">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**The space-extrapolated outlet, refined in TIME** (each row repeats the "</span></span>
<span id="cb24-151">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Richardson of the two finest grids above at that step count; Heun is "</span></span>
<span id="cb24-152">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order, so the change falls by 4 per doubling and the remaining "</span></span>
<span id="cb24-153">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correction is that change over 3; the last row of each class is the "</span></span>
<span id="cb24-154">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature route, 321 Simpson nodes, LSODA at rtol 1e-12):</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-155">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(tr, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[</span>
<span id="cb24-156">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"steps nt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space-Richardson outlet"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"change in it"</span>,</span>
<span id="cb24-157">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order in nt"</span>]))))</span>
<span id="cb24-158"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed temporal order of the space-extrapolated outlet: "</span></span>
<span id="cb24-159">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_time_order_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (parallel), "</span></span>
<span id="cb24-160">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_time_order_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (series), second order, as for "</span></span>
<span id="cb24-161">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Heun."</span>)</span>
<span id="cb24-162"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"WHAT THE SECOND EXTRAPOLATION IS WORTH. The space-Richardson ALONE, at "</span></span>
<span id="cb24-163">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_CONV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_spaceonly_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for the "</span></span>
<span id="cb24-164">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"parallel outlet, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_time_bias_par'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> above the "</span></span>
<span id="cb24-165">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"limit, while the two grid pairs of the space extrapolation disagree by "</span></span>
<span id="cb24-166">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_space_spread_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. A reading that is "</span></span>
<span id="cb24-167">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"space-converged can still be time-limited, and this one is."</span>)</span>
<span id="cb24-168"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at theta = 1:  parallel  a(inlet) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_inlet_end_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb24-169">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(EXACT, = exp(-lambda)), a(outlet) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_end_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb24-170">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(space + time extrapolated, residual bound "</span></span>
<span id="cb24-171">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_residual_bound_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)   -&gt; descending"</span>)</span>
<span id="cb24-172"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"               series    a(inlet) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_inlet_end_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb24-173">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(EXACT, C_R = 0 at the feed face), a(outlet) = "</span></span>
<span id="cb24-174">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_end_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (space + time extrapolated, residual "</span></span>
<span id="cb24-175">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bound </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_residual_bound_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)   -&gt; ascending"</span>)</span>
<span id="cb24-176"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The doubly extrapolated outlets meet the quadrature route to below 1e-7 "</span></span>
<span id="cb24-177">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_vs_quadrature_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> parallel, "</span></span>
<span id="cb24-178">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_vs_quadrature_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> series); the quadrature itself "</span></span>
<span id="cb24-179">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"moves by below 1e-8 from 161 to 321 nodes (here "</span></span>
<span id="cb24-180">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_quadrature_change_par'</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_a_outlet_quadrature_change_ser'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). "</span></span>
<span id="cb24-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The outlets are quoted to five decimals."</span>)</span>
<span id="cb24-182"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The reading rules, as rows: one that must move and one that must not.</span></span>
<span id="cb24-183"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb24-184">    sh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SHORT[cls]</span>
<span id="cb24-185">    BREAKS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_spaceonly_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_spaceonly_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb24-186">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"halve NT_CONV to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and report the space-Richardson alone"</span>,</span>
<span id="cb24-187">                   <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RR[cls][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb24-188">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the space-only reading IS a function of the step count, "</span></span>
<span id="cb24-189">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"which is why it is not what is reported"</span>))</span>
<span id="cb24-190">    BREAKS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb24-191">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"read the time extrapolation off the nt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/"</span></span>
<span id="cb24-192">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pair instead of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb24-193">                   M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_altpair_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>],</span>
<span id="cb24-194">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ROBUSTNESS (must NOT move): the reported outlet is the "</span></span>
<span id="cb24-195">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limit of the march, so which pair the limit is read from "</span></span>
<span id="cb24-196">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"must not matter"</span>))</span>
<span id="cb24-197"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows for the refinement study, every one on numbers already computed</span></span>
<span id="cb24-198"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># except the Euler and upwind ladders: (1) the inlet error one grid coarser;</span></span>
<span id="cb24-199"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (2) the inlet order against a reference 1e-3 off the exact face value;</span></span>
<span id="cb24-200"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (3) the space extrapolation read off the coarsest grid pair, and the time</span></span>
<span id="cb24-201"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># extrapolation's residual off the coarser step pair; (4) the outlet's temporal</span></span>
<span id="cb24-202"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># order with Euler in place of Heun; (5) the outlet's spatial order with</span></span>
<span id="cb24-203"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first-order upwind; (6) the outlet read at the last cell centre</span></span>
<span id="cb24-204">BED_BROKEN, BED_BROKEN_LABEL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}</span>
<span id="cb24-205"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb24-206">    sh, ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SHORT[cls], M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb24-207">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_err_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(INLET_ERRS[cls][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb24-208">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_err_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the error read on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells"</span></span>
<span id="cb24-209">    e_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bed_ends(cls, m, NT_CONV)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:]]</span>
<span id="cb24-210">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(e_off[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e_off[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb24-211">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the exact inlet value off by 1e-3"</span></span>
<span id="cb24-212">    coarse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(space_rich(cls, NT_CONV, GRIDS[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> space_rich(cls, NT_CONV)))</span>
<span id="cb24-213">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_spread_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> coarse</span>
<span id="cb24-214">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_spread_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the space extrapolation from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRIDS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRIDS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells"</span></span>
<span id="cb24-215">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_residual_bound_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(coarse, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(RR[cls][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RR[cls][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb24-216">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_residual_bound_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (</span>
<span id="cb24-217">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"space pair </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRIDS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GRIDS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, time pair </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-218">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_bias_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RR[cls][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb24-219">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_bias_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the space-only reading at nt = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_SET[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-220">    Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.dot([<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>],</span>
<span id="cb24-221">                       [bed_ends(cls, m, nt, scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:]]))</span>
<span id="cb24-222">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NT_SET]</span>
<span id="cb24-223">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2((Re[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Re[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (Re[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Re[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb24-224">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"forward Euler on the activity (march(..., scheme='euler'))"</span></span>
<span id="cb24-225">    up <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [bed_ends(cls, m, NT_CONV, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GRIDS[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]]</span>
<span id="cb24-226">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])))</span>
<span id="cb24-227">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind convection (Bed(..., limiter=None))"</span></span>
<span id="cb24-228">    cc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [OUTC[(cls, m, nt, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vanleer"</span>)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NT_SET <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> GRIDS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:]]</span>
<span id="cb24-229">    rc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [cc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (cc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> j]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)]</span>
<span id="cb24-230">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_vs_quadrature_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (rc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> QREF[cls]))</span>
<span id="cb24-231">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_vs_quadrature_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the outlet read at the last cell centre, not the face"</span></span>
<span id="cb24-232">    BED_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_quadrature_change_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb24-233">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PLUG.run(cls, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>],</span>
<span id="cb24-234">                       n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> QREF[cls])</span>
<span id="cb24-235">    BED_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_quadrature_change_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (</span>
<span id="cb24-236">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the quadrature on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PLUG<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ns<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> nodes at LSODA rtol 1e-6"</span>)</span>
<span id="cb24-237"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the two contrasts have opposite sign: "</span></span>
<span id="cb24-238">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_profile_contrast_par'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_profile_contrast_ser'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-239"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"For comparison, the production grid (m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) reads its first cell "</span></span>
<span id="cb24-240">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"centre at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>prof[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'series'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (series) and "</span></span>
<span id="cb24-241">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>prof[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'parallel'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (parallel). Neither is reported as the "</span></span>
<span id="cb24-242">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"inlet activity: the exact statement is the stronger one, since the series "</span></span>
<span id="cb24-243">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"inlet does not merely stay high, it does not decay at all."</span>)</span>
<span id="cb24-244">_b22 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B2.2-froment-bischoff-coking"</span>)</span>
<span id="cb24-245"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"B2.2, at its own operating point: the parallel half-bed coke contrast is "</span></span>
<span id="cb24-246">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_b22[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'diag_halfcontrast_pe_base'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, resolvable only with assays better "</span></span>
<span id="cb24-247">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"than </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _b22[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'diag_sigma_max_pe_base'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, and "</span></span>
<span id="cb24-248">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_b22[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'diag_halfcontrast_pe_T20'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at four times the coking time."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.3-levenspiel-deactivation-classes/index_files/figure-html/cell-12-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The bed’s first cell centre and outlet face, refined in SPACE</strong> (the inlet column is measured against the EXACT face value; the outlet, which has no closed form in the bed, is read on the outlet face at nt = 100 and Richardson-extrapolated from the last pair, then extrapolated again, in time, in the table below):</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
</colgroup>
<thead>
<tr class="header">
<th>class</th>
<th>cells m</th>
<th>a at s = 1/2m</th>
<th></th>
<th>error</th>
<th>vs the exact inlet</th>
<th>observed order</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>parallel</td>
<td>100</td>
<td>0.050143</td>
<td>3.560e-04</td>
<td></td>
<td>0.19016571</td>
<td></td>
</tr>
<tr class="even">
<td>parallel</td>
<td>200</td>
<td>0.049965</td>
<td>1.777e-04</td>
<td>1.00</td>
<td>0.19017338</td>
<td>+7.67e-06</td>
</tr>
<tr class="odd">
<td>parallel</td>
<td>400</td>
<td>0.049876</td>
<td>8.878e-05</td>
<td>1.00</td>
<td>0.19017530</td>
<td>+1.92e-06</td>
</tr>
<tr class="even">
<td>parallel</td>
<td>800</td>
<td>0.049831</td>
<td>4.437e-05</td>
<td>1.00</td>
<td>0.19017578</td>
<td>+4.81e-07</td>
</tr>
<tr class="odd">
<td>series</td>
<td>100</td>
<td>0.978069</td>
<td>2.193e-02</td>
<td></td>
<td>0.17710753</td>
<td></td>
</tr>
<tr class="even">
<td>series</td>
<td>200</td>
<td>0.988894</td>
<td>1.111e-02</td>
<td>0.98</td>
<td>0.17711201</td>
<td>+4.49e-06</td>
</tr>
<tr class="odd">
<td>series</td>
<td>400</td>
<td>0.994411</td>
<td>5.589e-03</td>
<td>0.99</td>
<td>0.17711313</td>
<td>+1.12e-06</td>
</tr>
<tr class="even">
<td>series</td>
<td>800</td>
<td>0.997197</td>
<td>2.803e-03</td>
<td>1.00</td>
<td>0.17711341</td>
<td>+2.79e-07</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>observed order of the outlet-face activity from the changes between grids: parallel 1.997, 1.999; series 2.004, 2.002
observed order of the cell-centre error: 1.00 (parallel), 1.00 (series): first order, which is what a 1/2m offset from the face demands.
The INLET study is purely spatial: doubling nt at m = 800 moves either inlet reading by below 1e-7 (here 2.5e-09), against a parallel cell-centre error of 4.44e-05 and a series one of 2.80e-03.
The OUTLET reading is NOT: the same doubling moves it by 7.3e-06. So the outlet is extrapolated a SECOND time, in nt.</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The space-extrapolated outlet, refined in TIME</strong> (each row repeats the Richardson of the two finest grids above at that step count; Heun is second order, so the change falls by 4 per doubling and the remaining correction is that change over 3; the last row of each class is the quadrature route, 321 Simpson nodes, LSODA at rtol 1e-12):</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>class</th>
<th>steps nt</th>
<th>space-Richardson outlet</th>
<th>change in it</th>
<th>observed order in nt</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>parallel</td>
<td>50</td>
<td>0.190205092</td>
<td></td>
<td></td>
</tr>
<tr class="even">
<td>parallel</td>
<td>100</td>
<td>0.190175938</td>
<td>-2.92e-05</td>
<td></td>
</tr>
<tr class="odd">
<td>parallel</td>
<td>200</td>
<td>0.190168616</td>
<td>-7.32e-06</td>
<td>1.99</td>
</tr>
<tr class="even">
<td>parallel</td>
<td>extrapolated</td>
<td>0.190166175</td>
<td>-2.44e-06</td>
<td></td>
</tr>
<tr class="odd">
<td>parallel</td>
<td>quadrature route</td>
<td>0.190166169</td>
<td>-6.4e-09</td>
<td></td>
</tr>
<tr class="even">
<td>series</td>
<td>50</td>
<td>0.177116493</td>
<td></td>
<td></td>
</tr>
<tr class="odd">
<td>series</td>
<td>100</td>
<td>0.177113503</td>
<td>-2.99e-06</td>
<td></td>
</tr>
<tr class="even">
<td>series</td>
<td>200</td>
<td>0.177112756</td>
<td>-7.47e-07</td>
<td>2.00</td>
</tr>
<tr class="odd">
<td>series</td>
<td>extrapolated</td>
<td>0.177112508</td>
<td>-2.49e-07</td>
<td></td>
</tr>
<tr class="even">
<td>series</td>
<td>quadrature route</td>
<td>0.177112508</td>
<td>+1.4e-10</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>observed temporal order of the space-extrapolated outlet: 1.99 (parallel), 2.00 (series), second order, as for Heun.
WHAT THE SECOND EXTRAPOLATION IS WORTH. The space-Richardson ALONE, at nt = 100, gives 0.1901759 for the parallel outlet, 9.8e-06 above the limit, while the two grid pairs of the space extrapolation disagree by 6.5e-10. A reading that is space-converged can still be time-limited, and this one is.

at theta = 1:  parallel  a(inlet) = 0.049787 (EXACT, = exp(-lambda)), a(outlet) = 0.19017 (space + time extrapolated, residual bound 2.4e-06)   -&gt; descending
               series    a(inlet) = 1.000000 (EXACT, C_R = 0 at the feed face), a(outlet) = 0.17711 (space + time extrapolated, residual bound 2.5e-07)   -&gt; ascending
The doubly extrapolated outlets meet the quadrature route to below 1e-7 (here 6.4e-09 parallel, 1.4e-10 series); the quadrature itself moves by below 1e-8 from 161 to 321 nodes (here 2e-10). The outlets are quoted to five decimals.
the two contrasts have opposite sign: +0.1404 vs -0.8229
For comparison, the production grid (m = 200) reads its first cell centre at 0.9889 (series) and 0.049965 (parallel). Neither is reported as the inlet activity: the exact statement is the stronger one, since the series inlet does not merely stay high, it does not decay at all.
B2.2, at its own operating point: the parallel half-bed coke contrast is -0.244, resolvable only with assays better than 8.6 %, and -0.0526 at four times the coking time.</code></pre>
</div>
</div>
</section>
<section id="where-even-the-mixed-reactor-separates-and-the-boundary-is-analytic" class="level3">
<h3 class="anchored" data-anchor-id="where-even-the-mixed-reactor-separates-and-the-boundary-is-analytic">7. Where even the mixed reactor separates, and the boundary is analytic</h3>
<p>Degeneracy 2 is <strong>one-way</strong>. Series with orders <img src="https://latex.codecogs.com/png.latex?(n',%20d)"> always has an exact parallel twin at <img src="https://latex.codecogs.com/png.latex?(n%20n',%20d+n')">. Going the other way, a parallel truth <img src="https://latex.codecogs.com/png.latex?(n'_p,%20d_p)"> has a series twin only if the required series order <img src="https://latex.codecogs.com/png.latex?d_s%20=%20d_p%20-%20n'_p/n"> is <strong>non-negative</strong>, and <img src="https://latex.codecogs.com/png.latex?d"> is an <em>order</em> in the paper’s own rate forms, so a negative one is not a member of the family.</p>
<p>So there is a line, <img src="https://latex.codecogs.com/png.latex?d%20=%20n'/n">, below which the exact twin ceases to exist. The prediction is sharp; what it buys is not. Below the line the best series impersonation is no longer perfect, but it is not immediately <em>bad</em> either: the residual grows smoothly with distance from the line, and only becomes measurable at a realistic resolution well inside the region. Tested on both sides:</p>
<div id="2a6f484c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:33.007070Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:33.006888Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:44.530447Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:44.529344Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The predicted boundary d = n'/n in the constant-flow mixed reactor."""</span></span>
<span id="cb27-2">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb27-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> npv, dv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>),</span>
<span id="cb27-4">                (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)):</span>
<span id="cb27-5">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], dv, npv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb27-6">    D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_class(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, y, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>],</span>
<span id="cb27-7">                  tag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed-boundary"</span>, npv, dv))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-8">    ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>]</span>
<span id="cb27-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># where the twin exists it is evaluated directly, exactly as in section 5:</span></span>
<span id="cb27-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># an optimiser bound must never stand in for an identity</span></span>
<span id="cb27-11">    tw, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> twin_residual(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>,</span>
<span id="cb27-12">                          <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(BASE, d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dv, nprime<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>npv, sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>), BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>])</span>
<span id="cb27-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb27-14">        D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(D, tw)</span>
<span id="cb27-15">    rows.append([npv, dv, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ds<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"attainable"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d &lt; 0: none"</span>,</span>
<span id="cb27-16">                 (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;1e-8*"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span></span>
<span id="cb27-17">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'*'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>),</span>
<span id="cb27-18">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> RES_X <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"YES"</span>])</span>
<span id="cb27-19">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mixed_boundary_np</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>npv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(D)</span>
<span id="cb27-20">display(Markdown(</span>
<span id="cb27-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Mixed flow, constant rate: can a series model impersonate a parallel "</span></span>
<span id="cb27-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"truth?**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[</span>
<span id="cb27-23">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n'"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d - n'/n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series twin"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D(parallel -&gt; series)"</span>,</span>
<span id="cb27-24">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"separable at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">?"</span>]))))</span>
<span id="cb27-25">inside <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-26">outside <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb27-27">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_worst_inside"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mixed_boundary_np</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb27-28">                                             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> inside))</span>
<span id="cb27-29">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_best_outside"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mixed_boundary_np</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb27-30">                                             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> outside))</span>
<span id="cb27-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Inside the region where the exact twin exists (d &gt;= n'/n) the best "</span></span>
<span id="cb27-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"series impersonation is below 1e-8 (here "</span></span>
<span id="cb27-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed_boundary_worst_inside'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), i.e. nothing. Outside it the "</span></span>
<span id="cb27-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"residual grows smoothly with distance from the line, from below 1e-3 at "</span></span>
<span id="cb27-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"d - n'/n = -0.25 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed_boundary_np1_d0.75'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) to "</span></span>
<span id="cb27-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed_boundary_np1_d0.25'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at -0.75, and only crosses the "</span></span>
<span id="cb27-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> resolution between d - n'/n = -0.25 and -0.5 (here "</span></span>
<span id="cb27-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed_boundary_np1_d0.5'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at -0.5)."</span>)</span>
<span id="cb27-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The line is a prediction about EXACTNESS, and it holds. It is not a "</span></span>
<span id="cb27-40">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prediction about measurability, and the (n' = 2, d = 1.5) row shows why: "</span></span>
<span id="cb27-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"it lies half a unit below the line yet is still fitted to below 1e-4 "</span></span>
<span id="cb27-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mixed_boundary_np2_d1.5'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), because an inexact series twin is "</span></span>
<span id="cb27-43">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still an excellent one there. Crossing the boundary is necessary for the "</span></span>
<span id="cb27-44">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed reactor to separate the two classes, and nowhere near sufficient."</span>)</span>
<span id="cb27-45">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.5"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.5"</span>],</span>
<span id="cb27-46">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"move d back across the predicted boundary to d = 1.5"</span>,</span>
<span id="cb27-47">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d1.5"</span>],</span>
<span id="cb27-48">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the separability of the mixed reactor is switched by the "</span></span>
<span id="cb27-49">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"analytic condition, in both directions"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Mixed flow, constant rate: can a series model impersonate a parallel truth?</strong></p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th>n’</th>
<th>d</th>
<th>d - n’/n</th>
<th>series twin</th>
<th>D(parallel -&gt; series)</th>
<th>separable at 0.002?</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1.0</td>
<td>1.5</td>
<td>+0.50</td>
<td>attainable</td>
<td>&lt;1e-8*</td>
<td>no</td>
</tr>
<tr class="even">
<td>1.0</td>
<td>1.0</td>
<td>+0.00</td>
<td>attainable</td>
<td>&lt;1e-8*</td>
<td>no</td>
</tr>
<tr class="odd">
<td>1.0</td>
<td>0.75</td>
<td>-0.25</td>
<td>d &lt; 0: none</td>
<td>7.49e-04</td>
<td>no</td>
</tr>
<tr class="even">
<td>1.0</td>
<td>0.5</td>
<td>-0.50</td>
<td>d &lt; 0: none</td>
<td>3.05e-03</td>
<td>YES</td>
</tr>
<tr class="odd">
<td>1.0</td>
<td>0.25</td>
<td>-0.75</td>
<td>d &lt; 0: none</td>
<td>4.02e-03</td>
<td>YES</td>
</tr>
<tr class="even">
<td>2.0</td>
<td>1.5</td>
<td>-0.50</td>
<td>d &lt; 0: none</td>
<td>4.04e-05</td>
<td>no</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>
Inside the region where the exact twin exists (d &gt;= n'/n) the best series impersonation is below 1e-8 (here 3.3e-10), i.e. nothing. Outside it the residual grows smoothly with distance from the line, from below 1e-3 at d - n'/n = -0.25 (here 7.5e-04) to 4.0e-03 at -0.75, and only crosses the 0.002 resolution between d - n'/n = -0.25 and -0.5 (here 3.1e-03 at -0.5).
The line is a prediction about EXACTNESS, and it holds. It is not a prediction about measurability, and the (n' = 2, d = 1.5) row shows why: it lies half a unit below the line yet is still fitted to below 1e-4 (here 4.0e-05), because an inexact series twin is still an excellent one there. Crossing the boundary is necessary for the mixed reactor to separate the two classes, and nowhere near sufficient.</code></pre>
</div>
</div>
</section>
<section id="the-recommended-device-taken-seriously" class="level3">
<h3 class="anchored" data-anchor-id="the-recommended-device-taken-seriously">8. The recommended device, taken seriously</h3>
<p>Levenspiel’s recommendation (Discussion, point 2, p.&nbsp;272) is unambiguous:</p>
<blockquote class="blockquote">
<p><em>“the most useful reactor set up uses a batch of solids and mixed flow of fluid with changing flow rate so as to keep the concentration of the pertinent reaction component unchanged with time within the reactor. Thus by constantly lowering the flow rate in a basket or recycle reactor the activity and concentration dependencies can be decoupled and studied separately.”</em></p>
</blockquote>
<p>Everything about that is right, and the page confirms both halves: the decay order <img src="https://latex.codecogs.com/png.latex?d"> comes straight out of the shape of <img src="https://latex.codecogs.com/png.latex?%5Ctau'(t)"> through eqs. (28)–(32) <strong>whatever <img src="https://latex.codecogs.com/png.latex?n'"> is</strong> (that is the decoupling), and, from degeneracy 3, the class does not come out at all. The two facts are the same fact. So the question the device leaves open is: <em>how many runs, over what span of held concentration, does the class actually take?</em></p>
<p>The recipe is the paper’s own: <img src="https://latex.codecogs.com/png.latex?k'_d%20=%20k_dC_%7B%5Crm%20A%7D%5E%7B%5C,n'%7D"> under parallel and <img src="https://latex.codecogs.com/png.latex?k_dC_%7B%5Crm%20R%7D%5E%7B%5C,n'%7D"> under series, so a set of runs at different held levels gives <img src="https://latex.codecogs.com/png.latex?k'_d"> as a function of the level, and a power law in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> is not a power law in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A0%7D-C_%7B%5Crm%20A%7D">. Below, the span required is <strong>root-found</strong> against a stated precision on <img src="https://latex.codecogs.com/png.latex?k'_d">, not read off a sweep, and then swept over the two design choices it hides, because root-finding a function of an arbitrary parameter does not make that parameter less arbitrary.</p>
<p><strong>The second half of this section prices a protocol the paper does not prescribe, and says so.</strong> For eq. (6) Levenspiel’s own instruction is to hold <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20P%7D">; holding <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> instead is the inverse of his priority. Both sentences are in <code>data/levenspiel-1972-printed-claims.csv</code> and both are printed below from it in full, hedge included. Under the author’s own instruction, a poison not consumed, so <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20P%7D"> fixed, this page’s own <img src="https://latex.codecogs.com/png.latex?%5Csigma%20=%200"> row shows <strong>no bias at all</strong>. What is priced below is the cost of the <em>other</em> choice, and it is a real cost only because one control knob cannot hold two concentrations.</p>
<div id="8c2ae0f7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:44.532565Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:44.532390Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:44.553312Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:44.552503Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""How wide a set of held-C_A runs does it take to name the class?</span></span>
<span id="cb29-2"></span>
<span id="cb29-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">At each held level c the device returns k'_d exactly (degeneracy 3 makes it</span></span>
<span id="cb29-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">the ONLY thing it returns).  Under a parallel truth k'_d = lam c^n'; a series</span></span>
<span id="cb29-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">reader fits ln k'_d = ln A + n'_s ln(1-c).  The relative misfit of that wrong</span></span>
<span id="cb29-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">reading, over L levels spanning [c0, c0+dc], is the signal.  Root-found."""</span></span>
<span id="cb29-7">L_LEVELS, C_LO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span></span>
<span id="cb29-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> wrong_class_misfit(dc, npv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], truth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>,</span>
<span id="cb29-9">                       lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, levels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb29-10">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(C_LO <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> lo,</span>
<span id="cb29-11">                    (C_LO <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dc,</span>
<span id="cb29-12">                    L_LEVELS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> levels <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> levels)</span>
<span id="cb29-13">    kd_true <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> npv     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># lam folded out</span></span>
<span id="cb29-14">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> truth <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> c)</span>
<span id="cb29-15">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(kd_true)</span>
<span id="cb29-16">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(x), x]).T</span>
<span id="cb29-17">    coef, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(A, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb29-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> coef) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RMS in ln k'_d</span></span>
<span id="cb29-19"></span>
<span id="cb29-20"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> prec <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>):</span>
<span id="cb29-21">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> dc: wrong_class_misfit(dc) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> prec</span>
<span id="cb29-22">    dc_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(f, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.80</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb29-23">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"constC_span_needed_prec</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(prec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dc_star)</span>
<span id="cb29-24">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"k'_d known to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>prec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %  -&gt;  held-C_A levels must span "</span></span>
<span id="cb29-25">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dc = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dc_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in C_A/C_A0 "</span></span>
<span id="cb29-26">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C_LO<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>dc_star<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), with </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L_LEVELS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> levels"</span>)</span>
<span id="cb29-27">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_misfit_at_span_0p5"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> wrong_class_misfit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb29-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">over a half-decade of held concentration (dc = 0.5) the wrong reading "</span></span>
<span id="cb29-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"misses by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_misfit_at_span_0p5'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % in k'_d - "</span></span>
<span id="cb29-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"comfortable; over dc = 0.05 it misses by "</span></span>
<span id="cb29-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>wrong_class_misfit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, which no rate constant is known to."</span>)</span>
<span id="cb29-32"></span>
<span id="cb29-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- and the span is a property of TWO choices that are not the paper's -----</span></span>
<span id="cb29-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># C_LO (where the set of held levels starts) and L_LEVELS (how many there are)</span></span>
<span id="cb29-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are design choices, not printed constants.  Root-finding a function of an</span></span>
<span id="cb29-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arbitrary parameter does not make the parameter less arbitrary, so both are</span></span>
<span id="cb29-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># swept and the answer is reported as a RANGE, with the base cell marked.</span></span>
<span id="cb29-38">LO_SCAN, LEV_SCAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.40</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb29-39">span_grid, all_spans <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb29-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LO_SCAN:</span>
<span id="cb29-41">    row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  &lt;-- base"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> C_LO <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)]</span>
<span id="cb29-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LEV_SCAN:</span>
<span id="cb29-43">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> dc: wrong_class_misfit(dc, lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo, levels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb29-44">                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.80</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb29-45">        all_spans.append(v)</span>
<span id="cb29-46">        row.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> C_LO <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> lv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> L_LEVELS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb29-47">    span_grid.append(row)</span>
<span id="cb29-48">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(all_spans))</span>
<span id="cb29-49">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(all_spans))</span>
<span id="cb29-50">display(Markdown(</span>
<span id="cb29-51">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**The required span is a property of two unprinted design choices** - "</span></span>
<span id="cb29-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"where the set of held levels starts (C_LO) and how many there are "</span></span>
<span id="cb29-53">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(L_LEVELS). Span needed at 5 % precision on k'_d, root-found in every "</span></span>
<span id="cb29-54">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell; `*` is the base case quoted above:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-55">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(span_grid,</span>
<span id="cb29-56">                            columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_LO </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> levels"</span>]</span>
<span id="cb29-57">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(lv) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LEV_SCAN]))))</span>
<span id="cb29-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Range over the sweep: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_span_prec5pct_min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to "</span></span>
<span id="cb29-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_span_prec5pct_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - a factor of "</span></span>
<span id="cb29-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_span_prec5pct_max'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_span_prec5pct_min'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and "</span></span>
<span id="cb29-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"monotone in the starting level. The base answer "</span></span>
<span id="cb29-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_span_needed_prec5pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is therefore an ORDER, not a "</span></span>
<span id="cb29-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"design constant: a set of held levels must span a few tenths of "</span></span>
<span id="cb29-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"C_A/C_A0, and where it starts matters as much as how wide it is."</span>)</span>
<span id="cb29-65">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_max"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_max"</span>],</span>
<span id="cb29-66">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"start the level set at C_A/C_A0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LO_SCAN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of "</span></span>
<span id="cb29-67">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LO_SCAN[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb29-68">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_min"</span>],</span>
<span id="cb29-69">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the required span is set by the unprinted C_LO as much as by "</span></span>
<span id="cb29-70">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the demanded precision"</span>))</span>
<span id="cb29-71">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec5pct"</span>,</span>
<span id="cb29-72">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec5pct"</span>],</span>
<span id="cb29-73">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"demand 2 % precision on k'_d instead of 5 %"</span>,</span>
<span id="cb29-74">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec2pct"</span>],</span>
<span id="cb29-75">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the required span is set by the precision, and moves with it"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>k'_d known to  2.0 %  -&gt;  held-C_A levels must span dc = 0.111 in C_A/C_A0 (i.e. 0.15 to 0.26), with 5 levels
k'_d known to  5.0 %  -&gt;  held-C_A levels must span dc = 0.204 in C_A/C_A0 (i.e. 0.15 to 0.35), with 5 levels
k'_d known to 10.0 %  -&gt;  held-C_A levels must span dc = 0.335 in C_A/C_A0 (i.e. 0.15 to 0.49), with 5 levels

over a half-decade of held concentration (dc = 0.5) the wrong reading misses by 17.1 % in k'_d - comfortable; over dc = 0.05 it misses by 0.52 %, which no rate constant is known to.</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The required span is a property of two unprinted design choices</strong> - where the set of held levels starts (C_LO) and how many there are (L_LEVELS). Span needed at 5 % precision on k’_d, root-found in every cell; <code>*</code> is the base case quoted above:</p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>C_LO &nbsp;levels</th>
<th>3</th>
<th>5</th>
<th>9</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>0.05</td>
<td>0.073</td>
<td>0.078</td>
<td>0.087</td>
</tr>
<tr class="even">
<td>0.10</td>
<td>0.135</td>
<td>0.146</td>
<td>0.162</td>
</tr>
<tr class="odd">
<td>0.15 &lt;– base</td>
<td>0.189</td>
<td>0.204*</td>
<td>0.225</td>
</tr>
<tr class="even">
<td>0.25</td>
<td>0.270</td>
<td>0.290</td>
<td>0.317</td>
</tr>
<tr class="odd">
<td>0.40</td>
<td>0.336</td>
<td>0.356</td>
<td>0.382</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Range over the sweep: 0.073 to 0.382 - a factor of 5.3, and monotone in the starting level. The base answer 0.204 is therefore an ORDER, not a design constant: a set of held levels must span a few tenths of C_A/C_A0, and where it starts matters as much as how wide it is.</code></pre>
</div>
</div>
<div id="fdc9fa5e" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:44.556057Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:44.555882Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:44.827830Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:44.826821Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One knob, two constraints: side-by-side in the recommended device.</span></span>
<span id="cb32-2"></span>
<span id="cb32-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">Holding C_A fixed sets the flow rate.  If the poison is CONSUMED (eq. 6 prints</span></span>
<span id="cb32-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"P -&gt; P(down)"), C_P then drifts as the flow rate falls, so k'_d is not constant</span></span>
<span id="cb32-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">and the eq.-(32) straight line is bent.  What the paper actually PRESCRIBES for</span></span>
<span id="cb32-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">eq. (6) is printed below, from the claims CSV, in full."""</span></span>
<span id="cb32-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cid <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p271_keep_constant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p271_side_by_side_hedge"</span>):</span>
<span id="cb32-8">    display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&gt; *</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLAIMS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[cid, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'quote'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">* &amp;nbsp;&amp;nbsp;(p. "</span></span>
<span id="cb32-9">                     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLAIMS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[cid, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, `</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cid<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`)"</span>))</span>
<span id="cb32-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Read together: for eq. (6) the author's instruction is to keep C_P "</span></span>
<span id="cb32-11">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constant, and holding C_A too is the conditional extra ('if possible'). "</span></span>
<span id="cb32-12">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He then hedges the failure of the SECOND condition, not the first: 'If "</span></span>
<span id="cb32-13">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_A cannot be kept constant in side-by-side deactivation, analysis is "</span></span>
<span id="cb32-14">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still not particularly difficult.' What follows holds C_A and lets C_P "</span></span>
<span id="cb32-15">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drift - the inverse of that priority - because that is what a single "</span></span>
<span id="cb32-16">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"flow-rate knob does when the poison is consumed. The author's own "</span></span>
<span id="cb32-17">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"protocol is the sigma = 0 row below, and it is unbiased."</span>)</span>
<span id="cb32-18"></span>
<span id="cb32-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> recovered_d(sig, d_true):</span>
<span id="cb32-20">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The order an experimenter would read off the paper's own Fig.-6 plot."""</span></span>
<span id="cb32-21">    tau, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], d_true,</span>
<span id="cb32-22">                         BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], sig<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sig)</span>
<span id="cb32-23">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bend(dv):</span>
<span id="cb32-24">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (tau^(d-1) - 1)/(d-1) loses digits to cancellation near d = 1, and no</span></span>
<span id="cb32-25">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ODE tolerance recovers them; expm1 does</span></span>
<span id="cb32-26">        lt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(tau)</span>
<span id="cb32-27">        y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lt <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.expm1((dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb32-28">        A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.vstack([np.ones_like(TH), TH]).T</span>
<span id="cb32-29">        coef, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(A, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb32-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> coef) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.ptp(y), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>))</span>
<span id="cb32-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(minimize_scalar(bend, bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb32-32">                                 options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>}).x)</span>
<span id="cb32-33"></span>
<span id="cb32-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- d = 1 is a blind spot of the device, and exactly so --------------------</span></span>
<span id="cb32-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># In a mixed reactor at held C_A the poison consumed per unit time goes as</span></span>
<span id="cb32-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tau' x rate ~ (1/a) x a^d = a^(d-1).  At d = 1 that is CONSTANT: C_P settles</span></span>
<span id="cb32-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at a fixed value and never drifts, so the eq.-(32) line stays perfectly</span></span>
<span id="cb32-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># straight no matter how much poison is consumed.  The over-determination has</span></span>
<span id="cb32-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># no cost at all at d = 1 - and only at d = 1.</span></span>
<span id="cb32-40">SIG_SCAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">21</span>)</span>
<span id="cb32-41">bias1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(recovered_d(sv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_SCAN])</span>
<span id="cb32-42">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_at_d1_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bias1.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"d = 1: the recovered order is unbiased to below 1e-7 (here "</span></span>
<span id="cb32-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_bias_at_d1_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) for every sigma up to "</span></span>
<span id="cb32-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SIG_SCAN[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - an exact cancellation "</span></span>
<span id="cb32-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(consumption rate ~ a^(d-1) = const at d = 1), not a small number."</span>)</span>
<span id="cb32-47"></span>
<span id="cb32-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- d = 2, where the drift is real ---------------------------------------</span></span>
<span id="cb32-49">D_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb32-50">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_sig0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> recovered_d(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, D_TRUE)</span>
<span id="cb32-51">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_base"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> recovered_d(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], D_TRUE)</span>
<span id="cb32-52">bias2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(recovered_d(sv, D_TRUE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SIG_SCAN])</span>
<span id="cb32-53">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_max_scanned"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bias2.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-54">target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((t <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bias2.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> t), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb32-55"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> target <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"no bias target reached; max scanned </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bias2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb32-56">j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(bias2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> target))</span>
<span id="cb32-57">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_target"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(target)</span>
<span id="cb32-58">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_sigma_for_bias"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(brentq(</span>
<span id="cb32-59">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> sv: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(recovered_d(sv, D_TRUE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> target,</span>
<span id="cb32-60">    SIG_SCAN[j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], SIG_SCAN[j], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>))</span>
<span id="cb32-61">SIG_SCAN_READ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SIG_SCAN[j])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break row: read off the scan, not root-found</span></span>
<span id="cb32-62">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_sig0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_sig0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_TRUE</span>
<span id="cb32-63">                                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb32-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_TRUE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: recovered </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_recovered_d_sig0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at "</span></span>
<span id="cb32-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sigma = 0 and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_recovered_d_base'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at "</span></span>
<span id="cb32-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the base sigma = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sig'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - a bias of "</span></span>
<span id="cb32-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_recovered_d_base'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb32-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The sigma = 0 row IS the author's own protocol for eq. (6) - a poison "</span></span>
<span id="cb32-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"in such excess that C_P does not move is C_P kept constant - and it "</span></span>
<span id="cb32-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"recovers d to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_bias_sig0'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative. The bias below "</span></span>
<span id="cb32-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"is the price of the OTHER protocol, the one a single flow-rate knob "</span></span>
<span id="cb32-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"forces on you if the poison is consumed and you choose to hold C_A."</span>)</span>
<span id="cb32-73"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"root-found (bracketed by the scan, not read off it): the bias reaches "</span></span>
<span id="cb32-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>target<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % once sigma exceeds </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_sigma_for_bias'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb32-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the largest bias over sigma &lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SIG_SCAN[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is "</span></span>
<span id="cb32-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'constC_sbs_bias_max_scanned'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb32-77">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_base"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_base"</span>],</span>
<span id="cb32-78">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"set sigma = 0 (poison in such excess that C_P never moves)"</span>,</span>
<span id="cb32-79">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_sig0"</span>],</span>
<span id="cb32-80">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the bias IS the poison consumption; with none, d comes back exactly"</span>))</span>
<span id="cb32-81">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_at_d1_max"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_at_d1_max"</span>],</span>
<span id="cb32-82">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"move off d = 1, where the a^(d-1) cancellation holds, to d = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>D_TRUE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb32-83">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_max_scanned"</span>],</span>
<span id="cb32-84">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the blind spot is exactly at d = 1 and nowhere else"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<blockquote class="blockquote">
<p><em>“For parallel deactivation (Eq. 4) keep C_A constant; For series deactivation (Eq. 5) keep C_R constant; For side-by-side deactivation (Eq. 6) keep C_P constant; For independent deactivation (Eq. 7) no concentration need be kept constant”</em> &nbsp;&nbsp;(p.&nbsp;271, <code>p271_keep_constant</code>)</p>
</blockquote>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<blockquote class="blockquote">
<p><em>“The analysis is quite similar for series deactivation if C_A, hence C_R is kept constant, and for side-by-side deactivation if C_P and, if possible, C_A are kept constant. If C_A cannot be kept constant in side-by-side deactivation, analysis is still not particularly difficult”</em> &nbsp;&nbsp;(p.&nbsp;271, <code>p271_side_by_side_hedge</code>)</p>
</blockquote>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Read together: for eq. (6) the author's instruction is to keep C_P constant, and holding C_A too is the conditional extra ('if possible'). He then hedges the failure of the SECOND condition, not the first: 'If C_A cannot be kept constant in side-by-side deactivation, analysis is still not particularly difficult.' What follows holds C_A and lets C_P drift - the inverse of that priority - because that is what a single flow-rate knob does when the poison is consumed. The author's own protocol is the sigma = 0 row below, and it is unbiased.
d = 1: the recovered order is unbiased to below 1e-7 (here 8.4e-09) for every sigma up to 20 - an exact cancellation (consumption rate ~ a^(d-1) = const at d = 1), not a small number.

d = 2: recovered 2.0000 at sigma = 0 and 1.3835 at the base sigma = 0.8 - a bias of -30.83 %.
The sigma = 0 row IS the author's own protocol for eq. (6) - a poison in such excess that C_P does not move is C_P kept constant - and it recovers d to 5.4e-09 relative. The bias below is the price of the OTHER protocol, the one a single flow-rate knob forces on you if the poison is consumed and you choose to hold C_A.
root-found (bracketed by the scan, not read off it): the bias reaches 5 % once sigma exceeds 0.0763; the largest bias over sigma &lt;= 20 is 49.2 %.</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Four layers, in order of what they can catch.</p>
<ol type="1">
<li><strong>The pymrm bed against an independent exact route.</strong> The pseudo-steady bed at frozen <img src="https://latex.codecogs.com/png.latex?a(s)"> is a first-order cascade, so the outlet is a quadrature: no grid, no operator, no linear solve in common with the finite-volume bed. Both refinement axes are swept separately, each with the other axis’s error cancelled, and the two solvers of the bed’s fluid equation are compared.</li>
<li><strong>Every reactor against the paper’s own closed forms.</strong> Eqs. (15), (19),
<ol start="22" type="1">
<li>and (28)–(31) are exact solutions of the very systems solved here, for the illustrative first-order case; they are the strongest available check and they are the paper’s, not this page’s.</li>
</ol></li>
<li><strong>A defect-injection table</strong>, with a row for every reported metric.</li>
<li><strong>The pseudo-steady assumption itself</strong>, dropped and costed.</li>
</ol>
<div id="ee66cd34" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:44.830433Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:44.830301Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:51:44.973905Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:51:44.973204Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(1a) SPATIAL order, isolated: frozen a(s), bed outlet vs exact quadrature."""</span></span>
<span id="cb34-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> cumulative_simpson <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> _csimp</span>
<span id="cb34-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> exact_outlet(kappa, n, afun, ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20001</span>):</span>
<span id="cb34-4">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, ns)</span>
<span id="cb34-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _cascade(np.concatenate(([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], _csimp(afun(s), x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s))), kappa, n)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb34-6"></span>
<span id="cb34-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> frozen_outlet(m, kappa, n, afun, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb34-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Outlet concentration of the bed at a frozen activity profile."""</span></span>
<span id="cb34-9">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(m, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb34-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> b.outlet(b.steady_c(kappa, afun(b.s_c), n))</span>
<span id="cb34-11"></span>
<span id="cb34-12">FROZEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a = e^{-3s}"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exp"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s)),</span>
<span id="cb34-13">          (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a = 0.2 + 0.8 s^2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quad"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb34-14">rows, SPATIAL_BROKEN, SPATIAL_BROKEN_LABEL, FINEST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}, {}, []</span>
<span id="cb34-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, tag, afun <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FROZEN:</span>
<span id="cb34-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb34-17">        ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> exact_outlet(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, n_, afun)</span>
<span id="cb34-18">        errs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb34-19">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>):</span>
<span id="cb34-20">            errs.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(frozen_outlet(m, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, n_, afun) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref))</span>
<span id="cb34-21">            rows.append([label, n_, m, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb34-22">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log2(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb34-23">        key <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb34-24">        M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_err_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb34-25">        M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb34-26">        FINEST.append(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb34-27">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows: the error one grid coarser, and the observed order with</span></span>
<span id="cb34-28">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first-order upwind convection</span></span>
<span id="cb34-29">        SPATIAL_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_err_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(errs[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb34-30">        SPATIAL_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_err_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the error read on 200 cells"</span></span>
<span id="cb34-31">        e_up <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(frozen_outlet(mm, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, n_, afun, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> mm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)]</span>
<span id="cb34-32">        SPATIAL_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(e_up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e_up[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb34-33">        SPATIAL_BROKEN_LABEL[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind convection (Bed(..., limiter=None))"</span></span>
<span id="cb34-34">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Spatial convergence of the pymrm bed against the quadrature "</span></span>
<span id="cb34-35">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(activity frozen, so no time error can leak in):**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb34-36">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(rows,</span>
<span id="cb34-37">                                          columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"frozen a(s)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells m"</span>,</span>
<span id="cb34-38">                                                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|outlet error|"</span>,</span>
<span id="cb34-39">                                                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order"</span>]))))</span>
<span id="cb34-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the round-off of these errors: the newton/deferred gap of the fluid solve</span></span>
<span id="cb34-41">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_spatial_finest_over_roundoff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(FINEST) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_frozen"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>))</span>
<span id="cb34-42">_bl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, route<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred"</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb34-43">GAP_LOOSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_bl.steady_c(BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _bl.s_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _cn)))</span>
<span id="cb34-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Second order at both reaction orders, with the outlet read on the "</span></span>
<span id="cb34-45">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated outlet face. The smallest of these errors is "</span></span>
<span id="cb34-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_spatial_finest_over_roundoff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the newton/deferred gap "</span></span>
<span id="cb34-47">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of the fluid solve (at least 1e3)."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Spatial convergence of the pymrm bed against the quadrature (activity frozen, so no time error can leak in):</strong></p>
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th>frozen a(s)</th>
<th>n</th>
<th>cells m</th>
<th></th>
<th>outlet error</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>a = e^{-3s}</td>
<td>1.0</td>
<td>25</td>
<td>1.659e-04</td>
<td></td>
</tr>
<tr class="even">
<td>a = e^{-3s}</td>
<td>1.0</td>
<td>50</td>
<td>3.920e-05</td>
<td>2.08</td>
</tr>
<tr class="odd">
<td>a = e^{-3s}</td>
<td>1.0</td>
<td>100</td>
<td>9.480e-06</td>
<td>2.05</td>
</tr>
<tr class="even">
<td>a = e^{-3s}</td>
<td>1.0</td>
<td>200</td>
<td>2.328e-06</td>
<td>2.03</td>
</tr>
<tr class="odd">
<td>a = e^{-3s}</td>
<td>1.0</td>
<td>400</td>
<td>5.765e-07</td>
<td>2.01</td>
</tr>
<tr class="even">
<td>a = e^{-3s}</td>
<td>2.0</td>
<td>25</td>
<td>1.077e-04</td>
<td></td>
</tr>
<tr class="odd">
<td>a = e^{-3s}</td>
<td>2.0</td>
<td>50</td>
<td>2.323e-05</td>
<td>2.21</td>
</tr>
<tr class="even">
<td>a = e^{-3s}</td>
<td>2.0</td>
<td>100</td>
<td>5.284e-06</td>
<td>2.14</td>
</tr>
<tr class="odd">
<td>a = e^{-3s}</td>
<td>2.0</td>
<td>200</td>
<td>1.251e-06</td>
<td>2.08</td>
</tr>
<tr class="even">
<td>a = e^{-3s}</td>
<td>2.0</td>
<td>400</td>
<td>3.038e-07</td>
<td>2.04</td>
</tr>
<tr class="odd">
<td>a = 0.2 + 0.8 s^2</td>
<td>1.0</td>
<td>25</td>
<td>4.369e-05</td>
<td></td>
</tr>
<tr class="even">
<td>a = 0.2 + 0.8 s^2</td>
<td>1.0</td>
<td>50</td>
<td>1.007e-05</td>
<td>2.12</td>
</tr>
<tr class="odd">
<td>a = 0.2 + 0.8 s^2</td>
<td>1.0</td>
<td>100</td>
<td>2.414e-06</td>
<td>2.06</td>
</tr>
<tr class="even">
<td>a = 0.2 + 0.8 s^2</td>
<td>1.0</td>
<td>200</td>
<td>5.907e-07</td>
<td>2.03</td>
</tr>
<tr class="odd">
<td>a = 0.2 + 0.8 s^2</td>
<td>1.0</td>
<td>400</td>
<td>1.461e-07</td>
<td>2.02</td>
</tr>
<tr class="even">
<td>a = 0.2 + 0.8 s^2</td>
<td>2.0</td>
<td>25</td>
<td>1.722e-05</td>
<td></td>
</tr>
<tr class="odd">
<td>a = 0.2 + 0.8 s^2</td>
<td>2.0</td>
<td>50</td>
<td>3.884e-06</td>
<td>2.15</td>
</tr>
<tr class="even">
<td>a = 0.2 + 0.8 s^2</td>
<td>2.0</td>
<td>100</td>
<td>9.218e-07</td>
<td>2.07</td>
</tr>
<tr class="odd">
<td>a = 0.2 + 0.8 s^2</td>
<td>2.0</td>
<td>200</td>
<td>2.245e-07</td>
<td>2.04</td>
</tr>
<tr class="even">
<td>a = 0.2 + 0.8 s^2</td>
<td>2.0</td>
<td>400</td>
<td>5.541e-08</td>
<td>2.02</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Second order at both reaction orders, with the outlet read on the extrapolated outlet face. The smallest of these errors is 4e+05 times the newton/deferred gap of the fluid solve (at least 1e3).</code></pre>
</div>
</div>
<div id="7ee03d91" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:51:44.976873Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:51:44.976736Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:52:06.414090Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:52:06.412914Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(1b) TEMPORAL and SPATIAL order of the full march, each with the other axis's</span></span>
<span id="cb36-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">error cancelled, and the production setting against the quadrature."""</span></span>
<span id="cb36-3">args <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>])</span>
<span id="cb36-4"></span>
<span id="cb36-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> x_history(nt, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb36-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Outlet conversion at the 41 observation times (all on the step grid)."""</span></span>
<span id="cb36-7">    scheme <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kw.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scheme"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>)</span>
<span id="cb36-8">    on_grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kw.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"on_grid"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb36-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Bed(m, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nt,</span>
<span id="cb36-10">                              scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>scheme, on_grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>on_grid)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-11"></span>
<span id="cb36-12">NTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">320</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">640</span>)        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># multiples of 40: every observation time is a step</span></span>
<span id="cb36-13">OT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {s: observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> nt: x_history(nt, scheme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s), NTS) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler"</span>)}</span>
<span id="cb36-14">OXM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: x_history(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>))</span>
<span id="cb36-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler"</span>):</span>
<span id="cb36-16">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(OT[s][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-17">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(OT[s][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-18">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_space_order_march_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(OXM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-19">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_space_order_march_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(OXM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-20">_dT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(OT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> OT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])))</span>
<span id="cb36-21">_dX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(OXM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> OXM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])))</span>
<span id="cb36-22">XN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BED.march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-23">XD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, route<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred"</span>).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-24">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_march"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(XN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XD)))</span>
<span id="cb36-25">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_axes_finest_over_roundoff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_dT, _dX) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_march"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>))</span>
<span id="cb36-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the round-off of the section-6 ladders: the same newton/deferred gap of the march</span></span>
<span id="cb36-27"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _lad <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>):</span>
<span id="cb36-28">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inlet_cellcentre'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inlet'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'outlet_'</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _lad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_finest_over_roundoff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb36-29">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(FINEST6[_lad]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_march"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>))</span>
<span id="cb36-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The finest changes of the section-6 ladders are at least 1e3 times the "</span></span>
<span id="cb36-31">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton/deferred gap of the march (here "</span></span>
<span id="cb36-32">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_route_gap_march'</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FINEST6.items())</span>
<span id="cb36-33">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" times)."</span>)</span>
<span id="cb36-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time alone (m = 200, nt = 40..640), Heun:  orders "</span></span>
<span id="cb36-35">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time alone (m = 200, nt = 40..640), Euler: orders "</span></span>
<span id="cb36-37">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space alone (nt = 80, m = 50..800):        orders "</span></span>
<span id="cb36-39">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OXM[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the newton and deferred-correction routes give the same production "</span></span>
<span id="cb36-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"conversion history to below 1e-10 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_route_gap_march'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); "</span></span>
<span id="cb36-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the finest differences of both ladders are at least 1e3 times that "</span></span>
<span id="cb36-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_axes_finest_over_roundoff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times)."</span>)</span>
<span id="cb36-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows of the ladders</span></span>
<span id="cb36-45">OT_OFFGRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> nt: x_history(nt, on_grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>))</span>
<span id="cb36-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"for contrast, the conversion history interpolated between steps "</span></span>
<span id="cb36-47">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(nt = 25..400, where 25, 50 and 100 steps miss observation times): orders "</span></span>
<span id="cb36-48">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OT_OFFGRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb36-49">OXM_UP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: x_history(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>))</span>
<span id="cb36-50">XD_LOOSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, route<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred"</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-51">GAP_MARCH_LOOSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(XN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XD_LOOSE)))</span>
<span id="cb36-52">XD_LOOSER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, route<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred"</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-53">GAP_MARCH_LOOSER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(XN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> XD_LOOSER)))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the inlet ladder's finest change is only 1.8e3 times the 1e-4 gap</span></span>
<span id="cb36-54"></span>
<span id="cb36-55">ref_par <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugExact(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">161</span>).run(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-56">ref_ser <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PlugExact(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">161</span>).run(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb36-57">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(XN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_par[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])))</span>
<span id="cb36-58">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_over_resolution"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RES_X)</span>
<span id="cb36-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"production bed (m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, nt = 200) vs the quadrature over theta &gt; 0 "</span></span>
<span id="cb36-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(at theta = 0 the bed is fresh and both classes share one profile): "</span></span>
<span id="cb36-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_vs_quadrature_production'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in conversion, a fraction "</span></span>
<span id="cb36-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_vs_quadrature_over_resolution'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> resolution "</span></span>
<span id="cb36-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the separability verdicts are read at. That is what licenses the sweep "</span></span>
<span id="cb36-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"to run on the quadrature."</span>)</span>
<span id="cb36-65">Xser, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BED.march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb36-66">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_series"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xser[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_ser[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])))</span>
<span id="cb36-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"same, series (ascending profile): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bed_vs_quadrature_series'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The finest changes of the section-6 ladders are at least 1e3 times the newton/deferred gap of the march (here inlet 5e+10, space 3e+08, time 8e+08 times).
time alone (m = 200, nt = 40..640), Heun:  orders 1.9911, 1.9956, 1.9978
time alone (m = 200, nt = 40..640), Euler: orders 1.0035, 1.0015, 1.0007
space alone (nt = 80, m = 50..800):        orders 2.0111, 2.0055, 2.0027
the newton and deferred-correction routes give the same production conversion history to below 1e-10 (here 9e-16); the finest differences of both ladders are at least 1e3 times that (here 3e+08 times).
for contrast, the conversion history interpolated between steps (nt = 25..400, where 25, 50 and 100 steps miss observation times): orders 1.96, 1.99, 3.52
production bed (m = 200, nt = 200) vs the quadrature over theta &gt; 0 (at theta = 0 the bed is fresh and both classes share one profile): 1.53e-06 in conversion, a fraction 7.6e-04 of the 0.002 resolution the separability verdicts are read at. That is what licenses the sweep to run on the quadrature.
same, series (ascending profile): 1.53e-06</code></pre>
</div>
</div>
<div id="9c0e054f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:52:06.417194Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:52:06.416986Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:52:07.069380Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:52:07.068564Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(2) Every device against the PAPER'S OWN closed forms, eqs. (15), (19), (22),</span></span>
<span id="cb38-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(28)-(31).  These are exact solutions of the systems being solved, printed in</span></span>
<span id="cb38-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">1972; they share no code with anything above."""</span></span>
<span id="cb38-4">kap, lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first-order reaction, first-order decay, n' = 0</span></span>
<span id="cb38-5">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb38-6"></span>
<span id="cb38-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (15): batch fluid.  k'' t_obs = kap_b, k_d t_obs = lam</span></span>
<span id="cb38-8">Xb, ab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_batch(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, lam, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-9">cb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xb</span>
<span id="cb38-10">c_inf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam)</span>
<span id="cb38-11">lhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(np.log(cb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c_inf))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c_inf)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH</span>
<span id="cb38-12">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq15_maxdev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rhs)))</span>
<span id="cb38-13">CF_BROKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq15_maxdev"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH))))}</span>
<span id="cb38-14">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(15)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch fluid, Fig. 2"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-7 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq15_maxdev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>])</span>
<span id="cb38-15"></span>
<span id="cb38-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (19): mixed flow, constant rate</span></span>
<span id="cb38-17">Xm, am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_mixed(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, lam, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-18">cm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xm</span>
<span id="cb38-19">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq19_maxdev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-20">                                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log(kap) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH))))</span>
<span id="cb38-21">CF_BROKEN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq19_maxdev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-22">                                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log(kap) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH))))</span>
<span id="cb38-23">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(19)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed flow, Fig. 3"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-7 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq19_maxdev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>])</span>
<span id="cb38-24"></span>
<span id="cb38-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (22): plug flow, constant rate - the pymrm BED, not the quadrature</span></span>
<span id="cb38-26">Xp, Ap, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BED.march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, lam, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb38-27">cp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Xp</span>
<span id="cb38-28">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_maxdev_pymrm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cp))</span>
<span id="cb38-29">                                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log(kap) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH))))</span>
<span id="cb38-30">CF_BROKEN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22_maxdev_pymrm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cp))</span>
<span id="cb38-31">                                                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log(kap) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH))))</span>
<span id="cb38-32">rows.append([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(22)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug flow, Fig. 4 - solved on the pymrm bed"</span>,</span>
<span id="cb38-33">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq22_maxdev_pymrm'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb38-34"></span>
<span id="cb38-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eqs. (28)-(31): the held-C_A device at d = 0, 1, 2, 3.  lam_c &lt; 1 so that the</span></span>
<span id="cb38-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d = 0 branch, where the activity reaches zero at k'_d t = 1, stays alive across</span></span>
<span id="cb38-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the whole window - the branch is exercised, not stepped over.</span></span>
<span id="cb38-38">cs, lam_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span></span>
<span id="cb38-39">Qd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cs) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> cs)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (C_A0 - C_A)/k' in tau'_ref units</span></span>
<span id="cb38-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dv, form <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1/tau'"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ln tau'"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tau'"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(tau')^2"</span>)):</span>
<span id="cb38-41">    tau, aa <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, lam_c, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dv), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, cs, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb38-43">        lhs, rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tau, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Qd) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lam_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH)</span>
<span id="cb38-44">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb38-45">        lhs, rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(tau), np.log(Qd) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> lam_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH</span>
<span id="cb38-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:</span>
<span id="cb38-47">        lhs, rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tau, Qd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> lam_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH)</span>
<span id="cb38-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb38-49">        lhs, rhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tau <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, Qd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TH)</span>
<span id="cb38-50">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lhs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rhs)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rhs)))</span>
<span id="cb38-51">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_reldev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev</span>
<span id="cb38-52">    M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a_end_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_branch"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(aa[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb38-53">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows: the closed form with k'_d off by 1 % (same lam_c in the run),</span></span>
<span id="cb38-54">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the branch activity with lam_c raised by a quarter</span></span>
<span id="cb38-55">    tau_b, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> run_const_c(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_c, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dv), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, cs, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb38-56">    lhs_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tau_b, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>: np.log(tau_b), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>: tau_b, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>: tau_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>}[dv]</span>
<span id="cb38-57">    CF_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_reldev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lhs_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rhs))</span>
<span id="cb38-58">                                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rhs)))</span>
<span id="cb38-59">    CF_BROKEN[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a_end_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_branch"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(run_const_c(</span>
<span id="cb38-60">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.25</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam_c, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(dv), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, cs, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb38-61">    rows.append([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"held C_A, d = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dv<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>form<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> linear in t)"</span>,</span>
<span id="cb38-62">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-7 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>])</span>
<span id="cb38-63">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**The paper's own closed forms, met by the reactors solved "</span></span>
<span id="cb38-64">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"here** (max deviation; relative for eqs. 28-31)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb38-65">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed eq."</span>,</span>
<span id="cb38-66">                                                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"device / branch"</span>,</span>
<span id="cb38-67">                                                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deviation"</span>]))))</span>
<span id="cb38-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"All four printed branches of the deactivation order (d = 0, 1, 2, 3) are "</span></span>
<span id="cb38-69">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exercised on a LIVE activity: a(theta = 1) = "</span></span>
<span id="cb38-70">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'a_end_d</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>j<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_branch'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb38-71">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" for d = 0, 1, 2, 3.  d = 0 is the branch on which the activity reaches "</span></span>
<span id="cb38-72">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zero in finite time (at k'_d t = 1); the window stops short of it."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The paper’s own closed forms, met by the reactors solved here</strong> (max deviation; relative for eqs. 28-31)</p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>printed eq.</th>
<th>device / branch</th>
<th>deviation</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>(15)</td>
<td>batch fluid, Fig. 2</td>
<td>below 1e-7 (here 8.6e-09)</td>
</tr>
<tr class="even">
<td>(19)</td>
<td>mixed flow, Fig. 3</td>
<td>below 1e-7 (here 2.7e-15)</td>
</tr>
<tr class="odd">
<td>(22)</td>
<td>plug flow, Fig. 4 - solved on the pymrm bed</td>
<td>3.01e-06</td>
</tr>
<tr class="even">
<td>(28)</td>
<td>held C_A, d = 0 (1/tau’ linear in t)</td>
<td>below 1e-7 (here 1.4e-16)</td>
</tr>
<tr class="odd">
<td>(29)</td>
<td>held C_A, d = 1 (ln tau’ linear in t)</td>
<td>below 1e-7 (here 3.3e-16)</td>
</tr>
<tr class="even">
<td>(30)</td>
<td>held C_A, d = 2 (tau’ linear in t)</td>
<td>below 1e-7 (here 2.0e-16)</td>
</tr>
<tr class="odd">
<td>(31)</td>
<td>held C_A, d = 3 ((tau’)^2 linear in t)</td>
<td>below 1e-7 (here 2.2e-16)</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>All four printed branches of the deactivation order (d = 0, 1, 2, 3) are exercised on a LIVE activity: a(theta = 1) = 0.200, 0.449, 0.556, 0.620 for d = 0, 1, 2, 3.  d = 0 is the branch on which the activity reaches zero in finite time (at k'_d t = 1); the window stops short of it.</code></pre>
</div>
</div>
<div id="5d017420" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:52:07.072227Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:52:07.072045Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:52:18.727874Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:52:18.726851Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(4) The paper's pseudo-steady assumption (p. 269), dropped and costed.</span></span>
<span id="cb40-2"></span>
<span id="cb40-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">eps = (fluid residence time)/(observation window).  The bed is re-solved with</span></span>
<span id="cb40-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">eps dc/dtheta retained, on the same operators; the deviation from the</span></span>
<span id="cb40-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">pseudo-steady answer is root-found against the conversion resolution."""</span></span>
<span id="cb40-6">BEDT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eps study: the O(eps) term, not the grid</span></span>
<span id="cb40-7">NT_PS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eps = 0 reference: its time error is far below the cost</span></span>
<span id="cb40-8">X_PS, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BEDT.march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NT_PS)</span>
<span id="cb40-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pseudo_steady_cost(eps, cls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb40-10">    Xt, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BEDT.transient(cls, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, eps, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>])</span>
<span id="cb40-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (X_PS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> ref <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> ref))))</span>
<span id="cb40-12"></span>
<span id="cb40-13">eps_grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-2</span>])</span>
<span id="cb40-14">cost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([pseudo_steady_cost(e) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> eps_grid])</span>
<span id="cb40-15">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps1e-3"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cost[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb40-16">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps3e-2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cost[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb40-17">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_slope"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(eps_grid[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]),</span>
<span id="cb40-18">                                                 np.log(cost[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb40-19">eps_star <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> e: pseudo_steady_cost(np.exp(e)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RES_X,</span>
<span id="cb40-20">                  np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>), np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-2</span>), xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb40-21">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_eps_star"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(eps_star))</span>
<span id="cb40-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows: the slope with the accumulation term scaled by sqrt(eps) instead</span></span>
<span id="cb40-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># of eps (a wrong time scale); the slope against an eps = 0 reference marched in</span></span>
<span id="cb40-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 200 steps; and eps* read at half the resolution off the grid</span></span>
<span id="cb40-25">PS_SLOPE_SQRT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(eps_grid[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]),</span>
<span id="cb40-26">                                 np.log([pseudo_steady_cost(np.sqrt(e))</span>
<span id="cb40-27">                                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> eps_grid[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb40-28">_X200 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BEDT.march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>args, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb40-29">PS_SLOPE_REF200 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(eps_grid[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]),</span>
<span id="cb40-30">                                   np.log([pseudo_steady_cost(e, ref<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_X200)</span>
<span id="cb40-31">                                           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> eps_grid[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb40-32">PS_EPS_HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.interp(np.log(RES_X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), np.log(cost),</span>
<span id="cb40-33">                                     np.log(eps_grid))))</span>
<span id="cb40-34">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.1</span>))</span>
<span id="cb40-35">ax.loglog(eps_grid, cost, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072B2"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb40-36">ax.axhline(RES_X, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb40-37">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"conversion resolution </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-38">ax.axvline(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_eps_star"</span>], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#D55E00"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb40-39">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\v</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">arepsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pseudo_steady_eps_star'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-40">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\v</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">arepsilon</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = fluid residence time / observation window"</span>)</span>
<span id="cb40-41">ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max error in $X_A$ from the</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pseudo-steady assumption"</span>)</span>
<span id="cb40-42">ax.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb40-43">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb40-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cost is first order in eps (slope </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pseudo_steady_cost_slope'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over "</span></span>
<span id="cb40-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eps = 1e-4 to 3e-3, against an eps = 0 reference marched in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_PS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> steps; "</span></span>
<span id="cb40-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"against one marched in 200 steps the slope reads </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PS_SLOPE_REF200<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb40-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"because that reference's time error is part of the smallest costs), and "</span></span>
<span id="cb40-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"crosses the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RES_X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> conversion resolution at "</span></span>
<span id="cb40-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eps* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pseudo_steady_eps_star'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb40-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Read as the paper reads it (p. 267): with a fluid residence time of 1 s, "</span></span>
<span id="cb40-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the assumption is worth its own error bar once the run lasts longer than "</span></span>
<span id="cb40-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pseudo_steady_eps_star'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s = "</span></span>
<span id="cb40-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pseudo_steady_eps_star'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min, the boundary the paper "</span></span>
<span id="cb40-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"draws in words: </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Deactivation in the order of minutes or longer can use "</span></span>
<span id="cb40-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the fixed batch of solids.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-56">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps1e-3"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps1e-3"</span>],</span>
<span id="cb40-57">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"raise eps 30x, to 3e-2"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps3e-2"</span>],</span>
<span id="cb40-58">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the assumption's cost is first order in eps and does move"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.3-levenspiel-deactivation-classes/index_files/figure-html/cell-19-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>cost is first order in eps (slope 1.000 over eps = 1e-4 to 3e-3, against an eps = 0 reference marched in 1600 steps; against one marched in 200 steps the slope reads 1.009, because that reference's time error is part of the smallest costs), and crosses the 0.002 conversion resolution at eps* = 4.30e-03.
Read as the paper reads it (p. 267): with a fluid residence time of 1 s, the assumption is worth its own error bar once the run lasts longer than 233 s = 4 min, the boundary the paper draws in words: "Deactivation in the order of minutes or longer can use the fixed batch of solids."</code></pre>
</div>
</div>
<section id="the-break-table" class="level3">
<h3 class="anchored" data-anchor-id="the-break-table">The break table</h3>
<p>Every reported number needs something that moves it. The table below holds the defects injected into the model and the solver; the claims cell after it wires those rows, and the breaks computed beside each result above, to the claim each one must fail. A claim that no row can move is an identity, and it is named as structural there.</p>
<div id="6526b2f1" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:52:18.730249Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:52:18.730119Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:52:22.649685Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:52:22.648645Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb42-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Defect injection: break something on purpose, watch the number move."""</span></span>
<span id="cb42-2">kap, lam, dv, npv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>]</span>
<span id="cb42-3"></span>
<span id="cb42-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) wrong nu in construct_div: cylindrical instead of Cartesian weight coord</span></span>
<span id="cb42-5">Xnu, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kap, lam, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb42-6">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>],</span>
<span id="cb42-7">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bed(200, nu=1): cylindrical, not the Cartesian weight coordinate"</span>,</span>
<span id="cb42-8">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xnu[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_par[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wrong geometry flag nu = 1 (inlet face area zero, feed cut off)"</span>))</span>
<span id="cb42-9"></span>
<span id="cb42-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) first-order upwind: no limiter</span></span>
<span id="cb42-11">Xtvd, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kap, lam, dv, npv,</span>
<span id="cb42-12">                                          n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb42-13">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>],</span>
<span id="cb42-14">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bed(200, limiter=None): first-order upwind"</span>,</span>
<span id="cb42-15">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xtvd[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_par[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]))), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer limiter removed"</span>))</span>
<span id="cb42-16"></span>
<span id="cb42-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (c) Euler instead of Heun on the activity: ORDER against ORDER, on the same</span></span>
<span id="cb42-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ladder.  Setting an order against an ERROR cannot fail, because they are</span></span>
<span id="cb42-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># different quantities.</span></span>
<span id="cb42-20">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_heun_min"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_heun_min"</span>],</span>
<span id="cb42-21">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"march(..., scheme='euler') on the same ladder (m = 200, nt = 40..640)"</span>,</span>
<span id="cb42-22">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_euler_min"</span>],</span>
<span id="cb42-23">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed order against observed order: 2 -&gt; 1"</span>))</span>
<span id="cb42-24"></span>
<span id="cb42-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (d) the inlet boundary condition flipped to zero-gradient</span></span>
<span id="cb42-26">Xbc, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Bed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, feed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).march(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kap, lam, dv, npv, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb42-27">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_production"</span>],</span>
<span id="cb42-28">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bed(200, feed=False): inlet {a:1,b:0,d:0}, feed not imposed"</span>,</span>
<span id="cb42-29">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xbc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_par[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]))),</span>
<span id="cb42-30">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary condition on the outward normal. Not independent "</span></span>
<span id="cb42-31">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evidence from row (a): with nu = 1 the inlet face has zero "</span></span>
<span id="cb42-32">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area, so an un-fed bed and a bed with the wrong nu reach the "</span></span>
<span id="cb42-33">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same answer"</span>))</span>
<span id="cb42-34"></span>
<span id="cb42-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (e) the four rate forms, swapped one for another (the wrong-class injection)</span></span>
<span id="cb42-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>):</span>
<span id="cb42-37">    y_true <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kap, lam, dv, npv, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>],</span>
<span id="cb42-38">                     c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb42-39">    y_wrong <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(cfg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, kap, lam, dv, npv, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>],</span>
<span id="cb42-40">                      c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb42-41">    BREAKS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_par_vs_ser"</span>, M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_par_vs_ser"</span>],</span>
<span id="cb42-42">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"use eq. (5) where eq. (4) is true, WITHOUT refitting"</span>,</span>
<span id="cb42-43">                   <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((y_wrong <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y_true) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb42-44">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the unfitted gap - the fitted one is the metric itself"</span>))</span>
<span id="cb42-45"></span>
<span id="cb42-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (f) transcription: a mis-read subscript in eq. (5), C_R read as C_A</span></span>
<span id="cb42-47">y_true <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, kap, lam, dv, npv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb42-48">y_typo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kap, lam, dv, npv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb42-49">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_nonzero"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,</span>
<span id="cb42-50">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (5) transcribed with C_A for C_R (one subscript)"</span>,</span>
<span id="cb42-51">               <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean((y_typo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y_true) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb42-52">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reported as the response gap; the symbolic residual is the guard"</span>))</span>
<span id="cb42-53"></span>
<span id="cb42-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (g) the n' = 0 collapse, broken by giving the decay a concentration</span></span>
<span id="cb42-55">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_nprime0_plug"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_nprime0_plug"</span>],</span>
<span id="cb42-56">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"give the decay a concentration order n' = 0.7"</span>,</span>
<span id="cb42-57">               M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_nprime0_off_condition"</span>],</span>
<span id="cb42-58">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the collapse is exactly at n' = 0 and nowhere else"</span>))</span>
<span id="cb42-59"></span>
<span id="cb42-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (h) the fitter itself: widen the multistart on the entry that carries the</span></span>
<span id="cb42-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plug-flow count of 1 (parallel truth, independent candidate, 2.2e-3)</span></span>
<span id="cb42-62">y_true <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, kap, lam, dv, npv, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>],</span>
<span id="cb42-63">                 c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb42-64">big <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _seeds(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, lam) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [[np.log(kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f), np.log(lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g), dvv]</span>
<span id="cb42-65">                                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>)</span>
<span id="cb42-66">                                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> dvv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>)]</span>
<span id="cb42-67">D_big <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_class(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, y_true, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, kap, lam, seeds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>big, keep<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb42-68">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_plug_par_vs_ind"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_plug_par_vs_ind"</span>],</span>
<span id="cb42-69">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"multistart widened from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_seeds(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'independent'</span>, kap, lam))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to "</span></span>
<span id="cb42-70">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(big)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> seeds"</span>, D_big,</span>
<span id="cb42-71">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ROBUSTNESS (must NOT move): a separability number is an UPPER "</span></span>
<span id="cb42-72">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound, and this bounds the bound - a lower value here would mean "</span></span>
<span id="cb42-73">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the headline overstates the separation"</span>))</span>
<span id="cb42-74">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_plug_par_vs_ind_wideseed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(D_big)</span>
<span id="cb42-75"></span>
<span id="cb42-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (i) the resolution the verdicts are read at - ONE ROW PER DEVICE, so that the</span></span>
<span id="cb42-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># three counts carrying the page's negative headline (batch, mixed, constC) each</span></span>
<span id="cb42-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># have a mover of their own.  The alternative resolution is chosen per device to</span></span>
<span id="cb42-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># be one that actually moves that device's count.</span></span>
<span id="cb42-80"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg, alt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)):</span>
<span id="cb42-81">    BREAKS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_n_separable"</span>, N_SEP[cfg],</span>
<span id="cb42-82">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"read the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> matrix at resolution </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>alt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of "</span></span>
<span id="cb42-83">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'sep_threshold_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb42-84">                   <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb42-85">                             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> SEP[cfg][i, j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> alt)),</span>
<span id="cb42-86">                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the count is a function of the stated resolution, by design"</span>))</span>
<span id="cb42-87"></span>
<span id="cb42-88"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and the held-C_A count needs a PHYSICAL injection, because no resolution</span></span>
<span id="cb42-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># moves it: every pair in that device is exactly degenerate at the base point.</span></span>
<span id="cb42-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Degeneracy 3's fourth member holds only at d = 1 (the poison consumed per unit</span></span>
<span id="cb42-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># time goes as a^(d-1)), so d = 2 is where side-by-side leaves the collapse.</span></span>
<span id="cb42-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Where an identity of sec. 4 still applies the twin is used, so this costs</span></span>
<span id="cb42-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># three fits, not sixteen.</span></span>
<span id="cb42-94"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> constC_count_at(d_inj, res):</span>
<span id="cb42-95">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(BASE, d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d_inj)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> cnt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb42-96">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, truth <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb42-97">        y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> respond(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>, truth, b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>], b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>], b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nprime"</span>],</span>
<span id="cb42-98">                    b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sig"</span>], n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>])</span>
<span id="cb42-99">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, cand <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb42-100">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> j:</span>
<span id="cb42-101">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb42-102">            v, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> twin_residual(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>, truth, cand, b, BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>])</span>
<span id="cb42-103">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb42-104">                v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_class(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>, y, cand, b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kappa"</span>], b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam"</span>],</span>
<span id="cb42-105">                              n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], c_set<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c_set"</span>],</span>
<span id="cb42-106">                              tag<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC-d2"</span>, truth, cand))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb42-107">            cnt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> res)</span>
<span id="cb42-108">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cnt)</span>
<span id="cb42-109">CONSTC_ALT_RES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span></span>
<span id="cb42-110">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_constC_n_separable"</span>, N_SEP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>],</span>
<span id="cb42-111">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"move the held-C_A device to d = 2, where the a^(d-1) "</span></span>
<span id="cb42-112">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cancellation that pins C_P fails, AND read at "</span></span>
<span id="cb42-113">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CONSTC_ALT_RES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb42-114">               constC_count_at(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, CONSTC_ALT_RES),</span>
<span id="cb42-115">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COMPOUND, and deliberately so: at the page's own 1e-2 "</span></span>
<span id="cb42-116">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution this count stays 0 for every d tried, because the "</span></span>
<span id="cb42-117">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collapse of parallel/series/independent is exact at any d and "</span></span>
<span id="cb42-118">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"only side-by-side ever leaves it"</span>))</span>
<span id="cb42-119"></span>
<span id="cb42-120">df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAKS, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as built"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"injected defect"</span>,</span>
<span id="cb42-121">                                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"with the defect"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"note"</span>])</span>
<span id="cb42-122">df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(nn).startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ROBUSTNESS"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mover"</span></span>
<span id="cb42-123">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"note"</span>]]</span>
<span id="cb42-124">df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves?"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(b) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span></span>
<span id="cb42-125">                           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b)))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no"</span>)</span>
<span id="cb42-126">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as built"</span>], df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"with the defect"</span>])]</span>
<span id="cb42-127"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed to four figures, and round-off-sized numbers as the bound they are</span></span>
<span id="cb42-128"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># checked at, so the table reads the same on every machine</span></span>
<span id="cb42-129">_show <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.copy()</span>
<span id="cb42-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as built"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"with the defect"</span>):</span>
<span id="cb42-131">    _show[col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;1e-8"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb42-132">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> df[col]]</span>
<span id="cb42-133">display(Markdown(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"**Defect-injection table**</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> md_table(_show)))</span>
<span id="cb42-134">movers <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mover"</span>]</span>
<span id="cb42-135"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> (movers[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves?"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(), movers[movers[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves?"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>]</span>
<span id="cb42-136">rob <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[df[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness"</span>]</span>
<span id="cb42-137"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(rob[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as built"</span>], rob[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"with the defect"</span>]):</span>
<span id="cb42-138">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"robustness row improved: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb42-139"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(movers)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> injected defects, every one of which moves its metric; "</span></span>
<span id="cb42-140">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(rob)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> robustness row(s), which must NOT move and do not "</span></span>
<span id="cb42-141">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(worst change </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>((<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(rob[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as built'</span>], rob[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'with the defect'</span>])), default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb42-142">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break_rows"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(movers))</span>
<span id="cb42-143">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break_robustness_rows"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(rob))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Defect-injection table</strong></p>
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
<col style="width: 14%">
</colgroup>
<thead>
<tr class="header">
<th>metric</th>
<th>as built</th>
<th>injected defect</th>
<th>with the defect</th>
<th>note</th>
<th>kind</th>
<th>moves?</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>eq24_numeric_offset</td>
<td>1.05</td>
<td>read eq. (24) as if it printed 1/k</td>
<td>0</td>
<td>the defect metric is exactly the printed-vs-required gap</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>degen_batch_sbs_is_parallel_on_condition</td>
<td>0</td>
<td>step off the n’ = n, d = 1 condition (d = 2)</td>
<td>0.0166</td>
<td>shows the identity is conditional, not a numerical artefact</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>degen_sbs_is_parallel_famB_plug</td>
<td>&lt;1e-8</td>
<td>evaluate the same sigma-family identity in the MIXED reactor</td>
<td>0.1185</td>
<td>degeneracy 5 is a property of the batch and the bed only</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>degen_mixed_series_is_parallel</td>
<td>&lt;1e-8</td>
<td>tighten the integrator from rtol 1e-9 to 1e-13</td>
<td>&lt;1e-8</td>
<td>the metric measures the ODE tolerance; the identity itself is exact</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>bed_a_outlet_spaceonly_par</td>
<td>0.1902</td>
<td>halve NT_CONV to 50 and report the space-Richardson alone</td>
<td>0.1902</td>
<td>the space-only reading IS a function of the step count, which is why it is not what is reported</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>bed_a_outlet_end_par</td>
<td>0.1902</td>
<td>read the time extrapolation off the nt = 50/100 pair instead of 100/200</td>
<td>0.1902</td>
<td>ROBUSTNESS (must NOT move): the reported outlet is the limit of the march, so which pair the limit is read from must not matter</td>
<td>robustness</td>
<td>no</td>
</tr>
<tr class="odd">
<td>bed_a_outlet_spaceonly_ser</td>
<td>0.1771</td>
<td>halve NT_CONV to 50 and report the space-Richardson alone</td>
<td>0.1771</td>
<td>the space-only reading IS a function of the step count, which is why it is not what is reported</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>bed_a_outlet_end_ser</td>
<td>0.1771</td>
<td>read the time extrapolation off the nt = 50/100 pair instead of 100/200</td>
<td>0.1771</td>
<td>ROBUSTNESS (must NOT move): the reported outlet is the limit of the march, so which pair the limit is read from must not matter</td>
<td>robustness</td>
<td>no</td>
</tr>
<tr class="odd">
<td>mixed_boundary_np1_d0.5</td>
<td>0.003055</td>
<td>move d back across the predicted boundary to d = 1.5</td>
<td>&lt;1e-8</td>
<td>the separability of the mixed reactor is switched by the analytic condition, in both directions</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>constC_span_prec5pct_max</td>
<td>0.3819</td>
<td>start the level set at C_A/C_A0 = 0.05 instead of 0.4</td>
<td>0.0725</td>
<td>the required span is set by the unprinted C_LO as much as by the demanded precision</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>constC_span_needed_prec5pct</td>
<td>0.2035</td>
<td>demand 2 % precision on k’_d instead of 5 %</td>
<td>0.1111</td>
<td>the required span is set by the precision, and moves with it</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>constC_sbs_recovered_d_base</td>
<td>1.383</td>
<td>set sigma = 0 (poison in such excess that C_P never moves)</td>
<td>2</td>
<td>the bias IS the poison consumption; with none, d comes back exactly</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>constC_sbs_bias_at_d1_max</td>
<td>&lt;1e-8</td>
<td>move off d = 1, where the a^(d-1) cancellation holds, to d = 2</td>
<td>0.4916</td>
<td>the blind spot is exactly at d = 1 and nowhere else</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>pseudo_steady_cost_eps1e-3</td>
<td>0.0004653</td>
<td>raise eps 30x, to 3e-2</td>
<td>0.01398</td>
<td>the assumption’s cost is first order in eps and does move</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>bed_vs_quadrature_production</td>
<td>1.529e-06</td>
<td>Bed(200, nu=1): cylindrical, not the Cartesian weight coordinate</td>
<td>0.8523</td>
<td>wrong geometry flag nu = 1 (inlet face area zero, feed cut off)</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>bed_vs_quadrature_production</td>
<td>1.529e-06</td>
<td>Bed(200, limiter=None): first-order upwind</td>
<td>0.001201</td>
<td>van Leer limiter removed</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>bed_time_order_heun_min</td>
<td>1.991</td>
<td>march(…, scheme=‘euler’) on the same ladder (m = 200, nt = 40..640)</td>
<td>1.001</td>
<td>observed order against observed order: 2 -&gt; 1</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>bed_vs_quadrature_production</td>
<td>1.529e-06</td>
<td>Bed(200, feed=False): inlet {a:1,b:0,d:0}, feed not imposed</td>
<td>0.8523</td>
<td>boundary condition on the outward normal. Not independent evidence from row (a): with nu = 1 the inlet face has zero area, so an un-fed bed and a bed with the wrong nu reach the same answer</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>sep_plug_par_vs_ser</td>
<td>0.0008066</td>
<td>use eq. (5) where eq. (4) is true, WITHOUT refitting</td>
<td>0.1606</td>
<td>the unfitted gap - the fitted one is the metric itself</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>sep_mixed_par_vs_ser</td>
<td>&lt;1e-8</td>
<td>use eq. (5) where eq. (4) is true, WITHOUT refitting</td>
<td>0.03641</td>
<td>the unfitted gap - the fitted one is the metric itself</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>printed_chain_nonzero</td>
<td>0</td>
<td>eq. (5) transcribed with C_A for C_R (one subscript)</td>
<td>0.1606</td>
<td>reported as the response gap; the symbolic residual is the guard</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>degen_nprime0_plug</td>
<td>0</td>
<td>give the decay a concentration order n’ = 0.7</td>
<td>1.42</td>
<td>the collapse is exactly at n’ = 0 and nowhere else</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>sep_plug_par_vs_ind</td>
<td>0.002202</td>
<td>multistart widened from 4 to 20 seeds</td>
<td>0.002202</td>
<td>ROBUSTNESS (must NOT move): a separability number is an UPPER bound, and this bounds the bound - a lower value here would mean the headline overstates the separation</td>
<td>robustness</td>
<td>no</td>
</tr>
<tr class="even">
<td>sep_plug_n_separable</td>
<td>1</td>
<td>read the plug matrix at resolution 0.0001 instead of 0.002</td>
<td>5</td>
<td>the count is a function of the stated resolution, by design</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>sep_batch_n_separable</td>
<td>0</td>
<td>read the batch matrix at resolution 0.0001 instead of 0.002</td>
<td>7</td>
<td>the count is a function of the stated resolution, by design</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="even">
<td>sep_mixed_n_separable</td>
<td>0</td>
<td>read the mixed matrix at resolution 0.0001 instead of 0.002</td>
<td>3</td>
<td>the count is a function of the stated resolution, by design</td>
<td>mover</td>
<td>yes</td>
</tr>
<tr class="odd">
<td>sep_constC_n_separable</td>
<td>0</td>
<td>move the held-C_A device to d = 2, where the a^(d-1) cancellation that pins C_P fails, AND read at 0.0001</td>
<td>3</td>
<td>COMPOUND, and deliberately so: at the page’s own 1e-2 resolution this count stays 0 for every d tried, because the collapse of parallel/series/independent is exact at any d and only side-by-side ever leaves it</td>
<td>mover</td>
<td>yes</td>
</tr>
</tbody>
</table>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>24 injected defects, every one of which moves its metric; 3 robustness row(s), which must NOT move and do not (worst change 2.4e-07).</code></pre>
</div>
</div>
<div id="0d1dd8df" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:52:22.652369Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:52:22.652237Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:52:22.687528Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:52:22.686674Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb44-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Claims: every published number, registered once with how it is checked.</span></span>
<span id="cb44-2"></span>
<span id="cb44-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">docs/claims-design.md.  A VALUE (a physical, data or discretisation result</span></span>
<span id="cb44-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">above round-off) is held to the committed baseline within its rtol; a BOUND (a</span></span>
<span id="cb44-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">residual, an identity, a solver-tolerance effect, an optimiser stall, an</span></span>
<span id="cb44-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">observed order) is checked against its limit on every run and on any machine;</span></span>
<span id="cb44-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">an EXACT result (a count, a boolean, a stated constant) by equality, and a</span></span>
<span id="cb44-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">count decided by a threshold carries its margin to that threshold.  The set of</span></span>
<span id="cb44-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">names is fixed and never depends on a value."""</span></span>
<span id="cb44-10">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B2.3"</span>)</span>
<span id="cb44-11">B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># name -&gt; bound arguments</span></span>
<span id="cb44-12">RTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># value claims held tighter than 5 %, each with the reason</span></span>
<span id="cb44-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- identities measured by subtraction: degeneracies 1 to 5 --------------------</span></span>
<span id="cb44-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb44-15">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_nprime0_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-16">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb44-17">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n' = 0: the class enters only through f^n', and _pow(x, 0) is 1.0"</span>)</span>
<span id="cb44-18">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-19">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-20">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 2 over nine order combinations, LSODA at rtol 1e-9"</span>)</span>
<span id="cb44-21">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel_rtol1e-13"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-22">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same nine combinations at rtol 1e-13"</span>)</span>
<span id="cb44-23">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_constC_par_ser_ind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-24">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb44-25">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 3: k'_d is a constant for three classes in one held-C_A run"</span>)</span>
<span id="cb44-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>):</span>
<span id="cb44-27">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_sbs_is_parallel_famA_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-28">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb44-29">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 4: the poison solves the reactant's own equation"</span>)</span>
<span id="cb44-30">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_batch_sbs_is_parallel_on_condition"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-31">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 4 in the batch, as above"</span>)</span>
<span id="cb44-32">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_batch"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-33">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-34">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 5 in the batch, five sigma, LSODA at rtol 1e-9"</span>)</span>
<span id="cb44-35">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_plug"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-36">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-37">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 5 in the bed, five sigma"</span>)</span>
<span id="cb44-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the separability matrices ---------------------------------------------------</span></span>
<span id="cb44-39">FIT_BOUND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>),</span>
<span id="cb44-40">             (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>)}</span>
<span id="cb44-41"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb44-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, tr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb44-43">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, cd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb44-44">            nm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[tr]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_vs_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cd]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb44-45">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> j:</span>
<span id="cb44-46">                B[nm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb44-47">                             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a class against its own response: the twin is "</span></span>
<span id="cb44-48">                                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the truth itself, residual exactly 0"</span>)</span>
<span id="cb44-49">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> np.isfinite(SEP_TWIN[cfg][i, j]):</span>
<span id="cb44-50">                B[nm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-51">                             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity-backed (a twin of sec. 4); what is left "</span></span>
<span id="cb44-52">                                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is the integrator's, rtol 1e-9"</span>)</span>
<span id="cb44-53">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> (cfg, tr, cd) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FIT_BOUND:</span>
<span id="cb44-54">                B[nm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-55">                             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no twin: an optimiser upper bound on a minimum, "</span></span>
<span id="cb44-56">                                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claimed only as a tenth of the conversion "</span></span>
<span id="cb44-57">                                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resolution"</span>)</span>
<span id="cb44-58">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_identity_twin_worst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-59">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-60">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"largest twin residual over the 44 identity-backed entries, rtol 1e-9"</span>)</span>
<span id="cb44-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb44-62">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_stall_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-63">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-64">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"largest diagonal fit (exact minimum 0) with the central-difference "</span></span>
<span id="cb44-65">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Jacobian; ODE rtol 1e-9"</span>)</span>
<span id="cb44-66">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-67">                            note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the largest of the four sep_stall_* bounds"</span>)</span>
<span id="cb44-68">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst_not_sbs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-69">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-70">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as sep_stall_worst, side-by-side excluded. Close to vacuous: for these "</span></span>
<span id="cb44-71">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"classes the seed grid contains the truth, so the fits only evaluate it"</span>)</span>
<span id="cb44-72"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, (cfg, q, vals, bnd) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROFILES.items():</span>
<span id="cb44-73">    B[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bnd, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-74">                   note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"profile of the side-by-side self-fit in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV[cfg]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: "</span></span>
<span id="cb44-75">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PNAMES[q]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> held at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(vals)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the other "</span></span>
<span id="cb44-76">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"four refitted (ODE rtol 1e-12, central differences). A "</span></span>
<span id="cb44-77">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"nonzero physical minimum, not a tolerance; the bound is a "</span></span>
<span id="cb44-78">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"tenth of the 2e-3 conversion resolution, and below the "</span></span>
<span id="cb44-79">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_stall_1pct_cheapest_batch'</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sep_stall_1pct_cheapest_mixed'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb44-80">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a +1 % move of one constant costs. Optimiser upper "</span></span>
<span id="cb44-81">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bounds, safe in the direction of a non-identifiability "</span></span>
<span id="cb44-82">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"claim; a point whose free constant ends on the box edge is "</span></span>
<span id="cb44-83">                        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"limited by the box (printed)"</span>)</span>
<span id="cb44-84">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_constC_best_pair"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-85">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb44-86">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every off-diagonal entry of the held-C_A matrix is a twin of degeneracy 3"</span>)</span>
<span id="cb44-87"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the mixed-flow boundary -------------------------------------------------------</span></span>
<span id="cb44-88"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_worst_inside"</span>):</span>
<span id="cb44-89">    B[nm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-90">                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inside d &gt;= n'/n the exact twin exists; integrator rtol 1e-9"</span>)</span>
<span id="cb44-91">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.75"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-92">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-93">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no twin: an optimiser upper bound, claimed only as below 1e-3, half the "</span></span>
<span id="cb44-94">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2e-3 resolution"</span>)</span>
<span id="cb44-95"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np2_d1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_best_outside"</span>):</span>
<span id="cb44-96">    B[nm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-97">                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no twin: an optimiser upper bound, claimed only as below 1e-4"</span>)</span>
<span id="cb44-98"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- held C_A, side-by-side --------------------------------------------------------</span></span>
<span id="cb44-99">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_at_d1_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-100">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-101">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|recovered d - 1| over 21 sigma at d = 1; minimize_scalar xatol 1e-10 on "</span></span>
<span id="cb44-102">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"an expm1 transform"</span>)</span>
<span id="cb44-103">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_sig0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-104">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-105">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|recovered d / 2 - 1| at sigma = 0, the author's own protocol"</span>)</span>
<span id="cb44-106"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the paper's closed forms ------------------------------------------------------</span></span>
<span id="cb44-107">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq15_maxdev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-108">                        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch fluid against eq. (15), LSODA at rtol 1e-9, atol 1e-13"</span>)</span>
<span id="cb44-109"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq19_maxdev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq28_reldev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq29_reldev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq30_reldev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq31_reldev"</span>):</span>
<span id="cb44-110">    B[nm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb44-111">                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent decay: dw/dtheta = -lam is constant, so every "</span></span>
<span id="cb44-112">                      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integrator step is exact and what is left is round-off"</span>)</span>
<span id="cb44-113"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- the bed: tolerance effects and observed orders --------------------------------</span></span>
<span id="cb44-114">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_inlet_time_sensitivity"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-115">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-116">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet cell centre, nt doubled at m = 800; the bound is 400x below the "</span></span>
<span id="cb44-117">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel cell-centre error the spatial study measures"</span>)</span>
<span id="cb44-118"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sh <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"par"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ser"</span>):</span>
<span id="cb44-119">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_cellcentre_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-120">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-121">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order: the first cell centre sits 1/2m from the face"</span>)</span>
<span id="cb44-122">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-123">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Heun on the activity march"</span>)</span>
<span id="cb44-124">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_space_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-125">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-126">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet-face activity (linear extrapolation of the last two cells), "</span></span>
<span id="cb44-127">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"changes between 200/400 and 400/800 cells at nt = 100"</span>)</span>
<span id="cb44-128">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_vs_quadrature_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-129">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-130">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubly extrapolated outlet activity against the quadrature route; "</span></span>
<span id="cb44-131">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the bound is chosen above the measured Richardson error (the "</span></span>
<span id="cb44-132">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature itself converges to 1e-8)"</span>)</span>
<span id="cb44-133">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_outlet_quadrature_change_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-134">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-135">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quadrature route, 161 against 321 Simpson nodes, LSODA rtol 1e-12"</span>)</span>
<span id="cb44-136"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1_exp"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2_exp"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1_quad"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2_quad"</span>):</span>
<span id="cb44-137">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_spatial_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-138">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-139">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ConvFluxTVD (van Leer), outlet on the extrapolated face, m = 200 to 400"</span>)</span>
<span id="cb44-140">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_spatial_finest_over_roundoff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-141">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-142">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smallest 400-cell frozen-profile error over the newton/deferred gap"</span>)</span>
<span id="cb44-143">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_frozen"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-144">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-145">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton step tol 1e-12 against deferred sweeps to a change below 1e-12, "</span></span>
<span id="cb44-146">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same discrete equations, 200 cells"</span>)</span>
<span id="cb44-147">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_march"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-148">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb44-149">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"production conversion history (200 cells, 200 steps) by the two routes"</span>)</span>
<span id="cb44-150"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _nm, _what <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_cellcentre"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet cell-centre error ladder (last two grids)"</span>),</span>
<span id="cb44-151">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_space"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outlet-face activity, last two grids at nt = 100"</span>),</span>
<span id="cb44-152">                   (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_time"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubly extrapolated outlet, last two step counts"</span>)):</span>
<span id="cb44-153">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_finest_over_roundoff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-154">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-155">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"finest change of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_what<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> over the newton/deferred gap of the march"</span>)</span>
<span id="cb44-156">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_axes_finest_over_roundoff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-157">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-158">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finest differences of the time and space ladders over the route gap"</span>)</span>
<span id="cb44-159"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s_, lo, hi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heun"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.95</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.05</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"euler"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>)):</span>
<span id="cb44-160">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>):</span>
<span id="cb44-161">        B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_time_order_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-162">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-163">            note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the activity, m = 200, nt = 40..640 (observation times "</span></span>
<span id="cb44-164">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on the step grid), space error cancelled"</span>)</span>
<span id="cb44-165"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>):</span>
<span id="cb44-166">    B[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_space_order_march_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-167">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.95</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.05</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-168">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion history at nt = 80, m = 50..800, time error cancelled"</span>)</span>
<span id="cb44-169">B[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_slope"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb44-170">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.995</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.005</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb44-171">    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the cost of the pseudo-steady assumption is first order in eps; fitted "</span></span>
<span id="cb44-172">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"over eps = 1e-4 to 3e-3 against an eps = 0 reference of 1600 steps"</span>)</span>
<span id="cb44-173"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- value claims held tighter than 5 %, so that their break rows fail them --------</span></span>
<span id="cb44-174"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exact inlet values and the space-only outlet reading: held tight enough that</span></span>
<span id="cb44-175"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># their break rows (a cell centre for the exact value, nt halved) fail them</span></span>
<span id="cb44-176">RTOL.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_end_par"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_end_ser"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,</span>
<span id="cb44-177">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_spaceonly_par"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_spaceonly_ser"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-6</span>})</span>
<span id="cb44-178">EXACT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># name -&gt; structural note, or None when a break row moves it</span></span>
<span id="cb44-179">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_identities"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the number of symbolic identities checked"</span>,</span>
<span id="cb44-180">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_nonzero"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb44-181">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_residual_is_log_kd_over_k"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb44-182">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_repaired_residual"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb44-183">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_identity_backed"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"entries with a twin of sec. 4, decided by the algebra"</span>,</span>
<span id="cb44-184">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fits_capped"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>,</span>
<span id="cb44-185">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_target"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a stated target, the first of 5 %, 2 %, 1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% r</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">eached"</span>,</span>
<span id="cb44-186">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break_rows"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows of the break table"</span>,</span>
<span id="cb44-187">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break_robustness_rows"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robustness rows of the break table"</span>,</span>
<span id="cb44-188">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_threshold_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the stated instrument resolution"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP},</span>
<span id="cb44-189">}</span>
<span id="cb44-190">STRUCT_VALUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_offset_expected"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ln(k/k_d) of the chosen constants, the "</span></span>
<span id="cb44-191">                                        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reference the numeric offset is compared with"</span>}</span>
<span id="cb44-192"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M.items():</span>
<span id="cb44-193">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> B:</span>
<span id="cb44-194">        claims.bound(k_, v, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>B[k_])</span>
<span id="cb44-195">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXACT:</span>
<span id="cb44-196">        claims.exact(k_, v, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>EXACT[k_] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>EXACT[k_])</span>
<span id="cb44-197">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCT_VALUE:</span>
<span id="cb44-198">        claims.value(k_, v, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>STRUCT_VALUE[k_])</span>
<span id="cb44-199">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb44-200">        claims.value(k_, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RTOL.get(k_, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>))</span>
<span id="cb44-201"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(B) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(B) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M)</span>
<span id="cb44-202"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- thresholded counts, with their margins ----------------------------------------</span></span>
<span id="cb44-203"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the margin of fits_capped = 0: the largest share of its evaluation budget any</span></span>
<span id="cb44-204"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># production fit used (Jacobian evaluations included), against the budget</span></span>
<span id="cb44-205">_share <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {t: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EVALS.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"budget-break"</span>,)}</span>
<span id="cb44-206">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fits_budget_share_max"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_share.values()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb44-207">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"largest share of the 10000-evaluation budget used by any of the "</span></span>
<span id="cb44-208">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_share)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> production fits; 0 capped fits needs it below 1, "</span></span>
<span id="cb44-209">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and 0.9 keeps a margin"</span>)</span>
<span id="cb44-210"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"largest share of the evaluation budget used by any production fit: "</span></span>
<span id="cb44-211">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 0.9 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_share.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_share, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_share.get)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb44-212">claims.count(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_optimiser_overstated"</span>, SEP_OVER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb44-213">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity-backed entries where the fit alone stops more than 1e-6 "</span></span>
<span id="cb44-214">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"above the twin"</span>)</span>
<span id="cb44-215"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb44-216">    n_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.count(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_n_separable"</span>, SEP_OFF[cfg], res_of.get(cfg, RES_X),</span>
<span id="cb44-217">                      min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>,</span>
<span id="cb44-218">                      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"off-diagonal entries above the instrument resolution"</span>)</span>
<span id="cb44-219">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> n_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N_SEP[cfg]</span>
<span id="cb44-220"></span>
<span id="cb44-221"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- break rows ----------------------------------------------------------------------</span></span>
<span id="cb44-222"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Rows that only re-read a count at another resolution re-run nothing; they stay</span></span>
<span id="cb44-223"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># in the table as documentation of the threshold, and the counts get a row that</span></span>
<span id="cb44-224"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># recomputes the matrix (the candidates not refitted) instead.</span></span>
<span id="cb44-225"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> metric, base, inj, broken, note <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS:</span>
<span id="cb44-226">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> metric <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_nonzero"</span>:      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># wired below, on the count itself</span></span>
<span id="cb44-227">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb44-228">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> metric.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_n_separable"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> metric <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_constC_n_separable"</span>:</span>
<span id="cb44-229">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb44-230">    claims.breaks(inj, metric, broken)</span>
<span id="cb44-231">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (12) read with k for k_d"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_nonzero"</span>, SYM_TYPO_NONZERO)</span>
<span id="cb44-232">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (24) taken with 1/k"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_residual_is_log_kd_over_k"</span>, EQ24_BROKEN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb44-233">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (24) taken as printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_repaired_residual"</span>, EQ24_BROKEN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb44-234">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the reference inverted, ln(k_d/k)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq24_offset_expected"</span>, np.log(_kd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _k))</span>
<span id="cb44-235">SWAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>,</span>
<span id="cb44-236">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"independent"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>}</span>
<span id="cb44-237"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb44-238">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CLASSES:</span>
<span id="cb44-239">        claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate form swapped (eq. 5 for 4, eq. 7 for 6)"</span>,</span>
<span id="cb44-240">                      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"span_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cls]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.ptp(RESP[(cfg, SWAP[cls])])))</span>
<span id="cb44-241"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb44-242">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n' = 0.7 instead of 0"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_nprime0_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, OFF_NP0[cfg])</span>
<span id="cb44-243">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n' set back to 0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_nprime0_off_condition"</span>,</span>
<span id="cb44-244">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_nprime0_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>)))</span>
<span id="cb44-245">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 2 without relabelling the orders and lam"</span>,</span>
<span id="cb44-246">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel"</span>, DEGEN2_UNMAPPED)</span>
<span id="cb44-247">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"integrated at the production rtol 1e-9"</span>,</span>
<span id="cb44-248">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel_rtol1e-13"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_mixed_series_is_parallel"</span>])</span>
<span id="cb44-249">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series without relabelling lam"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_constC_par_ser_ind"</span>, DEGEN3_UNMAPPED)</span>
<span id="cb44-250"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>):</span>
<span id="cb44-251">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"off the n' = n, d = 1 condition"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_sbs_is_parallel_famA_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-252">                  OFF_A[cfg])</span>
<span id="cb44-253">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"back on the n' = n, d = 1 condition"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_batch_sbs_off_condition"</span>,</span>
<span id="cb44-254">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_batch_sbs_is_parallel_on_condition"</span>])</span>
<span id="cb44-255">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same identity in the mixed reactor"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_batch"</span>,</span>
<span id="cb44-256">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_mixed"</span>])</span>
<span id="cb44-257"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC"</span>):</span>
<span id="cb44-258">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same identity in the batch, where it holds"</span>,</span>
<span id="cb44-259">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"degen_sbs_is_parallel_famB_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_batch"</span>])</span>
<span id="cb44-260">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"back on the n = n' = d = 1 condition"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_famB_off_condition"</span>,</span>
<span id="cb44-261">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_plug"</span>])</span>
<span id="cb44-262">UNFIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the candidate's rate form at the truth's constants, not refitted</span></span>
<span id="cb44-263"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb44-264">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, tr <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb44-265">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, cd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(CLASSES):</span>
<span id="cb44-266">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> j:</span>
<span id="cb44-267">                UNFIT[(cfg, i, j)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(</span>
<span id="cb44-268">                    (RESP[(cfg, cd)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RESP[(cfg, tr)]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb44-269">                claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"candidate's rate form at the truth's constants, not "</span></span>
<span id="cb44-270">                              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refitted"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[tr]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_vs_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHORT[cd]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-271">                              UNFIT[(cfg, i, j)])</span>
<span id="cb44-272">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"not refitted"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_best_pair"</span>,</span>
<span id="cb44-273">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (c, _, _), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> UNFIT.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> cfg))</span>
<span id="cb44-274">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"not refitted"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_plug_par_vs_ind_wideseed"</span>, UNFIT[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)])</span>
<span id="cb44-275"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plug"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>):</span>
<span id="cb44-276">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the matrix with the candidates not refitted"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_n_separable"</span>,</span>
<span id="cb44-277">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (c, _, _), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> UNFIT.items()</span>
<span id="cb44-278">                            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> res_of.get(cfg, RES_X))))</span>
<span id="cb44-279">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degeneracy 2's twin without the lam mapping"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_identity_twin_worst"</span>,</span>
<span id="cb44-280">              TWIN_UNMAPPED)</span>
<span id="cb44-281">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the twin's parameters added as a seed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_optimiser_worst_overstatement"</span>,</span>
<span id="cb44-282">              OVER_TWIN_SEEDED)</span>
<span id="cb44-283">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the diagonal fits stopped after 3 evaluations"</span>,</span>
<span id="cb44-284">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_optimiser_overstated"</span>, OVER_COUNT_EARLY)</span>
<span id="cb44-285"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SEP:</span>
<span id="cb44-286">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polish stopped after 3 evaluations"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_stall_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-287">                  <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(STALL_EARLY[(cfg, c)] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"side-by-side"</span>)))</span>
<span id="cb44-288">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polish stopped after 3 evaluations"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst"</span>,</span>
<span id="cb44-289">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(STALL_EARLY.values()))</span>
<span id="cb44-290">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"polish stopped after 3 evaluations"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst_not_sbs"</span>,</span>
<span id="cb44-291">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (c, cl), v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STALL_EARLY.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>))</span>
<span id="cb44-292"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROFILES:</span>
<span id="cb44-293">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the far end of the range with the other four NOT refitted"</span>, name,</span>
<span id="cb44-294">                  PROF_UNFIT[name])</span>
<span id="cb44-295"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cfg <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"batch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed"</span>):</span>
<span id="cb44-296">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the cheapest constant moved 2 %, not 1 %"</span>,</span>
<span id="cb44-297">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sep_stall_1pct_cheapest_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cfg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, COST_2PCT[cfg])</span>
<span id="cb44-298">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a budget of 50 evaluations"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fits_capped"</span>, FITS_CAPPED_BROKEN)</span>
<span id="cb44-299">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a budget of 50 evaluations"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fits_budget_share_max"</span>,</span>
<span id="cb44-300">              EVALS[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"budget-break"</span>,)])</span>
<span id="cb44-301"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_worst_inside"</span>,</span>
<span id="cb44-302">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.25"</span>):</span>
<span id="cb44-303">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d moved below the line to 0.5"</span>, nm, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.5"</span>])</span>
<span id="cb44-304">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d moved further from the line, to 0.25"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.75"</span>,</span>
<span id="cb44-305">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.25"</span>])</span>
<span id="cb44-306"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np2_d1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_best_outside"</span>):</span>
<span id="cb44-307">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n' = 1, d = 0.5 instead"</span>, nm, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.5"</span>])</span>
<span id="cb44-308">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"demand 5 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% i</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">nstead of 2 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec2pct"</span>,</span>
<span id="cb44-309">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec5pct"</span>])</span>
<span id="cb44-310">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"demand 5 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% i</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">nstead of 10 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec10pct"</span>,</span>
<span id="cb44-311">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_needed_prec5pct"</span>])</span>
<span id="cb44-312">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a span of 0.05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_misfit_at_span_0p5"</span>, wrong_class_misfit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>))</span>
<span id="cb44-313">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"start the levels at 0.40"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_min"</span>,</span>
<span id="cb44-314">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_max"</span>])</span>
<span id="cb44-315">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"base sigma instead of 0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_sig0"</span>,</span>
<span id="cb44-316">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_base"</span>])</span>
<span id="cb44-317">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"base sigma instead of 0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_sig0"</span>,</span>
<span id="cb44-318">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_recovered_d_base"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb44-319">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d = 1 instead of 2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_max_scanned"</span>,</span>
<span id="cb44-320">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_at_d1_max"</span>])</span>
<span id="cb44-321">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read off the sigma scan, not root-found"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_sigma_for_bias"</span>,</span>
<span id="cb44-322">              SIG_SCAN_READ)</span>
<span id="cb44-323"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>BED_BROKEN, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>SPATIAL_BROKEN}.items():</span>
<span id="cb44-324">    claims.breaks({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>BED_BROKEN_LABEL, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>SPATIAL_BROKEN_LABEL}[nm], nm, v)</span>
<span id="cb44-325"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CF_BROKEN.items():</span>
<span id="cb44-326">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_d 1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% hi</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">gh in the closed form"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nm.startswith((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq15"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq19"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq22"</span>))</span>
<span id="cb44-327">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k'_d 1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% hi</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">gh in the run"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nm.endswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reldev"</span>)</span>
<span id="cb44-328">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k'_d 25 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% hi</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">gh in the run"</span>, nm, v)</span>
<span id="cb44-329"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parallel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>):</span>
<span id="cb44-330">    sh, other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SHORT[cls], SHORT[SWAP[cls]]</span>
<span id="cb44-331">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the production cell centre in place of the exact inlet"</span>,</span>
<span id="cb44-332">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_a_inlet_end_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(prof[cls][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb44-333">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_end"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_altpair"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_profile_contrast"</span>):</span>
<span id="cb44-334">        claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the other class's profile (eq. 5 for eq. 4)"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sh<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb44-335">                      M[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>other<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>])</span>
<span id="cb44-336">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read at the outlet cell"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_inlet_time_sensitivity"</span>,</span>
<span id="cb44-337">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_profile_time_sensitivity"</span>])</span>
<span id="cb44-338">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read at the inlet cell"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_profile_time_sensitivity"</span>,</span>
<span id="cb44-339">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_inlet_time_sensitivity"</span>])</span>
<span id="cb44-340">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Heun for Euler"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_euler_min"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_heun_min"</span>])</span>
<span id="cb44-341">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Heun for Euler"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_euler_max"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_heun_max"</span>])</span>
<span id="cb44-342">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Euler for Heun"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_heun_max"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_euler_max"</span>])</span>
<span id="cb44-343">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conversion interpolated between steps, nt = 25..400 (march(..., on_grid=False))"</span>,</span>
<span id="cb44-344">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_time_order_heun_max"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(OT_OFFGRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb44-345"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e_, f_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>)):</span>
<span id="cb44-346">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind convection (Bed(..., limiter=None))"</span>,</span>
<span id="cb44-347">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bed_space_order_march_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, f_(OXM_UP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>]))</span>
<span id="cb44-348">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred sweeps stopped at a change of 1e-4 (Bed(..., tol=1e-4))"</span>,</span>
<span id="cb44-349">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_frozen"</span>, GAP_LOOSE)</span>
<span id="cb44-350">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred sweeps stopped at a change of 1e-4 (Bed(..., tol=1e-4))"</span>,</span>
<span id="cb44-351">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_spatial_finest_over_roundoff"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(FINEST) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GAP_LOOSE)</span>
<span id="cb44-352">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred sweeps stopped at a change of 1e-4 (Bed(..., tol=1e-4))"</span>,</span>
<span id="cb44-353">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_route_gap_march"</span>, GAP_MARCH_LOOSE)</span>
<span id="cb44-354">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred sweeps stopped at a change of 1e-4 (Bed(..., tol=1e-4))"</span>,</span>
<span id="cb44-355">              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_axes_finest_over_roundoff"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_dT, _dX) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GAP_MARCH_LOOSE)</span>
<span id="cb44-356"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _lad, _nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inlet"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_cellcentre"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"space"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_space"</span>),</span>
<span id="cb44-357">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_time"</span>)):</span>
<span id="cb44-358">    claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deferred sweeps stopped at a change of 1e-2 (Bed(..., tol=1e-2))"</span>,</span>
<span id="cb44-359">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_finest_over_roundoff"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(FINEST6[_lad]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GAP_MARCH_LOOSER)</span>
<span id="cb44-360">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps = 0 reference marched in 200 steps"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_slope"</span>,</span>
<span id="cb44-361">              PS_SLOPE_REF200)</span>
<span id="cb44-362">_nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAKS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bed(200, nu=1)"</span>)]</span>
<span id="cb44-363"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_nu) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb44-364">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bed(200, nu=1)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_over_resolution"</span>, _nu[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RES_X)</span>
<span id="cb44-365">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series bed against the parallel quadrature"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_vs_quadrature_series"</span>,</span>
<span id="cb44-366">              <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xser[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ref_par[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]))))</span>
<span id="cb44-367">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps = 1e-3 instead of 3e-2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps3e-2"</span>,</span>
<span id="cb44-368">              M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_eps1e-3"</span>])</span>
<span id="cb44-369">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"accumulation scaled by sqrt(eps)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_cost_slope"</span>, PS_SLOPE_SQRT)</span>
<span id="cb44-370">claims.breaks(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps* read at half the resolution"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pseudo_steady_eps_star"</span>, PS_EPS_HALF)</span>
<span id="cb44-371"></span>
<span id="cb44-372">_kinds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {kd: [k_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> kd]</span>
<span id="cb44-373">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kd <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)}</span>
<span id="cb44-374"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims registered: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values, "</span></span>
<span id="cb44-375">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'bound'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exact'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact.  The bounds that "</span></span>
<span id="cb44-376">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"are not identities at 0:"</span>)</span>
<span id="cb44-377"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _kinds[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>]:</span>
<span id="cb44-378">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[k_]</span>
<span id="cb44-379">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>:</span>
<span id="cb44-380">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb44-381">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>), c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>)</span>
<span id="cb44-382">    rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> hi <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb44-383">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&gt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"&lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb44-384">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rng<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'basis'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]  (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'value'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb44-385"></span>
<span id="cb44-386"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -- numbers written in the prose of this page, checked against their claims -------</span></span>
<span id="cb44-387">SAYS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb44-388">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_stall_worst"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-9"</span>],</span>
<span id="cb44-389">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_profile_d_batch"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 2e-4"</span>],</span>
<span id="cb44-390">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_profile_d_mixed"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 2e-4"</span>],</span>
<span id="cb44-391">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_profile_nprime_mixed"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 2e-4"</span>],</span>
<span id="cb44-392">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fits_budget_share_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 0.9"</span>],</span>
<span id="cb44-393">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_worst_inside"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-8"</span>],</span>
<span id="cb44-394">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np1_d0.75"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-3"</span>],</span>
<span id="cb44-395">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mixed_boundary_np2_d1.5"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-4"</span>],</span>
<span id="cb44-396">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_sbs_bias_at_d1_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-7"</span>],</span>
<span id="cb44-397">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_optimiser_worst_overstatement"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.3e-3"</span>],</span>
<span id="cb44-398">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sep_plug_par_vs_ser"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.1e-4"</span>],</span>
<span id="cb44-399">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_inlet_end_par"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0498"</span>],</span>
<span id="cb44-400">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_end_par"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.19"</span>],</span>
<span id="cb44-401">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bed_a_outlet_end_ser"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.18"</span>],</span>
<span id="cb44-402">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_mixed"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"more than 1e-1"</span>],</span>
<span id="cb44-403">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"degen_sbs_is_parallel_famB_constC"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"more than 1e-1"</span>],</span>
<span id="cb44-404">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_chain_identities"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"26"</span>],</span>
<span id="cb44-405">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_min"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.07"</span>],</span>
<span id="cb44-406">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constC_span_prec5pct_max"</span>: [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>],</span>
<span id="cb44-407">}</span>
<span id="cb44-408"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_, lits <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SAYS.items():</span>
<span id="cb44-409">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lits:</span>
<span id="cb44-410">        claims.says(lit, k_)</span>
<span id="cb44-411"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># wall clock is deliberately neither printed nor reported: it is machine</span></span>
<span id="cb44-412"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dependent, and two executions of this page must give identical content.</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>largest share of the evaluation budget used by any production fit: below 0.9 (here 0.53, ('plug', 'series', 'side-by-side'))
226 claims registered: 92 values, 116 bounds, 18 exact.  The bounds that are not identities at 0:
  bed_route_gap_frozen                         &lt;= 1e-11       [tolerance]  (here 1.55e-13)
  degen_nprime0_batch                          &lt;= 1e-12       [identity]  (here 0)
  degen_nprime0_plug                           &lt;= 1e-12       [identity]  (here 0)
  degen_nprime0_mixed                          &lt;= 1e-12       [identity]  (here 0)
  degen_nprime0_constC                         &lt;= 1e-12       [identity]  (here 0)
  degen_mixed_series_is_parallel               &lt;= 1e-08       [tolerance]  (here 1.3e-09)
  degen_mixed_series_is_parallel_rtol1e-13     &lt;= 1e-11       [tolerance]  (here 1.12e-13)
  degen_constC_par_ser_ind                     &lt;= 1e-12       [identity]  (here 8.88e-16)
  degen_sbs_is_parallel_famA_batch             &lt;= 1e-12       [identity]  (here 0)
  degen_sbs_is_parallel_famA_plug              &lt;= 1e-12       [identity]  (here 0)
  degen_sbs_is_parallel_famA_mixed             &lt;= 1e-12       [identity]  (here 7.33e-15)
  degen_batch_sbs_is_parallel_on_condition     &lt;= 1e-12       [identity]  (here 0)
  degen_sbs_is_parallel_famB_batch             &lt;= 1e-07       [tolerance]  (here 2.48e-09)
  degen_sbs_is_parallel_famB_plug              &lt;= 1e-08       [tolerance]  (here 1.88e-11)
  sep_batch_par_vs_s-b-s                       &lt;= 1e-08       [tolerance]  (here 3.98e-11)
  sep_batch_s-b-s_vs_par                       &lt;= 1e-08       [tolerance]  (here 2.82e-11)
  sep_batch_ind_vs_par                         &lt;= 1e-08       [tolerance]  (here 0)
  sep_batch_ind_vs_ser                         &lt;= 1e-08       [tolerance]  (here 0)
  sep_batch_ind_vs_s-b-s                       &lt;= 1e-08       [tolerance]  (here 0)
  sep_plug_par_vs_s-b-s                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_plug_ser_vs_s-b-s                        &lt;= 0.0002      [chosen]  (here 1.39e-05)
  sep_plug_s-b-s_vs_par                        &lt;= 1e-08       [tolerance]  (here 1.58e-15)
  sep_plug_ind_vs_par                          &lt;= 1e-08       [tolerance]  (here 0)
  sep_plug_ind_vs_ser                          &lt;= 1e-08       [tolerance]  (here 0)
  sep_plug_ind_vs_s-b-s                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_mixed_par_vs_ser                         &lt;= 1e-08       [tolerance]  (here 3.34e-10)
  sep_mixed_par_vs_s-b-s                       &lt;= 1e-08       [tolerance]  (here 0)
  sep_mixed_ser_vs_par                         &lt;= 1e-08       [tolerance]  (here 1.32e-10)
  sep_mixed_ser_vs_s-b-s                       &lt;= 0.0002      [chosen]  (here 3.45e-05)
  sep_mixed_s-b-s_vs_par                       &lt;= 0.0002      [chosen]  (here 7.36e-06)
  sep_mixed_s-b-s_vs_ser                       &lt;= 0.0002      [chosen]  (here 8.13e-05)
  sep_mixed_ind_vs_par                         &lt;= 1e-08       [tolerance]  (here 0)
  sep_mixed_ind_vs_ser                         &lt;= 1e-08       [tolerance]  (here 0)
  sep_mixed_ind_vs_s-b-s                       &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_par_vs_ser                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_par_vs_s-b-s                      &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_par_vs_ind                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_ser_vs_par                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_ser_vs_s-b-s                      &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_ser_vs_ind                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_s-b-s_vs_par                      &lt;= 1e-08       [tolerance]  (here 1.07e-16)
  sep_constC_s-b-s_vs_ser                      &lt;= 1e-08       [tolerance]  (here 1.08e-16)
  sep_constC_s-b-s_vs_ind                      &lt;= 1e-08       [tolerance]  (here 1.07e-16)
  sep_constC_ind_vs_par                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_ind_vs_ser                        &lt;= 1e-08       [tolerance]  (here 0)
  sep_constC_ind_vs_s-b-s                      &lt;= 1e-08       [tolerance]  (here 0)
  sep_identity_twin_worst                      &lt;= 1e-08       [tolerance]  (here 1.47e-09)
  sep_stall_batch                              &lt;= 1e-09       [tolerance]  (here 6.28e-11)
  sep_stall_plug                               &lt;= 1e-09       [tolerance]  (here 5.09e-11)
  sep_stall_mixed                              &lt;= 1e-09       [tolerance]  (here 5.21e-11)
  sep_stall_constC                             &lt;= 1e-09       [tolerance]  (here 7.29e-16)
  sep_stall_worst                              &lt;= 1e-09       [tolerance]  (here 6.28e-11)
  sep_stall_worst_not_sbs                      &lt;= 1e-09       [tolerance]  (here 6.28e-11)
  sep_profile_d_batch                          &lt;= 0.0002      [chosen]  (here 3.86e-05)
  sep_profile_d_mixed                          &lt;= 0.0002      [chosen]  (here 0.000156)
  sep_profile_nprime_mixed                     &lt;= 0.0002      [chosen]  (here 1.27e-05)
  sep_constC_best_pair                         &lt;= 1e-12       [identity]  (here 1.08e-16)
  bed_a_inlet_cellcentre_order_par             [0.9, 1.1]     [theory]  (here 1)
  bed_a_outlet_space_order_par                 [1.9, 2.1]     [theory]  (here 2)
  bed_a_inlet_cellcentre_order_ser             [0.9, 1.1]     [theory]  (here 0.995)
  bed_a_outlet_space_order_ser                 [1.9, 2.1]     [theory]  (here 2)
  bed_inlet_time_sensitivity                   &lt;= 1e-07       [chosen]  (here 2.49e-09)
  bed_a_outlet_quadrature_change_par           &lt;= 1e-08       [tolerance]  (here 7.79e-13)
  bed_a_outlet_quadrature_change_ser           &lt;= 1e-08       [tolerance]  (here 1.87e-10)
  bed_a_outlet_time_order_par                  [1.8, 2.2]     [theory]  (here 1.99)
  bed_a_outlet_vs_quadrature_par               &lt;= 1e-07       [chosen]  (here 6.37e-09)
  bed_a_outlet_time_order_ser                  [1.8, 2.2]     [theory]  (here 2)
  bed_a_outlet_vs_quadrature_ser               &lt;= 1e-07       [chosen]  (here 1.4e-10)
  mixed_boundary_np1_d1.5                      &lt;= 1e-08       [tolerance]  (here 3.05e-11)
  mixed_boundary_np1_d1                        &lt;= 1e-08       [tolerance]  (here 3.34e-10)
  mixed_boundary_np1_d0.75                     &lt;= 0.001       [chosen]  (here 0.000749)
  mixed_boundary_np2_d1.5                      &lt;= 0.0001      [chosen]  (here 4.04e-05)
  mixed_boundary_worst_inside                  &lt;= 1e-08       [tolerance]  (here 3.34e-10)
  mixed_boundary_best_outside                  &lt;= 0.0001      [chosen]  (here 4.04e-05)
  constC_sbs_bias_at_d1_max                    &lt;= 1e-07       [tolerance]  (here 8.35e-09)
  constC_sbs_bias_sig0                         &lt;= 1e-07       [tolerance]  (here 5.4e-09)
  bed_spatial_order_n1_exp                     [1.9, 2.1]     [theory]  (here 2.01)
  bed_spatial_order_n2_exp                     [1.9, 2.1]     [theory]  (here 2.04)
  bed_spatial_order_n1_quad                    [1.9, 2.1]     [theory]  (here 2.02)
  bed_spatial_order_n2_quad                    [1.9, 2.1]     [theory]  (here 2.02)
  bed_spatial_finest_over_roundoff             &gt;= 1000        [theory]  (here 3.58e+05)
  bed_time_order_heun_min                      [1.95, 2.05]   [theory]  (here 1.99)
  bed_time_order_heun_max                      [1.95, 2.05]   [theory]  (here 2)
  bed_time_order_euler_min                     [0.95, 1.05]   [theory]  (here 1)
  bed_time_order_euler_max                     [0.95, 1.05]   [theory]  (here 1)
  bed_space_order_march_min                    [1.95, 2.05]   [theory]  (here 2)
  bed_space_order_march_max                    [1.95, 2.05]   [theory]  (here 2.01)
  bed_route_gap_march                          &lt;= 1e-11       [tolerance]  (here 8.88e-16)
  bed_axes_finest_over_roundoff                &gt;= 1000        [theory]  (here 3.32e+08)
  bed_a_inlet_cellcentre_finest_over_roundoff  &gt;= 1000        [theory]  (here 5e+10)
  bed_a_outlet_space_finest_over_roundoff      &gt;= 1000        [theory]  (here 3.14e+08)
  bed_a_outlet_time_finest_over_roundoff       &gt;= 1000        [theory]  (here 8.41e+08)
  eq15_maxdev                                  &lt;= 1e-07       [tolerance]  (here 8.63e-09)
  eq19_maxdev                                  &lt;= 1e-12       [identity]  (here 2.66e-15)
  eq28_reldev                                  &lt;= 1e-12       [identity]  (here 1.39e-16)
  eq29_reldev                                  &lt;= 1e-12       [identity]  (here 3.26e-16)
  eq30_reldev                                  &lt;= 1e-12       [identity]  (here 1.97e-16)
  eq31_reldev                                  &lt;= 1e-12       [identity]  (here 2.19e-16)
  pseudo_steady_cost_slope                     [0.995, 1.005] [theory]  (here 1)
  fits_budget_share_max                        &lt;= 0.9         [chosen]  (here 0.529)</code></pre>
</div>
</div>
<div id="903ef382" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-02T12:52:22.690443Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-02T12:52:22.690262Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-02T12:52:22.699483Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-02T12:52:22.698944Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb46-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb46-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for B2.3:
  bed_route_gap_frozen                        = (here 1.5e-13)   bound  bound &lt;= 1e-11 [tolerance]
  printed_chain_identities                    = 26               exact  exact
  printed_chain_nonzero                       = 0                exact  exact
  eq24_residual_is_log_kd_over_k              = 1                exact  exact
  eq24_repaired_residual                      = 1                exact  exact
  eq24_numeric_offset                         = 1.0498           value  rtol 0.05
  eq24_offset_expected                        = 1.0498           value  rtol 0.05
  span_batch_par                              = 0.43721          value  rtol 0.05
  span_batch_ser                              = 0.6274           value  rtol 0.05
  span_batch_s-b-s                            = 0.47511          value  rtol 0.05
  span_batch_ind                              = 0.37818          value  rtol 0.05
  span_plug_par                               = 0.62914          value  rtol 0.05
  span_plug_ser                               = 0.35228          value  rtol 0.05
  span_plug_s-b-s                             = 0.55333          value  rtol 0.05
  span_plug_ind                               = 0.70491          value  rtol 0.05
  span_mixed_par                              = 0.39462          value  rtol 0.05
  span_mixed_ser                              = 0.30501          value  rtol 0.05
  span_mixed_s-b-s                            = 0.30411          value  rtol 0.05
  span_mixed_ind                              = 0.53051          value  rtol 0.05
  span_constC_par                             = 1.2              value  rtol 0.05
  span_constC_ser                             = 1.8              value  rtol 0.05
  span_constC_s-b-s                           = 0.88235          value  rtol 0.05
  span_constC_ind                             = 3                value  rtol 0.05
  degen_nprime0_batch                         = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_nprime0_plug                          = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_nprime0_mixed                         = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_nprime0_constC                        = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_nprime0_off_condition                 = 1.4203           value  rtol 0.05
  degen_mixed_series_is_parallel              = (here 1.3e-09)   bound  bound &lt;= 1e-08 [tolerance]
  degen_mixed_series_is_parallel_rtol1e-13    = (here 1.1e-13)   bound  bound &lt;= 1e-11 [tolerance]
  degen_constC_par_ser_ind                    = (here 8.9e-16)   bound  bound &lt;= 1e-12 [identity]
  degen_sbs_is_parallel_famA_batch            = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_sbs_is_parallel_famA_plug             = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_sbs_is_parallel_famA_mixed            = (here 7.3e-15)   bound  bound &lt;= 1e-12 [identity]
  degen_batch_sbs_is_parallel_on_condition    = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  degen_batch_sbs_off_condition               = 0.0166           value  rtol 0.05
  degen_sbs_is_parallel_famB_batch            = (here 2.5e-09)   bound  bound &lt;= 1e-07 [tolerance]
  degen_sbs_is_parallel_famB_plug             = (here 1.9e-11)   bound  bound &lt;= 1e-08 [tolerance]
  degen_sbs_is_parallel_famB_mixed            = 0.11854          value  rtol 0.05
  degen_sbs_is_parallel_famB_constC           = 0.35345          value  rtol 0.05
  degen_sbs_famB_off_condition                = 0.1125           value  rtol 0.05
  sep_batch_par_vs_par                        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_batch_par_vs_ser                        = 0.00015921       value  rtol 0.05
  sep_batch_par_vs_s-b-s                      = (here 4.0e-11)   bound  bound &lt;= 1e-08 [tolerance]
  sep_batch_par_vs_ind                        = 0.00015921       value  rtol 0.05
  sep_batch_ser_vs_par                        = 0.001764         value  rtol 0.05
  sep_batch_ser_vs_ser                        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_batch_ser_vs_s-b-s                      = 0.001764         value  rtol 0.05
  sep_batch_ser_vs_ind                        = 0.001764         value  rtol 0.05
  sep_batch_s-b-s_vs_par                      = (here 2.8e-11)   bound  bound &lt;= 1e-08 [tolerance]
  sep_batch_s-b-s_vs_ser                      = 0.0001026        value  rtol 0.05
  sep_batch_s-b-s_vs_s-b-s                    = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_batch_s-b-s_vs_ind                      = 0.0001026        value  rtol 0.05
  sep_batch_ind_vs_par                        = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_batch_ind_vs_ser                        = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_batch_ind_vs_s-b-s                      = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_batch_ind_vs_ind                        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_plug_par_vs_par                         = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_plug_par_vs_ser                         = 0.00080659       value  rtol 0.05
  sep_plug_par_vs_s-b-s                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_plug_par_vs_ind                         = 0.0022016        value  rtol 0.05
  sep_plug_ser_vs_par                         = 3.74e-05         value  rtol 0.05
  sep_plug_ser_vs_ser                         = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_plug_ser_vs_s-b-s                       = (here 1.4e-05)   bound  bound &lt;= 0.0002 [chosen]
  sep_plug_ser_vs_ind                         = 0.00025459       value  rtol 0.05
  sep_plug_s-b-s_vs_par                       = (here 1.6e-15)   bound  bound &lt;= 1e-08 [tolerance]
  sep_plug_s-b-s_vs_ser                       = 0.00098486       value  rtol 0.05
  sep_plug_s-b-s_vs_s-b-s                     = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_plug_s-b-s_vs_ind                       = 0.0019168        value  rtol 0.05
  sep_plug_ind_vs_par                         = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_plug_ind_vs_ser                         = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_plug_ind_vs_s-b-s                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_plug_ind_vs_ind                         = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_mixed_par_vs_par                        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_mixed_par_vs_ser                        = (here 3.3e-10)   bound  bound &lt;= 1e-08 [tolerance]
  sep_mixed_par_vs_s-b-s                      = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_mixed_par_vs_ind                        = 0.00093544       value  rtol 0.05
  sep_mixed_ser_vs_par                        = (here 1.3e-10)   bound  bound &lt;= 1e-08 [tolerance]
  sep_mixed_ser_vs_ser                        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_mixed_ser_vs_s-b-s                      = (here 3.5e-05)   bound  bound &lt;= 0.0002 [chosen]
  sep_mixed_ser_vs_ind                        = 0.00040188       value  rtol 0.05
  sep_mixed_s-b-s_vs_par                      = (here 7.4e-06)   bound  bound &lt;= 0.0002 [chosen]
  sep_mixed_s-b-s_vs_ser                      = (here 8.1e-05)   bound  bound &lt;= 0.0002 [chosen]
  sep_mixed_s-b-s_vs_s-b-s                    = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_mixed_s-b-s_vs_ind                      = 0.00039772       value  rtol 0.05
  sep_mixed_ind_vs_par                        = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_mixed_ind_vs_ser                        = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_mixed_ind_vs_s-b-s                      = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_mixed_ind_vs_ind                        = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_constC_par_vs_par                       = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_constC_par_vs_ser                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_par_vs_s-b-s                     = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_par_vs_ind                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ser_vs_par                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ser_vs_ser                       = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_constC_ser_vs_s-b-s                     = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ser_vs_ind                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_s-b-s_vs_par                     = (here 1.1e-16)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_s-b-s_vs_ser                     = (here 1.1e-16)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_s-b-s_vs_s-b-s                   = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_constC_s-b-s_vs_ind                     = (here 1.1e-16)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ind_vs_par                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ind_vs_ser                       = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ind_vs_s-b-s                     = (here 0.0e+00)   bound  bound &lt;= 1e-08 [tolerance]
  sep_constC_ind_vs_ind                       = (here 0.0e+00)   bound  bound &lt;= 0 [identity]
  sep_identity_backed                         = 44               exact  exact
  sep_identity_twin_worst                     = (here 1.5e-09)   bound  bound &lt;= 1e-08 [tolerance]
  sep_optimiser_worst_overstatement           = 0.0013124        value  rtol 0.05
  sep_stall_batch                             = (here 6.3e-11)   bound  bound &lt;= 1e-09 [tolerance]
  sep_stall_plug                              = (here 5.1e-11)   bound  bound &lt;= 1e-09 [tolerance]
  sep_stall_mixed                             = (here 5.2e-11)   bound  bound &lt;= 1e-09 [tolerance]
  sep_stall_constC                            = (here 7.3e-16)   bound  bound &lt;= 1e-09 [tolerance]
  sep_stall_worst                             = (here 6.3e-11)   bound  bound &lt;= 1e-09 [tolerance]
  sep_stall_worst_not_sbs                     = (here 6.3e-11)   bound  bound &lt;= 1e-09 [tolerance]
  sep_profile_d_batch                         = (here 3.9e-05)   bound  bound &lt;= 0.0002 [chosen]
  sep_profile_d_mixed                         = (here 1.6e-04)   bound  bound &lt;= 0.0002 [chosen]
  sep_profile_nprime_mixed                    = (here 1.3e-05)   bound  bound &lt;= 0.0002 [chosen]
  sep_stall_1pct_cheapest_batch               = 0.00039272       value  rtol 0.05
  sep_stall_1pct_cheapest_mixed               = 0.00039884       value  rtol 0.05
  fits_capped                                 = 0                exact  exact
  sep_threshold_batch                         = 0.002            exact  exact
  sep_batch_best_pair                         = 0.001764         value  rtol 0.05
  sep_threshold_plug                          = 0.002            exact  exact
  sep_plug_best_pair                          = 0.0022016        value  rtol 0.05
  sep_threshold_mixed                         = 0.002            exact  exact
  sep_mixed_best_pair                         = 0.00093544       value  rtol 0.05
  sep_threshold_constC                        = 0.01             exact  exact
  sep_constC_best_pair                        = (here 1.1e-16)   bound  bound &lt;= 1e-12 [identity]
  bed_a_inlet_end_par                         = 0.049787         value  rtol 0.0001
  bed_a_inlet_end_ser                         = 1                value  rtol 0.0001
  bed_a_inlet_cellcentre_err_par              = 4.4373e-05       value  rtol 0.05
  bed_a_inlet_cellcentre_order_par            = (here 1.0e+00)   bound  bound [0.9, 1.1] [theory]
  bed_a_outlet_space_order_par                = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  bed_a_inlet_cellcentre_err_ser              = 0.0028034        value  rtol 0.05
  bed_a_inlet_cellcentre_order_ser            = (here 1.0e+00)   bound  bound [0.9, 1.1] [theory]
  bed_a_outlet_space_order_ser                = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  bed_inlet_time_sensitivity                  = (here 2.5e-09)   bound  bound &lt;= 1e-07 [chosen]
  bed_profile_time_sensitivity                = 7.3223e-06       value  rtol 0.05
  bed_a_outlet_quadrature_change_par          = (here 7.8e-13)   bound  bound &lt;= 1e-08 [tolerance]
  bed_a_outlet_quadrature_change_ser          = (here 1.9e-10)   bound  bound &lt;= 1e-08 [tolerance]
  bed_a_outlet_time_order_par                 = (here 2.0e+00)   bound  bound [1.8, 2.2] [theory]
  bed_a_outlet_spaceonly_par                  = 0.19018          value  rtol 2e-06
  bed_a_outlet_end_par                        = 0.19017          value  rtol 0.05
  bed_a_outlet_altpair_par                    = 0.19017          value  rtol 0.05
  bed_a_outlet_time_bias_par                  = 9.7631e-06       value  rtol 0.05
  bed_a_outlet_space_spread_par               = 6.4797e-10       value  rtol 0.05
  bed_a_outlet_residual_bound_par             = 2.4408e-06       value  rtol 0.05
  bed_a_outlet_vs_quadrature_par              = (here 6.4e-09)   bound  bound &lt;= 1e-07 [chosen]
  bed_profile_contrast_par                    = 0.14038          value  rtol 0.05
  bed_a_outlet_time_order_ser                 = (here 2.0e+00)   bound  bound [1.8, 2.2] [theory]
  bed_a_outlet_spaceonly_ser                  = 0.17711          value  rtol 2e-06
  bed_a_outlet_end_ser                        = 0.17711          value  rtol 0.05
  bed_a_outlet_altpair_ser                    = 0.17711          value  rtol 0.05
  bed_a_outlet_time_bias_ser                  = 9.9536e-07       value  rtol 0.05
  bed_a_outlet_space_spread_ser               = 4.4471e-10       value  rtol 0.05
  bed_a_outlet_residual_bound_ser             = 2.4884e-07       value  rtol 0.05
  bed_a_outlet_vs_quadrature_ser              = (here 1.4e-10)   bound  bound &lt;= 1e-07 [chosen]
  bed_profile_contrast_ser                    = -0.82289         value  rtol 0.05
  mixed_boundary_np1_d1.5                     = (here 3.0e-11)   bound  bound &lt;= 1e-08 [tolerance]
  mixed_boundary_np1_d1                       = (here 3.3e-10)   bound  bound &lt;= 1e-08 [tolerance]
  mixed_boundary_np1_d0.75                    = (here 7.5e-04)   bound  bound &lt;= 0.001 [chosen]
  mixed_boundary_np1_d0.5                     = 0.0030548        value  rtol 0.05
  mixed_boundary_np1_d0.25                    = 0.0040219        value  rtol 0.05
  mixed_boundary_np2_d1.5                     = (here 4.0e-05)   bound  bound &lt;= 0.0001 [chosen]
  mixed_boundary_worst_inside                 = (here 3.3e-10)   bound  bound &lt;= 1e-08 [tolerance]
  mixed_boundary_best_outside                 = (here 4.0e-05)   bound  bound &lt;= 0.0001 [chosen]
  constC_span_needed_prec2pct                 = 0.11105          value  rtol 0.05
  constC_span_needed_prec5pct                 = 0.20354          value  rtol 0.05
  constC_span_needed_prec10pct                = 0.33546          value  rtol 0.05
  constC_misfit_at_span_0p5                   = 0.17109          value  rtol 0.05
  constC_span_prec5pct_min                    = 0.0725           value  rtol 0.05
  constC_span_prec5pct_max                    = 0.38194          value  rtol 0.05
  constC_sbs_bias_at_d1_max                   = (here 8.4e-09)   bound  bound &lt;= 1e-07 [tolerance]
  constC_sbs_recovered_d_sig0                 = 2                value  rtol 0.05
  constC_sbs_recovered_d_base                 = 1.3835           value  rtol 0.05
  constC_sbs_bias_max_scanned                 = 0.4916           value  rtol 0.05
  constC_sbs_bias_target                      = 0.05             exact  exact
  constC_sbs_sigma_for_bias                   = 0.0763           value  rtol 0.05
  constC_sbs_bias_sig0                        = (here 5.4e-09)   bound  bound &lt;= 1e-07 [tolerance]
  bed_spatial_err_n1_exp                      = 5.7651e-07       value  rtol 0.05
  bed_spatial_order_n1_exp                    = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  bed_spatial_err_n2_exp                      = 3.0378e-07       value  rtol 0.05
  bed_spatial_order_n2_exp                    = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  bed_spatial_err_n1_quad                     = 1.4612e-07       value  rtol 0.05
  bed_spatial_order_n1_quad                   = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  bed_spatial_err_n2_quad                     = 5.5411e-08       value  rtol 0.05
  bed_spatial_order_n2_quad                   = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  bed_spatial_finest_over_roundoff            = (here 3.6e+05)   bound  bound &gt;= 1000 [theory]
  bed_time_order_heun_min                     = (here 2.0e+00)   bound  bound [1.95, 2.05] [theory]
  bed_time_order_heun_max                     = (here 2.0e+00)   bound  bound [1.95, 2.05] [theory]
  bed_time_order_euler_min                    = (here 1.0e+00)   bound  bound [0.95, 1.05] [theory]
  bed_time_order_euler_max                    = (here 1.0e+00)   bound  bound [0.95, 1.05] [theory]
  bed_space_order_march_min                   = (here 2.0e+00)   bound  bound [1.95, 2.05] [theory]
  bed_space_order_march_max                   = (here 2.0e+00)   bound  bound [1.95, 2.05] [theory]
  bed_route_gap_march                         = (here 8.9e-16)   bound  bound &lt;= 1e-11 [tolerance]
  bed_axes_finest_over_roundoff               = (here 3.3e+08)   bound  bound &gt;= 1000 [theory]
  bed_a_inlet_cellcentre_finest_over_roundoff = (here 5.0e+10)   bound  bound &gt;= 1000 [theory]
  bed_a_outlet_space_finest_over_roundoff     = (here 3.1e+08)   bound  bound &gt;= 1000 [theory]
  bed_a_outlet_time_finest_over_roundoff      = (here 8.4e+08)   bound  bound &gt;= 1000 [theory]
  bed_vs_quadrature_production                = 1.5295e-06       value  rtol 0.05
  bed_vs_quadrature_over_resolution           = 0.00076474       value  rtol 0.05
  bed_vs_quadrature_series                    = 1.5293e-06       value  rtol 0.05
  eq15_maxdev                                 = (here 8.6e-09)   bound  bound &lt;= 1e-07 [tolerance]
  eq19_maxdev                                 = (here 2.7e-15)   bound  bound &lt;= 1e-12 [identity]
  eq22_maxdev_pymrm                           = 3.0098e-06       value  rtol 0.05
  eq28_reldev                                 = (here 1.4e-16)   bound  bound &lt;= 1e-12 [identity]
  a_end_d0_branch                             = 0.2              value  rtol 0.05
  eq29_reldev                                 = (here 3.3e-16)   bound  bound &lt;= 1e-12 [identity]
  a_end_d1_branch                             = 0.44933          value  rtol 0.05
  eq30_reldev                                 = (here 2.0e-16)   bound  bound &lt;= 1e-12 [identity]
  a_end_d2_branch                             = 0.55556          value  rtol 0.05
  eq31_reldev                                 = (here 2.2e-16)   bound  bound &lt;= 1e-12 [identity]
  a_end_d3_branch                             = 0.62017          value  rtol 0.05
  pseudo_steady_cost_eps1e-3                  = 0.00046531       value  rtol 0.05
  pseudo_steady_cost_eps3e-2                  = 0.013978         value  rtol 0.05
  pseudo_steady_cost_slope                    = (here 1.0e+00)   bound  bound [0.995, 1.005] [theory]
  pseudo_steady_eps_star                      = 0.0042972        value  rtol 0.05
  sep_plug_par_vs_ind_wideseed                = 0.0022016        value  rtol 0.05
  break_rows                                  = 24               exact  exact
  break_robustness_rows                       = 3                exact  exact
  fits_budget_share_max                       = (here 5.3e-01)   bound  bound &lt;= 0.9 [chosen]
  sep_optimiser_overstated                    = 1                exact  exact, margin 1
  sep_batch_n_separable                       = 0                exact  exact, margin 0.118
  sep_plug_n_separable                        = 1                exact  exact, margin 0.0416
  sep_mixed_n_separable                       = 0                exact  exact, margin 0.532
  sep_constC_n_separable                      = 0                exact  exact, margin 1</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>To the four rate equations, nothing</strong>: eqs. (4)–(7) are four lines of algebra, and three of the paper’s four contactings are lumped systems that need no discretisation at all. This page says so rather than dressing them up. What the reimplementation adds is below, and only the bed is the solver’s part:</p>
<ul>
<li><strong>The question the paper asks becomes measurable.</strong> “Which reactor can tell the classes apart” is answered by 64 fits, not by an argument, and it comes out the opposite way round from the taxonomy: <strong>every one of the four devices is exactly degenerate somewhere</strong>, and the reason in each case is a one-line identity the paper does not state. Two of the four collapse parallel onto series or onto independent, which destroys the taxonomy outright; the other two, the batch of fluid and the plug-flow bed, collapse only side-by-side onto parallel, and do so for <em>every</em> value of the poison group <img src="https://latex.codecogs.com/png.latex?%5Csigma">. The identity for the mixed reactor, series<img src="https://latex.codecogs.com/png.latex?(n',d)%20%5Cequiv"> parallel<img src="https://latex.codecogs.com/png.latex?(nn',%5C,d+n')">, is the sharp form of the whole result, and it carries an analytic boundary, <img src="https://latex.codecogs.com/png.latex?d%20%3C%20n'/n">, below which the exact twin ceases to exist; the boundary is <em>predicted</em>, and the measurement then shows what it is and is not worth (necessary for the mixed reactor to separate the two classes, nowhere near sufficient).</li>
<li><strong>And the identities are used, not just admired.</strong> Each one names a parameter vector at which some candidate reproduces some truth exactly. Those vectors are evaluated directly and reported beside the fits, because on one entry of the matrix the multistart, seeded next to the twin and free to reach it, fell into a wrong basin 1.3e-3 short and would have printed an exactly-zero separation as a measured one. That is the asymmetry this page is built on: a non-separability result is a proof, a separability result is only “no better fit was found”.</li>
<li><strong>And the honest negative.</strong> At a 0.2-percentage-point conversion resolution, one of the twelve class pairs is separable in one of the four devices. A page that only reported where separation is easy would have reported nothing at all here, which is why the measurement was worth making.</li>
<li><strong>The bed is where pymrm is load-bearing, and it changes the recommendation.</strong> The plug-flow contacting is the only one with a spatial coordinate; it is <em>not</em> the only one free of exact degeneracy, as §4 shows, and its outlet history is still a hard measurement. Its <em>profile</em> is not: descending for parallel, ascending for series, contrasts of opposite sign, with both inlet values known in closed form (<img src="https://latex.codecogs.com/png.latex?a(0,%5Ctheta)%20=%20e%5E%7B-%5Clambda%5Ctheta%7D"> under parallel decay, and identically 1 under series, because no R has been made at the feed face). The page’s practical advice is therefore about what to measure, not which vessel to buy, and it is the same signature <code>B2.2</code> found in the coke. Each fluid profile of the bed is one <code>newton</code> solve with the exact Jacobian of <code>ConvFluxTVD</code>, which converges in a few iterations where van Leer deferred correction needs several times as many sweeps to the same profile (both counts are printed in the implementation section). And because the finite-volume bed keeps the fluid accumulation term, the <strong>pseudo-steady assumption the paper states on p.&nbsp;269 can be dropped and priced</strong>: first order in <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon">, crossing a 0.2 % conversion resolution at a run length that lands on the “minutes or longer” the paper writes in words on p.&nbsp;267.</li>
<li><strong>One printed defect, settled two ways.</strong> Eq. (24)’s <img src="https://latex.codecogs.com/png.latex?1/k_d"> should be <img src="https://latex.codecogs.com/png.latex?1/k">: symbolically the gap is exactly <img src="https://latex.codecogs.com/png.latex?%5Cln(k_d/k)">, and dimensionally the printed argument is in seconds where <img src="https://latex.codecogs.com/png.latex?%5Ctau'"> is in g cat·sec/liter. Reported, not repaired.</li>
</ul>
<p><strong>What it cannot add.</strong> There is no measurement in this paper, so nothing here is validated in the sense of agreeing with an experiment: every number is reproduction of printed algebra, an exact identity, or a computed property of the printed rate forms. And a separability number is an upper bound produced by an optimiser: the <em>non</em>-separability results are proofs, the separability results are “no better fit was found”.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>If you are designing an experiment to find a deactivation mechanism</strong>, the short version of this page is:</p>
<ol type="1">
<li><strong>Check <img src="https://latex.codecogs.com/png.latex?n'"> first.</strong> If the decay has no concentration dependence, there is only one class and no experiment can find another. Everything below is about <img src="https://latex.codecogs.com/png.latex?n'%20%3E%200">.</li>
<li><strong>A well-mixed fluid throws the class away.</strong> In any constant-flow mixed reactor, series deactivation of order <img src="https://latex.codecogs.com/png.latex?(n',%20d)"> is <em>exactly</em> parallel deactivation of order <img src="https://latex.codecogs.com/png.latex?(nn',%20d+n')">: same conversion history, at every time, for any <img src="https://latex.codecogs.com/png.latex?n">. Only below <img src="https://latex.codecogs.com/png.latex?d%20=%20n'/n"> does the exact twin cease to exist, and even there the impersonation stays good until you are roughly half an order below the line.</li>
<li><strong>Side-by-side is not a separate class in a batch or in a bed.</strong> The poison profile is a <em>power</em> of the reactant profile there, so eq. (6) with poison group <img src="https://latex.codecogs.com/png.latex?%5Csigma"> is eq. (4) with <img src="https://latex.codecogs.com/png.latex?n'%20%5Cto%20%5Clambda%5Csigma/%5Ckappa">: exactly, for every <img src="https://latex.codecogs.com/png.latex?%5Csigma">, at <img src="https://latex.codecogs.com/png.latex?n%20=%20n'%20=%20d%20=%201">. No experiment in either device can distinguish them, and the plug-flow bed is no exception. (It fails in the two well-mixed devices, where the profiles are not powers of one another.)</li>
<li><strong>Levenspiel’s recommended device does what he says and no more.</strong> Holding <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> constant by lowering the flow rate gives you <img src="https://latex.codecogs.com/png.latex?d"> cleanly from the shape of <img src="https://latex.codecogs.com/png.latex?%5Ctau'(t)">: that is real, and eqs. (28)–(31) reproduce to round-off. It does <em>not</em> give you the class: within one run parallel, series and independent are the same equation. Recovering the class needs a <strong>set</strong> of runs at different held levels, and the span matters: with <img src="https://latex.codecogs.com/png.latex?k'_d"> known to 5 % you need a span of a few hundredths to a few tenths in <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D/C_%7B%5Crm%20A0%7D"> (the measured range is printed in §8), and <em>where the set starts matters as much as how wide it is</em>: the range is swept over plausible starting levels and level counts in §8. A narrow bracket of levels tells you nothing.</li>
<li><strong>Run a bed, and assay the bed.</strong> The gradient is the information, but it is in the <em>solid</em>, not in the effluent. Judged on conversion history alone the bed separates one class pair in twelve at a 0.2-percentage-point resolution; judged on the spent catalyst it separates parallel from series at a glance, because the profile’s gradient reverses sign, and the inlet activity is exactly <img src="https://latex.codecogs.com/png.latex?e%5E%7B-%5Clambda%5Ctheta%7D"> under parallel decay against exactly 1 under series. One sample beats a whole campaign of outlet analyses. Before designing on it, size the contrast your assay can actually reach: <code>B2.2</code>’s own <em>within-bed</em> parallel signature at its operating point needs carbon assays better than 10 % (its numbers are printed in §6), and that is the same family of measurement.</li>
<li><strong>Hold <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20P%7D">, not <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D">, if the poison is consumed.</strong> That is the paper’s own instruction for eq. (6) and this page confirms it: with the poison in excess the deactivation order comes back exactly. Holding <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> instead, one knob, two constraints, bends the Fig.-6 line and biases <img src="https://latex.codecogs.com/png.latex?d">, except at <img src="https://latex.codecogs.com/png.latex?d%20=%201"> where the <img src="https://latex.codecogs.com/png.latex?a%5E%7Bd-1%7D"> consumption rate makes the drift cancel exactly. The paper hedges the failure of the <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20A%7D"> condition, not of the <img src="https://latex.codecogs.com/png.latex?C_%7B%5Crm%20P%7D"> one; this page sizes what that hedge costs.</li>
</ol>
<p><strong>Structure reuse.</strong> The <code>Bed</code> class is a one-dimensional convection problem with a distributed, slowly-evolving source parameter: the machinery of <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a> (coke profile), <code>ConvFluxTVD</code> + <code>construct_div</code> + one <code>newton</code> solve per fluid profile, with the outlet face moved to the linear extrapolation of the last two cells. The activity is marched in <img src="https://latex.codecogs.com/png.latex?w%20=%20(a%5E%7B1-d%7D-1)/(1-d)">, the paper’s own linearising substitution (eqs. 28–32), which is worth copying: it removes <img src="https://latex.codecogs.com/png.latex?a%5Ed"> from every right-hand side and makes the finite-time extinction of <img src="https://latex.codecogs.com/png.latex?d%20%3C%201"> ordinary rather than stiff.</p>
<p><strong>Where this sits in the ladder.</strong> <a href="../B2.1-voorhies-coking-law/"><code>B2.1</code></a> (coke keeps time), <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a> (coke keeps place), this page (what an experiment can actually recover). <code>B2.4</code> (Beeckman–Froment) is the next rung.</p>
<p><strong>Cite the source, not this page:</strong> Levenspiel, O., <em>Experimental Search for a Simple Rate Equation to Describe Deactivating Porous Catalyst Particles</em>, Journal of Catalysis <strong>25</strong>(2) 265–272 (1972), <a href="https://doi.org/10.1016/0021-9517(72)90227-8">doi:10.1016/0021-9517(72)90227-8</a>. Note that this is Levenspiel the author; <em>Chemical Reaction Engineering</em> is a different work and is not reproduced anywhere here.</p>
<p><strong>Fit/test, one line:</strong> nothing on this page is fitted to any measurement and nothing is validated against one: the paper reports no data. Every number is exact reproduction of printed algebra, an exact algebraic identity between the printed rate forms, or a computed property of those rate forms in a reactor.</p>


</section>
</section>

 ]]></description>
  <category>sec:B</category>
  <category>struct:S1</category>
  <category>struct:S5</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.3-levenspiel-deactivation-classes/</guid>
  <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Voorhies’ coking law: carbon on catalyst keeps time, not throughput</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.1-voorhies-coking-law/</link>
  <description><![CDATA[ 




<section id="voorhies-coking-law-carbon-on-catalyst-keeps-time-not-throughput" class="level1">
<h1>Voorhies’ coking law: carbon on catalyst keeps time, not throughput</h1>
<p><strong>Catalog ID:</strong> <code>B2.1</code> · <strong>Structures:</strong> <code>S1</code> · <strong>Tier:</strong> T0</p>
<p>Every deactivation model that writes coke as a function of time-on-stream, including the Froment–Bischoff reactor model of <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a>, which was written to replace it, descends from five pages of <em>Industrial &amp; Engineering Chemistry</em>, April 1945:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AC_c%20%5C;=%5C;%20A%5C,%5Ctheta%5E%7B%5C,n%7D,%0A"></p>
<p>carbon on catalyst as a power of the time since the catalyst was last regenerated. The paper’s abstract stakes a sharper claim than the power law itself: <em>“For all the data examined, the amount of carbon deposited on the catalyst at given conditions is, within limits, independent of the hydrocarbon feed rate.”</em> Push twice the oil over the same catalyst for the same two hours and you get the same carbon on the catalyst, the deposit keeps time, not throughput.</p>
<p>That is the non-obvious claim, and the paper prints the tables that carry it. This page quantifies what the printed word “independent” amounts to (a feed-rate exponent with its standard error, against the competing hypothesis at exponent <img src="https://latex.codecogs.com/png.latex?+1">), shows that the paper’s two carbon columns are one measurement seen twice (so the claim gets exactly one test per table, not two), reproduces the printed conversion–feed-rate–time algebra by two routes, measures the temperature-doubling claim per catalyst with its standard errors, and settles a factor-of-two defect in the printed nomenclature of the diffusion hypothesis from the paper’s own two lines.</p>
<div id="cc864042" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:17.841349Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:17.841179Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:17.853521Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:17.852669Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.4.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B2.1-voorhies-coking-law"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="ae4b85a3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:17.855977Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:17.855793Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.026802Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.025763Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Imports. Packages beyond pymrm and the Colab defaults (numpy, scipy, pandas,</span></span>
<span id="cb2-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># matplotlib, pyyaml, sympy) are installed here with subprocess, not %pip. The only</span></span>
<span id="cb2-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pymrm call on this page is find_roots (see "What pymrm adds").</span></span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb2-5"></span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> solve_ivp</span>
<span id="cb2-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.stats <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> t <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> student_t</span>
<span id="cb2-13"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm.checks <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> find_roots</span>
<span id="cb2-14"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Claims, cite_data, load_data, load_meta</span>
<span id="cb2-15"></span>
<span id="cb2-16">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-17">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb2-18">PAGE_B22 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B2.2-froment-bischoff-coking"</span></span>
<span id="cb2-19"></span>
<span id="cb2-20"></span>
<span id="cb2-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fill(text, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>v):</span>
<span id="cb2-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Fill ``&lt;&lt;name:fmt&gt;&gt;`` in ``text`` from ``v``. Formats are Python formats, or</span></span>
<span id="cb2-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``pctN`` / ``+pctN`` for a fraction shown as a percentage with N decimals."""</span></span>
<span id="cb2-24">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sub(m):</span>
<span id="cb2-25">        name, _, fmt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).partition(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb2-26">        x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v[name]</span>
<span id="cb2-27">        mp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re.fullmatch(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\+</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pct</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, fmt)</span>
<span id="cb2-28">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> mp:</span>
<span id="cb2-29">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>{mp.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)}<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>{mp.group(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)}f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb2-30">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(x, fmt)</span>
<span id="cb2-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> re.sub(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"&lt;&lt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[^&lt;&gt;]</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&gt;&gt;"</span>, sub, text)</span>
<span id="cb2-32"></span>
<span id="cb2-33"></span>
<span id="cb2-34"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> say(text, V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb2-35">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Prose whose numbers are written by code, so they cannot drift. ``V`` is the dictionary</span></span>
<span id="cb2-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    of the page's numbers; keyword arguments add to it and take precedence."""</span></span>
<span id="cb2-37">    display(Markdown(fill(text, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(V <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> {}), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw})))</span>
<span id="cb2-38"></span>
<span id="cb2-39"></span>
<span id="cb2-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed constants of the paper, read once: every number the text states about them is filled from here</span></span>
<span id="cb2-41">pc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies-1945-printed-constants.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb2-42">K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(pc.item_id, pc.printed_value.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p><strong>The source, precisely.</strong> Alexis Voorhies, Jr., “Carbon Formation in Catalytic Cracking”, <em>Industrial &amp; Engineering Chemistry</em> <strong>37</strong>(4) 318–322 (April 1945), doi:10.1021/ie50424a010, Esso Laboratories, Standard Oil Company of New Jersey (Louisiana Division), Baton Rouge, La., identified from the scan’s own display title, by-line and abstract on page 318, with the ACS download stamp confirming volume 37, issue 4, first page 318. The by-line prints <strong>“ALEXIS VOORHIES, JR.”</strong>; the catalogue’s “Voorhies, A.” lacks the Jr., and this page carries it. The scan is CCITT-G4 bilevel at 300 ppi native; every numeral on this page was read from cropped native-resolution renders at digit scale, never from the text layer. (The neighbouring <code>B1.7</code> Mears file on disk opens with the tail of another paper discussing “the Voorhies (1945) relationship”, a standing reminder in this repository that a first-page glance is not an identification.)</p>
<p><strong>What the paper does.</strong> It observes that for fixed-bed and fluid catalytic cracking alike, carbon-on-catalyst follows <img src="https://latex.codecogs.com/png.latex?C_c%20=%20A%5Ctheta%5En"> with <img src="https://latex.codecogs.com/png.latex?n"> in a narrow band and <img src="https://latex.codecogs.com/png.latex?A"> specific to catalyst, feed stock and temperature; that at a fixed residence time the deposit is nearly independent of feed rate; and it then chains its two fitted correlations into a working relation between conversion, feed rate and cracking-period length (its eq. 5), the practical payoff, “applied to the commercial-scale units”. A closing hypothesis reads the low temperature coefficient as diffusion control through the deposit itself, predicting <img src="https://latex.codecogs.com/png.latex?n%20=%200.5">.</p>
<p><strong>Where it sits.</strong> Downstream, Froment &amp; Bischoff (1961, page <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a>) argue that once coke lays down as a <em>profile</em> along a bed, an activity correlated only with time is ill-posed, and their Section 7(a) checks their mechanisms against the very exponent range this paper prints. <code>B2.2</code> established which of their mechanism/activity pairs can reach the Voorhies exponents; that finding is <code>B2.2</code>’s and is not restated here, this page owns the original law, its tables, and its own printed claims. <code>B2.3</code> (Levenspiel’s deactivation orders) continues the ladder.</p>
<p><strong>What this page deliberately does not do.</strong> The fixed-bed carbon-vs-time points (Fig. 1), the conversion–yield points (Fig. 3), the conversion–time curves (Fig. 4) and the fluid-cracking data (Fig. 5) exist <strong>only as figures</strong>. Nothing on this page digitises them: the coefficients and exponents of eqs. (1), (2), (3), (6), (7) are transcribed as printed and are <em>not</em> refit, and every claim tested here is tested against the paper’s <strong>printed tables and printed equations</strong> alone. In particular, Tables I and II hold <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> fixed, so <strong>nothing on this page tests the time exponent <img src="https://latex.codecogs.com/png.latex?n"> against data</strong>, the page says so rather than pretending otherwise.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>All equation numbers are the paper’s; every constant below was read from a cropped native-resolution render. The constants as typeset here are compared with the data file of printed constants by the claim <code>typeset_constants_match_csv</code>, so a retyping error cannot stand.</p>
<p><strong>The law</strong> (p.&nbsp;319, unnumbered, then fitted twice):</p>
<p><img src="https://latex.codecogs.com/png.latex?C_c%20=%20A%5C,%5Ctheta%5E%7B%5C,n%7D"></p>
<p>with, from the Nomenclature (p.&nbsp;322): <img src="https://latex.codecogs.com/png.latex?C_c"> = “carbon, weight per cent on catalyst”, <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> = “catalyst residence time, minutes”, <img src="https://latex.codecogs.com/png.latex?A"> = “constant, depending on catalyst, feed stock, and temperature”, and <img src="https://latex.codecogs.com/png.latex?n"> = “constant, depending <strong>only slightly</strong> on catalyst, feed stock, temperature” (emphasis added, that asymmetry is measured below). For fixed-bed cracking <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> is the length of the process period since the last regeneration.</p>
<p><strong>The four fitted instances</strong>, as printed:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>eq.</th>
<th>correlation</th>
<th>system</th>
<th>mode</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>(1)</td>
<td><img src="https://latex.codecogs.com/png.latex?C_c%20=%200.86%5C,%5Ctheta%5E%7B0.41%7D"></td>
<td>West Texas gas oil, natural (activated clay) catalyst, 850 °F</td>
<td>fixed bed</td>
</tr>
<tr class="even">
<td>(2)</td>
<td><img src="https://latex.codecogs.com/png.latex?C_c%20=%200.65%5C,%5Ctheta%5E%7B0.44%7D"></td>
<td>East Texas gas oil, synthetic (silica–alumina) catalyst, 850 °F</td>
<td>fixed bed</td>
</tr>
<tr class="odd">
<td>(6)</td>
<td><img src="https://latex.codecogs.com/png.latex?C_c%20=%200.52%5C,%5Ctheta%5E%7B0.38%7D"></td>
<td>East Texas gas oil, natural catalyst, 900–930 °F</td>
<td>fluid</td>
</tr>
<tr class="even">
<td>(7)</td>
<td><img src="https://latex.codecogs.com/png.latex?C_c%20=%200.24%5C,%5Ctheta%5E%7B0.53%7D"></td>
<td>Tinsley gas oil, synthetic catalyst, 950 °F</td>
<td>fluid</td>
</tr>
</tbody>
</table>
<p>(Eq. 2 prints its subscript with a filled counter, the ink reads “<img src="https://latex.codecogs.com/png.latex?C_.">”, but its restatements on pp.&nbsp;321 and 322 print <img src="https://latex.codecogs.com/png.latex?C_c"> unambiguously.)</p>
<p><strong>The carbon-yield correlation</strong> (p.&nbsp;321), for the same runs as eq. (2):</p>
<p><img src="https://latex.codecogs.com/png.latex?C_f%20=%20(3.55)(10%5E%7B-5%7D)%5C,V%5E%7B2.93%7D%20%5Ctag%7B3%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?C_f"> = carbon, weight per cent <strong>on feed</strong>, and <img src="https://latex.codecogs.com/png.latex?V"> = volume per cent conversion of feed stock, defined on p.&nbsp;318 as 100 minus volume % cycle gas oil (400 °F i.b.p.), the paper’s own caveat: a correlating convention, “not an exact measure of feed stock destruction”.</p>
<p><strong>The mass-balance bridge and the derived design equation</strong> (p.&nbsp;321):</p>
<p><img src="https://latex.codecogs.com/png.latex?C_c%20=%20C_f%20%5Cdiv%20(%5Ctext%7Bcatalyst-to-oil%20weight%20ratio%7D)%0A%20%20%20%20%20%20=%20C_f%5C,U%5C,%5Cfrac%7B%5Ctheta%7D%7B60%7D%5C,%5Cfrac%7BD_o%7D%7BD_c%7D,%20%5Cqquad%0A%5Cfrac%7BD_o%7D%7BD_c%7D%20=%20%5Cfrac%7B1%7D%7B0.58%7D%20%5Ctag%7B4%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctherefore%5C%200.65%5C,%5Ctheta%5E%7B0.44%7D%20=%20(3.55)(10%5E%7B-5%7D)%5C,V%5E%7B2.93%7D%5C,%0A%20%20%20U%5C,%5Cfrac%7B%5Ctheta%7D%7B60%7D%5Ccdot%5Cfrac%7B1%7D%7B0.58%7D%0A%5Cquad%5CLongrightarrow%5Cquad%0AV%20=%2096%5Ccdot%5Cfrac%7B1%7D%7BU%5E%7B0.34%7D%7D%5Ccdot%5Cfrac%7B1%7D%7B%5Ctheta%5E%7B0.19%7D%7D%20%5Ctag%7B5%7D"></p>
<p>where <img src="https://latex.codecogs.com/png.latex?U"> is feed rate in v/v/hr and <img src="https://latex.codecogs.com/png.latex?W%20=%20U%5C,D_o/D_c"> (p.&nbsp;319) converts it to a weight basis. The chain (2)+(3)+(4)→(5) is pure printed algebra and is reproduced below, twice: by a symbolic route and by a numeric route with no solver code in common (they share the one hand isolation step; the printed triple is the external check on that step).</p>
<p><strong>The diffusion hypothesis</strong> (p.&nbsp;322): if the rate of diffusion through the deposit is inversely proportional to the deposit,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BdC_c%7D%7Bd%5Ctheta%7D%20=%20%5Cfrac%7BK%7D%7BC_c%7D%0A%5Cquad%5Ctext%7Bor%7D%5Cquad%0AC_c%20=%20A%5C,%5Ctheta%5E%7B0.5%7D%20%5Ctag%7B8%7D"></p>
<p>and the Nomenclature prints “<img src="https://latex.codecogs.com/png.latex?K"> = constant <img src="https://latex.codecogs.com/png.latex?(=%20A%5E2)">”. Integrating the paper’s own left-hand line gives <img src="https://latex.codecogs.com/png.latex?K%20=%20A%5E2/2">, a factor-of-two defect settled below, from these two lines alone, and <strong>reported, not repaired</strong>.</p>
<p><strong>Two studies, kept apart.</strong> The paper’s fixed-bed material comes from two distinct experimental campaigns, and conflating them manufactures a contradiction: (i) the <strong>Fig.-1 study</strong> behind eqs. (2), (3), (5), small fixed-bed units, <em>one</em> repeatedly regenerated batch of synthetic catalyst of “such inherent stability that its activity was completely restored after each successive regeneration”, carbon determined from the regeneration gases; and (ii) the <strong>Table I/II study</strong>, a small-scale fixed-bed unit, a <em>fresh batch of catalyst every run</em>, carbon by combustion of the discharged catalyst. Same oil, same nominal temperature, different units and batches; the measured gap between their <img src="https://latex.codecogs.com/png.latex?A"> values is one of the results below.</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p>The law is two constants per system; nothing else enters. Everything this page computes uses only the printed values, which are read from the data file of printed constants (the table below is written from it, not typed).</p>
<div id="070a19ac" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.029191Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.029048Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.034665Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.033998Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> quantity </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> value </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> provenance </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A, n</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;eq1_A:g&gt;&gt;, &lt;&lt;eq1_n:g&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 319, transcribed </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fit to figure-only data; not refit here</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A, n</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;eq2_A:g&gt;&gt;, &lt;&lt;eq2_n:g&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 319, transcribed </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fit to figure-only data; not refit here</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;c3_mant:g&gt;&gt;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">imes10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-5}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, &lt;&lt;eq3_exp:g&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 321, transcribed </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fit to figure-only data; not refit here</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D_o/D_c</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/&lt;&lt;eq4_density_ratio:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 321, printed once, inside the eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> derivation only </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A, n</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> eqs</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">7</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;eq6_A:g&gt;&gt;, &lt;&lt;eq6_n:g&gt;&gt; and &lt;&lt;eq7_A:g&gt;&gt;, &lt;&lt;eq7_n:g&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 322, transcribed </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fluid; fits to figure-only data</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> triple </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;eq5_coeff:g&gt;&gt;, &lt;&lt;eq5_expU:g&gt;&gt;, &lt;&lt;eq5_expTheta:g&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 321, printed algebra, re-derived below </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> for Tables I and II </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;theta_tables_min:g&gt;&gt; min </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> "uniformly maintained at 2 hours", p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 320 </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the printed doubling claim </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_low_F:g&gt;&gt; to &lt;&lt;doubling_high_F:g&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 320, drawn from Table I through Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 2 </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb3-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, c3_mant<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>K)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>quantity</th>
<th>value</th>
<th>provenance</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?(A,%20n)"> eq. (1)</td>
<td>0.86, 0.41</td>
<td>p.&nbsp;319, transcribed (fit to figure-only data; not refit here)</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?(A,%20n)"> eq. (2)</td>
<td>0.65, 0.44</td>
<td>p.&nbsp;319, transcribed (fit to figure-only data; not refit here)</td>
</tr>
<tr class="odd">
<td>eq. (3)</td>
<td><img src="https://latex.codecogs.com/png.latex?3.55%5Ctimes10%5E%7B-5%7D">, 2.93</td>
<td>p.&nbsp;321, transcribed (fit to figure-only data; not refit here)</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?D_o/D_c"></td>
<td><img src="https://latex.codecogs.com/png.latex?1/0.58"></td>
<td>p.&nbsp;321, printed once, inside the eq.-(5) derivation only</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?(A,%20n)"> eqs. (6), (7)</td>
<td>0.52, 0.38 and 0.24, 0.53</td>
<td>p.&nbsp;322, transcribed (fluid; fits to figure-only data)</td>
</tr>
<tr class="even">
<td>eq. (5) triple</td>
<td>96, 0.34, 0.19</td>
<td>p.&nbsp;321, printed algebra, re-derived below</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5Ctheta"> for Tables I and II</td>
<td>120 min</td>
<td>“uniformly maintained at 2 hours”, p.&nbsp;320</td>
</tr>
<tr class="even">
<td>the printed doubling claim</td>
<td>190 to 200 °F</td>
<td>p.&nbsp;320, drawn from Table I through Fig. 2</td>
</tr>
</tbody>
</table>
</div>
</div>
<p><strong>Conventions.</strong> Feed-rate exponents are <img src="https://latex.codecogs.com/png.latex?m%20%5Cequiv%20d%5Cln%20C/d%5Cln%20U"> at fixed <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> (and nominally fixed <img src="https://latex.codecogs.com/png.latex?T">), by least squares of <img src="https://latex.codecogs.com/png.latex?%5Cln%20C"> on <img src="https://latex.codecogs.com/png.latex?%5Cln%20U"> on the printed rows, with the standard error of <img src="https://latex.codecogs.com/png.latex?m"> from the scatter of those rows; deviations are (value − printed)/printed. Temperatures stay in °F as printed. Every fit on this page is stated where it is made: what is fitted to what, over which rows, and with how many degrees of freedom.</p>
<p><strong>Assumptions carried from the source.</strong> Carbon means <em>catalytic</em> carbon, strippable carbon is purged before determination (p.&nbsp;319) and the paper calls its contribution negligible for these operations. Conversion is the cycle-gas-oil convention above. Substantially atmospheric pressure (“pressure was not a variable in the data presented here”, p.&nbsp;319). The feed-rate-independence claim is bounded by the paper itself: <em>“It is not proved or claimed that this observation will hold for all feed stocks, all catalysts, or an extreme variation in feed rates”</em> (p.&nbsp;320). The tables span a limited range of feed rate, printed with the results below, and every statement lives inside that span.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Three datasets, all transcriptions from this paper, read from cropped native-resolution renders, never the text layer.</p>
<section id="table-i-p.-320-east-texas-gas-oil-the-feed-rate-and-temperature-evidence" class="level3">
<h3 class="anchored" data-anchor-id="table-i-p.-320-east-texas-gas-oil-the-feed-rate-and-temperature-evidence">1. Table I (p.&nbsp;320): East Texas gas oil, the feed-rate and temperature evidence</h3>
<p>Four feed rates × four nominal temperature levels × two catalysts, every run a fresh 2-hour period on a fresh catalyst batch, carbon by combustion of the discharged catalyst. This is the paper’s own supporting evidence for the feed-rate claim and the data behind its Fig.-2 temperature claim, so every test against it below is a <strong>consistency check of the paper’s claims with the paper’s own data</strong>, and is labelled so; nothing here is held-out validation.</p>
<p>Two transcription notes, both settled at digit scale: the natural-catalyst 793 °F row and the synthetic 911 °F row print feed rate <strong>1.1</strong> (not 1.0; the synthetic one was verified twice at 4× magnification after a whole-page read mis-gave it). The mass-balance identity of results section 2 mildly disfavours the synthetic 1.1, as computed in the next section, but the glyph is unambiguous, so 1.1 is transcribed and the tension is reported rather than repaired.</p>
</section>
<section id="table-ii-p.-320-cetane-and-decalin-the-widest-feed-rate-range" class="level3">
<h3 class="anchored" data-anchor-id="table-ii-p.-320-cetane-and-decalin-the-widest-feed-rate-range">2. Table II (p.&nbsp;320): cetane and Decalin, the widest feed-rate range</h3>
<p>Pure-compound cracking, natural catalyst, 850 °F, 2-hour periods, the widest feed-rate span in the paper, and therefore the sharpest printed test of the claim.</p>
</section>
<section id="the-printed-constants-and-prose-claims" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-constants-and-prose-claims">3. The printed constants and prose claims</h3>
<p>Every coefficient, exponent and quantitative sentence this page uses, with locations, in <code>voorhies-1945-printed-constants.csv</code>. The five fitted <img src="https://latex.codecogs.com/png.latex?(A,n)"> pairs and eq. (3) are the author’s fits to <strong>figure-only</strong> data; they enter this page as transcriptions and are never refit.</p>
<p><strong>Cross-page reconciliation.</strong> <code>B2.2</code>‘s dataset <code>froment-bischoff-1961-printed-claims.csv</code> carries the Voorhies exponent range as Froment &amp; Bischoff quote it (their Sec. 7(a)); since this page states the same range from the original, the two are printed side by side below rather than retyped. <code>B2.2</code>’s findings about those rows, that they are transcriptions whose OCR mangles the range, and that the quoted range is other papers’ measurements seen through F&amp;B, are inherited and none affects their use here as a cross-reference.</p>
<div id="8ab925ec" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.036381Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.036253Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.049829Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.049120Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies-1945-tableI.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-2">t2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies-1945-tableII.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-3">t1_meta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies-1945-tableI.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed text of the carbon cells: it fixes the half-digit rounding allowance of each</span></span>
<span id="cb4-5">t1_str <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies-1945-tableI.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb4-6">t2_str <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies-1945-tableII.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb4-7"></span>
<span id="cb4-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I (p. 320): fixed-bed, East Texas gas oil, 2-hour periods"</span>)</span>
<span id="cb4-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(t1.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb4-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cite_data(t1_meta)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Table II (p. 320): cetane and Decalin, natural catalyst, 850 F, 2-hour periods"</span>)</span>
<span id="cb4-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(t2.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb4-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Printed constants and claims used by this page:"</span>)</span>
<span id="cb4-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(pc[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item_id"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"where"</span>]].to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Table I (p. 320): fixed-bed, East Texas gas oil, 2-hour periods
 catalyst  block  feed_rate_vvhr  temp_F  C_feed_wtpct  C_cat_wtpct
  natural      1             0.6     812           3.8          5.0
  natural      1             0.8     811           2.9          5.1
  natural      1             1.1     793           2.0          4.6
  natural      1             1.2     804           2.0          5.0
  natural      2             0.6     862           4.5          5.7
  natural      2             0.8     848           3.1          5.4
  natural      2             1.0     845           2.5          5.3
  natural      2             1.2     840           2.1          5.4
  natural      3             0.6     911           5.5          6.6
  natural      3             0.8     908           4.3          6.8
  natural      3             1.0     904           3.3          6.7
  natural      3             1.2     904           2.9          6.8
  natural      4             0.6     962           6.9          8.1
  natural      4             0.8     958           5.2          8.2
  natural      4             1.0     958           4.1          8.2
  natural      4             1.2     952           3.4          8.2
synthetic      1             0.6     808           5.8          7.9
synthetic      1             0.8     798           4.1          7.4
synthetic      1             1.0     803           3.2          7.4
synthetic      1             1.2     801           2.7          7.4
synthetic      2             0.6     863           7.8         10.1
synthetic      2             0.8     857           5.7          9.9
synthetic      2             1.0     852           4.2          9.4
synthetic      2             1.2     850           3.5          9.4
synthetic      3             0.6     917           9.3         12.0
synthetic      3             0.8     906           6.8         11.9
synthetic      3             1.1     911           5.3         11.8
synthetic      3             1.2     901           4.3         11.1
synthetic      4             0.6     964          11.2         14.0
synthetic      4             0.8     955           8.4         13.9
synthetic      4             1.0     957           6.6         14.1
synthetic      4             1.2     956           5.5         13.9

Voorhies, A. Jr. (1945) — Industrial &amp; Engineering Chemistry 37(4) 318-322 — doi:10.1021/ie50424a010 — table

Table II (p. 320): cetane and Decalin, natural catalyst, 850 F, 2-hour periods
   feed  feed_rate_vvhr  C_feed_wtpct  C_cat_wtpct
 cetane             0.6          4.80          4.9
 cetane             0.8          3.90          5.3
 cetane             1.2          2.50          5.2
 cetane             2.4          1.10          4.7
decalin             0.6          3.10          3.8
decalin             0.8          2.40          4.0
decalin             1.2          1.60          3.7
decalin             2.4          0.75          3.7

Printed constants and claims used by this page:
             item_id  printed_value                                      where
               eq1_A       0.860000           eq. (1), p. 319; restated p. 322
               eq1_n       0.410000                            eq. (1), p. 319
               eq2_A       0.650000      eq. (2), p. 319; restated pp. 321-322
               eq2_n       0.440000                            eq. (2), p. 319
           eq3_coeff       0.000036                            eq. (3), p. 321
             eq3_exp       2.930000                            eq. (3), p. 321
   eq4_density_ratio       0.580000           p. 321, between eqs. (4) and (5)
           eq5_coeff      96.000000                            eq. (5), p. 321
            eq5_expU       0.340000                            eq. (5), p. 321
        eq5_expTheta       0.190000                            eq. (5), p. 321
               eq6_A       0.520000                            eq. (6), p. 322
               eq6_n       0.380000                            eq. (6), p. 322
               eq7_A       0.240000                            eq. (7), p. 322
               eq7_n       0.530000                            eq. (7), p. 322
               eq8_n       0.500000                            eq. (8), p. 322
    K_identification       2.000000                       Nomenclature, p. 322
      doubling_low_F     190.000000                       p. 320, right column
     doubling_high_F     200.000000                       p. 320, right column
 faulty_measured_pct      36.000000                p. 321, left column (twice)
faulty_predicted_pct      41.000000                        p. 321, left column
    theta_tables_min     120.000000 Table I/II captions and p. 320 left column</code></pre>
</div>
</div>
<div id="d3c63459" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.051581Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.051403Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.058003Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.057294Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Cross-page reconciliation: the exponent range B2.2 quotes against the original.</span></span>
<span id="cb6-2">fb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"froment-bischoff-1961-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE_B22)</span>
<span id="cb6-3">fb_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fb.loc[fb.claim_id <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies_n_low"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_value"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb6-4">fb_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(fb.loc[fb.claim_id <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"voorhies_n_high"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_value"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb6-5">n_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: K[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_n"</span>)}</span>
<span id="cb6-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The four gas-oil exponents printed by Voorhies (1945):"</span>,</span>
<span id="cb6-7">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> n_printed.items()))</span>
<span id="cb6-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"min and max of the four: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(n_printed.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(n_printed.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Froment &amp; Bischoff (1961) Sec. 7(a), as transcribed on B2.2's page: "</span></span>
<span id="cb6-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fb_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fb_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for gas-oil cracking (Voorhies)'"</span>)</span>
<span id="cb6-11">same <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(n_printed.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> fb_lo) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(n_printed.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> fb_hi)</span>
<span id="cb6-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"-&gt; their quoted range is exactly the min and max of the four printed equations: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>same<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> same, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reconciliation with B2.2's transcription failed: investigate before publishing"</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The four gas-oil exponents printed by Voorhies (1945): eq1 n = 0.41, eq2 n = 0.44, eq6 n = 0.38, eq7 n = 0.53
min and max of the four: 0.38 and 0.53
Froment &amp; Bischoff (1961) Sec. 7(a), as transcribed on B2.2's page: '0.38 to 0.53 for gas-oil cracking (Voorhies)'
-&gt; their quoted range is exactly the min and max of the four printed equations: True</code></pre>
</div>
</div>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p><strong>There is no field to discretise on this page and it would be dishonest to invent one.</strong> The law is a two-parameter power function; the feed-rate test is least squares on log-transformed printed rows; the eq.-(5) chain is algebra; the one differential equation in the paper (eq. 8) is a scalar separable ODE, integrated symbolically and, as its independent second route, numerically with <code>solve_ivp</code>. No <code>construct_grad</code>, no <code>construct_div</code>, no Newton solve. The one pymrm call is <code>pymrm.checks.find_roots</code>, which finds the root of the eq.-(5) chain for the conversion <img src="https://latex.codecogs.com/png.latex?V"> on the physical range 0 to 100 % and raises unless it finds exactly one. This page follows <a href="../A1.6-wen-yu-minimum-fluidisation/"><code>A1.6</code></a>, <a href="../A1.1-ergun-pressure-drop/"><code>A1.1</code></a> and <a href="../F1.4-krishna-ellenberger-holdup/"><code>F1.4</code></a> in saying so in the section where a reader would otherwise expect a solver. (The bed that <em>does</em> need operators, coke laying down as a profile along a reactor, is the sequel, <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a>, which builds exactly that on this law.)</p>
<p><strong>One function computes every number.</strong> <code>study(t1, t2, K)</code> takes the two printed tables and the dictionary <code>K</code> of printed constants and returns every number the page publishes, so a break-table row at the end is one more call with one cell or one constant changed. The fits it makes are listed after the code.</p>
<div id="20af7934" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.060262Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.060139Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.470708Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.469920Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The printed text of every carbon cell fixes its half-digit rounding: 4.7 is known to</span></span>
<span id="cb8-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># +-0.05, 0.75 to +-0.005. These are properties of the print, not of a defect.</span></span>
<span id="cb8-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> half_ulp(printed):</span>
<span id="cb8-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Half of the last printed digit of each cell, from its text."""</span></span>
<span id="cb8-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> pd.Series([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> s <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb8-6">                      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> printed], index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>printed.index)</span>
<span id="cb8-7"></span>
<span id="cb8-8"></span>
<span id="cb8-9">HU1, HU2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_ulp(t1_str.C_cat_wtpct), half_ulp(t2_str.C_cat_wtpct)</span>
<span id="cb8-10">HU_FEED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (half_ulp(t1_str.C_feed_wtpct), half_ulp(t2_str.C_feed_wtpct))</span>
<span id="cb8-11"></span>
<span id="cb8-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The fitting tool of the whole page: ordinary least squares with its standard errors.</span></span>
<span id="cb8-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ols(X, y):</span>
<span id="cb8-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Least squares ``y = X b``: coefficients, their standard errors from the residual</span></span>
<span id="cb8-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    scatter, and the degrees of freedom."""</span></span>
<span id="cb8-16">    X, y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(X, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), np.asarray(y, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb8-17">    b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-18">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> b</span>
<span id="cb8-19">    dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X.shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb8-20">    cov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dof) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.linalg.inv(X.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> X)</span>
<span id="cb8-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> b, np.sqrt(np.diag(cov)), dof</span>
<span id="cb8-22"></span>
<span id="cb8-23"></span>
<span id="cb8-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> slope_fit(U, C):</span>
<span id="cb8-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Feed-rate exponent m = d ln C / d ln U: ln C fitted to ln U with one intercept,</span></span>
<span id="cb8-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    and the standard error of m from the scatter of the group's own rows."""</span></span>
<span id="cb8-27">    b, se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(np.column_stack([np.ones(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(U)), np.log(U)]), np.log(C))</span>
<span id="cb8-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(se[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), dof</span>
<span id="cb8-29"></span>
<span id="cb8-30"></span>
<span id="cb8-31"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> slope_endpoints(U, C):</span>
<span id="cb8-32">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The same exponent from the two extreme feed rates only, a regression-free</span></span>
<span id="cb8-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    estimator that uses the lowest and the highest feed-rate row of the group."""</span></span>
<span id="cb8-34">    U, C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(U, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), np.asarray(C, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb8-35">    i, j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(U)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(U))</span>
<span id="cb8-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> U[i]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> (U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> U[j]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb8-37">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the lowest or highest feed rate occurs in more than one row"</span>)</span>
<span id="cb8-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(C[j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> C[i]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log(U[j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> U[i]))</span>
<span id="cb8-39"></span>
<span id="cb8-40"></span>
<span id="cb8-41"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> slope_rounding_floor(U, C, half):</span>
<span id="cb8-42">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst-case shift of the fitted slope when every printed C is off by up to half</span></span>
<span id="cb8-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    its last printed digit: the linearised ``delta m = sum w_i dlnC_i`` with the least</span></span>
<span id="cb8-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    squares weights ``w_i``, maximised by the adversarial sign pattern."""</span></span>
<span id="cb8-45">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(np.asarray(U, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb8-46">    w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x.mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x.mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb8-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.asarray(half, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.asarray(C, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))</span>
<span id="cb8-48"></span>
<span id="cb8-49"></span>
<span id="cb8-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pooled_slope(df, by, with_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb8-51">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One feed-rate exponent for several groups: ln C_cat fitted to ln U with a separate</span></span>
<span id="cb8-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    intercept for every group (``by``), and optionally one common temperature slope</span></span>
<span id="cb8-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    inside the groups, T minus the group's mean T. Returns m, its standard error, dof."""</span></span>
<span id="cb8-54">    lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[by].astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>).agg(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span>.join, axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(by, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> df[by].astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb8-55">    labv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lab.to_numpy(dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb8-56">    Xb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (labv[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> np.unique(labv)[<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, :]).astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb8-57">    cols <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [Xb, np.log(df.feed_rate_vvhr.to_numpy())[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]]</span>
<span id="cb8-58">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> with_T:</span>
<span id="cb8-59">        cols.append((df.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> df.groupby(labv).temp_F.transform(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean"</span>)).to_numpy()[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>])</span>
<span id="cb8-60">    b, se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(np.hstack(cols), np.log(df.C_cat_wtpct.to_numpy()))</span>
<span id="cb8-61">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b[Xb.shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(se[Xb.shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]), dof</span>
<span id="cb8-62"></span>
<span id="cb8-63"></span>
<span id="cb8-64"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dt2_fit(T, C):</span>
<span id="cb8-65">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Doubling interval ln 2 / s of the carbon, ln C fitted to T (s = d ln C / dT),</span></span>
<span id="cb8-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    with its standard error ln 2 se(s) / s^2 from the scatter of the rows."""</span></span>
<span id="cb8-67">    b, se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(np.column_stack([np.ones(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T)), np.asarray(T, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)]), np.log(np.asarray(C, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))</span>
<span id="cb8-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> se[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb8-69"></span>
<span id="cb8-70"></span>
<span id="cb8-71"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> unique_root(f, lo, hi, xtol):</span>
<span id="cb8-72">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The one root of ``f`` on the physical range [lo, hi], by pymrm.checks.find_roots.</span></span>
<span id="cb8-73"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Raises unless it returns exactly one."""</span></span>
<span id="cb8-74">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(f, lo, hi, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>xtol)</span>
<span id="cb8-75">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb8-76">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'roots'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> roots on [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'message'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-77">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-78"></span>
<span id="cb8-79"></span>
<span id="cb8-80"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> last_digit(x):</span>
<span id="cb8-81">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One unit of the last digit with which a constant is written (0.65 -&gt; 0.01)."""</span></span>
<span id="cb8-82">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> decimal <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Decimal</span>
<span id="cb8-83">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> Decimal(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x))).as_tuple().exponent</span>
<span id="cb8-84"></span>
<span id="cb8-85"></span>
<span id="cb8-86"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rounding_margin(c, eu, et):</span>
<span id="cb8-87">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Distance, in units of the last printed digit, of (c, eu, et) from the nearest</span></span>
<span id="cb8-88"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    rounding boundary of the printed (96, 0.34, 0.19): 0.5 is the middle of a rounding</span></span>
<span id="cb8-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    interval, 0 a value on its edge."""</span></span>
<span id="cb8-90">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb8-91">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(c), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(eu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(et <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>))</span>
<span id="cb8-92"></span>
<span id="cb8-93"></span>
<span id="cb8-94"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- facts of the derivation that no printed number enters ----------------------------</span></span>
<span id="cb8-95"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (8): dC/dtheta = K / C from a clean catalyst, and what K matching C = A theta^0.5 needs.</span></span>
<span id="cb8-96">_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-97">_K, _A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K A_"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-98">_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.Function(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>)</span>
<span id="cb8-99">_sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.dsolve(sp.Eq(_C(_th).diff(_th), _K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _C(_th)), _C(_th), ics<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{_C(sp.S(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)): <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>})</span>
<span id="cb8-100">C_SYMBOLIC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [s.rhs <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (_sol <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(_sol, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> [_sol])</span>
<span id="cb8-101">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s.rhs.subs({_K: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, _th: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>}) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-102">K_OVER_A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.solve(sp.Eq(C_SYMBOLIC, _A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sp.sqrt(_th)), _K)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb8-103"></span>
<span id="cb8-104"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The constants as typeset in "The published model" below, checked against the CSV.</span></span>
<span id="cb8-105">TYPESET <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(eq1_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.86</span>, eq1_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.41</span>, eq2_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.65</span>, eq2_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.44</span>, eq3_coeff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.55e-5</span>, eq3_exp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.93</span>,</span>
<span id="cb8-106">               eq4_density_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.58</span>, eq5_coeff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">96.0</span>, eq5_expU<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span>, eq5_expTheta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.19</span>,</span>
<span id="cb8-107">               eq6_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.52</span>, eq6_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.38</span>, eq7_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.24</span>, eq7_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.53</span>, eq8_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb8-108">               theta_tables_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">120.0</span>)</span>
<span id="cb8-109"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the one row whose feed-rate glyph the sidecar discusses: synthetic catalyst, block 3, 911 F</span></span>
<span id="cb8-110">GLYPH_ROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t1.index[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">911</span>)][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-111">GLYPH_ALTERNATIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the other reading of the glyph that prints 1.1</span></span>
<span id="cb8-112"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># window of the chain checks: the feed rates and periods of the fixed-bed discussion (a choice)</span></span>
<span id="cb8-113">U_WIN, TH_WIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">240.0</span>)</span>
<span id="cb8-114"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># window in which the hypothesis' invariant is evaluated (a choice)</span></span>
<span id="cb8-115">TH_LO, TH_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">300.0</span></span>
<span id="cb8-116">V_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># volume per cent conversion cannot exceed 100</span></span>
<span id="cb8-117">N_U, N_TH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid of the numeric route of eq. (5)</span></span>
<span id="cb8-118"></span>
<span id="cb8-119"></span>
<span id="cb8-120"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> study(t1, t2, K, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>, tsign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, ode_rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, refuse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb8-121">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Every number the page publishes, for the data ``t1``, ``t2`` and the printed</span></span>
<span id="cb8-122"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    constants ``K``. Returns the claim values ``R`` and further detail ``X``.</span></span>
<span id="cb8-123"></span>
<span id="cb8-124"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``tsign`` is the sign of the temperature correction of the slopes, ``xtol`` the</span></span>
<span id="cb8-125"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    tolerance of every root find, ``ode_rtol`` the tolerance of the ODE integrations.</span></span>
<span id="cb8-126"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    With ``refuse=True`` a chain whose root find has no unique root on the physical range</span></span>
<span id="cb8-127"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    records nan for the numeric route instead of raising (for the break rows)."""</span></span>
<span id="cb8-128">    R, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}</span>
<span id="cb8-129">    theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_tables_min"</span>]</span>
<span id="cb8-130"></span>
<span id="cb8-131">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 1. feed-rate exponents -------------------------------------------------------</span></span>
<span id="cb8-132">    groups <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>temp_F<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">F"</span>, g, HU1)</span>
<span id="cb8-133">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (cat, blk), g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>])]</span>
<span id="cb8-134">    groups <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II"</span>, feed, g, HU2) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> feed, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t2.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>)]</span>
<span id="cb8-135">    sl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb8-136">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ds, label, g, hu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> groups:</span>
<span id="cb8-137">        m_cat, se_cat, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope_fit(g.feed_rate_vvhr, g.C_cat_wtpct)</span>
<span id="cb8-138">        m_feed, se_feed, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope_fit(g.feed_rate_vvhr, g.C_feed_wtpct)</span>
<span id="cb8-139">        sl.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(dataset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ds, group<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>label, m_feed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m_feed, se_feed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>se_feed, m_cat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m_cat,</span>
<span id="cb8-140">                       se_cat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>se_cat, dof<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dof, span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> g.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(),</span>
<span id="cb8-141">                       floor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>slope_rounding_floor(g.feed_rate_vvhr, g.C_cat_wtpct, hu.loc[g.index])))</span>
<span id="cb8-142">    sl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(sl)</span>
<span id="cb8-143">    T1, T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl[sl.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I"</span>], sl[sl.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II"</span>]</span>
<span id="cb8-144">    cet, dec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl[sl.group <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], sl[sl.group <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decalin"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-145">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slopes"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl</span>
<span id="cb8-146">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_rows_tableI"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_rows_tableII"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t1), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t2)</span>
<span id="cb8-147">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_tableI_mean"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.m_feed.mean()</span>
<span id="cb8-148">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_mean"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.m_cat.mean()</span>
<span id="cb8-149">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_worst_block"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.m_cat.loc[T1.m_cat.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().idxmax()]</span>
<span id="cb8-150">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_group_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl.m_cat.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb8-151">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_group_min"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_group_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl.m_feed.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), sl.m_feed.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb8-152">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_closer_to_zero_ratio_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sl.m_cat).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sl.m_cat.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()</span>
<span id="cb8-153">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_dev_from_minus_one_min_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (sl.m_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()</span>
<span id="cb8-154">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_dev_from_minus_one_max_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (sl.m_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb8-155">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_tableII_cetane"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_cetane"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cet.m_feed, cet.m_cat</span>
<span id="cb8-156">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_feed_tableII_decalin"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_decalin"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dec.m_feed, dec.m_cat</span>
<span id="cb8-157">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_cetane_se"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_decalin_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cet.se_cat, dec.se_cat</span>
<span id="cb8-158">    cg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>]</span>
<span id="cb8-159">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_cetane_endpoint"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope_endpoints(cg.feed_rate_vvhr, cg.C_cat_wtpct)</span>
<span id="cb8-160">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_rounding_floor_tableI"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_rounding_floor_tableII"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.floor.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), T2.floor.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb8-161">    ratio_sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl.se_cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sl.floor       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># standard error against the rounding floor, group by group</span></span>
<span id="cb8-162">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"groups_se_exceeds_floor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((ratio_sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb8-163">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"se_floor_margin"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((ratio_sf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb8-164">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_cetane_over_own_floor_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cet.m_cat), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_cetane_endpoint"</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cet.floor</span>
<span id="cb8-165">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one exponent per table, with its standard error (separate intercept per group)</span></span>
<span id="cb8-166">    m, se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pooled_slope(t1, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>])</span>
<span id="cb8-167">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m, se</span>
<span id="cb8-168">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled_from_one_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se</span>
<span id="cb8-169">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled_over_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se</span>
<span id="cb8-170">    dists <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se]</span>
<span id="cb8-171">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooled_dof_I"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dof</span>
<span id="cb8-172">    m, se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pooled_slope(t1, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>], with_T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-173">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m, se</span>
<span id="cb8-174">    dists.append((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se)</span>
<span id="cb8-175">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"withT_dof_I"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dof</span>
<span id="cb8-176">    m, se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pooled_slope(t2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>)</span>
<span id="cb8-177">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m, se</span>
<span id="cb8-178">    dists.append((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se)</span>
<span id="cb8-179">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_pooled_from_one_se_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(dists)</span>
<span id="cb8-180">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooled_dof_II"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dof</span>
<span id="cb8-181"></span>
<span id="cb8-182">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 2. the temperature confound, bounded with the paper's own doubling rule -------</span></span>
<span id="cb8-183">    dt2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {cat: dt2_fit(g.temp_F, g.C_cat_wtpct) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cat, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t1.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>)}</span>
<span id="cb8-184">    m_cor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb8-185">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (cat, blk), g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]):</span>
<span id="cb8-186">        f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (tsign <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (g.temp_F.mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g.temp_F) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dt2[cat][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-187">        m_cor.append(slope_fit(g.feed_rate_vvhr, g.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-188">    m_cor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array(m_cor)</span>
<span id="cb8-189">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_raw"</span>], X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T1.m_cat.to_numpy(), m_cor</span>
<span id="cb8-190">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_tempcorrected_mean"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m_cor.mean()</span>
<span id="cb8-191">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_raw_over_floor_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T1.m_cat.to_numpy()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T1.floor.to_numpy()))</span>
<span id="cb8-192">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_corrected_over_floor_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_cor) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T1.floor.to_numpy()))</span>
<span id="cb8-193"></span>
<span id="cb8-194">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 3. the implied catalyst-to-oil ratio -------------------------------------------</span></span>
<span id="cb8-195">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> implied_WU(df):</span>
<span id="cb8-196">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> df.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (df.C_feed_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> df.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>))</span>
<span id="cb8-197"></span>
<span id="cb8-198">    WU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}{</span>blk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: implied_WU(g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (cat, blk), g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>])}</span>
<span id="cb8-199">    WU.update({feed: implied_WU(g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> feed, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t2.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>)})</span>
<span id="cb8-200">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WU</span>
<span id="cb8-201">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_implied_natural"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> implied_WU(t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>]).mean()</span>
<span id="cb8-202">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_implied_synthetic"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> implied_WU(t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>]).mean()</span>
<span id="cb8-203">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_implied_cetane"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_implied_decalin"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].mean(), WU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decalin"</span>].mean()</span>
<span id="cb8-204">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_decalin_over_cetane"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_implied_decalin"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_implied_cetane"</span>]</span>
<span id="cb8-205">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_within_group_cv_max_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> v.std(ddof<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v.mean() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WU.values())</span>
<span id="cb8-206">    bm, bse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}</span>
<span id="cb8-207">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (cat, blk), g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]):</span>
<span id="cb8-208">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> WU[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}{</span>blk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb8-209">        bm[(cat, blk)], bse[(cat, blk)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r.mean(), r.std(ddof<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(r))</span>
<span id="cb8-210">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cat <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>):</span>
<span id="cb8-211">        ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bm[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bm[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)]</span>
<span id="cb8-212">        se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.hypot(bse[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bm[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], bse[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bm[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)])</span>
<span id="cb8-213">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"WU_block_drift_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-214">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"WU_block_drift_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_over_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> se</span>
<span id="cb8-215">        X[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bm_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (bm[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], bm[(cat, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)])</span>
<span id="cb8-216">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># half-digit rounding of the printed cells, row by row, from their own decimals</span></span>
<span id="cb8-217">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> allowance(df, hu_cat, hu_feed):</span>
<span id="cb8-218">        uC, uF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hu_cat.loc[df.index], hu_feed.loc[df.index]</span>
<span id="cb8-219">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((df.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> uC) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (df.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> uC)</span>
<span id="cb8-220">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (df.C_feed_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> uF) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (df.C_feed_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> uF) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-221"></span>
<span id="cb8-222">    allow <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([allowance(t1, HU1, HU_FEED[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), allowance(t2, HU2, HU_FEED[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])])</span>
<span id="cb8-223">    labels <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.concat([t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" block "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t1.block.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", U = "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t1.feed_rate_vvhr.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>),</span>
<span id="cb8-224">                        t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", U = "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> t2.feed_rate_vvhr.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)], ignore_index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-225">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_half_digit_allowance_max_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> allow.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb8-226">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"allowance_row"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> labels[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(allow))]</span>
<span id="cb8-227">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the 911 F synthetic row, read 1.1 or 1.0, against the other three rows of its block</span></span>
<span id="cb8-228">    gb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)]</span>
<span id="cb8-229">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> key, alt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as_read"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"if_1p0"</span>, GLYPH_ALTERNATIVE)):</span>
<span id="cb8-230">        gg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gb.copy()</span>
<span id="cb8-231">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> alt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb8-232">            gg.loc[GLYPH_ROW, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_rate_vvhr"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> alt</span>
<span id="cb8-233">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> implied_WU(gg)</span>
<span id="cb8-234">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"WU_glyph_row_dev_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (r[GLYPH_ROW] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.drop(GLYPH_ROW).mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-235">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># m_cat = m_feed + 1 + (slope of ln(W/U) on ln U inside the group), exactly</span></span>
<span id="cb8-236">    gaps, s_wu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb8-237">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ds, label, g, hu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> groups:</span>
<span id="cb8-238">        r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> implied_WU(g)</span>
<span id="cb8-239">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope_fit(g.feed_rate_vvhr, r)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-240">        row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl[(sl.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> ds) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (sl.group <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> label)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-241">        s_wu.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s))</span>
<span id="cb8-242">        gaps.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((row.m_cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> row.m_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s))</span>
<span id="cb8-243">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_slope_vs_feed_worst_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(s_wu)</span>
<span id="cb8-244">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_decomposition_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(gaps)</span>
<span id="cb8-245"></span>
<span id="cb8-246">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 4. the printed chain (2) + (3) + (4) -&gt; (5) ------------------------------------</span></span>
<span id="cb8-247">    A2, n2, c3, e3, dr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (K[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_density_ratio"</span>))</span>
<span id="cb8-248">    pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff"</span>], K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expU"</span>], K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expTheta"</span>])</span>
<span id="cb8-249">    rat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: sp.Rational(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x)))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exact decimal, so the isolation is exact</span></span>
<span id="cb8-250">    U_, th_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U theta"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-251">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route A, symbolic: eq. (2) = eq. (3) times eq. (4), isolated for V</span></span>
<span id="cb8-252">    Vsol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (rat(A2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> rat(n2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> rat(dr) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (rat(c3) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th_)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rat(e3))</span>
<span id="cb8-253">    c_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(Vsol.subs({U_: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, th_: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>}))</span>
<span id="cb8-254">    eu_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(sp.diff(sp.log(Vsol), U_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U_))</span>
<span id="cb8-255">    et_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sp.simplify(sp.diff(sp.log(Vsol), th_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th_))</span>
<span id="cb8-256">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff_symbolic"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expU_symbolic"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expTheta_symbolic"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c_sym, eu_sym, et_sym</span>
<span id="cb8-257">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route B, numeric: the same isolation, root-found for V point by point on a (U, theta)</span></span>
<span id="cb8-258">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid, then ln V fitted to (1, ln U, ln theta) by least squares</span></span>
<span id="cb8-259">    Ug, Tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.meshgrid(np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>U_WIN, N_U), np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>TH_WIN, N_TH))</span>
<span id="cb8-260">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb8-261">        Vg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([unique_root(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> V, rhs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> dr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (c3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t): V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> e3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rhs,</span>
<span id="cb8-262">                                   <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, V_MAX, xtol) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(Ug.ravel(), Tg.ravel())])</span>
<span id="cb8-263">        Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([np.ones_like(Vg), np.log(Ug.ravel()), np.log(Tg.ravel())])</span>
<span id="cb8-264">        beta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(Xg, np.log(Vg), rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-265">        c_num, eu_num, et_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(beta[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(beta[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(beta[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb8-266">        resid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> beta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(Vg)).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb8-267">        X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refused"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb8-268">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> err:</span>
<span id="cb8-269">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> refuse:</span>
<span id="cb8-270">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span></span>
<span id="cb8-271">        c_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eu_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> et_num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> resid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.nan</span>
<span id="cb8-272">        X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refused"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(err)</span>
<span id="cb8-273">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff_numeric"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expU_numeric"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expTheta_numeric"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c_num, eu_num, et_num</span>
<span id="cb8-274">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_numeric_fit_residual"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> resid</span>
<span id="cb8-275">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_route_gap_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> c_num) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c_sym, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eu_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eu_num), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(et_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> et_num))</span>
<span id="cb8-276">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed (96, 0.34, 0.19) against the exact chain at the corners of the window; the ratio is</span></span>
<span id="cb8-277">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a power law in U and theta, so its extreme is at a corner</span></span>
<span id="cb8-278">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chain"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (c_sym, eu_sym, et_sym)</span>
<span id="cb8-279">    corners <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(u, t) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_WIN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH_WIN]</span>
<span id="cb8-280">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_printed_rounding_worst_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb8-281">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((pr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> pr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> pr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (c_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> eu_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> et_sym)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u, t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> corners)</span>
<span id="cb8-282">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_over_avg_conversion"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> et_sym</span>
<span id="cb8-283"></span>
<span id="cb8-284">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> hits(c, eu, et):</span>
<span id="cb8-285">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> pr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(eu, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(et, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb8-286"></span>
<span id="cb8-287">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> chain(A2v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A2, n2v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n2, c3v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c3, e3v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>e3, drv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dr):</span>
<span id="cb8-288">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (A2v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> drv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c3v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e3v), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e3v, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n2v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e3v</span>
<span id="cb8-289"></span>
<span id="cb8-290">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_hits_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hits(c_sym, eu_sym, et_sym)</span>
<span id="cb8-291">    margins <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [rounding_margin(c_sym, eu_sym, et_sym)]</span>
<span id="cb8-292">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># misreadings of a leading digit, a transposed glyph or an exponent scale: none may round</span></span>
<span id="cb8-293">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to the printed triple</span></span>
<span id="cb8-294">    mis <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(e3v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>e3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(e3v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>e3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.30</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(drv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(c3v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>),</span>
<span id="cb8-295">           <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n2v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.03</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(A2v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>)]</span>
<span id="cb8-296">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misreadings"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb8-297">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> mis:</span>
<span id="cb8-298">        c_, eu_, et_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb8-299">        margins.append(rounding_margin(c_, eu_, et_))</span>
<span id="cb8-300">        X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misreadings"</span>].append((kw, c_, eu_, et_, hits(c_, eu_, et_)))</span>
<span id="cb8-301">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_misreadings_total"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(mis)</span>
<span id="cb8-302">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_misreadings_matching"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(h <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_, h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misreadings"</span>])</span>
<span id="cb8-303">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every last-digit +-1 alternative of the five inputs</span></span>
<span id="cb8-304">    alt, surv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], []</span>
<span id="cb8-305">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> key, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A2v"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2v"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c3v"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e3v"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>),</span>
<span id="cb8-306">                      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drv"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_density_ratio"</span>)):</span>
<span id="cb8-307">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> step <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb8-308">            val <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> step <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> last_digit(K[name])</span>
<span id="cb8-309">            c_, eu_, et_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{key: val})</span>
<span id="cb8-310">            margins.append(rounding_margin(c_, eu_, et_))</span>
<span id="cb8-311">            alt.append((name, val, c_, eu_, et_, hits(c_, eu_, et_)))</span>
<span id="cb8-312">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternatives"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> alt</span>
<span id="cb8-313">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_last_digit_alternatives_matching"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(a[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> alt)</span>
<span id="cb8-314">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_last_digit_alternatives_total"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(alt)</span>
<span id="cb8-315">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_e3_alternatives_matching"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(a[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> alt <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>)</span>
<span id="cb8-316">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_margin"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(margins)</span>
<span id="cb8-317">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the "faulty point" remark, made quantitative through eq. (3)</span></span>
<span id="cb8-318">    V36, V41 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_measured_pct"</span>], K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_predicted_pct"</span>]</span>
<span id="cb8-319">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_point_implied_Cf_wtpct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> V41 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>]</span>
<span id="cb8-320">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_point_online_Cf_wtpct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> V36 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>]</span>
<span id="cb8-321">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_point_excess_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_point_implied_Cf_wtpct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_point_online_Cf_wtpct"</span>]</span>
<span id="cb8-322"></span>
<span id="cb8-323">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 5. the temperature coefficient ---------------------------------------------------</span></span>
<span id="cb8-324">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cat, key <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>)):</span>
<span id="cb8-325">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> cat]</span>
<span id="cb8-326">        b1, b4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g[g.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], g[g.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]</span>
<span id="cb8-327">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_F"</span>], R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_se_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dt2[cat][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], dt2[cat][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb8-328">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_twopoint_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb8-329">            (b4.temp_F.mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1.temp_F.mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb8-330">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.log(b4.C_cat_wtpct).mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(b1.C_cat_wtpct).mean()))</span>
<span id="cb8-331">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same interval from the four block means of each catalyst (2 degrees of freedom): the rows sit</span></span>
<span id="cb8-332">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at four temperatures, so the 16-row fit treats four temperature levels as 16 independent points</span></span>
<span id="cb8-333">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cat <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>):</span>
<span id="cb8-334">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> cat]</span>
<span id="cb8-335">        bT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>).temp_F.mean().to_numpy()</span>
<span id="cb8-336">        bC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(np.log(g.C_cat_wtpct).groupby(g.block).mean().to_numpy())</span>
<span id="cb8-337">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_blockmean_F"</span>], R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_blockmean_se_F"</span>], _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dt2_fit(bT, bC)</span>
<span id="cb8-338">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># lack of fit of the straight line through the rows: the quadratic term of ln C on T</span></span>
<span id="cb8-339">        Tc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g.temp_F.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g.temp_F.mean()</span>
<span id="cb8-340">        bq, sq, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(np.column_stack([np.ones(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Tc)), Tc, Tc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), np.log(g.C_cat_wtpct.to_numpy()))</span>
<span id="cb8-341">        R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_quadratic_t_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sq[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb8-342">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_split_blockmean_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_blockmean_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_blockmean_F"</span>]</span>
<span id="cb8-343">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_split_over_se_blockmean"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_split_blockmean_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.hypot(</span>
<span id="cb8-344">        R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_blockmean_se_F"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_blockmean_se_F"</span>])</span>
<span id="cb8-345">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_natural_vs_band_blockmean_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_blockmean_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_high_F"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_blockmean_se_F"</span>]</span>
<span id="cb8-346">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_synthetic_vs_band_low_blockmean_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_blockmean_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_low_F"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_blockmean_se_F"</span>]</span>
<span id="cb8-347">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_split_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_F"</span>]</span>
<span id="cb8-348">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_split_over_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_split_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.hypot(</span>
<span id="cb8-349">        R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_se_F"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_se_F"</span>])</span>
<span id="cb8-350">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_natural_vs_band_high_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_high_F"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_se_F"</span>]</span>
<span id="cb8-351">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_synthetic_vs_band_low_se"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_low_F"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_synthetic_se_F"</span>]</span>
<span id="cb8-352">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same fit on the carbon on feed, split exactly: ln C_feed = ln C_cat - ln U - ln(W/U) - const,</span></span>
<span id="cb8-353">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and least-squares slopes add</span></span>
<span id="cb8-354">    nat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>]</span>
<span id="cb8-355">    sT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> y: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(nat.temp_F.to_numpy(), np.asarray(y, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb8-356">    s_cat, s_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sT(np.log(nat.C_cat_wtpct)), sT(np.log(nat.C_feed_wtpct))</span>
<span id="cb8-357">    s_U, s_wu_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sT(np.log(nat.feed_rate_vvhr)), sT(np.log(implied_WU(nat)))</span>
<span id="cb8-358">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_feed_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> s_feed)</span>
<span id="cb8-359">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_linked_F"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (s_cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_U))</span>
<span id="cb8-360">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_decomposition_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s_feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (s_cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s_wu_T))</span>
<span id="cb8-361">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_slopes"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(cat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s_cat, feed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s_feed, U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s_U, WU<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s_wu_T)</span>
<span id="cb8-362"></span>
<span id="cb8-363">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- 6. the diffusion hypothesis: K = A^2 and the exponents ---------------------------</span></span>
<span id="cb8-364">    A_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>]</span>
<span id="cb8-365"></span>
<span id="cb8-366">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ode_ratio(Kc, rtol):</span>
<span id="cb8-367">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> solve_ivp(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, c: Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, theta], [np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)],</span>
<span id="cb8-368">                      rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb8-369">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s.status <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb8-370">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RuntimeError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"solve_ivp status </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>status<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>message<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-371">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(s.y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (A_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(theta)))</span>
<span id="cb8-372"></span>
<span id="cb8-373">    Kprinted, Khalf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_identification"</span>], A_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-374">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_over_A2_required"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K_OVER_A2</span>
<span id="cb8-375">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_printed_numeric_overshoot"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ode_ratio(Kprinted, ode_rtol)</span>
<span id="cb8-376">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_half_numeric_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ode_ratio(Khalf, ode_rtol) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb8-377">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_numeric_tolerance_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ode_ratio(Kprinted, ode_rtol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_printed_numeric_overshoot"</span>]),</span>
<span id="cb8-378">                                         <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ode_ratio(Khalf, ode_rtol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ode_ratio(Khalf, ode_rtol)))</span>
<span id="cb8-379">    npr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: K[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_n"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_n"</span>)}</span>
<span id="cb8-380">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_printed_min"</span>], R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_printed_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(npr.values()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(npr.values())</span>
<span id="cb8-381">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fb_range_matches_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(npr.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> fb_lo <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(npr.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> fb_hi)</span>
<span id="cb8-382">    drift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb8-383">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> eq, (ak, nk) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_n"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(2)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>),</span>
<span id="cb8-384">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(6)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_n"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(7)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_n"</span>)}.items():</span>
<span id="cb8-385">        drift[eq] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((TH_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TH_LO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K[nk] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-386">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> drift</span>
<span id="cb8-387">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drift_worst_eq"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(drift, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>drift.get)</span>
<span id="cb8-388">    X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drift_best_eq"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(drift, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>drift.get)</span>
<span id="cb8-389">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hypothesis_drift_worst_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(drift.values())</span>
<span id="cb8-390">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hypothesis_drift_best_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(drift.values())</span>
<span id="cb8-391">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A is local, n is portable: the two campaigns of the paper</span></span>
<span id="cb8-392">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_prediction_at_120min_wtpct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> theta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>]</span>
<span id="cb8-393">    blk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)]</span>
<span id="cb8-394">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_campaign_gap_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> blk.C_cat_wtpct.mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_prediction_at_120min_wtpct"</span>]</span>
<span id="cb8-395">    As <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [K[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_A"</span>)]</span>
<span id="cb8-396">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_span_factor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(As) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(As)</span>
<span id="cb8-397">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_span_half_range_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(npr.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(npr.values())) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(npr.values()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(npr.values()))</span>
<span id="cb8-398">    R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typeset_constants_match_csv"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(K[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TYPESET.items()))</span>
<span id="cb8-399">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {k: (v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(v, (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> R.items()}, X</span></code></pre></div></div>
</div>
<div id="38b1da80" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.473264Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.473079Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.663179Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.662354Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The baseline of the page: every number printed below comes from this one run, and every</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># number registered at the start of the Validation section is its result.</span></span>
<span id="cb9-3">R, X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> study(t1, t2, K)</span>
<span id="cb9-4">V <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>R, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>K}      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the values the prose cells fill in</span></span></code></pre></div></div>
</div>
<div id="257142b9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.665427Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.665303Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.669680Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.669011Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The checks the numbers are held to, declared here because the text quotes the bounds. A bound</span></span>
<span id="cb10-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is quoted with this run's value in "(here ...)": a round-off level value is not published.</span></span>
<span id="cb10-3">BOUNDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb10-4">    slope_decomposition_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb10-5">                                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact identity of least squares: ln(C_cat) = ln(C_feed) + ln(U) + const + ln(W/U), so the slopes add"</span>),</span>
<span id="cb10-6">    doubling_decomposition_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb10-7">                                    note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same additivity of least-squares slopes, against temperature"</span>),</span>
<span id="cb10-8">    eq5_numeric_fit_residual<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb10-9">                                  note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"find_roots xtol 1e-12 on V of order 30 to 80, so ln V is exact to about 1e-13; the chain is an exact power law"</span>),</span>
<span id="cb10-10">    eq5_route_gap_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb10-11">                           note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the symbolic and the root-found routes share the isolation of V and differ in solver only; set by find_roots xtol 1e-12"</span>),</span>
<span id="cb10-12">    K_half_numeric_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb10-13">                            note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"solve_ivp rtol 1e-10 on the integration with K = A^2 / 2"</span>),</span>
<span id="cb10-14">    K_numeric_tolerance_shift<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb10-15">                                   note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"change of either ODE ratio when rtol 1e-10 is tightened to 1e-12"</span>),</span>
<span id="cb10-16">)</span>
<span id="cb10-17">EXACT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb10-18">    n_rows_tableI<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{}, n_rows_tableII<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{},</span>
<span id="cb10-19">    groups_se_exceeds_floor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"se_floor_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb10-20">    eq5_hits_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>),</span>
<span id="cb10-21">    eq5_misreadings_matching<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>),</span>
<span id="cb10-22">    eq5_last_digit_alternatives_matching<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>),</span>
<span id="cb10-23">    eq5_e3_alternatives_matching<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rounding_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>),</span>
<span id="cb10-24">    eq5_misreadings_total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb10-25">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the number of misreadings tried, by construction of the list"</span>),</span>
<span id="cb10-26">    eq5_last_digit_alternatives_total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb10-27">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"five inputs times two directions, by construction of the sweep"</span>),</span>
<span id="cb10-28">    n_printed_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{}, n_printed_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{}, fb_range_matches_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{},</span>
<span id="cb10-29">    typeset_constants_match_csv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{},</span>
<span id="cb10-30">    K_over_A2_required<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb10-31">        note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the exact symbolic result of integrating dC/dtheta = K/C from a clean catalyst, 1/2 whatever number is printed; its numeric twin K_printed_numeric_overshoot carries the break rows"</span>),</span>
<span id="cb10-32">)</span>
<span id="cb10-33">V.update({<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"max_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"max"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS.items()})</span></code></pre></div></div>
</div>
<div id="5350428b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.671542Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.671377Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.676894Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.676178Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The fits `study` makes</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, each stated once:</span></span>
<span id="cb11-2"></span>
<span id="cb11-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Feed-rate exponent of a group</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;n_group:d&gt;&gt; rows</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln C</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fitted to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb11-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  with one intercept, &lt;&lt;dof_group:d&gt;&gt; degrees of freedom; the standard error comes from</span></span>
<span id="cb11-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  the scatter of the group's own rows</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The same fit is made for carbon on catalyst</span></span>
<span id="cb11-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  and on feed</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">One exponent per table</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln C_{cat}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fitted to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> with a separate intercept</span></span>
<span id="cb11-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  for every group, so only the within-group variation of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> enters</span></span>
<span id="cb11-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;pooled_dof_I:d&gt;&gt; degrees of freedom for Table I, &lt;&lt;pooled_dof_II:d&gt;&gt; for Table II</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb11-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  and for Table I once more with one common temperature coefficient inside the groups,</span></span>
<span id="cb11-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">T</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> minus the group mean </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;withT_dof_I:d&gt;&gt; degrees of freedom</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Doubling interval of a catalyst</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;n_cat:d&gt;&gt; rows, &lt;&lt;dof_cat:d&gt;&gt; degrees of freedom</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb11-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln C_{cat}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fitted to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">T</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, interval </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln 2/s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, standard error </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln 2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athrm{se}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span></span>
<span id="cb11-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  The same fit on the four block means of the catalyst </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2 degrees of freedom</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the</span></span>
<span id="cb11-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  quadratic term of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln C_{cat}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">T</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> over the rows, as the test of the straight line</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The numeric route of eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln V</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fitted to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1, </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln U, </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on a</span></span>
<span id="cb11-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;&lt;n_u:d&gt;&gt; by &lt;&lt;n_th:d&gt;&gt; grid of root-found conversions; the chain is an exact power law,</span></span>
<span id="cb11-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  so the residual of this fit is a round-off check, not a goodness of fit</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb11-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, n_group<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]).size().iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), dof_group<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slopes"</span>].dof.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb11-20">    n_cat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()), dof_cat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,</span>
<span id="cb11-21">    n_u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_U, n_th<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_TH, pooled_dof_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooled_dof_I"</span>], pooled_dof_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooled_dof_II"</span>],</span>
<span id="cb11-22">    withT_dof_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"withT_dof_I"</span>])</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The fits <code>study</code> makes</strong>, each stated once:</p>
<ul>
<li><strong>Feed-rate exponent of a group</strong> (4 rows): <img src="https://latex.codecogs.com/png.latex?%5Cln%20C"> fitted to <img src="https://latex.codecogs.com/png.latex?%5Cln%20U"> with one intercept, 2 degrees of freedom; the standard error comes from the scatter of the group’s own rows. The same fit is made for carbon on catalyst and on feed.</li>
<li><strong>One exponent per table</strong>: <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bcat%7D"> fitted to <img src="https://latex.codecogs.com/png.latex?%5Cln%20U"> with a separate intercept for every group, so only the within-group variation of <img src="https://latex.codecogs.com/png.latex?U"> enters (23 degrees of freedom for Table I, 5 for Table II); and for Table I once more with one common temperature coefficient inside the groups, <img src="https://latex.codecogs.com/png.latex?T"> minus the group mean (22 degrees of freedom).</li>
<li><strong>Doubling interval of a catalyst</strong> (16 rows, 14 degrees of freedom): <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bcat%7D"> fitted to <img src="https://latex.codecogs.com/png.latex?T">, interval <img src="https://latex.codecogs.com/png.latex?%5Cln%202/s">, standard error <img src="https://latex.codecogs.com/png.latex?%5Cln%202%5C,%5Cmathrm%7Bse%7D(s)/s%5E2">. The same fit on the four block means of the catalyst (2 degrees of freedom), and the quadratic term of <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bcat%7D"> on <img src="https://latex.codecogs.com/png.latex?T"> over the rows, as the test of the straight line.</li>
<li><strong>The numeric route of eq. 5</strong>: <img src="https://latex.codecogs.com/png.latex?%5Cln%20V"> fitted to <img src="https://latex.codecogs.com/png.latex?(1,%20%5Cln%20U,%20%5Cln%5Ctheta)"> on a 7 by 8 grid of root-found conversions; the chain is an exact power law, so the residual of this fit is a round-off check, not a goodness of fit.</li>
</ul>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="what-independent-of-feed-rate-measures-as" class="level3">
<h3 class="anchored" data-anchor-id="what-independent-of-feed-rate-measures-as">1. What “independent of feed rate” measures as</h3>
<p>For each temperature block of Table I and each pure compound of Table II, the feed-rate exponent <img src="https://latex.codecogs.com/png.latex?m%20=%20d%5Cln%20C/d%5Cln%20U"> of <strong>both</strong> carbon columns, with its standard error. The two competing bookkeepings sit an exponent apart:</p>
<ul>
<li>if carbon tracked <strong>throughput</strong>: every unit of feed depositing its share, <img src="https://latex.codecogs.com/png.latex?C_c"> at fixed <img src="https://latex.codecogs.com/png.latex?%5Ctheta"> would scale <img src="https://latex.codecogs.com/png.latex?%5Cpropto%20U">: <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%20=%20+1">;</li>
<li>if carbon keeps <strong>time</strong>, <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%20=%200">, and the mass balance then forces <img src="https://latex.codecogs.com/png.latex?m_%7Bfeed%7D%20=%20-1"> (fewer per cent of a larger throughput).</li>
</ul>
<p>Two different uncertainties sit beside each slope, and they answer different questions. The <strong>standard error</strong> is the scatter of the group’s own rows about its fitted line. The <strong>rounding floor</strong> is the largest shift of the slope that half a last printed digit in every carbon cell could produce in the worst pattern, the resolution limit of a table printed to two significant figures; it bounds the printing, not the scatter. Group by group the standard error is the larger of the two in most groups (count printed below), so the floor is not the error bar of the slopes.</p>
<div id="43500ba8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.678708Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.678585Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.684967Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.684565Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">sl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slopes"</span>]</span>
<span id="cb12-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"feed-rate exponents m = dlnC/dlnU at fixed theta, with standard errors (OLS, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(sl.dof.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degrees of freedom per group)"</span>)</span>
<span id="cb12-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'group'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'span'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_feed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'se'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'se'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'floor'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sl.itertuples():</span>
<span id="cb12-5">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>group<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m_feed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>se_feed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>m_cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>se_cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ±</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>floor<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-6">T1, T2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sl[sl.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I"</span>], sl[sl.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II"</span>]</span>
<span id="cb12-7">V.update(span_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T1.span.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), span_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T2.span.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), n_groups<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sl))</span>
<span id="cb12-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every group, evaluated: how far each |m_cat| sits from 0 in units of its own standard error</span></span>
<span id="cb12-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"standard error above the rounding floor in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'groups_se_exceeds_floor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sl)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> groups"</span>)</span>
<span id="cb12-10">z0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sl.m_cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sl.se_cat).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb12-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">m_cat in units of its own standard error from 0: smallest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>z0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, largest </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>z0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb12-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(group </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>group[z0.idxmax()]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); with </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(sl.dof.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degrees of freedom only a value above "</span></span>
<span id="cb12-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>student_t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.975</span>, sl.dof.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is significant at the 5 % level of a single group."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>feed-rate exponents m = dlnC/dlnU at fixed theta, with standard errors (OLS, 2 degrees of freedom per group)
group                   span   m_feed     se    m_cat     se   floor
natural 805F              2x   -0.981  0.080   -0.065  0.092 ± 0.034
natural 849F              2x   -1.095  0.063   -0.085  0.044 ± 0.031
natural 907F              2x   -0.950  0.055   +0.034  0.024 ± 0.026
natural 958F              2x   -1.024  0.012   +0.017  0.008 ± 0.021
synthetic 802F            2x   -1.110  0.041   -0.091  0.043 ± 0.023
synthetic 856F            2x   -1.177  0.044   -0.116  0.027 ± 0.018
synthetic 909F            2x   -1.037  0.111   -0.085  0.051 ± 0.014
synthetic 958F            2x   -1.031  0.011   -0.003  0.016 ± 0.012
cetane                    4x   -1.082  0.061   -0.047  0.056 ± 0.017
decalin                   4x   -1.030  0.029   -0.036  0.035 ± 0.022
standard error above the rounding floor in 8 of the 10 groups

m_cat in units of its own standard error from 0: smallest 0.16, largest 4.33 (group synthetic 856F); with 2 degrees of freedom only a value above 4.3 is significant at the 5 % level of a single group.</code></pre>
</div>
</div>
<div id="3063783a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.687242Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.687121Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.693464Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.692829Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Reading, group by group</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Against the two hypotheses </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat} = </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">throughput</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb14-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">time</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, every one of the &lt;&lt;n_groups:d&gt;&gt; groups has </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat}</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">le &lt;&lt;absmax:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, closer to 0 than</span></span>
<span id="cb14-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by a factor of at least &lt;&lt;ratio_floor:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;m_cat_closer_to_zero_ratio_min:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt; in the least</span></span>
<span id="cb14-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">favourable group</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and its slope is</span></span>
<span id="cb14-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;fromone_min:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; to &lt;&lt;fromone_max:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; of its own standard errors below </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The same</span></span>
<span id="cb14-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rows put </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{feed}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> within &lt;&lt;m_feed_dev_from_minus_one_min_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; to</span></span>
<span id="cb14-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;m_feed_dev_from_minus_one_max_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; % of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">from &lt;&lt;m_feed_group_min:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt; to</span></span>
<span id="cb14-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;m_feed_group_max:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Over Table II's &lt;&lt;span_II:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt;-fold range, carbon on catalyst moves</span></span>
<span id="cb14-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">only between &lt;&lt;ccat_lo:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; and &lt;&lt;ccat_hi:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; wt % </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cetane</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> while carbon on feed falls from</span></span>
<span id="cb14-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;cf_hi:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; to &lt;&lt;cf_lo:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;, a factor &lt;&lt;cf_ratio:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb14-11">    absmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sl.m_cat.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), ratio_floor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.floor(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_closer_to_zero_ratio_min"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, fromone_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sl.m_cat) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sl.se_cat).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(),</span>
<span id="cb14-12">    fromone_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sl.m_cat) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sl.se_cat).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb14-13">    ccat_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].C_cat_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), ccat_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].C_cat_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb14-14">    cf_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].C_feed_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), cf_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].C_feed_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(),</span>
<span id="cb14-15">    cf_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].C_feed_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>].C_feed_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Reading, group by group.</strong> Against the two hypotheses <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%20=%20+1"> (throughput) and <img src="https://latex.codecogs.com/png.latex?0"> (time), every one of the 10 groups has <img src="https://latex.codecogs.com/png.latex?%7Cm_%7Bcat%7D%7C%20%5Cle%200.12">, closer to 0 than to <img src="https://latex.codecogs.com/png.latex?+1"> by a factor of at least 9.5 (9.59 in the least favourable group), and its slope is 12 to 122 of its own standard errors below <img src="https://latex.codecogs.com/png.latex?+1">. The same rows put <img src="https://latex.codecogs.com/png.latex?m_%7Bfeed%7D"> within 2 to 18 % of <img src="https://latex.codecogs.com/png.latex?-1"> (from -1.18 to -0.95). Over Table II’s 4-fold range, carbon on catalyst moves only between 4.7 and 5.3 wt % (cetane) while carbon on feed falls from 4.8 to 1.1, a factor 4.4.</p>
</div>
</div>
<p><strong>One exponent per table.</strong> Four rows per group is little, so the groups are pooled: <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bcat%7D"> fitted to <img src="https://latex.codecogs.com/png.latex?%5Cln%20U"> with a separate intercept for every group, which uses only the variation of <img src="https://latex.codecogs.com/png.latex?U"> inside a group and gives one exponent with its standard error.</p>
<div id="4b59dd35" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.695214Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.695046Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.702485Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.701772Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">tspan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]).temp_F.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]).temp_F.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb15-2">rho_TU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.corrcoef((t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]).temp_F.transform(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean"</span>)),</span>
<span id="cb15-3">                           (t1.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]).feed_rate_vvhr.transform(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean"</span>)))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb15-4">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""Inside a Table I block the temperature is not constant </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">it varies by up to</span></span>
<span id="cb15-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;tspan_max:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and it correlates with the feed rate </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">correlation &lt;&lt;rho_TU:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt; inside</span></span>
<span id="cb15-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the blocks</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so a second fit adds one common temperature coefficient inside the blocks; its</span></span>
<span id="cb15-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">standard error is larger because the two regressors are correlated</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, tspan_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tspan.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), rho_TU<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rho_TU)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Inside a Table I block the temperature is not constant (it varies by up to 22 °F) and it correlates with the feed rate (correlation -0.77 inside the blocks), so a second fit adds one common temperature coefficient inside the blocks; its standard error is larger because the two regressors are correlated.</p>
</div>
</div>
<div id="d7160caf" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.704584Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.704328Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.708276Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.707682Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> fit </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> standard error </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> degrees of freedom </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> distance from 0 </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> distance from </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb16-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb16-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table I, group intercepts </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;pooled_dof_I:d&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;z_I:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_pooled_from_one_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; standard errors </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb16-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table I, with a common temperature coefficient inside the blocks </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_withT:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_withT_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;withT_dof_I:d&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;z_IT:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;d1_IT:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; standard errors </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb16-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table II, group intercepts </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableII_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableII_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;pooled_dof_II:d&gt;&gt; </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;z_II:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;d1_II:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; standard errors </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb16-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, z_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled_se"</span>],</span>
<span id="cb16-7">    z_IT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT_se"</span>],</span>
<span id="cb16-8">    z_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled_se"</span>],</span>
<span id="cb16-9">    d1_IT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT_se"</span>],</span>
<span id="cb16-10">    d1_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled_se"</span>],</span>
<span id="cb16-11">    pooled_dof_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooled_dof_I"</span>], pooled_dof_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pooled_dof_II"</span>], withT_dof_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"withT_dof_I"</span>], V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th>fit</th>
<th><img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D"></th>
<th>standard error</th>
<th>degrees of freedom</th>
<th>distance from 0</th>
<th>distance from <img src="https://latex.codecogs.com/png.latex?+1"></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Table I, group intercepts</td>
<td>-0.050</td>
<td>0.018</td>
<td>23</td>
<td>2.9 standard errors</td>
<td>60 standard errors</td>
</tr>
<tr class="even">
<td>Table I, with a common temperature coefficient inside the blocks</td>
<td>+0.022</td>
<td>0.022</td>
<td>22</td>
<td>1.0 standard errors</td>
<td>45 standard errors</td>
</tr>
<tr class="odd">
<td>Table II, group intercepts</td>
<td>-0.042</td>
<td>0.029</td>
<td>5</td>
<td>1.4 standard errors</td>
<td>35 standard errors</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="b0a40e0d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.709935Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.709818Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.713663Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.712986Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">What that says about "independent of feed rate"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The paper's claim is a statement</span></span>
<span id="cb17-2"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">about carbon at a given residence time and temperature</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table II's fourfold range gives</span></span>
<span id="cb17-3"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat} = &lt;&lt;m_cat_tableII_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm &lt;&lt;m_cat_tableII_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: no feed-rate</span></span>
<span id="cb17-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">dependence is detectable </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;z_II:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> standard errors from 0</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the throughput</span></span>
<span id="cb17-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">hypothesis is excluded by about &lt;&lt;d1_II:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; standard errors</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table I's raw pooled exponent,</span></span>
<span id="cb17-6"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;m_cat_tableI_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm &lt;&lt;m_cat_tableI_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, is &lt;&lt;z_I:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors</span></span>
<span id="cb17-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">below 0, so it is </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> exactly zero; once a temperature coefficient inside the blocks is</span></span>
<span id="cb17-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">allowed for it is </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;m_cat_tableI_withT:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm &lt;&lt;m_cat_tableI_withT_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, &lt;&lt;z_IT:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors from 0 and still &lt;&lt;d1_IT:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; from </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The honest summary is</span></span>
<span id="cb17-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"a feed-rate exponent of a few hundredths at most, incompatible with </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by more than</span></span>
<span id="cb17-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;d1_min:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; standard errors on every fit, and indistinguishable from 0 once temperature is</span></span>
<span id="cb17-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">accounted for"; it is not "proved exactly zero", which is also what the paper's own</span></span>
<span id="cb17-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"within limits" hedge says</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb17-13">    z_I<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled_se"</span>],</span>
<span id="cb17-14">    z_IT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT_se"</span>],</span>
<span id="cb17-15">    z_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled_se"</span>],</span>
<span id="cb17-16">    d1_IT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_withT_se"</span>],</span>
<span id="cb17-17">    d1_II<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled_se"</span>],</span>
<span id="cb17-18">    d1_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.floor(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_pooled_from_one_se_min"</span>]), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>What that says about “independent of feed rate”.</strong> The paper’s claim is a statement about carbon at a given residence time and temperature. Table II’s fourfold range gives <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%20=%20-0.042%20%5Cpm%200.029">: no feed-rate dependence is detectable (<img src="https://latex.codecogs.com/png.latex?1.4"> standard errors from 0), and the throughput hypothesis is excluded by about 35 standard errors. Table I’s raw pooled exponent, <img src="https://latex.codecogs.com/png.latex?-0.050%20%5Cpm%200.018">, is 2.9 standard errors below 0, so it is <strong>not</strong> exactly zero; once a temperature coefficient inside the blocks is allowed for it is <img src="https://latex.codecogs.com/png.latex?+0.022%20%5Cpm%200.022">, 1.0 standard errors from 0 and still 45 from <img src="https://latex.codecogs.com/png.latex?+1">. The honest summary is “a feed-rate exponent of a few hundredths at most, incompatible with <img src="https://latex.codecogs.com/png.latex?+1"> by more than 35 standard errors on every fit, and indistinguishable from 0 once temperature is accounted for”; it is not “proved exactly zero”, which is also what the paper’s own “within limits” hedge says.</p>
</div>
</div>
<div id="aa73083a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.715508Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.715317Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:19.721209Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:19.720459Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The temperature confound a second way: bounded with the paper's own doubling rule.</span></span>
<span id="cb18-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Within a block each C_cat is moved to the block-mean temperature with 2^(dT/DT2), DT2 the</span></span>
<span id="cb18-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># catalyst's own doubling interval fitted over all 16 rows (section 4), and the slopes re-read.</span></span>
<span id="cb18-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I m_cat, raw vs corrected to block-mean T with the doubling rule of the catalyst's own rows:"</span>)</span>
<span id="cb18-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r, a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(T1.itertuples(), X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_raw"</span>], X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cor"</span>]):</span>
<span id="cb18-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>group<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:18s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> raw </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; corrected </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_raw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The correction moves individual blocks by up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cor'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_raw'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb18-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Against the rounding floors: the raw block slopes reach </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat_raw_over_floor_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> floors from zero, "</span></span>
<span id="cb18-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the corrected ones </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat_corrected_over_floor_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, with both signs occurring."</span>)</span>
<span id="cb18-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The doubling interval used for the correction is fitted to the same rows (ignoring the feed rate), so this"</span>)</span>
<span id="cb18-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"route is not independent of the fit above; it agrees with it in sign and size, which is all it is used for."</span>)</span>
<span id="cb18-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Cetane, the sharpest single group: m_cat = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat_tableII_cetane'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ± </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat_tableII_cetane_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb18-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"by the endpoint estimator (rows U = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cetane'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>feed_rate_vvhr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and "</span></span>
<span id="cb18-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cetane'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>feed_rate_vvhr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, no regression) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat_tableII_cetane_endpoint'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb18-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"both lie within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'m_cat_cetane_over_own_floor_max'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of cetane's own rounding floor."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Table I m_cat, raw vs corrected to block-mean T with the doubling rule of the catalyst's own rows:
  natural 805F       raw -0.065 -&gt; corrected +0.005
  natural 849F       raw -0.085 -&gt; corrected +0.018
  natural 907F       raw +0.034 -&gt; corrected +0.071
  natural 958F       raw +0.017 -&gt; corrected +0.060
  synthetic 802F     raw -0.091 -&gt; corrected -0.060
  synthetic 856F     raw -0.116 -&gt; corrected -0.040
  synthetic 909F     raw -0.085 -&gt; corrected -0.023
  synthetic 958F     raw -0.003 -&gt; corrected +0.038
  mean -0.049 -&gt; +0.009
The correction moves individual blocks by up to 0.103.
Against the rounding floors: the raw block slopes reach 6.6 floors from zero, the corrected ones 3.1, with both signs occurring.
The doubling interval used for the correction is fitted to the same rows (ignoring the feed rate), so this
route is not independent of the fit above; it agrees with it in sign and size, which is all it is used for.
Cetane, the sharpest single group: m_cat = -0.047 ± 0.056, by the endpoint estimator (rows U = 0.6 and 2.4, no regression) -0.030; both lie within 2.8 of cetane's own rounding floor.</code></pre>
</div>
</div>
<div id="0239a924" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:19.723056Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:19.722856Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.268554Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.267735Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># figure: both carbon columns against feed rate, log-log</span></span>
<span id="cb20-2">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>), sharey<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb20-3">blues <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.cm.Blues(np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb20-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cat <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>):</span>
<span id="cb20-5">    ls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span></span>
<span id="cb20-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>):</span>
<span id="cb20-7">        g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> cat) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> b)]</span>
<span id="cb20-8">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(g.feed_rate_vvhr, g.C_cat_wtpct, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>blues[b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb20-9">                     mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>)</span>
<span id="cb20-10">        ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(g.feed_rate_vvhr, g.C_feed_wtpct, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>blues[b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb20-11">                     mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>)</span>
<span id="cb20-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed rate U, v/v/hr"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"carbon, wt %"</span>)</span>
<span id="cb20-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: $C_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{cat}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">$ (circles, flat) vs $C_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{feed}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">$ (squares, ~1/U)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-14">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blues light→dark = four temperature blocks; filled natural, open synthetic"</span>)</span>
<span id="cb20-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> feed, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decalin"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>)]:</span>
<span id="cb20-16">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> feed]</span>
<span id="cb20-17">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(g.feed_rate_vvhr, g.C_cat_wtpct, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>feed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, on catalyst"</span>)</span>
<span id="cb20-18">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(g.feed_rate_vvhr, g.C_feed_wtpct, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>,</span>
<span id="cb20-19">                 label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>feed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, on feed"</span>)</span>
<span id="cb20-20">g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t2[t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>]</span>
<span id="cb20-21">uu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([g.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), g.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()])</span>
<span id="cb20-22">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(uu, g.C_cat_wtpct.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (uu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> uu[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb20-23">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].text(uu[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, g.C_cat_wtpct.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope +1 (throughput</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">hypothesis)"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.35"</span>)</span>
<span id="cb20-24">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(uu, g.C_feed_wtpct.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (uu[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> uu), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb20-25">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].text(uu[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.6</span>, g.C_feed_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope −1"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.35"</span>)</span>
<span id="cb20-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed rate U, v/v/hr"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"carbon, wt %"</span>)</span>
<span id="cb20-27">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: the claim at its sharpest"</span>)</span>
<span id="cb20-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb20-29">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.1-voorhies-coking-law/index_files/figure-html/cell-17-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-two-carbon-columns-are-one-measurement-so-each-table-carries-one-test" class="level3">
<h3 class="anchored" data-anchor-id="the-two-carbon-columns-are-one-measurement-so-each-table-carries-one-test">2. The two carbon columns are one measurement, so each table carries <em>one</em> test</h3>
<p>The paper states how Table I was measured: <em>“After each run the catalyst was discharged from the unit and analyzed for carbon by combustion”</em>: one carbon determination per run. The two printed columns are then related by the paper’s own eq.-(4) bookkeeping: <img src="https://latex.codecogs.com/png.latex?C_c%20=%20C_f%20%5Ccdot%20W%5Ctheta/60"> with <img src="https://latex.codecogs.com/png.latex?W%20=%20U%5C,D_o/D_c">, so the ratio</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BW%7D%7BU%7D%5CBig%7C_%7Bimplied%7D%20=%20%5Cfrac%7BC_c%7D%7BC_f%5Ccdot%20U%5Ccdot(%5Ctheta/60)%7D%0A%20%20%20%5C;%5Cleft(=%20%5Cfrac%7BD_o%7D%7BD_c%7D%5Cright)"></p>
<p>should be a <strong>constant of the unit and charge, row by row</strong>: and if it is constant, the two columns carry the same information and <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%5Capprox0"> <em>is</em> <img src="https://latex.codecogs.com/png.latex?m_%7Bfeed%7D%5Capprox-1"> restated. Checking its constancy simultaneously (a) tests that reading, (b) cross-checks all four transcribed columns at once (a mis-read digit breaks its own row), and (c) recovers the number the paper never prints for these units: the density ratio the eq.-(5) derivation would have needed <em>here</em> (the only density ratio printed anywhere in the five pages is the one on p.&nbsp;321, inside the fluid-oriented eq.-(5) derivation; the Nomenclature defines <img src="https://latex.codecogs.com/png.latex?D_o">, <img src="https://latex.codecogs.com/png.latex?D_c"> without values).</p>
<p>The two columns also obey an exact identity that is worth knowing before reading the slopes: <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bcat%7D%20=%20%5Cln%20C_%7Bfeed%7D%20+%20%5Cln%20U%20+%20%5Cmathrm%7Bconst%7D%20+%0A%5Cln(W/U)"> row by row, and least-squares slopes add, so inside every group <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%20=%20m_%7Bfeed%7D%20+%201%20+%20s_%7BW/U%7D">, where <img src="https://latex.codecogs.com/png.latex?s_%7BW/U%7D"> is the slope of <img src="https://latex.codecogs.com/png.latex?%5Cln(W/U)"> on <img src="https://latex.codecogs.com/png.latex?%5Cln%20U">. The two exponents of section 1 are therefore the same number up to how much the implied ratio drifts with the feed rate.</p>
<div id="b929a656" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.270918Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.270759Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.276930Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.276325Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">WU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU"</span>]</span>
<span id="cb21-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'group'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mean'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CV %'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  rows"</span>)</span>
<span id="cb21-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> key, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> WU.items():</span>
<span id="cb21-4">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>key<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>std(ddof<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r))</span>
<span id="cb21-5"></span>
<span id="cb21-6">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""Within-group scatter: worst CV &lt;&lt;WU_within_group_cv_max_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; %, against a per-row</span></span>
<span id="cb21-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">half-digit allowance of up to &lt;&lt;WU_half_digit_allowance_max_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; % </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;row&gt;&gt;, whose small</span></span>
<span id="cb21-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">one-decimal carbon cells dominate; each cell's allowance comes from its own printed decimals, so</span></span>
<span id="cb21-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">a two-decimal cell gets a hundredth of that</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The constancy is at the rounding floor: consistent</span></span>
<span id="cb21-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">with, and at this precision indistinguishable from, both columns being computed from </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">one</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span></span>
<span id="cb21-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">carbon determination through the run's fixed feed-to-catalyst mass ratio</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Two independent</span></span>
<span id="cb21-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">balances agreeing this well on all &lt;&lt;n_rows:d&gt;&gt; rows is not excluded, but either way the columns</span></span>
<span id="cb21-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">are redundant </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at the printed precision</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so the feed-rate claim gets one test per group, not two</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb21-14"></span>
<span id="cb21-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The slope identity above is exact on this page: the largest gap between </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat} - m_{feed} - 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb21-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_{W/U}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> over the &lt;&lt;n_groups:d&gt;&gt; groups is within &lt;&lt;max_slope_decomposition_gap:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here &lt;&lt;slope_decomposition_gap:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and</span></span>
<span id="cb21-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the largest </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_{W/U}</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is &lt;&lt;WU_slope_vs_feed_worst_abs:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, which is how far the two exponents</span></span>
<span id="cb21-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">of section 1 can differ from </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{feed} </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1 = m_{cat}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on these rows</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb21-19"></span>
<span id="cb21-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Implied </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">W/U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">= </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">D_o/D_c</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> of eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: natural &lt;&lt;WU_implied_natural:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, synthetic</span></span>
<span id="cb21-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;WU_implied_synthetic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, cetane &lt;&lt;WU_implied_cetane:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, decalin &lt;&lt;WU_implied_decalin:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb21-22"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Decalin over cetane is &lt;&lt;WU_decalin_over_cetane:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;: same unit, same catalyst, so </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">W = U D_o/D_c</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb21-23"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">attributes the whole difference to the two liquids' density ratio; the paper prints no densities, so</span></span>
<span id="cb21-24"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">this is a consistency observation, not a check against known values</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> None of the four is the</span></span>
<span id="cb21-25"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/&lt;&lt;eq4_density_ratio:g&gt;&gt; = &lt;&lt;inv:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed for the eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> unit; that ratio belongs to that</span></span>
<span id="cb21-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">study and would be wrong here</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"allowance_row"</span>], n_rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t2), n_groups<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sl),</span>
<span id="cb21-27">    inv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_density_ratio"</span>], V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>group                     mean   CV %  rows
natural1                 1.071    2.5  1.096 1.099 1.045 1.042
natural2                 1.069    1.2  1.056 1.089 1.060 1.071
natural3                 0.995    1.4  1.000 0.988 1.015 0.977
natural4                 0.992    1.1  0.978 0.986 1.000 1.005
synthetic1               1.140    0.9  1.135 1.128 1.156 1.142
synthetic2               1.101    1.7  1.079 1.086 1.119 1.119
synthetic3               1.064    2.9  1.075 1.094 1.012 1.076
synthetic4               1.049    1.2  1.042 1.034 1.068 1.053
cetane                   0.864    1.9  0.851 0.849 0.867 0.890
decalin                  1.014    2.9  1.022 1.042 0.964 1.028</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Within-group scatter: worst CV 2.9 %, against a per-row half-digit allowance of up to 5.9 % (cetane, U = 2.4, whose small one-decimal carbon cells dominate; each cell’s allowance comes from its own printed decimals, so a two-decimal cell gets a hundredth of that). The constancy is at the rounding floor: consistent with, and at this precision indistinguishable from, both columns being computed from <strong>one</strong> carbon determination through the run’s fixed feed-to-catalyst mass ratio. Two independent balances agreeing this well on all 40 rows is not excluded, but either way the columns are redundant <strong>at the printed precision</strong>, so the feed-rate claim gets one test per group, not two.</p>
<p>The slope identity above is exact on this page: the largest gap between <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%20-%20m_%7Bfeed%7D%20-%201"> and <img src="https://latex.codecogs.com/png.latex?s_%7BW/U%7D"> over the 10 groups is within 1e-12 (here 9e-16), and the largest <img src="https://latex.codecogs.com/png.latex?%7Cs_%7BW/U%7D%7C"> is 0.085, which is how far the two exponents of section 1 can differ from <img src="https://latex.codecogs.com/png.latex?m_%7Bfeed%7D%20+%201%20=%20m_%7Bcat%7D"> on these rows.</p>
<p>Implied <img src="https://latex.codecogs.com/png.latex?W/U"> (= <img src="https://latex.codecogs.com/png.latex?D_o/D_c"> of eq. 4): natural 1.032, synthetic 1.089, cetane 0.864, decalin 1.014. Decalin over cetane is 1.173: same unit, same catalyst, so <img src="https://latex.codecogs.com/png.latex?W%20=%20U%20D_o/D_c"> attributes the whole difference to the two liquids’ density ratio; the paper prints no densities, so this is a consistency observation, not a check against known values. None of the four is the <img src="https://latex.codecogs.com/png.latex?1/0.58%20=%201.724"> printed for the eq.-(5) unit; that ratio belongs to that study and would be wrong here.</p>
</div>
</div>
<div id="3222aee4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.278851Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.278730Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.282470Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.281790Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">One systematic residual, reported and not explained</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The implied ratio drifts </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">down</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb23-2"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">across the temperature blocks: natural &lt;&lt;bm_nat1:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; to &lt;&lt;bm_nat4:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, synthetic</span></span>
<span id="cb23-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;bm_syn1:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; to &lt;&lt;bm_syn4:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; from the lowest to the highest block, a block-1 over block-4</span></span>
<span id="cb23-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ratio minus one of &lt;&lt;WU_block_drift_natural_pct:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; % and &lt;&lt;WU_block_drift_synthetic_pct:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb23-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Against the scatter of the four rows in each block </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the standard error of the block mean, combined</span></span>
<span id="cb23-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">for the two blocks</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the drift is &lt;&lt;WU_block_drift_natural_over_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; and</span></span>
<span id="cb23-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;WU_block_drift_synthetic_over_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">each block mean rests on four rows, so about</span></span>
<span id="cb23-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">six degrees of freedom</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so it is larger than the within-block scatter</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> A charging mass ratio has no business varying with temperature, and nothing in the paper</span></span>
<span id="cb23-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">explains it</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It does not touch the feed-rate verdict, which lives within blocks</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb23-10"></span>
<span id="cb23-11"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The row whose feed-rate glyph the sidecar discusses</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The synthetic 911 °F row prints</span></span>
<span id="cb23-12"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U = 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Read so, its implied ratio sits &lt;&lt;abs_asread:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; % below the other three rows of its</span></span>
<span id="cb23-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">block; read as </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;alt:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> it would sit &lt;&lt;WU_glyph_row_dev_if_1p0_pct:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; % from them</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The identity</span></span>
<span id="cb23-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cannot adjudicate a glyph this small: the pixels can, and did </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the glyph is unambiguous, 1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1 is kept</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb23-15">    bm_nat1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bm_natural"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], bm_nat4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bm_natural"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], bm_syn1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bm_synthetic"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb23-16">    bm_syn4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bm_synthetic"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], abs_asread<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_glyph_row_dev_as_read_pct"</span>]),</span>
<span id="cb23-17">    alt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>GLYPH_ALTERNATIVE, V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>One systematic residual, reported and not explained.</strong> The implied ratio drifts <em>down</em> across the temperature blocks: natural 1.071 to 0.992, synthetic 1.140 to 1.049 from the lowest to the highest block, a block-1 over block-4 ratio minus one of +7.9 % and +8.7 %. Against the scatter of the four rows in each block (the standard error of the block mean, combined for the two blocks) the drift is 4.6 and 9.1 standard errors (each block mean rests on four rows, so about six degrees of freedom), so it is larger than the within-block scatter. A charging mass ratio has no business varying with temperature, and nothing in the paper explains it. It does not touch the feed-rate verdict, which lives within blocks.</p>
<p><strong>The row whose feed-rate glyph the sidecar discusses.</strong> The synthetic 911 °F row prints <img src="https://latex.codecogs.com/png.latex?U%20=%201.1">. Read so, its implied ratio sits 6.4 % below the other three rows of its block; read as <img src="https://latex.codecogs.com/png.latex?1"> it would sit +2.9 % from them. The identity cannot adjudicate a glyph this small: the pixels can, and did (the glyph is unambiguous, 1.1 is kept).</p>
</div>
</div>
</section>
<section id="the-printed-algebra-chain-234-5-by-two-routes" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-algebra-chain-234-5-by-two-routes">3. The printed algebra chain, (2)+(3)+(4) → (5), by two routes</h3>
<p>The paper substitutes eq. (2) and eq. (3) into the mass balance (4) and prints the result as eq. (5). The chain is closed-form, so it can be checked to machine precision, by two routes with <strong>independent solvers</strong>:</p>
<ul>
<li><strong>route A, symbolic</strong>: exact rationals in <code>sympy</code>, the isolation of <img src="https://latex.codecogs.com/png.latex?V"> and its logarithmic derivatives;</li>
<li><strong>route B, numeric</strong>: the chain is <em>root-found</em> for <img src="https://latex.codecogs.com/png.latex?V"> on the physical range 0 to 100 % with <code>pymrm.checks.find_roots</code> (which raises unless it finds exactly one root), point by point on a <img src="https://latex.codecogs.com/png.latex?(U,%5Ctheta)"> grid, and the power-law form is recovered by least squares of <img src="https://latex.codecogs.com/png.latex?%5Cln%20V"> on <img src="https://latex.codecogs.com/png.latex?(1,%20%5Cln%20U,%20%5Cln%5Ctheta)"> with no computer algebra involved.</li>
</ul>
<p><strong>What the two routes share:</strong> the one hand isolation of <img src="https://latex.codecogs.com/png.latex?V%5E%7B2.93%7D"> from (2)+(3)+(4) and the five input constants. Their agreement therefore checks the solvers, not that step. The check on the shared step is external: an error in it would move the derived coefficient away from the <em>printed</em> 96, and the comparison against the printed triple below catches that.</p>
<div id="488f786a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.284042Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.283925Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.287823Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.287270Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1">c_sym, eu_sym, et_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chain"</span>]</span>
<span id="cb24-2">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> re-derived from eqs</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">:</span></span>
<span id="cb24-3"></span>
<span id="cb24-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- route A </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">symbolic</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">V = &lt;&lt;eq5_coeff_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4f&gt;&gt; / </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq5_expU_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq5_expTheta_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb24-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- route B </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">root find and least squares</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">V = &lt;&lt;eq5_coeff_numeric:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4f&gt;&gt; / </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq5_expU_numeric:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq5_expTheta_numeric:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb24-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- printed: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">V = &lt;&lt;eq5_coeff:g&gt;&gt; / </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq5_expU:g&gt;&gt;}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq5_expTheta:g&gt;&gt;}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb24-7"></span>
<span id="cb24-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The routes agree to within &lt;&lt;max_eq5_route_gap_max:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here &lt;&lt;eq5_route_gap_max:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt;; relative for the</span></span>
<span id="cb24-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">coefficient, absolute for the exponents; set by the root tolerance</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the power-law fit of route B</span></span>
<span id="cb24-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">leaves a log-residual within &lt;&lt;max_eq5_numeric_fit_residual:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here &lt;&lt;eq5_numeric_fit_residual:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb24-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">on the grid: the chain </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">is</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> exactly a power law,</span></span>
<span id="cb24-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">which route B verifies rather than assumes</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Every printed digit is the rounding of the exact chain:</span></span>
<span id="cb24-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq5_coeff_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4f&gt;&gt; to &lt;&lt;eq5_coeff:g&gt;&gt;, &lt;&lt;eq5_expU_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt; to &lt;&lt;eq5_expU:g&gt;&gt;,</span></span>
<span id="cb24-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq5_expTheta_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt; to &lt;&lt;eq5_expTheta:g&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">claim `eq5_hits_printed`</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The exponents are the</span></span>
<span id="cb24-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">identities </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1/&lt;&lt;eq3_exp:g&gt;&gt; = &lt;&lt;inv_e3:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> for </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1 - &lt;&lt;eq2_n:g&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/&lt;&lt;eq3_exp:g&gt;&gt; =</span></span>
<span id="cb24-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;et_id:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> for </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span></span>
<span id="cb24-17"></span>
<span id="cb24-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">What the printed rounding costs: the ratio of the printed form to the exact chain is a power</span></span>
<span id="cb24-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">law in </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so its extreme over a window is at a corner</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Over</span></span>
<span id="cb24-20"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">U = &lt;&lt;u0:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;u1:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> v/v/hr and </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = &lt;&lt;t0:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;t1:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> min </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">a window chosen</span></span>
<span id="cb24-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here, not the paper's</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the worst deviation is &lt;&lt;eq5_printed_rounding_worst_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt; %: the</span></span>
<span id="cb24-22"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed rounding is harmless there</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb24-23"></span>
<span id="cb24-24"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A small exact object the paper does not print: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">V</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is the </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">period-average</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> conversion,</span></span>
<span id="cb24-25"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">so the instantaneous conversion the chain implies is </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">d</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta V</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/d</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1 - &lt;&lt;eq5_expTheta_symbolic:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4f&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">V</span></span>
<span id="cb24-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">= &lt;&lt;inst_over_avg_conversion:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4f&gt;&gt;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">V</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> At every moment the instantaneous conversion sits at</span></span>
<span id="cb24-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;inst_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; % of the period average to date, declining and never negative, so the derived</span></span>
<span id="cb24-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">correlation is self-consistent as an averaged quantity</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb24-29">    inv_e3<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>], et_id<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>], u0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>U_WIN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], u1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>U_WIN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>],</span>
<span id="cb24-30">    t0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TH_WIN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], t1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TH_WIN[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], inst_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inst_over_avg_conversion"</span>], V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>eq. (5) re-derived from eqs. (2)+(3)+(4):</p>
<ul>
<li>route A (symbolic): <img src="https://latex.codecogs.com/png.latex?V%20=%2095.7145%20/%20(U%5E%7B0.34130%7D%5C,%5Ctheta%5E%7B0.19113%7D)"></li>
<li>route B (root find and least squares): <img src="https://latex.codecogs.com/png.latex?V%20=%2095.7145%20/%20(U%5E%7B0.34130%7D%5C,%5Ctheta%5E%7B0.19113%7D)"></li>
<li>printed: <img src="https://latex.codecogs.com/png.latex?V%20=%2096%20/%20(U%5E%7B0.34%7D%5C,%5Ctheta%5E%7B0.19%7D)"></li>
</ul>
<p>The routes agree to within 1e-09 (here 1e-15; relative for the coefficient, absolute for the exponents; set by the root tolerance), and the power-law fit of route B leaves a log-residual within 1e-09 (here 4e-15) on the grid: the chain <em>is</em> exactly a power law, which route B verifies rather than assumes. Every printed digit is the rounding of the exact chain: 95.7145 to 96, 0.34130 to 0.34, 0.19113 to 0.19 (claim <code>eq5_hits_printed</code>). The exponents are the identities <img src="https://latex.codecogs.com/png.latex?1/2.93%20=%200.34130"> for <img src="https://latex.codecogs.com/png.latex?U"> and <img src="https://latex.codecogs.com/png.latex?(1%20-%200.44)/2.93%20=%0A0.19113"> for <img src="https://latex.codecogs.com/png.latex?%5Ctheta">.</p>
<p>What the printed rounding costs: the ratio of the printed form to the exact chain is a power law in <img src="https://latex.codecogs.com/png.latex?U"> and <img src="https://latex.codecogs.com/png.latex?%5Ctheta">, so its extreme over a window is at a corner. Over <img src="https://latex.codecogs.com/png.latex?U%20=%200.3"> to <img src="https://latex.codecogs.com/png.latex?1.2"> v/v/hr and <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%2030"> to <img src="https://latex.codecogs.com/png.latex?240"> min (a window chosen here, not the paper’s) the worst deviation is 0.94 %: the printed rounding is harmless there.</p>
<p>A small exact object the paper does not print: <img src="https://latex.codecogs.com/png.latex?V(%5Ctheta)"> is the <em>period-average</em> conversion, so the instantaneous conversion the chain implies is <img src="https://latex.codecogs.com/png.latex?d(%5Ctheta%20V)/d%5Ctheta%20=%20(1%20-%200.1911)%5C,V%0A=%200.8089%5C,V">. At every moment the instantaneous conversion sits at 80.9 % of the period average to date, declining and never negative, so the derived correlation is self-consistent as an averaged quantity.</p>
</div>
</div>
<div id="804f22c9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.289979Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.289751Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.296641Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.296000Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># What the chain can and cannot pin: which misreadings of its five inputs still round to</span></span>
<span id="cb25-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed triple.</span></span>
<span id="cb25-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misreadings of a leading digit, a transposed glyph or an exponent scale:"</span>)</span>
<span id="cb25-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'misreading'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'coeff'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'expU'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'expT'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'matches the printed triple?'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;28s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kw, c_, eu_, et_, h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misreadings"</span>]:</span>
<span id="cb25-6">    desc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> kw.items())</span>
<span id="cb25-7">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>desc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eu_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>et_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'yes'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> h <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'no'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;28s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Every last-digit +-1 alternative of the five inputs:"</span>)</span>
<span id="cb25-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alternative reading'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'coeff'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'expU'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'expT'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'matches?'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, val, c_, eu_, et_, h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternatives"</span>]:</span>
<span id="cb25-11">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' read as '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(val, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'g'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:34s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eu_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>et_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'yes'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> h <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'no'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-12">surv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({a[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternatives"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>]})</span>
<span id="cb25-13">pinned <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({a[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alternatives"</span>]} <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(surv))</span>
<span id="cb25-14">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">What the chain certifies, and what it cannot</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;n_mis:d&gt;&gt; of the &lt;&lt;n_mis_tot:d&gt;&gt; misreadings</span></span>
<span id="cb25-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">above round to the printed triple, so the re-derivation excludes every leading-digit,</span></span>
<span id="cb25-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">transposed-glyph and exponent-scale misreading tried</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It does </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> pin every last digit:</span></span>
<span id="cb25-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq5_last_digit_alternatives_matching:d&gt;&gt; of the &lt;&lt;eq5_last_digit_alternatives_total:d&gt;&gt; last-digit</span></span>
<span id="cb25-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">alternatives still round to the printed </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq5_coeff:g&gt;&gt;, &lt;&lt;eq5_expU:g&gt;&gt;, &lt;&lt;eq5_expTheta:g&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, at least one</span></span>
<span id="cb25-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">for each of &lt;&lt;surv&gt;&gt;; those final digits rest on the digit-scale crops alone, read independently twice,</span></span>
<span id="cb25-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">at transcription and again at verification, in agreement</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The exponent of eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is pinned:</span></span>
<span id="cb25-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq5_e3_alternatives_matching:d&gt;&gt; of its two alternatives round to the printed triple</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb25-22">    n_mis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_misreadings_matching"</span>], n_mis_tot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"misreadings"</span>]),</span>
<span id="cb25-23">    surv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"`</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> surv), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>misreadings of a leading digit, a transposed glyph or an exponent scale:
misreading                             coeff    expU    expT  matches the printed triple?
e3v = 2.98                             88.66  0.3356  0.1879                           no
e3v = 2.63                            161.04  0.3802  0.2129                           no
drv = 0.53                             92.81  0.3413  0.1911                           no
c3v = 3.55e-06                        210.03  0.3413  0.1911                           no
n2v = 0.41                             95.71  0.3413  0.2014                           no
A2v = 0.85                            104.89  0.3413  0.1911                           no

Every last-digit +-1 alternative of the five inputs:
alternative reading                    coeff    expU    expT  matches?
eq2_A read as 0.66                     96.21  0.3413  0.1911       yes
eq2_A read as 0.64                     95.21  0.3413  0.1911        no
eq2_n read as 0.45                     95.71  0.3413  0.1877       yes
eq2_n read as 0.43                     95.71  0.3413  0.1945       yes
eq3_coeff read as 3.56e-05             95.62  0.3413  0.1911       yes
eq3_coeff read as 3.54e-05             95.81  0.3413  0.1911       yes
eq3_exp read as 2.94                   94.24  0.3401  0.1905        no
eq3_exp read as 2.92                   97.22  0.3425  0.1918        no
eq4_density_ratio read as 0.59         96.27  0.3413  0.1911       yes
eq4_density_ratio read as 0.57         95.15  0.3413  0.1911        no</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>What the chain certifies, and what it cannot.</strong> 0 of the 6 misreadings above round to the printed triple, so the re-derivation excludes every leading-digit, transposed-glyph and exponent-scale misreading tried. It does <strong>not</strong> pin every last digit: 6 of the 10 last-digit alternatives still round to the printed (96, 0.34, 0.19), at least one for each of <code>eq2_A</code>, <code>eq2_n</code>, <code>eq3_coeff</code>, <code>eq4_density_ratio</code>; those final digits rest on the digit-scale crops alone, read independently twice, at transcription and again at verification, in agreement. The exponent of eq. (3) is pinned: 0 of its two alternatives round to the printed triple.</p>
</div>
</div>
<div id="8750b232" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.298340Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.298220Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.301612Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.300965Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1">V36, V41 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_measured_pct"</span>], K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_predicted_pct"</span>]</span>
<span id="cb27-2">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The "faulty point" remark, made quantitative </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">labelled inference</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 321 twice flags</span></span>
<span id="cb27-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'the point at about &lt;&lt;faulty_measured_pct:g&gt;&gt;% conversion' as a possibly faulty determination, 'in</span></span>
<span id="cb27-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">which case the predicted value would be &lt;&lt;faulty_predicted_pct:g&gt;&gt;%'</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The point itself lives only in</span></span>
<span id="cb27-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 3 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">not digitised</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, but eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> makes the remark quantitative without it: a predicted</span></span>
<span id="cb27-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;faulty_predicted_pct:g&gt;&gt; % implies that the run's measured carbon on feed was</span></span>
<span id="cb27-7"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_f = &lt;&lt;c3m:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">imes10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-5}</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">cdot &lt;&lt;faulty_predicted_pct:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;eq3_exp:g&gt;&gt;} = &lt;&lt;faulty_point_implied_Cf_wtpct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> wt %,</span></span>
<span id="cb27-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">where the correlation at the measured &lt;&lt;faulty_measured_pct:g&gt;&gt; % gives &lt;&lt;faulty_point_online_Cf_wtpct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; wt %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb27-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The flagged point therefore sits a factor &lt;&lt;faulty_point_excess_ratio:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt; above the line in carbon yield</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb27-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">This is exact given eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and the two printed percentages, and it is not checkable further without</span></span>
<span id="cb27-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the figure</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, c3m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>, V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The “faulty point” remark, made quantitative (labelled inference).</strong> p.&nbsp;321 twice flags ‘the point at about 36% conversion’ as a possibly faulty determination, ‘in which case the predicted value would be 41%’. The point itself lives only in Fig. 3 (not digitised), but eq. (3) makes the remark quantitative without it: a predicted 41 % implies that the run’s measured carbon on feed was <img src="https://latex.codecogs.com/png.latex?C_f%20=%203.55%5Ctimes10%5E%7B-5%7D%5Ccdot%2041%5E%7B2.93%7D%20=%201.887"> wt %, where the correlation at the measured 36 % gives 1.289 wt %. The flagged point therefore sits a factor 1.46 above the line in carbon yield. This is exact given eq. (3) and the two printed percentages, and it is not checkable further without the figure.</p>
</div>
</div>
</section>
<section id="the-printed-doubling-interval-the-papers-fit-measured-per-catalyst" class="level3">
<h3 class="anchored" data-anchor-id="the-printed-doubling-interval-the-papers-fit-measured-per-catalyst">4. The printed doubling interval: the paper’s fit, measured per catalyst</h3>
<p>Fig. 2 is drawn <em>from Table I</em> (p.&nbsp;320: “The data in Table I permit a study of the effect of temperature”), so testing the printed doubling interval against Table I is a <strong>goodness-of-fit check of the author’s own correlation on the author’s own data</strong>, labelled as such here, in <code>meta.yaml</code> and in the README. The doubling interval is <img src="https://latex.codecogs.com/png.latex?%5CDelta%20T_2%20=%20%5Cln%202%20/%20(d%5Cln%20C_c/dT)">, with <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bcat%7D"> fitted to <img src="https://latex.codecogs.com/png.latex?T"> per catalyst over all its rows (the feed-rate scatter enters as noise; that is what the claim itself does by drawing one line per catalyst through all feed rates), with the standard error of the fitted slope carried to the interval. A second, regression-free estimate uses the means of the two extreme temperature blocks; it uses the same rows, so it is a second weighting of the same data, not independent evidence.</p>
<div id="ef6c30ce" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.303647Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.303529Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.308364Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.307804Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1">nat, syn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>], t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>]</span>
<span id="cb28-2">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> catalyst </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> doubling interval, fit to all rows </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> standard error </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> two-point </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">block means</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> distance from the printed band </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb28-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">---</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb28-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> natural </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_dT_natural_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_dT_natural_se_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_dT_natural_twopoint_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_natural_vs_band_high_se:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors from the band's upper end, &lt;&lt;doubling_high_F:g&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb28-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> synthetic </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_dT_synthetic_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_dT_synthetic_se_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_dT_synthetic_twopoint_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;doubling_synthetic_vs_band_low_se:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors from the band's lower end, &lt;&lt;doubling_low_F:g&gt;&gt; °F </span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">|</span></span>
<span id="cb28-6"></span>
<span id="cb28-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The printed claim is that carbon formation "doubles for approximately &lt;&lt;doubling_low_F:g&gt;&gt; to</span></span>
<span id="cb28-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_high_F:g&gt;&gt; °F"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The band sits </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">between</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the two catalysts: the natural catalyst</span></span>
<span id="cb28-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_natural_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is within &lt;&lt;nat_abs:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors of the band's upper end,</span></span>
<span id="cb28-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">so its own rows do not contradict the band; the synthetic catalyst </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_synthetic_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb28-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">is &lt;&lt;syn_abs:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors below the band's lower end on a straight line through its rows, which</span></span>
<span id="cb28-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the rows reject </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">quadratic term &lt;&lt;doubling_quadratic_t_synthetic:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors; natural</span></span>
<span id="cb28-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_quadratic_t_natural:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: the 16 rows sit at four temperatures and curve, so the row</span></span>
<span id="cb28-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">standard errors treat four temperature levels as 16 independent points</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> On the four block means of</span></span>
<span id="cb28-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">each catalyst </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2 degrees of freedom</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the intervals are &lt;&lt;doubling_dT_natural_blockmean_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb28-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_natural_blockmean_se_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_natural_vs_band_blockmean_se:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard</span></span>
<span id="cb28-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">errors from the band's upper end</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and &lt;&lt;doubling_dT_synthetic_blockmean_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb28-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_synthetic_blockmean_se_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_synthetic_vs_band_low_blockmean_se:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard</span></span>
<span id="cb28-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">errors from the band's lower end</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: on its four block means the synthetic catalyst is</span></span>
<span id="cb28-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;syn_bm_abs:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors below the band, not &lt;&lt;syn_abs:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The two catalysts differ by</span></span>
<span id="cb28-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_split_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; °F, &lt;&lt;doubling_dT_split_over_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors of that difference on the</span></span>
<span id="cb28-22"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">row fits and &lt;&lt;doubling_dT_split_over_se_blockmean:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; on the block means</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> As a pooled one-number summary</span></span>
<span id="cb28-23"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">of Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 2 the band is a fair reading</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Goodness of fit, not validation: claim and data are the same paper's</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb28-24">    nat_abs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_natural_vs_band_high_se"</span>]), syn_abs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_synthetic_vs_band_low_se"</span>]),</span>
<span id="cb28-25">    syn_bm_abs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_synthetic_vs_band_low_blockmean_se"</span>]), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>catalyst</th>
<th>doubling interval, fit to all rows</th>
<th>standard error</th>
<th>two-point (block means)</th>
<th>distance from the printed band</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>natural</td>
<td>205.6 °F</td>
<td>7.1 °F</td>
<td>208.3 °F</td>
<td>+0.8 standard errors from the band’s upper end, 200 °F</td>
</tr>
<tr class="even">
<td>synthetic</td>
<td>175.8 °F</td>
<td>4.8 °F</td>
<td>174.0 °F</td>
<td>-3.0 standard errors from the band’s lower end, 190 °F</td>
</tr>
</tbody>
</table>
<p>The printed claim is that carbon formation “doubles for approximately 190 to 200 °F”. The band sits <strong>between</strong> the two catalysts: the natural catalyst (206 °F) is within 0.8 standard errors of the band’s upper end, so its own rows do not contradict the band; the synthetic catalyst (176 °F) is 3.0 standard errors below the band’s lower end on a straight line through its rows, which the rows reject (quadratic term -3.6 standard errors; natural +2.5): the 16 rows sit at four temperatures and curve, so the row standard errors treat four temperature levels as 16 independent points. On the four block means of each catalyst (2 degrees of freedom) the intervals are 205.4 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 13.7 °F (+0.4 standard errors from the band’s upper end) and 176.0 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 9.4 °F (-1.5 standard errors from the band’s lower end): on its four block means the synthetic catalyst is 1.5 standard errors below the band, not 3.0. The two catalysts differ by 29.8 °F, 3.5 standard errors of that difference on the row fits and 1.8 on the block means. As a pooled one-number summary of Fig. 2 the band is a fair reading. Goodness of fit, not validation: claim and data are the same paper’s.</p>
</div>
</div>
<div id="5b23ec2f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.310530Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.310411Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.481745Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.480966Z&quot;}}" data-execution_count="23">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>))</span>
<span id="cb29-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> cat, c, mfc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>)]:</span>
<span id="cb29-3">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> cat]</span>
<span id="cb29-4">    ax.semilogy(g.temp_F, g.C_cat_wtpct, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mfc, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Table I)"</span>)</span>
<span id="cb29-5">    tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(g.temp_F.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, g.temp_F.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>)</span>
<span id="cb29-6">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_F"</span>]</span>
<span id="cb29-7">    b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.mean(np.log(g.C_cat_wtpct)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> g.temp_F.mean()       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the OLS line passes through the means</span></span>
<span id="cb29-8">    ax.semilogy(tt, np.exp(b0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tt), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb29-9">                label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: doubles per </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'doubling_dT_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cat<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_F'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> °F"</span>)</span>
<span id="cb29-10">ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cracking temperature, °F"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C on catalyst, wt %"</span>)</span>
<span id="cb29-11">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I against the printed temperature-doubling claim"</span>)</span>
<span id="cb29-12">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb29-13">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.1-voorhies-coking-law/index_files/figure-html/cell-24-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="f0a1e199" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.483579Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.483403Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.487587Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.486889Z&quot;}}" data-execution_count="24">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1">sd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_slopes"</span>]</span>
<span id="cb30-2">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">What the carbon-on-feed column would give</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The same fit on the carbon on feed gives a</span></span>
<span id="cb30-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">doubling interval of &lt;&lt;doubling_dT_natural_feed_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F for the natural catalyst, not</span></span>
<span id="cb30-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_natural_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F, so a column mix-up would not go unnoticed, and the printed claim</span></span>
<span id="cb30-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">is specifically a claim about carbon on catalyst</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Why they differ is an exact decomposition, not a</span></span>
<span id="cb30-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">guess: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln C_{feed} = </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln C_{cat} - </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln U - </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">W/U</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athrm{const}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> row by row, and least-squares</span></span>
<span id="cb30-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">slopes against </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">T</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> add, so </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_{feed} = s_{cat} - s_U - s_{W/U}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> with</span></span>
<span id="cb30-8"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_{cat} = &lt;&lt;s_cat:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_U = &lt;&lt;s_U:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">feed rate happens to correlate with temperature</span></span>
<span id="cb30-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">across the pooled rows</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_{W/U} = &lt;&lt;s_WU:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the drift of the implied ratio of section 2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span></span>
<span id="cb30-10"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">s_{feed} = &lt;&lt;s_feed:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> per °F; the identity closes to within &lt;&lt;max_doubling_decomposition_gap:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here &lt;&lt;doubling_decomposition_gap:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Carrying</span></span>
<span id="cb30-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">only the feed-rate term moves the interval from &lt;&lt;doubling_dT_natural_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; to</span></span>
<span id="cb30-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_natural_linked_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">fit of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ln</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_{cat}/U</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">T</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the drift of the implied</span></span>
<span id="cb30-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ratio moves it the rest of the way to &lt;&lt;doubling_dT_natural_feed_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb30-14">    s_cat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cat"</span>], s_U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U"</span>], s_WU<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU"</span>], s_feed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>], V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>What the carbon-on-feed column would give.</strong> The same fit on the carbon on feed gives a doubling interval of 155 °F for the natural catalyst, not 206 °F, so a column mix-up would not go unnoticed, and the printed claim is specifically a claim about carbon on catalyst. Why they differ is an exact decomposition, not a guess: <img src="https://latex.codecogs.com/png.latex?%5Cln%20C_%7Bfeed%7D%20=%20%5Cln%20C_%7Bcat%7D%20-%20%5Cln%20U%20-%20%5Cln(W/U)%20-%20%5Cmathrm%7Bconst%7D"> row by row, and least-squares slopes against <img src="https://latex.codecogs.com/png.latex?T"> add, so <img src="https://latex.codecogs.com/png.latex?s_%7Bfeed%7D%20=%20s_%7Bcat%7D%20-%20s_U%20-%20s_%7BW/U%7D"> with <img src="https://latex.codecogs.com/png.latex?s_%7Bcat%7D%20=%200.00337">, <img src="https://latex.codecogs.com/png.latex?s_U%20=%20-0.00052"> (feed rate happens to correlate with temperature across the pooled rows), <img src="https://latex.codecogs.com/png.latex?s_%7BW/U%7D%20=%20-0.00058"> (the drift of the implied ratio of section 2) and <img src="https://latex.codecogs.com/png.latex?s_%7Bfeed%7D%20=%200.00447"> per °F; the identity closes to within 1e-12 (here 0e+00). Carrying only the feed-rate term moves the interval from 206 to 178 °F (fit of <img src="https://latex.codecogs.com/png.latex?%5Cln(C_%7Bcat%7D/U)"> on <img src="https://latex.codecogs.com/png.latex?T">), and the drift of the implied ratio moves it the rest of the way to 155 °F.</p>
</div>
</div>
</section>
<section id="the-diffusion-hypothesis-the-printed-exponents-and-the-factor-of-two-defect-in-the-nomenclature" class="level3">
<h3 class="anchored" data-anchor-id="the-diffusion-hypothesis-the-printed-exponents-and-the-factor-of-two-defect-in-the-nomenclature">5. The diffusion hypothesis: the printed exponents, and the factor-of-two defect in the nomenclature</h3>
<p><strong>The factor-of-two defect, from the paper’s own two lines.</strong> Eq. (8) prints <img src="https://latex.codecogs.com/png.latex?dC_c/d%5Ctheta%20=%20K/C_c"> “or” <img src="https://latex.codecogs.com/png.latex?C_c%20=%20A%5Ctheta%5E%7B0.5%7D">, and the Nomenclature prints verbatim: <strong>“<img src="https://latex.codecogs.com/png.latex?K"> = constant <img src="https://latex.codecogs.com/png.latex?(=%20A%5E2)">”</strong>. The two printed lines of eq. (8) fix the relation between <img src="https://latex.codecogs.com/png.latex?K"> and <img src="https://latex.codecogs.com/png.latex?A"> with no freedom: separate and integrate from a clean catalyst (<img src="https://latex.codecogs.com/png.latex?C_c(0)=0">) and <img src="https://latex.codecogs.com/png.latex?C_c%20=%20%5Csqrt%7B2K%5Ctheta%7D">, so <img src="https://latex.codecogs.com/png.latex?K%20=%20A%5E2/2">, or differentiate the right-hand line: <img src="https://latex.codecogs.com/png.latex?dC_c/d%5Ctheta%20=%200.5%5C,A%5E2/C_c">, same answer. The printed parenthesis is off by exactly 2 (equivalently <img src="https://latex.codecogs.com/png.latex?%5Csqrt2"> in <img src="https://latex.codecogs.com/png.latex?A">). <img src="https://latex.codecogs.com/png.latex?K"> appears nowhere else in the paper, so nothing downstream inherits the defect. Reported, not repaired; both derivations below, the second by an ODE integrator that shares nothing with the symbolic route.</p>
<div id="b0946655" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.489516Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.489315Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.493300Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.492667Z&quot;}}" data-execution_count="25">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""route A </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">symbolic</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">dC/d</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = K/C</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> with </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> gives </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C = &lt;&lt;csym&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; matching</span></span>
<span id="cb31-2"><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C = A</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> requires </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K/A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2 = &lt;&lt;K_over_A2_required:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed: 1</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> This result is exact and</span></span>
<span id="cb31-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">independent of every printed number </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">claim `K_over_A2_required`, structural</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb31-4"></span>
<span id="cb31-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">route B </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`solve_ivp`, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A = &lt;&lt;eq2_A:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: integrating with the </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K = A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{&lt;&lt;K_identification:g&gt;&gt;}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb31-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the deposit overshoots </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by &lt;&lt;K_printed_numeric_overshoot:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6f&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt2 = &lt;&lt;sqrt2:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">;</span></span>
<span id="cb31-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">with </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K = A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2/2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the ratio differs from 1 by less than &lt;&lt;max_K_half_numeric_gap:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here &lt;&lt;K_half_numeric_gap:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb31-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Tightening the tolerance of the integration by a factor of 100 moves either ratio by less than</span></span>
<span id="cb31-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;max_K_numeric_tolerance_shift:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt; </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">here &lt;&lt;K_numeric_tolerance_shift:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0e&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb31-10">    csym<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sp.latex(C_SYMBOLIC), sqrt2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>route A (symbolic): <img src="https://latex.codecogs.com/png.latex?dC/d%5Ctheta%20=%20K/C"> with <img src="https://latex.codecogs.com/png.latex?C(0)%20=%200"> gives <img src="https://latex.codecogs.com/png.latex?C%20=%20%5Csqrt%7B2%7D%20%5Csqrt%7BK%7D%20%5Csqrt%7B%5Ctheta%7D">; matching <img src="https://latex.codecogs.com/png.latex?C%20=%20A%5Ctheta%5E%7B0.5%7D"> requires <img src="https://latex.codecogs.com/png.latex?K/A%5E2%20=%200.5"> (printed: 1). This result is exact and independent of every printed number (claim <code>K_over_A2_required</code>, structural).</p>
<p>route B (<code>solve_ivp</code>, <img src="https://latex.codecogs.com/png.latex?A%20=%200.65">): integrating with the <strong>printed</strong> <img src="https://latex.codecogs.com/png.latex?K%20=%20A%5E%7B2%7D"> the deposit overshoots <img src="https://latex.codecogs.com/png.latex?A%5Ctheta%5E%7B0.5%7D"> by 1.414214 (<img src="https://latex.codecogs.com/png.latex?%5Csqrt2%20=%201.414214">); with <img src="https://latex.codecogs.com/png.latex?K%20=%20A%5E2/2"> the ratio differs from 1 by less than 1e-08 (here 1e-11). Tightening the tolerance of the integration by a factor of 100 moves either ratio by less than 1e-08 (here 2e-11).</p>
</div>
</div>
<p><strong>How close is “close enough to 0.5”?</strong> The paper: the four exponents “are all close enough to 0.5 to suggest a good concordance with the theory advanced above.” The hypothesis is exercised on every printed <img src="https://latex.codecogs.com/png.latex?(A,%20n)"> pair by asking what each correlation says about the quantity the hypothesis holds constant, <img src="https://latex.codecogs.com/png.latex?C_c%5C,dC_c/d%5Ctheta%20=%20n%20A%5E2%20%5Ctheta%5E%7B2n-1%7D">, which is constant iff <img src="https://latex.codecogs.com/png.latex?n%20=%200.5">, across a window of residence times chosen here (not the paper’s).</p>
<div id="361d8a41" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.494859Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.494711Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.499497Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.498748Z&quot;}}" data-execution_count="26">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"C dC/dtheta = n A^2 theta^(2n-1): variation over theta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TH_LO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TH_HI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> min"</span>)</span>
<span id="cb32-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq.'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'A'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'(theta_hi/lo)^(2n-1)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drift from constant'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;20s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb32-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> eq, (ak, nk) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(1)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_n"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(2)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>),</span>
<span id="cb32-4">                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(6)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_n"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(7)"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_A"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_n"</span>)}.items():</span>
<span id="cb32-5">    ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (TH_HI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TH_LO) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> K[nk] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb32-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eq<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K[ak]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K[nk]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ratio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'drift'</span>][eq]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:19.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb32-7">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""Under the hypothesis's own invariant the printed exponents are not uniformly 'close to 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5': the</span></span>
<span id="cb32-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">worst is eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;worst&gt;&gt; with a drift of &lt;&lt;hypothesis_drift_worst_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; % over the window, the</span></span>
<span id="cb32-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">smallest eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;best&gt;&gt; with &lt;&lt;hypothesis_drift_best_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The paper's qualitative suggestion</span></span>
<span id="cb32-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">survives; a quantitative </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n = 0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> does not, and the paper itself never claims it does </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'n = constant,</span></span>
<span id="cb32-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">depending only slightly on </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">...</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, worst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drift_worst_eq"</span>], best<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>X[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drift_best_eq"</span>], V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>C dC/dtheta = n A^2 theta^(2n-1): variation over theta = 10-300 min
 eq.      A      n     (theta_hi/lo)^(2n-1)    drift from constant
 (1)   0.86   0.41                    0.542                  45.8 %
 (2)   0.65   0.44                    0.665                  33.5 %
 (6)   0.52   0.38                    0.442                  55.8 %
 (7)   0.24   0.53                    1.226                  22.6 %</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Under the hypothesis’s own invariant the printed exponents are not uniformly ‘close to 0.5’: the worst is eq. (6) with a drift of 56 % over the window, the smallest eq. (7) with 23 %. The paper’s qualitative suggestion survives; a quantitative <img src="https://latex.codecogs.com/png.latex?n%20=%200.5"> does not, and the paper itself never claims it does (‘n = constant, depending only slightly on …’).</p>
</div>
</div>
<div id="8e69597f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.501146Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.500910Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.506620Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.505914Z&quot;}}" data-execution_count="27">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is local, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is portable: the paper's own two campaigns</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, from the Fig</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-1 study</span></span>
<span id="cb34-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">one repeatedly regenerated batch</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, predicts </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_c</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;theta_tables_min:g&gt;&gt;</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\ </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\m</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">athrm{min}</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> =</span></span>
<span id="cb34-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq2_prediction_at_120min_wtpct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> wt %</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table I's synthetic block 2 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">about &lt;&lt;tblk:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F; a fresh</span></span>
<span id="cb34-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">batch every run</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> prints &lt;&lt;cblk_lo:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; to &lt;&lt;cblk_hi:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; wt %, a factor &lt;&lt;A_campaign_gap_ratio:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt; on</span></span>
<span id="cb34-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the block mean</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> East Texas gas oil, synthetic catalyst, 850 °F and the same residence time in both; only the</span></span>
<span id="cb34-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">unit and the catalyst batch differ</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> That is the Nomenclature's asymmetry made concrete: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> moved by</span></span>
<span id="cb34-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;gap_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; % between campaigns of the same laboratory, while </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> stays between</span></span>
<span id="cb34-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;n_printed_min:g&gt;&gt; and &lt;&lt;n_printed_max:g&gt;&gt; across two modes, three oils and two catalyst types</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The four</span></span>
<span id="cb34-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">printed </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> span a factor &lt;&lt;A_span_factor:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;; the four exponents span</span></span>
<span id="cb34-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;n_printed_min:g&gt;&gt; to &lt;&lt;n_printed_max:g&gt;&gt;, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm&lt;&lt;n_span_half_range_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> % about their midpoint</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb34-11">    tblk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)].temp_F.mean(),</span>
<span id="cb34-12">    cblk_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)].C_cat_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(),</span>
<span id="cb34-13">    cblk_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1[(t1.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)].C_cat_wtpct.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb34-14">    gap_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (R[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A_campaign_gap_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong><img src="https://latex.codecogs.com/png.latex?A"> is local, <img src="https://latex.codecogs.com/png.latex?n"> is portable: the paper’s own two campaigns.</strong> Eq. (2), from the Fig.-1 study (one repeatedly regenerated batch), predicts <img src="https://latex.codecogs.com/png.latex?C_c(120%5C%20%5Cmathrm%7Bmin%7D)%20=%0A5.34"> wt %. Table I’s synthetic block 2 (about 856 °F; a fresh batch every run) prints 9.4 to 10.1 wt %, a factor 1.82 on the block mean. East Texas gas oil, synthetic catalyst, 850 °F and the same residence time in both; only the unit and the catalyst batch differ. That is the Nomenclature’s asymmetry made concrete: <img src="https://latex.codecogs.com/png.latex?A"> moved by 82 % between campaigns of the same laboratory, while <img src="https://latex.codecogs.com/png.latex?n"> stays between 0.38 and 0.53 across two modes, three oils and two catalyst types. The four printed <img src="https://latex.codecogs.com/png.latex?A"> span a factor 3.6; the four exponents span 0.38 to 0.53, <img src="https://latex.codecogs.com/png.latex?%5Cpm16"> % about their midpoint.</p>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>No measurement outside the paper exists on this page, so validation means: (a) internal identities the printed tables must satisfy (the implied catalyst-to-oil ratio of section 2, the slope identity), (b) reproduction of printed algebra by two routes (section 3), (c) every statement over a set computed over the whole set, with standard errors where an estimate is compared with a value, and (d) a break table for <strong>every</strong> number the page registers: each row injects a defect a reader of a 1945 bilevel scan could actually commit (a 3↔︎8 or 5↔︎6 glyph swap, a dropped superscript, a swapped column, a unit misreading, a mistyped printed constant), reruns the arithmetic of the whole page, and shows which numbers move.</p>
<p><strong>The registered numbers.</strong> Every number the sections above print is registered below with the way it is checked (<code>docs/claims-design.md</code>): a <em>value</em> is a data or discretisation result, held in CI to a tight relative tolerance because the arithmetic is deterministic and only a changed input moves it; a <em>bound</em> is a residual, an identity or a tolerance effect; an <em>exact</em> result is a count, a flag or a printed constant, with the distance to its rounding threshold where one decided it.</p>
<div id="e04141a3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.508715Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.508471Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:20.512405Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:20.511711Z&quot;}}" data-execution_count="28">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb35-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number of the baseline run, registered with the way it is checked</span></span>
<span id="cb35-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (docs/claims-design.md).</span></span>
<span id="cb35-3">VALUE_RTOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># deterministic arithmetic on printed data: only a changed input moves a value</span></span>
<span id="cb35-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> R.items():</span>
<span id="cb35-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS:</span>
<span id="cb35-6">        claims.bound(name, v, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>BOUNDS[name])</span>
<span id="cb35-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXACT:</span>
<span id="cb35-8">        claims.exact(name, v, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EXACT[name])</span>
<span id="cb35-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb35-10">        claims.value(name, v, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>VALUE_RTOL)</span>
<span id="cb35-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> numbers registered: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BOUNDS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bounds, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EXACT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exact, "</span></span>
<span id="cb35-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BOUNDS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EXACT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>105 numbers registered: 6 bounds, 14 exact, 85 values</code></pre>
</div>
</div>
<div id="49279a23" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:20.514364Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:20.514197Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.269479Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.268532Z&quot;}}" data-execution_count="29">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb37-1">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (injected defect, claim, clean value, broken value, caught)</span></span>
<span id="cb37-2">REFUSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (injected defect, why) where the page's own one-root demand stopped the numeric route</span></span>
<span id="cb37-3"></span>
<span id="cb37-4"></span>
<span id="cb37-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> run_row(label, t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1, t2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2, K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb37-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One injected defect: rerun the arithmetic of the whole page and record, for every</span></span>
<span id="cb37-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    claim, whether its own check catches the result."""</span></span>
<span id="cb37-8">    R_, X_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> study(t1_, t2_, K_, refuse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb37-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> X_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refused"</span>]:</span>
<span id="cb37-10">        REFUSED.append((label, X_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"refused"</span>]))</span>
<span id="cb37-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> R_.items():</span>
<span id="cb37-12">        BREAK.append((label, name, claims[name], v, claims.breaks(label, name, v)))</span>
<span id="cb37-13"></span>
<span id="cb37-14"></span>
<span id="cb37-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> cell(df, sel, col, new):</span>
<span id="cb37-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A copy of ``df`` with ``col`` of the rows ``sel`` set to ``new``; returns the</span></span>
<span id="cb37-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    label of the change as well."""</span></span>
<span id="cb37-18">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.copy()</span>
<span id="cb37-19">    old <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out.loc[sel, col].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb37-20">    out.loc[sel, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> new</span>
<span id="cb37-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>col<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>old<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>new<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb37-22"></span>
<span id="cb37-23"></span>
<span id="cb37-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> swapped(df, sel):</span>
<span id="cb37-25">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df.copy()</span>
<span id="cb37-26">    out.loc[sel, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_feed_wtpct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out.loc[sel, [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_feed_wtpct"</span>]].to_numpy()</span>
<span id="cb37-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb37-28"></span>
<span id="cb37-29"></span>
<span id="cb37-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> misread(name, new):</span>
<span id="cb37-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K[name]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>new<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>K, name: new}</span>
<span id="cb37-32"></span>
<span id="cb37-33"></span>
<span id="cb37-34">is_nat <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"natural"</span></span>
<span id="cb37-35">is_syn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.catalyst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"synthetic"</span></span>
<span id="cb37-36">cet_24 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cetane"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t2.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>)</span>
<span id="cb37-37">dec_24 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t2.feed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decalin"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t2.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>)</span>
<span id="cb37-38">syn906 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> is_syn(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">906</span>)</span>
<span id="cb37-39">syn911 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> is_syn(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">911</span>)</span>
<span id="cb37-40">nat962 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> is_nat(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">962</span>)</span>
<span id="cb37-41">nat1_06 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> is_nat(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb37-42">syn4_06 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> is_syn(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>)</span>
<span id="cb37-43">syn_b3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> is_syn(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb37-44"></span>
<span id="cb37-45"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> inspect</span>
<span id="cb37-46">DEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: v.default <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> inspect.signature(study).parameters.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v.default <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> inspect.Parameter.empty}</span>
<span id="cb37-47">ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (label, keyword arguments of run_row)</span></span>
<span id="cb37-48"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sel, col, new, where <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(cet_24, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II cetane, U 2.4"</span>),</span>
<span id="cb37-49">                             (cet_24, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_rate_vvhr"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II cetane"</span>),</span>
<span id="cb37-50">                             (dec_24, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II decalin, U 2.4"</span>),</span>
<span id="cb37-51">                             (t2.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_feed_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II, both feeds, U 0.6"</span>)]:</span>
<span id="cb37-52">    d, lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cell(t2, sel, col, new)</span>
<span id="cb37-53">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>where<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d)))</span>
<span id="cb37-54"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> sel, col, new, where <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(syn906, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_feed_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I synthetic 906 F"</span>),</span>
<span id="cb37-55">                             (syn911, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I synthetic 911 F"</span>),</span>
<span id="cb37-56">                             (syn911, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed_rate_vvhr"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I synthetic 911 F"</span>),</span>
<span id="cb37-57">                             (nat962, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"temp_F"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">902</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I natural 962 F"</span>),</span>
<span id="cb37-58">                             (nat1_06, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I natural block 1, U 0.6"</span>),</span>
<span id="cb37-59">                             (syn4_06, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C_cat_wtpct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I synthetic block 4, U 0.6"</span>)]:</span>
<span id="cb37-60">    d, lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cell(t1, sel, col, new)</span>
<span id="cb37-61">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>where<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d)))</span>
<span id="cb37-62">ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [</span>
<span id="cb37-63">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: the two carbon columns swapped"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>swapped(t2, t2.feed.notna()))),</span>
<span id="cb37-64">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I synthetic block 3: the two carbon columns swapped"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>swapped(t1, syn_b3))),</span>
<span id="cb37-65">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: the two carbon columns swapped"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>swapped(t1, t1.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))),</span>
<span id="cb37-66">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: temperatures read as degrees C (x 5/9)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.assign(temp_F<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>))),</span>
<span id="cb37-67">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: carbon on catalyst made proportional to the feed rate (throughput hypothesis)"</span>,</span>
<span id="cb37-68">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2.assign(C_cat_wtpct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t2.feed_rate_vvhr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t2.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feed"</span>).feed_rate_vvhr.transform(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>)))),</span>
<span id="cb37-69">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I: carbon on catalyst made proportional to the feed rate (throughput hypothesis)"</span>,</span>
<span id="cb37-70">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.assign(C_cat_wtpct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t1.feed_rate_vvhr</span>
<span id="cb37-71">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t1.groupby([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"catalyst"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"block"</span>]).feed_rate_vvhr.transform(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"min"</span>)))),</span>
<span id="cb37-72">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"temperature correction of the slopes with the sign flipped (tsign </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tsign'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>DEF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tsign'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(tsign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>DEF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tsign"</span>])),</span>
<span id="cb37-73">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I natural block 3: carbon on catalyst x 1.2"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.assign(C_cat_wtpct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.C_cat_wtpct.where(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>(is_nat(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)), t1.C_cat_wtpct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>)))),</span>
<span id="cb37-74">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table I synthetic block 2: temperatures read 30 F too high"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.assign(temp_F<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.temp_F.where(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>(is_syn(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t1.block <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)), t1.temp_F <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>)))),</span>
<span id="cb37-75">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"last row of Table II dropped (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2.iloc[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb37-76">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"last row of Table I dropped (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.iloc[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb37-77">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"root tolerance of the chain, xtol </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'xtol'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; 1e-3"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)),</span>
<span id="cb37-78">    (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ODE tolerance, rtol </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEF[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ode_rtol'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; 1e-6"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ode_rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)),</span>
<span id="cb37-79">]</span>
<span id="cb37-80"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_A"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.88</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq1_n"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.47</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_A"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>),</span>
<span id="cb37-81">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.41</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq2_n"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.50</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_coeff"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.55e-6</span>),</span>
<span id="cb37-82">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.98</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_exp"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.63</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_density_ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.53</span>),</span>
<span id="cb37-83">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">90.0</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">94.0</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">105.0</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expU"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_expTheta"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.18</span>),</span>
<span id="cb37-84">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_A"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.32</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq6_n"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.33</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_A"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.29</span>),</span>
<span id="cb37-85">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq7_n"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.58</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_n"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.60</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_identification"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>),</span>
<span id="cb37-86">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_low_F"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">180.0</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_high_F"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">210.0</span>),</span>
<span id="cb37-87">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_measured_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">38.0</span>), misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"faulty_predicted_pct"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">47.0</span>),</span>
<span id="cb37-88">                misread(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_tables_min"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>)]:</span>
<span id="cb37-89">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed constant </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k_)))</span>
<span id="cb37-90">CONTROLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control: clean rerun"</span>, {}),</span>
<span id="cb37-91">            (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control: the rows of both tables in reverse order"</span>,</span>
<span id="cb37-92">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(t1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t1.iloc[::<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], t2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t2.iloc[::<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))]</span>
<span id="cb37-93"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CONTROLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ROWS:</span>
<span id="cb37-94">    run_row(lab, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span></code></pre></div></div>
</div>
<div id="8d1ca5ea" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.272028Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.271892Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.280112Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.279707Z&quot;}}" data-execution_count="30">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1">by_row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb38-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, m_, c0_, b_, c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb38-3">    by_row.setdefault(r_, []).append((m_, c_))</span>
<span id="cb38-4">controls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> by_row <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r_.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>)]</span>
<span id="cb38-5">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(r_, m_) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, m_, c0_, b_, c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> controls]</span>
<span id="cb38-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> bad, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a control row failed a claim: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb38-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'injected defect'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;92}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'claims failed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'registered'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, ms <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> by_row.items():</span>
<span id="cb38-9">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">92</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;92}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(c_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ms)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ms)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, why <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> REFUSED:</span>
<span id="cb38-11">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"refused by the page itself, numeric route of eq. (5) not computed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>why<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb38-12">caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, m_, _, _, c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c_}</span>
<span id="cb38-13">open_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> claims.metrics[k_].get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb38-14">structural <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> claims.metrics[k_].get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb38-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(by_row)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(controls)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> controls, which fail no claim); </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(caught)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb38-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"claims are failed by at least one row; open: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(open_) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(structural)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb38-17">V.update(n_rows_break<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(by_row) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(controls), n_controls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(controls),</span>
<span id="cb38-18">         n_claims<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics), n_caught<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(caught))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>injected defect                                                                              claims failed of registered
control: clean rerun                                                                                     0 of        105
control: the rows of both tables in reverse order                                                        0 of        105
Table II cetane, U 2.4: C_cat_wtpct 4.7 -&gt; 4.2                                                          12 of        105
Table II cetane: feed_rate_vvhr 2.4 -&gt; 1.4                                                              15 of        105
Table II decalin, U 2.4: C_cat_wtpct 3.7 -&gt; 3.2                                                         11 of        105
Table II, both feeds, U 0.6: C_feed_wtpct 4.8 -&gt; 4.3                                                     9 of        105
Table I synthetic 906 F: C_feed_wtpct 6.8 -&gt; 6.3                                                         6 of        105
Table I synthetic 911 F: C_cat_wtpct 11.8 -&gt; 11.3                                                       25 of        105
Table I synthetic 911 F: feed_rate_vvhr 1.1 -&gt; 1                                                        11 of        105
Table I natural 962 F: temp_F 962 -&gt; 902                                                                18 of        105
Table I natural block 1, U 0.6: C_cat_wtpct 5 -&gt; 5.5                                                    30 of        105
Table I synthetic block 4, U 0.6: C_cat_wtpct 14 -&gt; 13                                                  30 of        105
Table II: the two carbon columns swapped                                                                10 of        105
Table I synthetic block 3: the two carbon columns swapped                                               32 of        105
Table I: the two carbon columns swapped                                                                 16 of        105
Table I: temperatures read as degrees C (x 5/9)                                                         18 of        105
Table II: carbon on catalyst made proportional to the feed rate (throughput hypothesis)                 15 of        105
Table I: carbon on catalyst made proportional to the feed rate (throughput hypothesis)                  45 of        105
temperature correction of the slopes with the sign flipped (tsign +1 -&gt; -1)                              2 of        105
Table I natural block 3: carbon on catalyst x 1.2                                                       16 of        105
Table I synthetic block 2: temperatures read 30 F too high                                              13 of        105
last row of Table II dropped (8 -&gt; 7 rows)                                                              12 of        105
last row of Table I dropped (32 -&gt; 31 rows)                                                             25 of        105
root tolerance of the chain, xtol 1e-12 -&gt; 1e-3                                                          2 of        105
ODE tolerance, rtol 1e-10 -&gt; 1e-6                                                                        2 of        105
printed constant eq1_A 0.86 -&gt; 0.88                                                                      2 of        105
printed constant eq1_n 0.41 -&gt; 0.47                                                                      2 of        105
printed constant eq2_A 0.65 -&gt; 0.85                                                                      8 of        105
printed constant eq2_n 0.44 -&gt; 0.41                                                                      9 of        105
printed constant eq2_n 0.44 -&gt; 0.5                                                                      10 of        105
printed constant eq3_coeff 3.55e-05 -&gt; 3.55e-06                                                         12 of        105
printed constant eq3_exp 2.93 -&gt; 2.98                                                                   14 of        105
printed constant eq3_exp 2.93 -&gt; 2.63                                                                   16 of        105
printed constant eq4_density_ratio 0.58 -&gt; 0.53                                                          6 of        105
printed constant eq5_coeff 96 -&gt; 90                                                                      4 of        105
printed constant eq5_coeff 96 -&gt; 94                                                                      5 of        105
printed constant eq5_coeff 96 -&gt; 105                                                                     5 of        105
printed constant eq5_expU 0.34 -&gt; 0.35                                                                   4 of        105
printed constant eq5_expTheta 0.19 -&gt; 0.18                                                               4 of        105
printed constant eq6_A 0.52 -&gt; 0.32                                                                      1 of        105
printed constant eq6_n 0.38 -&gt; 0.33                                                                      5 of        105
printed constant eq7_A 0.24 -&gt; 0.29                                                                      2 of        105
printed constant eq7_n 0.53 -&gt; 0.58                                                                      6 of        105
printed constant eq8_n 0.5 -&gt; 0.6                                                                        1 of        105
printed constant K_identification 2 -&gt; 3                                                                 1 of        105
printed constant doubling_low_F 190 -&gt; 180                                                               2 of        105
printed constant doubling_high_F 200 -&gt; 210                                                              2 of        105
printed constant faulty_measured_pct 36 -&gt; 38                                                            2 of        105
printed constant faulty_predicted_pct 41 -&gt; 47                                                           2 of        105
printed constant theta_tables_min 120 -&gt; 60                                                              7 of        105
refused by the page itself, numeric route of eq. (5) not computed: printed constant eq3_coeff 3.55e-05 -&gt; 3.55e-06 (0 roots on [0, 100]: no sign change in the scanned range)
refused by the page itself, numeric route of eq. (5) not computed: printed constant eq3_exp 2.93 -&gt; 2.63 (0 roots on [0, 100]: no sign change in the scanned range)

50 rows (2 controls, which fail no claim); 100 of 105 claims are failed by at least one row; open: none; structural: K_over_A2_required, doubling_decomposition_gap, eq5_last_digit_alternatives_total, eq5_misreadings_total, slope_decomposition_gap</code></pre>
</div>
</div>
<div id="05139112" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.282613Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.282480Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.287777Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.287061Z&quot;}}" data-execution_count="31">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># What the rows do to the numbers the text relies on: the broken value of selected claims, row by row.</span></span>
<span id="cb40-2">SHOW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_cetane"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableI_pooled"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WU_within_group_cv_max_pct"</span>,</span>
<span id="cb40-3">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling_dT_natural_F"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq5_coeff_symbolic"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K_printed_numeric_overshoot"</span>]</span>
<span id="cb40-4">tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {(r_, m_): b_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, m_, c0_, b_, c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHOW}</span>
<span id="cb40-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'injected defect'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;92}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m_[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHOW))</span>
<span id="cb40-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'baseline'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;92}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[m_]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:15.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHOW))</span>
<span id="cb40-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> by_row:</span>
<span id="cb40-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r_.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"control"</span>):</span>
<span id="cb40-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb40-10">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r_[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">92</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;92}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tab[(r_, m_)]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:15.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHOW))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>injected defect                                                                              m_cat_tableII_ m_cat_tableI_p WU_within_grou doubling_dT_na eq5_coeff_symb K_printed_nume
baseline                                                                                           -0.04699        -0.0501          2.942          205.6          95.71          1.414
Table II cetane, U 2.4: C_cat_wtpct 4.7 -&gt; 4.2                                                      -0.1294        -0.0501          3.201          205.6          95.71          1.414
Table II cetane: feed_rate_vvhr 2.4 -&gt; 1.4                                                         -0.03483        -0.0501          28.38          205.6          95.71          1.414
Table II decalin, U 2.4: C_cat_wtpct 3.7 -&gt; 3.2                                                    -0.04699        -0.0501          6.064          205.6          95.71          1.414
Table II, both feeds, U 0.6: C_feed_wtpct 4.8 -&gt; 4.3                                               -0.04699        -0.0501             13          205.6          95.71          1.414
Table I synthetic 906 F: C_feed_wtpct 6.8 -&gt; 6.3                                                   -0.04699        -0.0501          5.571          205.6          95.71          1.414
Table I synthetic 911 F: C_cat_wtpct 11.8 -&gt; 11.3                                                  -0.04699       -0.05421          4.675          205.6          95.71          1.414
Table I synthetic 911 F: feed_rate_vvhr 1.1 -&gt; 1                                                   -0.04699       -0.05126          2.942          205.6          95.71          1.414
Table I natural 962 F: temp_F 962 -&gt; 902                                                           -0.04699        -0.0501          2.942          198.2          95.71          1.414
Table I natural block 1, U 0.6: C_cat_wtpct 5 -&gt; 5.5                                               -0.04699       -0.06722          6.046          213.1          95.71          1.414
Table I synthetic block 4, U 0.6: C_cat_wtpct 14 -&gt; 13                                             -0.04699       -0.03759          3.739          205.6          95.71          1.414
Table II: the two carbon columns swapped                                                           -0.04699        -0.0501          44.72          205.6          95.71          1.414
Table I synthetic block 3: the two carbon columns swapped                                          -0.04699        -0.1798          55.49          205.6          95.71          1.414
Table I: the two carbon columns swapped                                                            -0.04699        -0.0501          28.29          205.6          95.71          1.414
Table I: temperatures read as degrees C (x 5/9)                                                    -0.04699        -0.0501          2.942          114.2          95.71          1.414
Table II: carbon on catalyst made proportional to the feed rate (throughput hypothesis)               0.953        -0.0501          57.97          205.6          95.71          1.414
Table I: carbon on catalyst made proportional to the feed rate (throughput hypothesis)             -0.04699         0.9499          26.28          242.9          95.71          1.414
temperature correction of the slopes with the sign flipped (tsign +1 -&gt; -1)                        -0.04699        -0.0501          2.942          205.6          95.71          1.414
Table I natural block 3: carbon on catalyst x 1.2                                                  -0.04699        -0.0501          2.942          185.3          95.71          1.414
Table I synthetic block 2: temperatures read 30 F too high                                         -0.04699        -0.0501          2.942          205.6          95.71          1.414
last row of Table II dropped (8 -&gt; 7 rows)                                                         -0.04699        -0.0501          3.282          205.6          95.71          1.414
last row of Table I dropped (32 -&gt; 31 rows)                                                        -0.04699        -0.0523          2.942          205.6          95.71          1.414
root tolerance of the chain, xtol 1e-12 -&gt; 1e-3                                                    -0.04699        -0.0501          2.942          205.6          95.71          1.414
ODE tolerance, rtol 1e-10 -&gt; 1e-6                                                                  -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq1_A 0.86 -&gt; 0.88                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq1_n 0.41 -&gt; 0.47                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq2_A 0.65 -&gt; 0.85                                                                -0.04699        -0.0501          2.942          205.6          104.9          1.414
printed constant eq2_n 0.44 -&gt; 0.41                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq2_n 0.44 -&gt; 0.5                                                                 -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq3_coeff 3.55e-05 -&gt; 3.55e-06                                                    -0.04699        -0.0501          2.942          205.6            210          1.414
printed constant eq3_exp 2.93 -&gt; 2.98                                                              -0.04699        -0.0501          2.942          205.6          88.66          1.414
printed constant eq3_exp 2.93 -&gt; 2.63                                                              -0.04699        -0.0501          2.942          205.6            161          1.414
printed constant eq4_density_ratio 0.58 -&gt; 0.53                                                    -0.04699        -0.0501          2.942          205.6          92.81          1.414
printed constant eq5_coeff 96 -&gt; 90                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq5_coeff 96 -&gt; 94                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq5_coeff 96 -&gt; 105                                                               -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq5_expU 0.34 -&gt; 0.35                                                             -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq5_expTheta 0.19 -&gt; 0.18                                                         -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq6_A 0.52 -&gt; 0.32                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq6_n 0.38 -&gt; 0.33                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq7_A 0.24 -&gt; 0.29                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq7_n 0.53 -&gt; 0.58                                                                -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant eq8_n 0.5 -&gt; 0.6                                                                  -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant K_identification 2 -&gt; 3                                                           -0.04699        -0.0501          2.942          205.6          95.71           1.14
printed constant doubling_low_F 190 -&gt; 180                                                         -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant doubling_high_F 200 -&gt; 210                                                        -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant faulty_measured_pct 36 -&gt; 38                                                      -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant faulty_predicted_pct 41 -&gt; 47                                                     -0.04699        -0.0501          2.942          205.6          95.71          1.414
printed constant theta_tables_min 120 -&gt; 60                                                        -0.04699        -0.0501          2.942          205.6          95.71          1.414</code></pre>
</div>
</div>
<div id="c205b667" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.289699Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.289523Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.293992Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.293341Z&quot;}}" data-execution_count="32">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb42-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The falsifier of the page's main claim: carbon on catalyst made proportional to the feed rate.</span></span>
<span id="cb42-2">thr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m_: b_ <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r_, m_, c0_, b_, c_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r_.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table II: carbon on catalyst made proportional"</span>)}</span>
<span id="cb42-3">shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> thr[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>]</span>
<span id="cb42-4">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Can the central test fail</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Making carbon on catalyst proportional to the feed rate in</span></span>
<span id="cb42-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Table II moves the pooled exponent from &lt;&lt;base:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; to &lt;&lt;broken:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, a shift of &lt;&lt;shift:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2f&gt;&gt;, which is</span></span>
<span id="cb42-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;se_units:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; of its standard errors and &lt;&lt;floors:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; of the table's own rounding floor</span></span>
<span id="cb42-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;slope_rounding_floor_tableII:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The test can fail; it does not</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb42-8">    base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>], broken<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>thr[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled"</span>], shift<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>shift,</span>
<span id="cb42-9">    se_units<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m_cat_tableII_pooled_se"</span>], floors<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slope_rounding_floor_tableII"</span>], V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Can the central test fail?</strong> Making carbon on catalyst proportional to the feed rate in Table II moves the pooled exponent from -0.042 to +0.958, a shift of 1.00, which is 34 of its standard errors and 46 of the table’s own rounding floor (0.022). The test can fail; it does not.</p>
</div>
</div>
<section id="blind-spots-what-this-page-does-not-establish" class="level3">
<h3 class="anchored" data-anchor-id="blind-spots-what-this-page-does-not-establish">Blind spots: what this page does <em>not</em> establish</h3>
<div id="7cb55f83" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.295840Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.295720Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.300257Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.299564Z&quot;}}" data-execution_count="33">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb43-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The time exponent </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is never tested against data here</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Tables I and II sit at a single</span></span>
<span id="cb43-2"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = &lt;&lt;theta_tables_min:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> min; the carbon-versus-time evidence is figure-only </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Figs</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 1 and 5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span></span>
<span id="cb43-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   and was deliberately not digitised</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Every </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> on this page is a transcription of the author's fit</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> A</span></span>
<span id="cb43-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   page that </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tests</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> needs those figures through the review gate, or another paper's tables</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Feed-rate independence is shown inside &lt;&lt;u_lo:g&gt;&gt; to &lt;&lt;u_hi:g&gt;&gt; v/v/hr at one residence time, on</span></span>
<span id="cb43-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   one gas oil and two pure compounds, at the paper's two-figure printing</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The paper's "within</span></span>
<span id="cb43-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   limits" hedge is honest and this page inherits it: Table I's raw pooled exponent is</span></span>
<span id="cb43-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;m_cat_tableI_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, not exactly zero, and what remains</span></span>
<span id="cb43-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   once temperature is allowed for, &lt;&lt;m_cat_tableI_withT:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_withT_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt;, cannot</span></span>
<span id="cb43-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   be told from zero at this precision</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The claim's evidence is one column, not two</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Since the two carbon columns are linked by the run's</span></span>
<span id="cb43-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   mass ratio, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{feed}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pprox-1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is not corroboration of </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pprox0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: it is the same fact</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> This</span></span>
<span id="cb43-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   page's contribution is establishing the linkage, not doubling the evidence</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The doubling test is goodness of fit</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">claim and data share a source</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The per-catalyst split</span></span>
<span id="cb43-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_natural_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; against &lt;&lt;doubling_dT_synthetic_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is</span></span>
<span id="cb43-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;doubling_dT_split_over_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors of the difference on the 16 rows and</span></span>
<span id="cb43-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;doubling_dT_split_over_se_blockmean:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; on the four block means each; the two-point route</span></span>
<span id="cb43-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;doubling_dT_natural_twopoint_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; and &lt;&lt;doubling_dT_synthetic_twopoint_F:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0f&gt;&gt; °F</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> uses the same</span></span>
<span id="cb43-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   rows, so it shows the split is robust to the weighting, not that it is independent evidence</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Nothing validates eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> or eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> against measurement</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: the runs behind them are figure-only</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   What is established is that eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is what eqs</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> imply, so the paper's algebra is clean,</span></span>
<span id="cb43-22"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   and that the printed triple is its correct rounding</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The re-derivation excludes every misreading</span></span>
<span id="cb43-23"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   tried of a leading digit, a glyph or an exponent scale, but not every last digit</span></span>
<span id="cb43-24"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;eq5_last_digit_alternatives_matching:d&gt;&gt; of &lt;&lt;eq5_last_digit_alternatives_total:d&gt;&gt; last-digit</span></span>
<span id="cb43-25"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   alternatives still round to the printed triple</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">; those digits rest on the digit-scale crops, read</span></span>
<span id="cb43-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   independently twice</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">6</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K = A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> defect is a nomenclature error with no consequences in the paper</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> occurs nowhere</span></span>
<span id="cb43-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   else</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It is reported because the case's whole content is the printed constants, and this is the one</span></span>
<span id="cb43-29"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   printed relation between constants that is wrong</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb43-30"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">7</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The temperature drift of the implied ratio, &lt;&lt;WU_block_drift_natural_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; and</span></span>
<span id="cb43-31"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;WU_block_drift_synthetic_pct:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; % across the blocks, is unexplained</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> It is</span></span>
<span id="cb43-32"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   &lt;&lt;WU_block_drift_natural_over_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; and &lt;&lt;WU_block_drift_synthetic_over_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; standard errors of</span></span>
<span id="cb43-33"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">   the within-block scatter </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">block means of four rows each, about six degrees of freedom</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, so it is not noise, and no reading offered here accounts for it; it is recorded, not resolved</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb43-34">    u_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(t1.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), t2.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), u_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(t1.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), t2.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<ol type="1">
<li><strong>The time exponent <img src="https://latex.codecogs.com/png.latex?n"> is never tested against data here.</strong> Tables I and II sit at a single <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20120"> min; the carbon-versus-time evidence is figure-only (Figs. 1 and 5) and was deliberately not digitised. Every <img src="https://latex.codecogs.com/png.latex?n"> on this page is a transcription of the author’s fit. A page that <em>tests</em> <img src="https://latex.codecogs.com/png.latex?n"> needs those figures through the review gate, or another paper’s tables.</li>
<li><strong>Feed-rate independence is shown inside 0.6 to 2.4 v/v/hr at one residence time, on one gas oil and two pure compounds, at the paper’s two-figure printing.</strong> The paper’s “within limits” hedge is honest and this page inherits it: Table I’s raw pooled exponent is -0.050 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 0.018, not exactly zero, and what remains once temperature is allowed for, +0.022 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 0.022, cannot be told from zero at this precision.</li>
<li><strong>The claim’s evidence is one column, not two.</strong> Since the two carbon columns are linked by the run’s mass ratio, <img src="https://latex.codecogs.com/png.latex?m_%7Bfeed%7D%5Capprox-1"> is not corroboration of <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D%5Capprox0">: it is the same fact. This page’s contribution is establishing the linkage, not doubling the evidence.</li>
<li><strong>The doubling test is goodness of fit</strong> (claim and data share a source). The per-catalyst split (206 against 176 °F) is 3.5 standard errors of the difference on the 16 rows and 1.8 on the four block means each; the two-point route (208 and 174 °F) uses the same rows, so it shows the split is robust to the weighting, not that it is independent evidence.</li>
<li><strong>Nothing validates eq. (3) or eq. (5) against measurement</strong>: the runs behind them are figure-only. What is established is that eq. (5) is what eqs. (2)+(3)+(4) imply, so the paper’s algebra is clean, and that the printed triple is its correct rounding. The re-derivation excludes every misreading tried of a leading digit, a glyph or an exponent scale, but not every last digit (6 of 10 last-digit alternatives still round to the printed triple); those digits rest on the digit-scale crops, read independently twice.</li>
<li><strong>The <img src="https://latex.codecogs.com/png.latex?K%20=%20A%5E2"> defect is a nomenclature error with no consequences in the paper</strong>: <img src="https://latex.codecogs.com/png.latex?K"> occurs nowhere else. It is reported because the case’s whole content is the printed constants, and this is the one printed relation between constants that is wrong.</li>
<li><strong>The temperature drift of the implied ratio, 7.9 and 8.7 % across the blocks, is unexplained.</strong> It is 4.6 and 9.1 standard errors of the within-block scatter (block means of four rows each, about six degrees of freedom), so it is not noise, and no reading offered here accounts for it; it is recorded, not resolved.</li>
</ol>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<div id="b287f598" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.302339Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.302148Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.305987Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.305307Z&quot;}}" data-execution_count="34">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb44-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">To the law itself, nothing, and this page does not pretend otherwise</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_c = A</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is a</span></span>
<span id="cb44-2"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">two-constant power function; no operator, grid or solver appears above</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The one pymrm call is</span></span>
<span id="cb44-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`pymrm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">checks</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">find_roots`, which root-finds the eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> chain for the conversion on the physical range</span></span>
<span id="cb44-4"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0 to 100 % and raises unless it finds exactly one root; the least squares, the standard errors and the</span></span>
<span id="cb44-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">integration are NumPy and SciPy, and the symbolic route is SymPy</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> What the reimplementation adds is the</span></span>
<span id="cb44-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">quantification a 1945 paper asserts in words:</span></span>
<span id="cb44-7"></span>
<span id="cb44-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"Independent of feed rate" gets a number and an error bar</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The printed word becomes </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m_{cat}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb44-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  measured per group and pooled per table with its standard error against the two hypotheses an exponent</span></span>
<span id="cb44-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  apart: &lt;&lt;m_cat_tableII_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableII_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; on Table II's widest range,</span></span>
<span id="cb44-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  &lt;&lt;m_cat_tableI_withT:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_withT_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; on Table I with temperature allowed for</span></span>
<span id="cb44-12"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">&lt;&lt;m_cat_tableI_pooled:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">pm</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> &lt;&lt;m_cat_tableI_pooled_se:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; without</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and every fit tens of standard</span></span>
<span id="cb44-13"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  errors from </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> That is stronger and more honest than "substantially constant"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb44-14"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The tables' internal structure is made explicit</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The two carbon columns are linked by the run's mass</span></span>
<span id="cb44-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  ratio at the rounding floor, so the claim has one witness per table; the linkage constant is recovered </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">a</span></span>
<span id="cb44-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  number the paper never prints for these units</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, and one systematic residual, the temperature drift of that</span></span>
<span id="cb44-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  constant, is surfaced that a reader of the printed table would not see</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb44-18"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The printed algebra is verified and the printed prose made exact</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> The eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">5</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> triple is re-derived by a</span></span>
<span id="cb44-19"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  symbolic and a root-found route that differ in solver only; the "faulty point" remark and the doubling claim</span></span>
<span id="cb44-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  become numbers with stated provenance, the doubling claim with standard errors that show it holds for the</span></span>
<span id="cb44-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  natural catalyst and not for the synthetic one; and the derived correlation gains one small exact object the</span></span>
<span id="cb44-22"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  paper does not print </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">instantaneous conversion = &lt;&lt;inst_over_avg_conversion:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3f&gt;&gt; times the period average,</span></span>
<span id="cb44-23"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  everywhere</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb44-24"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">One printed defect is settled from two printed lines</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: the Nomenclature's "</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">K</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = constant </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">= A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">" is</span></span>
<span id="cb44-25"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  inconsistent with eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">8</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> by exactly a factor of two, shown symbolically and by an ODE integration, and shown</span></span>
<span id="cb44-26"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  to be consequence-free within the paper</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb44-27"></span>
<span id="cb44-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The reactor-scale story this law seeds, coke as a </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">profile</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and activity as a function of local carbon, is where</span></span>
<span id="cb44-29"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the operators live, and that is </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[`B2.2`]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">..</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/B2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2-froment-bischoff-coking/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>, V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>To the law itself, nothing, and this page does not pretend otherwise.</strong> <img src="https://latex.codecogs.com/png.latex?C_c%20=%20A%5Ctheta%5En"> is a two-constant power function; no operator, grid or solver appears above. The one pymrm call is <code>pymrm.checks.find_roots</code>, which root-finds the eq.-(5) chain for the conversion on the physical range 0 to 100 % and raises unless it finds exactly one root; the least squares, the standard errors and the integration are NumPy and SciPy, and the symbolic route is SymPy. What the reimplementation adds is the quantification a 1945 paper asserts in words:</p>
<ul>
<li><strong>“Independent of feed rate” gets a number and an error bar.</strong> The printed word becomes <img src="https://latex.codecogs.com/png.latex?m_%7Bcat%7D">, measured per group and pooled per table with its standard error against the two hypotheses an exponent apart: -0.042 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 0.029 on Table II’s widest range, +0.022 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 0.022 on Table I with temperature allowed for (-0.050 <img src="https://latex.codecogs.com/png.latex?%5Cpm"> 0.018 without), and every fit tens of standard errors from <img src="https://latex.codecogs.com/png.latex?+1">. That is stronger and more honest than “substantially constant”.</li>
<li><strong>The tables’ internal structure is made explicit.</strong> The two carbon columns are linked by the run’s mass ratio at the rounding floor, so the claim has one witness per table; the linkage constant is recovered (a number the paper never prints for these units), and one systematic residual, the temperature drift of that constant, is surfaced that a reader of the printed table would not see.</li>
<li><strong>The printed algebra is verified and the printed prose made exact.</strong> The eq.-(5) triple is re-derived by a symbolic and a root-found route that differ in solver only; the “faulty point” remark and the doubling claim become numbers with stated provenance, the doubling claim with standard errors that show it holds for the natural catalyst and not for the synthetic one; and the derived correlation gains one small exact object the paper does not print (instantaneous conversion = 0.809 times the period average, everywhere).</li>
<li><strong>One printed defect is settled from two printed lines</strong>: the Nomenclature’s “<img src="https://latex.codecogs.com/png.latex?K"> = constant <img src="https://latex.codecogs.com/png.latex?(=%20A%5E2)">” is inconsistent with eq. (8) by exactly a factor of two, shown symbolically and by an ODE integration, and shown to be consequence-free within the paper.</li>
</ul>
<p>The reactor-scale story this law seeds, coke as a <em>profile</em> and activity as a function of local carbon, is where the operators live, and that is <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a>.</p>
</div>
</div>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<div id="23e27dda" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.307715Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.307599Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.311795Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.311105Z&quot;}}" data-execution_count="35">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb45-1">say(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Use </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_c = A</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> as a first-cut coke inventory</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> for regenerative cracking-type systems: carbon on</span></span>
<span id="cb45-2"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">catalyst as a function of catalyst residence time alone, with feed rate entering only through the carbon-</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">yield</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb45-3"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">bookkeeping </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">C_f = C_c/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">W</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta/60</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Two warnings, both measured above:</span></span>
<span id="cb45-4"></span>
<span id="cb45-5"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> travels; </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> does not</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Across this paper's own two fixed-bed campaigns on the </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">same oil, catalyst type</span></span>
<span id="cb45-6"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  and temperature</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> moved by a factor &lt;&lt;A_campaign_gap_ratio:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt;; across modes and feeds the four printed</span></span>
<span id="cb45-7"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> span a factor &lt;&lt;A_span_factor:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1f&gt;&gt; while </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> stays in &lt;&lt;n_printed_min:g&gt;&gt; to &lt;&lt;n_printed_max:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Take an</span></span>
<span id="cb45-8"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  exponent from the literature if you must; take </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> only from your own unit</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb45-9"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">- </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">The feed-rate independence is bounded</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: demonstrated over &lt;&lt;u_lo:g&gt;&gt; to &lt;&lt;u_hi:g&gt;&gt; v/v/hr at</span></span>
<span id="cb45-10"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = &lt;&lt;theta_tables_min:g&gt;&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> min, with a residual exponent no larger than a few hundredths, and the paper</span></span>
<span id="cb45-11"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  itself declines to claim it "for all feed stocks, all catalysts, or an extreme variation in feed rates"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb45-12"></span>
<span id="cb45-13"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">If your deactivation model consumes this law downstream</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">activity against time-on-stream</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, read</span></span>
<span id="cb45-14"><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[`B2.2`]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">..</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">/B2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2-froment-bischoff-coking/</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> first: once coke forms a profile along a bed, a time-only activity is</span></span>
<span id="cb45-15"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ill-posed, and `B2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2` maps which coking mechanisms can and cannot reproduce the exponent band printed here</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb45-16"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">`B2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">3` </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Levenspiel</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> and `B2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4` </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Beeckman–Froment</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> continue the ladder; `B1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">7` </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Mears</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> is the disk-neighbour whose</span></span>
<span id="cb45-17"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">first page quotes this paper, and mis-identifies itself to a careless reader</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb45-18"></span>
<span id="cb45-19"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Transcription reuse:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> the three CSVs under `data/` carry Tables I and II and every printed constant with</span></span>
<span id="cb45-20"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">per-cell provenance; the mass-balance identity of section 2 re-verifies the transcription automatically if you</span></span>
<span id="cb45-21"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">edit them</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb45-22"></span>
<span id="cb45-23"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Cite the source, not this page:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Voorhies, A</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> Jr</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Carbon Formation in Catalytic Cracking</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, Industrial &amp;</span></span>
<span id="cb45-24"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Engineering Chemistry </span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">37</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">4</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 318–322 </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1945</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[doi:10.1021/ie50424a010]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">https://doi</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">org/10</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">1021/ie50424a010</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span></span>
<span id="cb45-25"></span>
<span id="cb45-26"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Fit/test, one line:</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> nothing on this page is fitted by this page except the least-squares statistics named in</span></span>
<span id="cb45-27"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the implementation section; every comparison is either reproduction of printed algebra or a consistency check of</span></span>
<span id="cb45-28"><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">the paper's printed claims against the paper's own printed tables, and is labelled so wherever it appears</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>,</span>
<span id="cb45-29">    u_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(t1.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), t2.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), u_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(t1.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), t2.feed_rate_vvhr.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), V<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Use <img src="https://latex.codecogs.com/png.latex?C_c%20=%20A%5Ctheta%5En"> as a first-cut coke inventory</strong> for regenerative cracking-type systems: carbon on catalyst as a function of catalyst residence time alone, with feed rate entering only through the carbon-<em>yield</em> bookkeeping (<img src="https://latex.codecogs.com/png.latex?C_f%20=%20C_c/(W%5Ctheta/60)">). Two warnings, both measured above:</p>
<ul>
<li><strong><img src="https://latex.codecogs.com/png.latex?n"> travels; <img src="https://latex.codecogs.com/png.latex?A"> does not.</strong> Across this paper’s own two fixed-bed campaigns on the <em>same oil, catalyst type and temperature</em>, <img src="https://latex.codecogs.com/png.latex?A"> moved by a factor 1.8; across modes and feeds the four printed <img src="https://latex.codecogs.com/png.latex?A"> span a factor 3.6 while <img src="https://latex.codecogs.com/png.latex?n"> stays in 0.38 to 0.53. Take an exponent from the literature if you must; take <img src="https://latex.codecogs.com/png.latex?A"> only from your own unit.</li>
<li><strong>The feed-rate independence is bounded</strong>: demonstrated over 0.6 to 2.4 v/v/hr at <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20120"> min, with a residual exponent no larger than a few hundredths, and the paper itself declines to claim it “for all feed stocks, all catalysts, or an extreme variation in feed rates”.</li>
</ul>
<p><strong>If your deactivation model consumes this law downstream</strong> (activity against time-on-stream), read <a href="../B2.2-froment-bischoff-coking/"><code>B2.2</code></a> first: once coke forms a profile along a bed, a time-only activity is ill-posed, and <code>B2.2</code> maps which coking mechanisms can and cannot reproduce the exponent band printed here. <code>B2.3</code> (Levenspiel) and <code>B2.4</code> (Beeckman–Froment) continue the ladder; <code>B1.7</code> (Mears) is the disk-neighbour whose first page quotes this paper, and mis-identifies itself to a careless reader.</p>
<p><strong>Transcription reuse:</strong> the three CSVs under <code>data/</code> carry Tables I and II and every printed constant with per-cell provenance; the mass-balance identity of section 2 re-verifies the transcription automatically if you edit them.</p>
<p><strong>Cite the source, not this page:</strong> Voorhies, A. Jr., <em>Carbon Formation in Catalytic Cracking</em>, Industrial &amp; Engineering Chemistry <strong>37</strong>(4) 318–322 (1945), <a href="https://doi.org/10.1021/ie50424a010">doi:10.1021/ie50424a010</a>.</p>
<p><strong>Fit/test, one line:</strong> nothing on this page is fitted by this page except the least-squares statistics named in the implementation section; every comparison is either reproduction of printed algebra or a consistency check of the paper’s printed claims against the paper’s own printed tables, and is labelled so wherever it appears.</p>
</div>
</div>
<div id="6899d106" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-04T03:57:29.313753Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-04T03:57:29.313497Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-04T03:57:29.322140Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-04T03:57:29.321426Z&quot;}}" data-execution_count="36">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb46-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and raises when a claim</span></span>
<span id="cb46-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fails its own check or has no break row.</span></span>
<span id="cb46-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for B2.1:
  n_rows_tableI                               = 32               exact  exact
  n_rows_tableII                              = 8                exact  exact
  m_feed_tableI_mean                          = -1.0505          value  rtol 0.001
  m_cat_tableI_mean                           = -0.049324        value  rtol 0.001
  m_cat_tableI_worst_block                    = -0.11647         value  rtol 0.001
  m_cat_group_max                             = 0.033929         value  rtol 0.001
  m_feed_group_min                            = -1.1768          value  rtol 0.001
  m_feed_group_max                            = -0.94973         value  rtol 0.001
  m_cat_closer_to_zero_ratio_min              = 9.5859           value  rtol 0.001
  m_feed_dev_from_minus_one_min_pct           = 1.9361           value  rtol 0.001
  m_feed_dev_from_minus_one_max_pct           = 17.68            value  rtol 0.001
  m_feed_tableII_cetane                       = -1.0824          value  rtol 0.001
  m_cat_tableII_cetane                        = -0.046992        value  rtol 0.001
  m_feed_tableII_decalin                      = -1.03            value  rtol 0.001
  m_cat_tableII_decalin                       = -0.036423        value  rtol 0.001
  m_cat_tableII_cetane_se                     = 0.055655         value  rtol 0.001
  m_cat_tableII_decalin_se                    = 0.03472          value  rtol 0.001
  m_cat_tableII_cetane_endpoint               = -0.03006         value  rtol 0.001
  slope_rounding_floor_tableI                 = 0.034142         value  rtol 0.001
  slope_rounding_floor_tableII                = 0.021854         value  rtol 0.001
  groups_se_exceeds_floor                     = 8                exact  exact, margin 0.0673
  m_cat_cetane_over_own_floor_max             = 2.7789           value  rtol 0.001
  m_cat_tableI_pooled                         = -0.050103        value  rtol 0.001
  m_cat_tableI_pooled_se                      = 0.017528         value  rtol 0.001
  m_cat_tableI_pooled_from_one_se             = 59.909           value  rtol 0.001
  m_cat_tableI_pooled_over_se                 = 2.8584           value  rtol 0.001
  m_cat_tableI_withT                          = 0.021717         value  rtol 0.001
  m_cat_tableI_withT_se                       = 0.021542         value  rtol 0.001
  m_cat_tableII_pooled                        = -0.041707        value  rtol 0.001
  m_cat_tableII_pooled_se                     = 0.029431         value  rtol 0.001
  m_cat_pooled_from_one_se_min                = 35.395           value  rtol 0.001
  m_cat_tableI_tempcorrected_mean             = 0.0085941        value  rtol 0.001
  m_cat_raw_over_floor_max                    = 6.6197           value  rtol 0.001
  m_cat_corrected_over_floor_max              = 3.1047           value  rtol 0.001
  WU_implied_natural                          = 1.0317           value  rtol 0.001
  WU_implied_synthetic                        = 1.0886           value  rtol 0.001
  WU_implied_cetane                           = 0.86422          value  rtol 0.001
  WU_implied_decalin                          = 1.0136           value  rtol 0.001
  WU_decalin_over_cetane                      = 1.1729           value  rtol 0.001
  WU_within_group_cv_max_pct                  = 2.942            value  rtol 0.001
  WU_block_drift_natural_pct                  = 7.9121           value  rtol 0.001
  WU_block_drift_natural_over_se              = 4.6031           value  rtol 0.001
  WU_block_drift_synthetic_pct                = 8.678            value  rtol 0.001
  WU_block_drift_synthetic_over_se            = 9.0699           value  rtol 0.001
  WU_half_digit_allowance_max_pct             = 5.9396           value  rtol 0.001
  WU_glyph_row_dev_as_read_pct                = -6.4285          value  rtol 0.001
  WU_glyph_row_dev_if_1p0_pct                 = 2.9286           value  rtol 0.001
  WU_slope_vs_feed_worst_abs                  = 0.084542         value  rtol 0.001
  slope_decomposition_gap                     = (here 9.3e-16)   bound  bound &lt;= 1e-12 [identity]
  eq5_coeff_symbolic                          = 95.714           value  rtol 0.001
  eq5_expU_symbolic                           = 0.3413           value  rtol 0.001
  eq5_expTheta_symbolic                       = 0.19113          value  rtol 0.001
  eq5_coeff_numeric                           = 95.714           value  rtol 0.001
  eq5_expU_numeric                            = 0.3413           value  rtol 0.001
  eq5_expTheta_numeric                        = 0.19113          value  rtol 0.001
  eq5_numeric_fit_residual                    = (here 4.0e-15)   bound  bound &lt;= 1e-09 [tolerance]
  eq5_route_gap_max                           = (here 1.2e-15)   bound  bound &lt;= 1e-09 [tolerance]
  eq5_printed_rounding_worst_pct              = 0.94322          value  rtol 0.001
  inst_over_avg_conversion                    = 0.80887          value  rtol 0.001
  eq5_hits_printed                            = True             exact  exact, margin 0.0136
  eq5_misreadings_total                       = 6                exact  exact
  eq5_misreadings_matching                    = 0                exact  exact, margin 0.0136
  eq5_last_digit_alternatives_matching        = 6                exact  exact, margin 0.0136
  eq5_last_digit_alternatives_total           = 10               exact  exact
  eq5_e3_alternatives_matching                = 0                exact  exact, margin 0.0136
  faulty_point_implied_Cf_wtpct               = 1.8866           value  rtol 0.001
  faulty_point_online_Cf_wtpct                = 1.2888           value  rtol 0.001
  faulty_point_excess_ratio                   = 1.4638           value  rtol 0.001
  doubling_dT_natural_F                       = 205.59           value  rtol 0.001
  doubling_dT_natural_se_F                    = 7.0838           value  rtol 0.001
  doubling_dT_natural_twopoint_F              = 208.28           value  rtol 0.001
  doubling_dT_synthetic_F                     = 175.77           value  rtol 0.001
  doubling_dT_synthetic_se_F                  = 4.7707           value  rtol 0.001
  doubling_dT_synthetic_twopoint_F            = 174.01           value  rtol 0.001
  doubling_dT_natural_blockmean_F             = 205.36           value  rtol 0.001
  doubling_dT_natural_blockmean_se_F          = 13.741           value  rtol 0.001
  doubling_quadratic_t_natural                = 2.4671           value  rtol 0.001
  doubling_dT_synthetic_blockmean_F           = 175.96           value  rtol 0.001
  doubling_dT_synthetic_blockmean_se_F        = 9.4076           value  rtol 0.001
  doubling_quadratic_t_synthetic              = -3.6466          value  rtol 0.001
  doubling_dT_split_blockmean_F               = 29.394           value  rtol 0.001
  doubling_dT_split_over_se_blockmean         = 1.7651           value  rtol 0.001
  doubling_natural_vs_band_blockmean_se       = 0.38986          value  rtol 0.001
  doubling_synthetic_vs_band_low_blockmean_se = -1.492           value  rtol 0.001
  doubling_dT_split_F                         = 29.815           value  rtol 0.001
  doubling_dT_split_over_se                   = 3.491            value  rtol 0.001
  doubling_natural_vs_band_high_se            = 0.78842          value  rtol 0.001
  doubling_synthetic_vs_band_low_se           = -2.9828          value  rtol 0.001
  doubling_dT_natural_feed_F                  = 155.17           value  rtol 0.001
  doubling_dT_natural_linked_F                = 178.21           value  rtol 0.001
  doubling_decomposition_gap                  = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  K_over_A2_required                          = 0.5              exact  exact
  K_printed_numeric_overshoot                 = 1.4142           value  rtol 0.001
  K_half_numeric_gap                          = (here 1.4e-11)   bound  bound &lt;= 1e-08 [tolerance]
  K_numeric_tolerance_shift                   = (here 1.9e-11)   bound  bound &lt;= 1e-08 [tolerance]
  n_printed_min                               = 0.38             exact  exact
  n_printed_max                               = 0.53             exact  exact
  fb_range_matches_printed                    = True             exact  exact
  hypothesis_drift_worst_pct                  = 55.793           value  rtol 0.001
  hypothesis_drift_best_pct                   = 22.639           value  rtol 0.001
  eq2_prediction_at_120min_wtpct              = 5.3426           value  rtol 0.001
  A_campaign_gap_ratio                        = 1.8156           value  rtol 0.001
  A_span_factor                               = 3.5833           value  rtol 0.001
  n_span_half_range_pct                       = 16.484           value  rtol 0.001
  typeset_constants_match_csv                 = True             exact  exact</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:B</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier2</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B2.1-voorhies-coking-law/</guid>
  <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Bischoff’s generalised modulus: measuring how narrow the narrow band is</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B1.3-bischoff-generalised-modulus/</link>
  <description><![CDATA[ 




<section id="bischoffs-generalised-modulus-measuring-how-narrow-the-narrow-band-is" class="level1">
<h1>Bischoff’s generalised modulus: measuring how narrow the narrow band is</h1>
<p><strong>Catalog ID:</strong> <code>B1.3</code> · <strong>Structure:</strong> <code>S3</code> (1D steady BVP) · <strong>Tier:</strong> T0</p>
<p>Thiele’s modulus makes the effectiveness factor of a first-order pellet a single curve. Every other rate form gets its own curve, and Langmuir-Hinshelwood kinetics get a <em>family</em> of them, which, as Bischoff (1965) opens by observing, “greatly complicates practical computations.”</p>
<p>His fix is one line: build the modulus from the integral of the rate, and the large-<img src="https://latex.codecogs.com/png.latex?m"> ends of <em>all</em> the curves coincide exactly. What remains is the intermediate range, about which the paper makes a quantitative claim: “the spread is only about 15% for the most interesting cases of one-half- to third-order reactions and is about 30% when zero-order reactions are included.” This page measures that claim (the collapse, its width, where the width peaks) and what the same modulus does for adsorption kinetics, variable diffusivity, and a shape it was never fitted to.</p>
<div id="8a744ca3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:46.927292Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:46.927095Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:46.937975Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:46.936963Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B1.3-bischoff-generalised-modulus"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="b873282b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:46.940318Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:46.940129Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:47.637470Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:47.636494Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> csv</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> functools</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> warnings</span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> IntegrationWarning, quad</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq, minimize_scalar</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm.checks <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> observed_orders</span>
<span id="cb2-11"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, Claims</span>
<span id="cb2-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (Power, LHHW, VolChange, mb_eta, Curve, ZeroOrder,  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this page's model.py</span></span>
<span id="cb2-13">                   mstar_power, K45SQ, m_eta_n1, m_eta_n2, m_eta_n3, m_eta_nhalf, m_eq20,</span>
<span id="cb2-14">                   Slab, Cyl2D, mu1_series, mu2_eq30, eta_series_1st, pz_coeffs, eta_pz,</span>
<span id="cb2-15">                   eq33, eq34)</span>
<span id="cb2-16"></span>
<span id="cb2-17">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># QUADPACK reports round-off-limited refinement at the tolerances Route B asks</span></span>
<span id="cb2-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for; Route B's accuracy is measured against the closed forms below, and the</span></span>
<span id="cb2-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># warning text embeds a temporary path that differs between runs</span></span>
<span id="cb2-21">warnings.filterwarnings(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>, category<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>IntegrationWarning)</span>
<span id="cb2-22">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb2-23">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb2-24"></span>
<span id="cb2-25"></span>
<span id="cb2-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(row, metric, broken):</span>
<span id="cb2-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One injected defect: ``broken`` is what claim ``metric`` becomes with it."""</span></span>
<span id="cb2-28">    caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.breaks(row, metric, broken)</span>
<span id="cb2-29">    BREAK.append((row, metric, claims[metric], broken, caught))</span>
<span id="cb2-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> caught</span>
<span id="cb2-31"></span>
<span id="cb2-32"></span>
<span id="cb2-33"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> maximise(fun, lo, hi, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb2-34">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Largest value of ``fun`` on ``[lo, hi]``: a log-spaced scan, then Brent's</span></span>
<span id="cb2-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    method in ``log x`` around the best scan point. Refuses a window-edge maximum</span></span>
<span id="cb2-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    unless ``edge_ok``, which returns the edge value (the break table uses it).</span></span>
<span id="cb2-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    ``refine=False`` returns the best scan point."""</span></span>
<span id="cb2-38">    xx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(lo, hi, ngrid)</span>
<span id="cb2-39">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [fun(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xx]</span>
<span id="cb2-40">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(vals))</span>
<span id="cb2-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> refine <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> (edge_ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, ngrid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)):</span>
<span id="cb2-42">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(xx[i]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(vals[i])</span>
<span id="cb2-43">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ngrid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maximum at the window edge: widen the window"</span></span>
<span id="cb2-44">    lo_x, mid_x, hi_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(xx[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), np.log(xx[i]), np.log(xx[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb2-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb2-46">        res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> lx: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>fun(np.exp(lx)), bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo_x, mid_x, hi_x),</span>
<span id="cb2-47">                              method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brent"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xtol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>})</span>
<span id="cb2-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>:     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a flat top ties the scan values: no valid bracket</span></span>
<span id="cb2-49">        res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> lx: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>fun(np.exp(lx)), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(lo_x, hi_x),</span>
<span id="cb2-50">                              method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>})</span>
<span id="cb2-51">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(res.x)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>res.fun)</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>Bischoff’s own account of the lineage, from p.&nbsp;351: “Thiele (2) and Zeldovich (3) in 1939 gave the early, and now classical, treatments.” Thiele’s modulus for a first-order reaction is <img src="https://latex.codecogs.com/png.latex?m%20=%20L%5Csqrt%7Bk_v/D%7D">, a grouping of rate coefficient, diffusivity and half-width; each reaction order needs its own version, and Chu and Hougen’s adsorption-rate curves (his ref. 7) need a fresh curve for every parameter pair <img src="https://latex.codecogs.com/png.latex?(%5Czeta,%20C_o)">. The paper’s purpose, in its own words: “it can be stated that a general solution would be very desirable. The purpose of this work is to show how this can be approximately realized.”</p>
<p>The mathematics is a slab (equivalently a single pore): steady diffusion with an arbitrary rate form <img src="https://latex.codecogs.com/png.latex?r(C)"> and concentration-dependent diffusivity <img src="https://latex.codecogs.com/png.latex?D(C)">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B%5Cmathrm%7Bd%7D%7D%7B%5Cmathrm%7Bd%7Dx%7D%5C!%5Cleft%5BD(C)%5C,%5Cfrac%7B%5Cmathrm%7Bd%7DC%7D%7B%5Cmathrm%7Bd%7Dx%7D%5Cright%5D%20=%20r(C),%0A%5Cqquad%20C(0)%20=%20C_o,%5Cqquad%20%5Cfrac%7B%5Cmathrm%7Bd%7DC(L)%7D%7B%5Cmathrm%7Bd%7Dx%7D%20=%200,"></p>
<p>his eqs. (1)-(3), with <img src="https://latex.codecogs.com/png.latex?x=0"> the surface and <img src="https://latex.codecogs.com/png.latex?x=L"> the sealed centre. A first integral (his eq. 5) gives the flux in terms of <img src="https://latex.codecogs.com/png.latex?%5Cint%20D%5C,r%5C,%5Cmathrm%7Bd%7DC">, and everything on this page follows from that.</p>
<p><strong>Why this page completes a quartet.</strong> <a href="../B1.1-thiele-weisz-hicks/"><code>B1.1</code></a> is Thiele’s curve itself; <a href="../B1.2-aris-shape-factor/"><code>B1.2</code></a> is Aris’s collapse across <em>shapes</em> at fixed (first-order) kinetics, using the volume-to-surface length <img src="https://latex.codecogs.com/png.latex?v_p/s_x">; this page is the collapse across <em>kinetics</em> at fixed shape. Bischoff cites exactly that division of labour: for other geometries, “Aris (8) has shown that by choosing appropriate characteristic lengths, other geometrical shapes give approximately similar results.” The final section combines the two collapses on a shape and a rate form neither paper computed, and audits a 1998 competitor, Pan &amp; Zhu’s approximate effectiveness factor for arbitrary kinetics in a cylinder, on the same problem.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p><strong>The general asymptotic solution and the modulus.</strong> For a semi-infinite slab (large modulus) the surface flux is exact and explicit (his eq. 11), and Bischoff defines the general modulus so that the asymptote is <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20=%201/m"> for <em>every</em> rate form (his eq. 13):</p>
<p><img src="https://latex.codecogs.com/png.latex?m%20%5C;%5Cequiv%5C;%20%5Cfrac%7BL%5C,r(C_o)%7D%7B%5Csqrt%7B2%7D%7D%0A%5Cleft%5B%5Cint_0%5E%7BC_o%7D%20D(%5Calpha)%5C,r(%5Calpha)%5C,%5Cmathrm%7Bd%7D%5Calpha%5Cright%5D%5E%7B-1/2%7D."></p>
<p>For the finite slab the exact solution is parametric in the (unknown) centre concentration <img src="https://latex.codecogs.com/png.latex?C_L">: his eq. (14) gives <img src="https://latex.codecogs.com/png.latex?m"> (one printed exponent of which is a misprint, one of five printed defects reported in the Results) and his eq. (15) gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20%5C;=%5C;%20%5Cfrac%7B1%7D%7Bm%7D%5Cleft%5B%5Cfrac%7B%5Cint_%7BC_L%7D%5E%7BC_o%7D%20D%5C,r%5C,%5Cmathrm%7Bd%7DC%7D%0A%7B%5Cint_%7B0%7D%5E%7BC_o%7D%20D%5C,r%5C,%5Cmathrm%7Bd%7DC%7D%5Cright%5D%5E%7B1/2%7D."></p>
<p><strong>Simple orders, <img src="https://latex.codecogs.com/png.latex?r%20=%20k_v%20C%5En"></strong> (his eq. 16). The modulus reduces to <img src="https://latex.codecogs.com/png.latex?m%20=%20L%5Csqrt%7B(n+1)%5C,k_v%20C_o%5E%7B%5C,n-1%7D/(2D)%7D"> (eq. 17), the standard modulus times <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B(n+1)/2%7D">, and eq. (15) reduces to <img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20=%20(1/m)%5Csqrt%7B1-(C_L/C_o)%5E%7Bn+1%7D%7D"> (eq. 19) with <img src="https://latex.codecogs.com/png.latex?m(C_L)"> from the quadrature of eq. (20). The paper evaluates five orders:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th><img src="https://latex.codecogs.com/png.latex?n"></th>
<th>printed solution</th>
<th>eqs.</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20=%20%5Ctanh%20m/m"></td>
<td>21</td>
</tr>
<tr class="even">
<td>0</td>
<td><img src="https://latex.codecogs.com/png.latex?%5Cmathcal%7BE%7D%20=%201"> for <img src="https://latex.codecogs.com/png.latex?m%3C1">, <img src="https://latex.codecogs.com/png.latex?1/m"> for <img src="https://latex.codecogs.com/png.latex?m%3E1"> (attributed to Wheeler, his ref. 4)</td>
<td>22</td>
</tr>
<tr class="odd">
<td>2</td>
<td>incomplete elliptic integral <img src="https://latex.codecogs.com/png.latex?F(%5Cphi,k)">, <img src="https://latex.codecogs.com/png.latex?k=%5Csin%2015%C2%B0"></td>
<td>23-24</td>
</tr>
<tr class="even">
<td>3</td>
<td><img src="https://latex.codecogs.com/png.latex?F(%5Cphi,k)">, <img src="https://latex.codecogs.com/png.latex?k%20=%20%5Csin%2045%C2%B0"></td>
<td>25-26</td>
</tr>
<tr class="odd">
<td>1/2</td>
<td><img src="https://latex.codecogs.com/png.latex?F"> and <img src="https://latex.codecogs.com/png.latex?E">, <img src="https://latex.codecogs.com/png.latex?k=%5Csin%2015%C2%B0"></td>
<td>27-28</td>
</tr>
</tbody>
</table>
<p>and states the claim this page measures: <strong>“the spread is only about 15% for the most interesting cases of one-half- to third-order reactions and is about 30% when zero-order reactions are included”</strong> (p.&nbsp;354), restated in the summary as “if reactions of order less than one-half are excluded, the spread between all the various curves is about 15%.”</p>
<p><strong>Adsorption (LHHW) kinetics</strong>, <img src="https://latex.codecogs.com/png.latex?r%20=%20k_v%20C/(%5Czeta%20+%20C)">, the form Chu &amp; Hougen computed curve families for. The general modulus becomes (his eqs. 29/31)</p>
<p><img src="https://latex.codecogs.com/png.latex?m%20=%20%5Cfrac%7BM%7D%7B%5Csqrt%202%7D%5C,%5Cfrac%7BC_o%7D%7B%5Czeta%20+%20C_o%7D%0A%5Cleft%5BC_o%20-%20%5Czeta%5Cln%5C!%5Cleft(1+%5Cfrac%7BC_o%7D%7B%5Czeta%7D%5Cright)%5Cright%5D%5E%7B-1/2%7D,%0A%5Cqquad%20M%20=%20L%5Csqrt%7Bk_v/D%7D,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?M"> the standard modulus of Chu and Hougen. The paper does not recompute their curves (“this paper will directly use their curves, which are redrawn in Figure 2”) and replots them against <img src="https://latex.codecogs.com/png.latex?m"> as its Figure 3, concluding “the spread is again about the same as for the simple order reactions.” Here the curves are computed, not redrawn, so that sentence too becomes a number.</p>
<p><strong>First-order reaction with volume change</strong>, <img src="https://latex.codecogs.com/png.latex?D(C)%20=%20D/(%5Comega%20C%20+%201)"> (eq. 32): the modulus correction is closed-form (eq. 33), <img src="https://latex.codecogs.com/png.latex?m%20=%20M%5C,%7C%5Comega%20C_o%7C%5C,%5B%5C,%5Comega%20C_o%20-%20%5Cln(%5Comega%20C_o%20+%201)%5D%5E%7B-1/2%7D/%5Csqrt%202">, and Table 1, the paper’s only table, compares it at four values of <img src="https://latex.codecogs.com/png.latex?%5Comega%20C_o"> with Hawthorn’s empirical correction <img src="https://latex.codecogs.com/png.latex?M%5C,%5B%5Comega%20C_o/%5Cln(1+%5Comega%20C_o)%5D%5E%7B0.7%7D"> (eq. 34).</p>
<p><strong>What the paper does <em>not</em> print:</strong> any measurement. Every number in it is computed from the model, so this is a provenance tier 6 page throughout, and “agreement” below means agreement between independent computations: Bischoff’s printed ones, closed forms, quadrature of his parametric solution, and pymrm finite-volume solutions of the underlying BVP.</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Assumptions, all Bischoff’s:</strong> steady state; a single reaction with rate a function of one concentration; isothermal; slab geometry (or a single pore), with surface concentration held at <img src="https://latex.codecogs.com/png.latex?C_o"> and zero flux at the centre; diffusivity constant or a known function <img src="https://latex.codecogs.com/png.latex?D(C)">. Nonisothermal pellets, film resistance and bimodal pore structures are explicitly deferred by the paper to its refs. 1, 4-6 and are not treated here (the nonisothermal pellet is <a href="../B1.1-thiele-weisz-hicks/"><code>B1.1</code></a>’s second half).</p>
<p><strong>Everything is dimensionless.</strong> With <img src="https://latex.codecogs.com/png.latex?c%20=%20C/C_o">, rates normalised so <img src="https://latex.codecogs.com/png.latex?%5Ctilde%20r(1)%20=%201"> and <img src="https://latex.codecogs.com/png.latex?%5Ctilde%20d%20=%20D(C)/D">, the model has no physical parameters at all, only the rate-form shape (<img src="https://latex.codecogs.com/png.latex?n">, or <img src="https://latex.codecogs.com/png.latex?%5Czeta%5E*%20=%20%5Czeta/C_o">, or <img src="https://latex.codecogs.com/png.latex?%5Comega%20C_o">) and the modulus. The normalisation shows a reduction: Chu &amp; Hougen’s two-parameter family <img src="https://latex.codecogs.com/png.latex?(%5Czeta,%20C_o)"> is the one-parameter family <img src="https://latex.codecogs.com/png.latex?%5Czeta%5E*%20=%20%5Czeta/C_o">; Bischoff’s Figures 2a-c vary <img src="https://latex.codecogs.com/png.latex?C_o"> and <img src="https://latex.codecogs.com/png.latex?%5Czeta"> separately because both are dimensional there.</p>
<p><strong>How the sources were read.</strong> Both PDFs are CCITT-G4 bilevel scans (Bischoff at 300 ppi native, Pan &amp; Zhu at 600 ppi, checked with <code>pdfimages -list</code>; rendering higher only interpolates). The Bischoff text layer is poor (sub- and superscripts unreliable), so every equation, exponent and table cell used here was read from a digit-scale crop of a native-resolution render, and the three printed tables used are transcribed into <code>data/</code> with provenance sidecars. Five printed defects were found this way and are reported, never repaired silently, in the Results: one Table 1 cell, the <img src="https://latex.codecogs.com/png.latex?n%20=%201/2"> elliptic reduction and an exponent in eq. (14) (Bischoff), plus one Table 5 cell and a sign in eq. (36) (the secondary source).</p>
<div id="b6d9a67b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:47.640145Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:47.639725Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:47.643763Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:47.642965Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The families and grids the page evaluates; there is no physical parameter.</span></span>
<span id="cb3-2">KEYS_15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "one-half- to third-order reactions"</span></span>
<span id="cb3-3">KEYS_30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>,) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KEYS_15          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "... when zero-order reactions are included"</span></span>
<span id="cb3-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># zeta* = zeta/C_o of Bischoff's Figures 2a-c: zeta from 0.001 to 100 at C_o = 0.1, 0.5, 1</span></span>
<span id="cb3-5">ZSTARS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>({<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> co, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)</span>
<span id="cb3-6">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> co <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)})</span>
<span id="cb3-7">W_FAM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># omega*C_o of Bischoff's Table 1</span></span>
<span id="cb3-8">U_GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.366</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>])  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># C_L/C_o</span></span>
<span id="cb3-9">N_SLAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># cells of the pymrm slab (Route A)</span></span>
<span id="cb3-10">N_CYL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># radial cells of the 2-D cylinder (Z = 1: 100 x 100)</span></span></code></pre></div></div>
</div>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Three small printed tables, all of them the authors’ own computed values: <strong>nothing on this page is a measurement</strong> (provenance tier 6; neither paper reports an experiment relevant here).</p>
<ul>
<li><code>bischoff-table1.csv</code>: Bischoff’s Table 1 (modulus correction factors for volume change), all eight cells as printed.</li>
<li><code>pan-zhu-table5.csv</code>, <code>pan-zhu-table6.csv</code>: the secondary source’s shape coefficients and its first-order accuracy test (columns <img src="https://latex.codecogs.com/png.latex?Z"> = 1 and 2), as printed.</li>
</ul>
<p>One table is borrowed: <a href="../B1.1-thiele-weisz-hicks/"><code>B1.1</code></a>’s <code>isothermal-exact.csv</code>, whose slab rows are <img src="https://latex.codecogs.com/png.latex?%5Ctanh%5Cphi/%5Cphi">. That page flags nothing about those rows (its caveats concern the non-isothermal continuation, which is not used here). Its <img src="https://latex.codecogs.com/png.latex?%5Cphi"> column is stored rounded, to at most seven decimal places, which matters for the reconciliation at the end of the Results.</p>
<p>The exact <img src="https://latex.codecogs.com/png.latex?%5Ceta(m)"> curves computed below are exported as <code>eta-generalised-modulus.csv</code> for reuse.</p>
<div id="0fcdebe9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:47.645832Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:47.645700Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:47.778011Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:47.776616Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">tab1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bischoff-table1.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-2">pan5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan-zhu-table5.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-3">pan6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan-zhu-table6.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb4-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bischoff-table1.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb4-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan-zhu-table6.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb4-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(tab1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table 1 rows; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(pan5)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table 5 Z-values; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(pan6)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Table 6 rows "</span></span>
<span id="cb4-7">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"across Z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(z) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(pan6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Z'</span>].unique())]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Bischoff, K. B. (1965) — AIChE Journal 11(2) 351-355 — doi:10.1002/aic.690110229 — transcribed
Pan, T.; Zhu, B. (1998) — Chemical Engineering Science 53(5) 933-946 — doi:10.1016/S0009-2509(97)00385-0 — transcribed
4 Table 1 rows; 9 Table 5 Z-values; 18 Table 6 rows across Z = [1.0, 2.0]</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>Three routes to <img src="https://latex.codecogs.com/png.latex?%5Ceta(m)">, sharing no assembly. The model code is in <code>model.py</code>.</p>
<p><strong>Route A: pymrm finite volume (<code>Slab</code>).</strong> The BVP itself, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%5B%5Ctilde%20d(c)%5C,c'%5D/%5Cmathrm%7Bd%7Dx%20=%20%5CPhi%5E2%5Ctilde%20r(c)"> on <img src="https://latex.codecogs.com/png.latex?x%5Cin(0,1)">, with <img src="https://latex.codecogs.com/png.latex?x%20=%200"> the centre and <img src="https://latex.codecogs.com/png.latex?x%20=%201"> the surface. The boundary dictionaries use the outward normal: <code>{"a": 1, "b": 0, "d": 0}</code> at <img src="https://latex.codecogs.com/png.latex?x%20=%200"> is <img src="https://latex.codecogs.com/png.latex?c'(0)%20=%200"> (symmetry), <code>{"a": 0, "b": 1, "d": 1}</code> at <img src="https://latex.codecogs.com/png.latex?x%20=%201"> is <img src="https://latex.codecogs.com/png.latex?c(1)%20=%201">. <code>construct_grad</code> and <code>construct_div</code> (<code>nu=0</code>, a slab) are assembled once. With constant diffusivity the residual is that constant operator plus the reaction, whose Jacobian is <code>NumJac((n, 1))</code> (one field: <code>(n, 1)</code>, never <code>(n,)</code>). With <img src="https://latex.codecogs.com/png.latex?%5Ctilde%20d(c)"> the face diffusivity depends on the state, so the whole residual, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bdiv%7D(-%5Ctilde%20d(c_f)%5C,%5Cmathrm%7Bgrad%7D%5C,c)%20+%0A%5CPhi%5E2%5Ctilde%20r(c)">, goes to one <code>NumJac((n, 1), axes_diagonals=[0])</code>: the residual of a cell reads its two neighbours through the face values <img src="https://latex.codecogs.com/png.latex?c_f"> (linear between cells by <code>interp_cntr_to_stagg</code>, at the two boundaries from <code>compute_boundary_values</code>). Every solve is one <code>newton</code> call with <code>tol=1e-12</code>, <code>stagnation=True</code> and <code>bounds=(0, inf)</code> (<img src="https://latex.codecogs.com/png.latex?c%5En"> with <img src="https://latex.codecogs.com/png.latex?n%20%3C%201"> is undefined below zero), and raises unless newton reports success. <img src="https://latex.codecogs.com/png.latex?%5Ceta"> is the volume average of the rate; the surface flux read with <code>compute_boundary_values</code> is the same sum rearranged (the finite-volume divergence telescopes to the boundary flux), so their gap is the solve residual, checked as an identity and not counted as a second route.</p>
<p><strong>Route B: quadrature of Bischoff’s parametric solution (<code>mb_eta</code>, <code>Curve</code>).</strong> Eqs. (14)-(15) with the <em>inner</em> integral <img src="https://latex.codecogs.com/png.latex?%5Cint%20%5Ctilde%20d%5C,%5Ctilde%20r%5C,%5Cmathrm%7Bd%7Dc"> in closed form for every rate form used (power law, LHHW, volume change), the outer integral by adaptive quadrature after the substitution <img src="https://latex.codecogs.com/png.latex?c%20=%20C_L%20+%20s%5E2"> that removes the square-root singularity, and <img src="https://latex.codecogs.com/png.latex?C_L(m)"> by <code>brentq</code> in <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Blogit%7D(C_L/C_o)">, which resolves both ends of the curve. One exponent of eq. (14) is amended in the process; that is a printed defect of the source, reported with proof in its own Results section below.</p>
<p><strong>Route C: the paper’s closed forms.</strong> Eqs. (21)-(28): <code>tanh</code>, the Wheeler piecewise form, and the incomplete elliptic integrals via <code>scipy.special.ellipkinc</code>/<code>ellipeinc</code>, independent of Route B’s quadrature. One implementation detail matters: the printed <img src="https://latex.codecogs.com/png.latex?%5Csin%5Cphi"> parametrisations pass through <img src="https://latex.codecogs.com/png.latex?%5Cphi%20=%20%5Cpi/2"> (at <img src="https://latex.codecogs.com/png.latex?C_o/C_L%20=%201+%5Csqrt3"> for the <img src="https://latex.codecogs.com/png.latex?k=%5Csin15%C2%B0"> pair), so <img src="https://latex.codecogs.com/png.latex?%5Cphi"> is evaluated from the equivalent <img src="https://latex.codecogs.com/png.latex?%5Ccos%5Cphi%20=%20(%5Csqrt3+1-t)/(%5Csqrt3-1+t)">, which carries the branch.</p>
<div id="6ddbfa23" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:47.780848Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:47.780477Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:49.270562Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:49.269633Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1">CURVES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: Curve(Power(n)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15}      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Route B, the exact curves</span></span>
<span id="cb6-2">CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ZeroOrder()                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (22)</span></span>
<span id="cb6-3">CLOSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>: m_eta_nhalf, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>: m_eta_n1, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>: m_eta_n2, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>: m_eta_n3}   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Route C</span></span>
<span id="cb6-4">SLAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Slab(N_SLAB)</span>
<span id="cb6-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"slab: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells, unknowns shaped </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shape<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; boundary conditions "</span></span>
<span id="cb6-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>bc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at x = 0 (centre) and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>bc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at x = 1 (surface)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>slab: 400 cells, unknowns shaped (400, 1); boundary conditions {'a': 1.0, 'b': 0.0, 'd': 0.0} at x = 0 (centre) and {'a': 0.0, 'b': 1.0, 'd': 1.0} at x = 1 (surface)</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-three-routes-agree-before-anything-is-measured" class="level3">
<h3 class="anchored" data-anchor-id="the-three-routes-agree-before-anything-is-measured">The three routes agree before anything is measured</h3>
<p>Route B (quadrature of eqs. 14-15) against Route C (the printed closed forms), across the whole parametric range. A wrong elliptic modulus, a dropped branch or a mistranscribed prefactor breaks this at once, and the break table at the end injects exactly those defects. The <img src="https://latex.codecogs.com/png.latex?n=1/2"> column here uses the <strong>amended</strong> reduction; the as-printed one has its own section.</p>
<div id="5784bc4b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:49.273027Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:49.272834Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:49.284655Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:49.283655Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> route_bc_dev(closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLOSED):</span>
<span id="cb8-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst relative gap between Route B and Route C over U_GRID, in m and eta."""</span></span>
<span id="cb8-3">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb8-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> closed.items():</span>
<span id="cb8-5">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U_GRID:</span>
<span id="cb8-6">            m_b, e_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mb_eta(Power(n), u)</span>
<span id="cb8-7">            m_c, e_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f(u)</span>
<span id="cb8-8">            dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(dev, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> dev</span>
<span id="cb8-10"></span>
<span id="cb8-11"></span>
<span id="cb8-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq20_dev(denominator_exponent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb8-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst relative gap in m between eq. (20) and Route B."""</span></span>
<span id="cb8-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_eq20(n, u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> mb_eta(Power(n), u, denominator_exponent)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb8-15">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>))</span>
<span id="cb8-16"></span>
<span id="cb8-17"></span>
<span id="cb8-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mstar_extrapolated(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>):</span>
<span id="cb8-19">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Dead-zone onset from Route B: m(u) at u = 1e-8 and 1e-10, extrapolated</span></span>
<span id="cb8-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    to u = 0 assuming m - m* ~ u^power ((1 - n)/2 = 1/4 for n = 1/2)."""</span></span>
<span id="cb8-21">    u1, u2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span></span>
<span id="cb8-22">    m1, m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mb_eta(Power(n), u1)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], mb_eta(Power(n), u2)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb8-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (m2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> power <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> power) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (u1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> power <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> power)</span>
<span id="cb8-24"></span>
<span id="cb8-25"></span>
<span id="cb8-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> asymptote_dev(m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, standard_modulus<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb8-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst |eta m - 1| at m for n = 2 and 3 (n = 1 and below are 1/m there</span></span>
<span id="cb8-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    by construction: the n = 1 table ends at m = 23.7, n &lt;= 1/2 dead-zones)."""</span></span>
<span id="cb8-29">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb8-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>):</span>
<span id="cb8-31">        m_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt((n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> standard_modulus <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> m</span>
<span id="cb8-32">        dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(dev, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CURVES[n].eta(m_n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb8-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> dev</span>
<span id="cb8-34"></span>
<span id="cb8-35"></span>
<span id="cb8-36">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_vs_closed_forms_worst_rel"</span>, route_bc_dev(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb8-37">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Route B's outer quadrature runs at epsrel 1e-10"</span>)</span>
<span id="cb8-38">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq20_vs_routeB_worst_rel"</span>, eq20_dev(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb8-39">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both are quadratures at epsrel 1e-10 or tighter"</span>)</span>
<span id="cb8-40">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mstar_nhalf_extrapolated_rel_dev"</span>,</span>
<span id="cb8-41">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mstar_extrapolated() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> mstar_power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb8-42">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-point extrapolation removes the leading u^(1/4) term"</span>)</span>
<span id="cb8-43">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote_eta_m_dev_at_m30"</span>, asymptote_dev(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb8-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Route B against the closed forms, worst relative gap over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(U_GRID)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> centre "</span></span>
<span id="cb8-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"concentrations x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLOSED)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> orders: below 1e-10 "</span></span>
<span id="cb8-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'routeB_vs_closed_forms_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb8-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (20) by quadrature against Route B, worst: below 1e-10 "</span></span>
<span id="cb8-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq20_vs_routeB_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb8-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"n = 1/2 dead-zone onset: m* = (n+1)/(1-n) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mstar_power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; Route B "</span></span>
<span id="cb8-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"extrapolated in u^(1/4) to within 1e-10 "</span></span>
<span id="cb8-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mstar_nhalf_extrapolated_rel_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb8-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"|eta m - 1| at m = 30, worst of n = 2 and 3: "</span></span>
<span id="cb8-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'asymptote_eta_m_dev_at_m30'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Route B against the closed forms, worst relative gap over 10 centre concentrations x 4 orders: below 1e-10 (here 2e-12)
eq. (20) by quadrature against Route B, worst: below 1e-10 (here 3e-13)
n = 1/2 dead-zone onset: m* = (n+1)/(1-n) = 3; Route B extrapolated in u^(1/4) to within 1e-10 (here 5e-14)
|eta m - 1| at m = 30, worst of n = 2 and 3: 2.254e-05</code></pre>
</div>
</div>
<p><strong>pymrm against Route B.</strong> Eight rate forms (four orders, two LHHW, two volume change) at three moduli each; <img src="https://latex.codecogs.com/png.latex?n%20=%201/2"> is taken on its smooth branch (<img src="https://latex.codecogs.com/png.latex?m%20%3C%20m%5E*%20=%203">), its dead zone in the next section. Every case is solved on a ladder of 100 to 800 cells, so that the gap at 400 cells can be read as grid error or not.</p>
<div id="fadb150d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:49.286639Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:49.286453Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:51.374411Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:51.373468Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">FORMS_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [Power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>),</span>
<span id="cb10-2">           LHHW(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), LHHW(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>), VolChange(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), VolChange(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)]</span>
<span id="cb10-3">CASES_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(rf, m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rf <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FORMS_A</span>
<span id="cb10-4">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(rf, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>))]</span>
<span id="cb10-5">_ref_curves <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {rf.label: Curve(rf) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rf <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> FORMS_A}</span>
<span id="cb10-6">REF_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([_ref_curves[rf.label].eta(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rf, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CASES_A])</span>
<span id="cb10-7">LADDER_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb10-8"></span>
<span id="cb10-9"></span>
<span id="cb10-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> slab_errors(n, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volume"</span>, flux_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"face"</span>):</span>
<span id="cb10-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""|eta_pymrm/eta_routeB - 1| for every case on n cells; and the gap between</span></span>
<span id="cb10-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the surface-flux (flux_read) and the volume-average eta of each solve."""</span></span>
<span id="cb10-13">    slab, err, gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Slab(n, nu), [], []</span>
<span id="cb10-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (rf, m), ref <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(CASES_A, REF_A):</span>
<span id="cb10-15">        Phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> rf.Rint(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb10-16">        c, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab.solve(rf, Phi)</span>
<span id="cb10-17">        e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab.eta_of(c, rf, Phi, read)</span>
<span id="cb10-18">        err.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb10-19">        gap.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(slab.eta_of(c, rf, Phi, flux_read) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> slab.eta_of(c, rf, Phi)))</span>
<span id="cb10-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array(err), np.array(gap)</span>
<span id="cb10-21"></span>
<span id="cb10-22"></span>
<span id="cb10-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> slab_ladder(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb10-24">    errs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: slab_errors(n, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LADDER_A}</span>
<span id="cb10-25">    worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([errs[n].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LADDER_A])</span>
<span id="cb10-26">    case_orders <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log2(errs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> errs[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>])</span>
<span id="cb10-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> errs, worst, case_orders</span>
<span id="cb10-28"></span>
<span id="cb10-29"></span>
<span id="cb10-30">ERR_A, WORST_A, ORD_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab_ladder()</span>
<span id="cb10-31">FLUX_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab_errors(N_SLAB)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb10-32">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_worst_rel"</span>, WORST_A[LADDER_A.index(N_SLAB)])</span>
<span id="cb10-33">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_observed_order"</span>, np.log2(WORST_A[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> WORST_A[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>,</span>
<span id="cb10-34">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second-order finite volume; worst case of 24, 400 to 800 cells"</span>)</span>
<span id="cb10-35">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_case_orders_min"</span>, ORD_A.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb10-36">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"per-case orders 400 to 800 cells; pre-asymptotic where two error terms compete"</span>)</span>
<span id="cb10-37">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_case_orders_max"</span>, ORD_A.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb10-38">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"per-case orders 400 to 800 cells; pre-asymptotic where two error terms compete"</span>)</span>
<span id="cb10-39">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_flux_vs_volume_worst"</span>, FLUX_GAP, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb10-40">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"finite-volume conservation; the gap is the residual of the solve"</span>)</span>
<span id="cb10-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cells'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'worst |eta/eta_B - 1| over '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CASES_A)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' cases'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;40}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-42"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(LADDER_A, WORST_A):</span>
<span id="cb10-43">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"worst case, 400 -&gt; 800 cells: order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_slab_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; per case "</span></span>
<span id="cb10-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the orders range from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORD_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-46">_slow <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>rf<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (rf, m), o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(CASES_A, ORD_A) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>]</span>
<span id="cb10-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cases more than 0.1 from order 2 (pre-asymptotic): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_slow)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb10-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'; '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_slow) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb10-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"surface flux (compute_boundary_values) against the volume average, worst of "</span></span>
<span id="cb10-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CASES_A)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> solves on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells: below 1e-8 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FLUX_GAP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> cells     worst |eta/eta_B - 1| over 24 cases
   100                               3.154e-05
   200                               7.917e-06
   400                               1.983e-06
   800                               4.963e-07
worst case, 400 -&gt; 800 cells: order 2.00; per case the orders range from 1.73 to 2.21
cases more than 0.1 from order 2 (pre-asymptotic): 2 (n = 1 at m = 3; LHHW z* = 10 at m = 3)
surface flux (compute_boundary_values) against the volume average, worst of 24 solves on 400 cells: below 1e-8 (here 1e-10)</code></pre>
</div>
</div>
</section>
<section id="the-dead-zone" class="level3">
<h3 class="anchored" data-anchor-id="the-dead-zone">The dead zone</h3>
<p>For <img src="https://latex.codecogs.com/png.latex?n%3C1"> past <img src="https://latex.codecogs.com/png.latex?m%5E*"> the reactant vanishes on an interior region, and the rate’s square-root kink at <img src="https://latex.codecogs.com/png.latex?c=0"> sits on the free boundary. The exact answer there is <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%201/m">. The page solves it with the regularised rate <img src="https://latex.codecogs.com/png.latex?r_%5Cvarepsilon%20=%20%5Csqrt%7Bc+%5Cvarepsilon%7D%20-%20%5Csqrt%7B%5Cvarepsilon%7D"> and its exact Jacobian (one <code>construct_coefficient_matrix</code> of <img src="https://latex.codecogs.com/png.latex?%5CPhi%5E2/(2%5Csqrt%7Bc+%5Cvarepsilon%7D)"> on the diagonal), and treats <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> as an error axis: a ladder in <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> on every grid, extrapolated to <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20%5Cto%200"> with <code>observed_orders</code>, then a grid ladder of those limits. The unregularised solve is shown beside it, as current pymrm handles it.</p>
<div id="2870ee72" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:51.376416Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:51.376224Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:51.799952Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:51.798716Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">DZ, M_DZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span></span>
<span id="cb12-2">PHI_DZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> M_DZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> DZ.Rint(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb12-3">EPS_LADDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-16</span>)</span>
<span id="cb12-4">DZ_NS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb12-5"></span>
<span id="cb12-6"></span>
<span id="cb12-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> deadzone_eta(n, eps, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volume"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb12-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eta m - 1 of the regularised dead-zone solve, and whether it converged."""</span></span>
<span id="cb12-9">    slab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Slab(n, nu)</span>
<span id="cb12-10">    c, sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab.solve(DZ, PHI_DZ, eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>eps, check<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb12-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> slab.eta_of(c, DZ, PHI_DZ, read) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> M_DZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(sol.success)</span>
<span id="cb12-12"></span>
<span id="cb12-13"></span>
<span id="cb12-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> deadzone_study(rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>, extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb12-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eps ladder on every grid, its eps -&gt; 0 limit, and the grid ladder of the limits.</span></span>
<span id="cb12-16"></span>
<span id="cb12-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The extrapolation solves at eps = 1e-12, 1e-12/rung, 1e-12/rung^2 and reads</span></span>
<span id="cb12-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    them as a refinement by 100 per rung; the error is O(sqrt(eps))."""</span></span>
<span id="cb12-19">    table, limits, eps_orders, n_ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}, [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb12-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DZ_NS:</span>
<span id="cb12-21">        row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [deadzone_eta(n, eps, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> eps <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EPS_LADDER]</span>
<span id="cb12-22">        n_ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(ok <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, ok <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> row)</span>
<span id="cb12-23">        table[n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> row]</span>
<span id="cb12-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> extrapolate:</span>
<span id="cb12-25">            lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(</span>
<span id="cb12-26">                <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: deadzone_eta(n, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(np.log(rung) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb12-27">                (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>))</span>
<span id="cb12-28">            limits[n], eps_orders <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lad[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>], eps_orders <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [lad[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb12-29">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb12-30">            limits[n] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table[n][EPS_LADDER.index(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)]</span>
<span id="cb12-31">    grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: limits[n], DZ_NS)</span>
<span id="cb12-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> table, limits, eps_orders, grid, n_ok</span>
<span id="cb12-33"></span>
<span id="cb12-34"></span>
<span id="cb12-35">DZ_TABLE, DZ_LIM, DZ_EPS_ORD, DZ_GRID, DZ_OK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> deadzone_study()</span>
<span id="cb12-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"n = 1/2, m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_DZ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (dead zone; exact eta m - 1 = 0): eta m - 1 of the regularised solve"</span>)</span>
<span id="cb12-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'cells'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'eps = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EPS_LADDER) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eps -&gt; 0'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-38"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DZ_NS:</span>
<span id="cb12-39">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DZ_TABLE[n]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DZ_LIM[n]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb12-40">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_regularised_converged"</span>, DZ_OK)</span>
<span id="cb12-41">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_deadzone_rel_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ_TABLE[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>][EPS_LADDER.index(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)]))</span>
<span id="cb12-42">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_eps_order_min"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(DZ_EPS_ORD), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb12-43">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_eps - r is O(sqrt(eps)) near c = 0; eps ratio 100 per rung"</span>)</span>
<span id="cb12-44">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_eps_order_max"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(DZ_EPS_ORD), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb12-45">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_eps - r is O(sqrt(eps)) near c = 0; eps ratio 100 per rung"</span>)</span>
<span id="cb12-46">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_grid_order"</span>, DZ_GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb12-47">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order, pre-asymptotic: the free boundary sits inside a cell"</span>)</span>
<span id="cb12-48">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_extrapolated_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ_GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-7</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb12-49">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Richardson limit of the eps -&gt; 0 limits on 100 to 800 cells against eta = 1/m"</span>)</span>
<span id="cb12-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"converged: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DZ_OK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EPS_LADDER)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> solves; eps orders "</span></span>
<span id="cb12-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(DZ_EPS_ORD)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(DZ_EPS_ORD)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (theory 1/2); grid orders of the "</span></span>
<span id="cb12-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eps -&gt; 0 limits </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DZ_GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; their "</span></span>
<span id="cb12-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Richardson limit is within 1e-7 of eta = 1/m "</span></span>
<span id="cb12-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'deadzone_extrapolated_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>n = 1/2, m = 5 (dead zone; exact eta m - 1 = 0): eta m - 1 of the regularised solve
 cells  eps = 1e-06  eps = 1e-08  eps = 1e-10  eps = 1e-12  eps = 1e-14  eps = 1e-16     eps -&gt; 0
   100    2.268e-03    2.559e-04    5.240e-05    3.185e-05    2.978e-05    2.957e-05    2.954e-05
   200    2.241e-03    2.330e-04    3.064e-05    1.030e-05    8.259e-06    8.054e-06    8.031e-06
   400    2.234e-03    2.267e-04    2.461e-05    4.347e-06    2.315e-06    2.112e-06    2.089e-06
   800    2.232e-03    2.250e-04    2.303e-05    2.785e-06    7.579e-07    5.549e-07    5.323e-07
converged: 24 of 24 solves; eps orders 0.50 to 0.50 (theory 1/2); grid orders of the eps -&gt; 0 limits 1.86, 1.93; their Richardson limit is within 1e-7 of eta = 1/m (here 2e-08)</code></pre>
</div>
</div>
<div id="41c03878" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:51.802650Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:51.802200Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:53.376089Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:53.375240Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1">PLAIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounds=(0, inf)"</span>: {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounds"</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.inf), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxfev"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>},</span>
<span id="cb14-2">         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"damping='monotone', no bounds"</span>: {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounds"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"damping"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monotone"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxfev"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>}}</span>
<span id="cb14-3"></span>
<span id="cb14-4"></span>
<span id="cb14-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> plain_runs(options, eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, exact_jacobian<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb14-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The dead-zone solve with the plain rate sqrt(max(c, 0)) (Jacobian by NumJac)</span></span>
<span id="cb14-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    on every grid: converged count, smallest of the last 50 steps over tol, the</span></span>
<span id="cb14-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    worst |eta m - 1| distance to the eps -&gt; 0 limit of the same grid, and the</span></span>
<span id="cb14-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    largest over the grids of the smallest concentration."""</span></span>
<span id="cb14-10">    n_ok, step_ratio, gap, c_min <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, np.inf, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.inf</span>
<span id="cb14-11">    tol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> options.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tol"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb14-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DZ_NS:</span>
<span id="cb14-13">        slab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Slab(n)</span>
<span id="cb14-14">        c, sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab.solve(DZ, PHI_DZ, eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>eps, check<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, exact_jacobian<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>exact_jacobian,</span>
<span id="cb14-15">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>options)</span>
<span id="cb14-16">        n_ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(sol.success)</span>
<span id="cb14-17">        steps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [h[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"step_norm"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sol.history[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>:]]</span>
<span id="cb14-18">        step_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(step_ratio, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(steps) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tol)</span>
<span id="cb14-19">        gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(gap, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(slab.eta_of(c, DZ, PHI_DZ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> M_DZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ_LIM[n]))</span>
<span id="cb14-20">        c_min <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(c_min, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()))</span>
<span id="cb14-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> n_ok, step_ratio, gap, c_min</span>
<span id="cb14-22"></span>
<span id="cb14-23"></span>
<span id="cb14-24">PLAIN_RES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: plain_runs(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PLAIN.items()}</span>
<span id="cb14-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"plain rate sqrt(max(c, 0)), newton tol=1e-12, stagnation=True, on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grids:"</span>)</span>
<span id="cb14-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (k, (n_ok, ratio, gap, _)), name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(PLAIN_RES.items(),</span>
<span id="cb14-27">                                         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_bounds_converged"</span>,</span>
<span id="cb14-28">                                          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_monotone_converged"</span>)):</span>
<span id="cb14-29">    claims.exact(name, n_ok, margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ratio, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>,</span>
<span id="cb14-30">                 note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin: smallest of the last 50 Newton steps over tol"</span>)</span>
<span id="cb14-31">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;32}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> converged on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_ok<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the last 50 steps stay at least "</span></span>
<span id="cb14-32">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"10 tol (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ratio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-33">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_eta_gap"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(r[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PLAIN_RES.values()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>,</span>
<span id="cb14-34">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta of the unconverged plain iterates against the eps -&gt; 0 "</span></span>
<span id="cb14-35">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"limit; where an unconverged iterate stops depends on the step history, "</span></span>
<span id="cb14-36">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measured 6e-8 to 5.4e-6 over the grids and both options"</span>)</span>
<span id="cb14-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"their eta m - 1 lies within 1e-5 of the regularised eps -&gt; 0 limit of the same grid "</span></span>
<span id="cb14-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'deadzone_plain_eta_gap'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb14-39">DEFAULT_TOL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.49012e-08</span>                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># newton's default tol</span></span>
<span id="cb14-40">PLAIN_DEFAULT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"damping='monotone', no bounds"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tol"</span>: DEFAULT_TOL}</span>
<span id="cb14-41">_nd, _rd, _gd, _cd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plain_runs(PLAIN_DEFAULT)</span>
<span id="cb14-42">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_default_tol_converged"</span>, _nd, margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log10(_rd)),</span>
<span id="cb14-43">             min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"margin: |log10| of the smallest late step over tol"</span>)</span>
<span id="cb14-44">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_default_tol_max_min_c"</span>, _cd, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb14-45">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"largest over the grids of min c: every reported solution goes negative"</span>)</span>
<span id="cb14-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the same monotone solve at newton's default tol = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFAULT_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: reports success on "</span></span>
<span id="cb14-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grids, by a thin margin (here the smallest late step is "</span></span>
<span id="cb14-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_rd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tol), on profiles that go negative in the dead zone (min c below -1e-9 on "</span></span>
<span id="cb14-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"every grid, here at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_cd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>plain rate sqrt(max(c, 0)), newton tol=1e-12, stagnation=True, on 4 grids:
  bounds=(0, inf)                  converged on 0 of 4; the last 50 steps stay at least 10 tol (here 22929)
  damping='monotone', no bounds    converged on 0 of 4; the last 50 steps stay at least 10 tol (here 134)
their eta m - 1 lies within 1e-5 of the regularised eps -&gt; 0 limit of the same grid (here 5e-06)
the same monotone solve at newton's default tol = 1.49012e-08: reports success on 4 of 4 grids, by a thin margin (here the smallest late step is 0.53 tol), on profiles that go negative in the dead zone (min c below -1e-9 on every grid, here at most -3.6e-08)</code></pre>
</div>
</div>
<div id="12ec62ad" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:53.378536Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:53.378345Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:53.385714Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:53.384885Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1">_n_bounds <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_bounds_converged"</span>]</span>
<span id="cb16-2">_n_monotone <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_monotone_converged"</span>]</span>
<span id="cb16-3">display(Markdown(</span>
<span id="cb16-4">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"With the regularisation, every one of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'deadzone_regularised_converged'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb16-5">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"solves converges (newton reports success), the error in $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">varepsilon$ falls as "</span></span>
<span id="cb16-6">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sqrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">varepsilon</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ on every grid (orders </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(DZ_EPS_ORD)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to "</span></span>
<span id="cb16-7">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(DZ_EPS_ORD)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), and the $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">varepsilon </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to 0$ limits converge in the grid at "</span></span>
<span id="cb16-8">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DZ_GRID[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to within 1e-7 of the exact $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta = 1/m$ "</span></span>
<span id="cb16-9">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'deadzone_extrapolated_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). At </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells and $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">varepsilon = 10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-12</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ the "</span></span>
<span id="cb16-10">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"deviation is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_deadzone_rel_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, about half grid error "</span></span>
<span id="cb16-11">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ_LIM[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">varepsilon </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to 0$) and half regularisation.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb16-12">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Without the regularisation, the same newton call does not converge on any of the "</span></span>
<span id="cb16-13">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grids: with `bounds=(0, inf)` it ends on the bound (converged "</span></span>
<span id="cb16-14">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_n_bounds<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), and without bounds, with `damping='monotone'`, it "</span></span>
<span id="cb16-15">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"runs out of iterations (converged </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_n_monotone<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); in both, the "</span></span>
<span id="cb16-16">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"steps stay above "</span></span>
<span id="cb16-17">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ten times the tolerance (`tol=1e-12`, `stagnation=True`). The unconverged iterates "</span></span>
<span id="cb16-18">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"are not far off: their $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta$ lies within 1e-5 of the regularised limit. At newton's "</span></span>
<span id="cb16-19">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"default `tol` (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFAULT_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) the monotone solve reports success on "</span></span>
<span id="cb16-20">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'deadzone_plain_default_tol_converged'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(DZ_NS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> grids, but the "</span></span>
<span id="cb16-21">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reported profiles go negative in the dead zone, where the discrete solution is not, "</span></span>
<span id="cb16-22">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and the smallest late step passes the test by a thin margin. No number on this page "</span></span>
<span id="cb16-23">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rests on the unregularised solve."</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>With the regularisation, every one of the 24 solves converges (newton reports success), the error in <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> falls as <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B%5Cvarepsilon%7D"> on every grid (orders 0.50 to 0.50), and the <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20%5Cto%200"> limits converge in the grid at order 1.93 to within 1e-7 of the exact <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%201/m"> (here 2e-08). At 400 cells and <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20=%2010%5E%7B-12%7D"> the deviation is 4.3e-06, about half grid error (2.1e-06 at <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon%20%5Cto%200">) and half regularisation.</p>
<p>Without the regularisation, the same newton call does not converge on any of the 4 grids: with <code>bounds=(0, inf)</code> it ends on the bound (converged 0 of 4), and without bounds, with <code>damping='monotone'</code>, it runs out of iterations (converged 0 of 4); in both, the steps stay above ten times the tolerance (<code>tol=1e-12</code>, <code>stagnation=True</code>). The unconverged iterates are not far off: their <img src="https://latex.codecogs.com/png.latex?%5Ceta"> lies within 1e-5 of the regularised limit. At newton’s default <code>tol</code> (1.49012e-08) the monotone solve reports success on 4 of 4 grids, but the reported profiles go negative in the dead zone, where the discrete solution is not, and the smallest late step passes the test by a thin margin. No number on this page rests on the unregularised solve.</p>
</div>
</div>
</section>
<section id="the-collapse-and-the-width-of-the-band" class="level3">
<h3 class="anchored" data-anchor-id="the-collapse-and-the-width-of-the-band">The collapse, and the width of the band</h3>
<p>Five reaction orders on the generalised modulus. The spread at fixed <img src="https://latex.codecogs.com/png.latex?m"> is reported two ways, because the paper does not say which it means: <img src="https://latex.codecogs.com/png.latex?%5Ceta_%7B%5Cmax%7D/%5Ceta_%7B%5Cmin%7D-1"> (relative to the lowest curve) and <img src="https://latex.codecogs.com/png.latex?(%5Ceta_%7B%5Cmax%7D-%5Ceta_%7B%5Cmin%7D)/%5Ceta_%7B%5Cmax%7D"> (as a fraction of the highest). The extrema are <strong>root-found, not sampled</strong>: the smooth interior maximum by Brent’s method on the exact curves, and the kink candidates (<img src="https://latex.codecogs.com/png.latex?m%20=%201">, where the <img src="https://latex.codecogs.com/png.latex?n=0"> curve breaks, and <img src="https://latex.codecogs.com/png.latex?m%5E*%20=%203">, where <img src="https://latex.codecogs.com/png.latex?n%20=%201/2"> enters its dead zone) evaluated exactly.</p>
<div id="90d711cc" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:53.387878Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:53.387692Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:53.584226Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:53.583210Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread(m, keys, curves<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CURVES):</span>
<span id="cb17-2">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [curves[k].eta(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> keys]</span>
<span id="cb17-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb17-4"></span>
<span id="cb17-5"></span>
<span id="cb17-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread_frac(m, keys, curves<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CURVES):</span>
<span id="cb17-7">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [curves[k].eta(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> keys]</span>
<span id="cb17-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v)</span>
<span id="cb17-9"></span>
<span id="cb17-10"></span>
<span id="cb17-11">M_15, BAND_15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread(m, KEYS_15), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb17-12">BAND_15_FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spread_frac(M_15, KEYS_15)</span>
<span id="cb17-13">KINK_15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, KEYS_15), spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, KEYS_15))</span>
<span id="cb17-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> BAND_15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> KINK_15, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the interior maximum is the global one"</span></span>
<span id="cb17-15">BAND_30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spread(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, KEYS_30)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the kink of eq. (22)</span></span>
<span id="cb17-16">BAND_30_FRAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spread_frac(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, KEYS_30)</span>
<span id="cb17-17">M_30, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread(m, KEYS_30), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb17-18">ETA3_AT_1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>].eta(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-19"></span>
<span id="cb17-20">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_max_relspread"</span>, BAND_15, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-21">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_argmax_m"</span>, M_15, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-22">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_frac_of_upper"</span>, BAND_15_FRAC, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-23">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_at_kink_relspread"</span>, BAND_30, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-24">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_frac_of_upper"</span>, BAND_30_FRAC, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb17-25">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_argmax_m"</span>, M_30, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb17-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_n3_at_m1"</span>, ETA3_AT_1, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb17-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Bischoff: "the spread is only about 15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">or ... one-half- to third-order"'</span>)</span>
<span id="cb17-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  measured: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (max/min - 1) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (fraction of the upper "</span></span>
<span id="cb17-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"curve), at m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span>)</span>
<span id="cb17-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a root-found interior maximum, above both kink candidates (worst kink </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KINK_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb17-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Bischoff: "about 30% when zero-order reactions are included"'</span>)</span>
<span id="cb17-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  measured: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (max/min - 1) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (fraction of the upper "</span></span>
<span id="cb17-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"curve), at the kink of eq. (22),"</span>)</span>
<span id="cb17-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  m = 1 (the smooth search converges to m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); the band there is "</span></span>
<span id="cb17-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1 - eta_n3(1), eta_n3(1) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ETA3_AT_1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-36"></span>
<span id="cb17-37"></span>
<span id="cb17-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second route to the two headline numbers: the closed forms (Route C), extrema</span></span>
<span id="cb17-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># re-root-found</span></span>
<span id="cb17-40"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread_closed(m, with_zero, closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLOSED):</span>
<span id="cb17-41">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eta_c(f):</span>
<span id="cb17-42">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: f(u)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb17-43">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> f(u)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb17-44">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [eta_c(closed[n]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> {<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>: mstar_power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)}.get(n, np.inf) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m</span>
<span id="cb17-45">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15]</span>
<span id="cb17-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> with_zero:</span>
<span id="cb17-47">        vals.append(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m)</span>
<span id="cb17-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(vals) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(vals) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb17-49"></span>
<span id="cb17-50"></span>
<span id="cb17-51"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> second_route(closed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLOSED):</span>
<span id="cb17-52">    m_c, band_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread_closed(m, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, closed), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb17-53">    band30_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> spread_closed(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, closed)</span>
<span id="cb17-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(band_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BAND_15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(band30_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BAND_30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb17-55">            <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> M_15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), band_c, band30_c, m_c)</span>
<span id="cb17-56"></span>
<span id="cb17-57"></span>
<span id="cb17-58">_sr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> second_route()</span>
<span id="cb17-59">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_second_route_gap"</span>, _sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb17-60">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative gap of the two band values between Route B and Route C"</span>)</span>
<span id="cb17-61">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_argmax_second_route_gap"</span>, _sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb17-62">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a flat maximum locates its abscissa only to about the square root "</span></span>
<span id="cb17-63">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of the function's accuracy"</span>)</span>
<span id="cb17-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"second route (closed forms, no shared quadrature): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb17-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"with n = 0: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"relative gap of the band values: below 1e-9 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); of the location "</span></span>
<span id="cb17-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"of the maximum: below 1e-5 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_sr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Bischoff: "the spread is only about 15% for ... one-half- to third-order"
  measured: 14.61% (max/min - 1) = 12.75% (fraction of the upper curve), at m = 1.2702;
  a root-found interior maximum, above both kink candidates (worst kink 0.1342)
Bischoff: "about 30% when zero-order reactions are included"
  measured: 40.55% (max/min - 1) = 28.85% (fraction of the upper curve), at the kink of eq. (22),
  m = 1 (the smooth search converges to m = 1.000000); the band there is 1 - eta_n3(1), eta_n3(1) = 0.711476
second route (closed forms, no shared quadrature): 0.146091 at m = 1.2702; with n = 0: 0.405529
relative gap of the band values: below 1e-9 (here 1e-12); of the location of the maximum: below 1e-5 (here 2e-07)</code></pre>
</div>
</div>
<div id="7014e361" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:53.586755Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:53.586561Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:53.793469Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:53.792648Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what the collapse replaced: the standard modulus M_n = L sqrt(k_v C_o^(n-1)/D),</span></span>
<span id="cb19-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "a form of modulus similar to Equation (17), but with only the term C_o^(n-1)",</span></span>
<span id="cb19-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so m = M_n ((n + 1)/2)^p with p = 1/2</span></span>
<span id="cb19-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread_std(M, keys, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb19-5">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [CURVES[k].eta(M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> p) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> keys]</span>
<span id="cb19-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb19-7"></span>
<span id="cb19-8"></span>
<span id="cb19-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> std_asymptote(keys, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb19-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Large-M spread: every eta -&gt; 1/m, so the ratio of the outer prefactors."""</span></span>
<span id="cb19-11">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [((k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> p <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> keys]</span>
<span id="cb19-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(f) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(f) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb19-13"></span>
<span id="cb19-14"></span>
<span id="cb19-15">M_STD15, BAND_STD15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> M: spread_std(M, KEYS_15), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb19-16">M_STD30, BAND_STD30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> M: spread_std(M, KEYS_30), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb19-17">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_band_nhalf_to_3"</span>, BAND_STD15, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb19-18">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_band_incl_n0"</span>, BAND_STD30, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb19-19">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_asympt_spread_nhalf_to_3"</span>, std_asymptote(KEYS_15), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb19-20">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_asympt_spread_incl_n0"</span>, std_asymptote(KEYS_30), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)</span>
<span id="cb19-21">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_spread_incl_n0_at_M1e3"</span>, spread_std(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, KEYS_30), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb19-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same five curves on the standard modulus M_n:"</span>)</span>
<span id="cb19-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n in [1/2, 3]: largest spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_STD15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_STD15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (on m: "</span></span>
<span id="cb19-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); at large M </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>std_asymptote(KEYS_15)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the ratio sqrt(4/1.5)"</span>)</span>
<span id="cb19-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  with n = 0   : largest spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_STD30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at M = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_STD30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (on m: "</span></span>
<span id="cb19-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); at large M </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>std_asymptote(KEYS_30)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the ratio sqrt(4/1)"</span>)</span>
<span id="cb19-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  computed at M = 1000 with n = 0: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>spread_std(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, KEYS_30)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on m every large-m spread is zero by construction, which is all eq. (13) does; "</span></span>
<span id="cb19-29">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the peak narrows by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_STD15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_STD30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>the same five curves on the standard modulus M_n:
  n in [1/2, 3]: largest spread 68.2% at M = 2.091 (on m: 14.6%); at large M 63.3%, the ratio sqrt(4/1.5)
  with n = 0   : largest spread 120.6% at M = 1.414 (on m: 40.6%); at large M 100.0%, the ratio sqrt(4/1)
  computed at M = 1000 with n = 0: 100.000000%
on m every large-m spread is zero by construction, which is all eq. (13) does; the peak narrows by 4.7x and 3.0x</code></pre>
</div>
</div>
<div id="e39c30d8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:53.795969Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:53.795750Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:54.565415Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:54.564627Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">MM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">120</span>)</span>
<span id="cb21-2">ETA_TAB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {n: np.array([CURVES[n].eta(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MM]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30}</span>
<span id="cb21-3">S15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([ETA_TAB[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.array([ETA_TAB[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb21-4">S30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([ETA_TAB[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.array([ETA_TAB[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb21-5"></span>
<span id="cb21-6">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6</span>))</span>
<span id="cb21-7">ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb21-8">colors <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>}</span>
<span id="cb21-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30:</span>
<span id="cb21-10">    ax.loglog(MM, ETA_TAB[n], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>colors[n], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>,</span>
<span id="cb21-11">              label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (Wheeler form)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb21-12">ax.loglog(MM, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> MM, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta = 1/m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-13">ax.axvline(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.8"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb21-14">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"generalised modulus </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Bischoff eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> 13</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-15">ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"effectiveness factor </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-16">ax.set_ylim(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>)</span>
<span id="cb21-17">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 1 recomputed: five orders on one modulus"</span>)</span>
<span id="cb21-18">ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower left"</span>)</span>
<span id="cb21-19">ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb21-20">ax.semilogx(MM, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S30, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"with $n=0$"</span>)</span>
<span id="cb21-21">ax.semilogx(MM, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S15, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">n </span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">in </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[1/2, 3]</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-22">ax.axhline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>)</span>
<span id="cb21-23">ax.axhline(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>)</span>
<span id="cb21-24">ax.annotate(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'"about 15%"'</span>, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.115</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15.7</span>), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>)</span>
<span id="cb21-25">ax.annotate(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'"about 30%"'</span>, (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.115</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.7</span>), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>)</span>
<span id="cb21-26">ax.plot([M_15], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BAND_15], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb21-27">ax.plot([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BAND_30], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb21-28">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-29">ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"spread in </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> at fixed </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">,  </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_{max}/</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_{min}-1</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[%]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-30">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Width of the band, and the printed claims"</span>)</span>
<span id="cb21-31">ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb21-32">fig.tight_layout()</span>
<span id="cb21-33">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B1.3-bischoff-generalised-modulus/index_files/figure-html/cell-14-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="53f945d7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:54.567943Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:54.567755Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:54.572431Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:54.571727Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1">display(Markdown(</span>
<span id="cb22-2">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Both printed claims hold, each under one of the two natural readings, and the "</span></span>
<span id="cb22-3">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"page pins which: **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$** for orders one-half to three "</span></span>
<span id="cb22-4">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"as $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">min</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-1$ (his </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">about 15%</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the same band is "</span></span>
<span id="cb22-5">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as a fraction of the upper curve), and with zero order included "</span></span>
<span id="cb22-6">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the maximum sits at the kink of eq. (22), $m = 1$ **exactly**, where the band is "</span></span>
<span id="cb22-7">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$1-</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">n=3</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(1)$: **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** relative to the lowest curve but "</span></span>
<span id="cb22-8">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** of the upper one, so his </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">about 30%</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is the "</span></span>
<span id="cb22-9">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fraction-of-upper reading. The claims are numbers read off log-log figures; "</span></span>
<span id="cb22-10">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"both round to the printed values under the reading just stated.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb22-11">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The contrast that justifies the construction: on the **standard** modulus the "</span></span>
<span id="cb22-12">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"same five curves never collapse. With zero order included the spread tends to "</span></span>
<span id="cb22-13">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>std_asymptote(KEYS_30)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at large $M$ (the ratio of the asymptotes, "</span></span>
<span id="cb22-14">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sqrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(3+1)/(0+1)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 2$) and peaks at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_STD30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; for orders one-half "</span></span>
<span id="cb22-15">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"to three it tends to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>std_asymptote(KEYS_15)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and peaks at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_STD15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. "</span></span>
<span id="cb22-16">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"On $m$ the peaks are </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and both spreads vanish "</span></span>
<span id="cb22-17">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at large $m$."</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Both printed claims hold, each under one of the two natural readings, and the page pins which: <strong>14.61% at <img src="https://latex.codecogs.com/png.latex?m%20=%201.270"></strong> for orders one-half to three as <img src="https://latex.codecogs.com/png.latex?%5Ceta_%7B%5Cmax%7D/%5Ceta_%7B%5Cmin%7D-1"> (his “about 15%”; the same band is 12.75% as a fraction of the upper curve), and with zero order included the maximum sits at the kink of eq. (22), <img src="https://latex.codecogs.com/png.latex?m%20=%201"> <strong>exactly</strong>, where the band is <img src="https://latex.codecogs.com/png.latex?1-%5Ceta_%7Bn=3%7D(1)">: <strong>40.55%</strong> relative to the lowest curve but <strong>28.85%</strong> of the upper one, so his “about 30%” is the fraction-of-upper reading. The claims are numbers read off log-log figures; both round to the printed values under the reading just stated.</p>
<p>The contrast that justifies the construction: on the <strong>standard</strong> modulus the same five curves never collapse. With zero order included the spread tends to 100% at large <img src="https://latex.codecogs.com/png.latex?M"> (the ratio of the asymptotes, <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B(3+1)/(0+1)%7D%20=%202">) and peaks at 120.6%; for orders one-half to three it tends to 63.3% and peaks at 68.2%. On <img src="https://latex.codecogs.com/png.latex?m"> the peaks are 40.6% and 14.6%, and both spreads vanish at large <img src="https://latex.codecogs.com/png.latex?m">.</p>
</div>
</div>
</section>
<section id="adsorption-kinetics-figures-2-and-3-computed-instead-of-redrawn" class="level3">
<h3 class="anchored" data-anchor-id="adsorption-kinetics-figures-2-and-3-computed-instead-of-redrawn">Adsorption kinetics: Figures 2 and 3, computed instead of redrawn</h3>
<p>For the LHHW form the paper reused Chu &amp; Hougen’s curves (“this paper will directly use their curves”). Computing them removes both the redrawing and the original numerical integration: each curve is Route B with the closed-form rate integral. Bischoff’s Figures 2a-c span <img src="https://latex.codecogs.com/png.latex?%5Czeta"> = 0.001 to 100 at <img src="https://latex.codecogs.com/png.latex?C_o"> = 0.1, 0.5, 1.0, in reduced form <img src="https://latex.codecogs.com/png.latex?%5Czeta%5E*%20=%20%5Czeta/C_o"> from <img src="https://latex.codecogs.com/png.latex?10%5E%7B-3%7D"> to <img src="https://latex.codecogs.com/png.latex?10%5E3">, from nearly zero-order to nearly first-order behaviour. The claim to measure: after replotting against <img src="https://latex.codecogs.com/png.latex?m">, “the spread is again about the same as for the simple order reactions.”</p>
<div id="855aa13b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:54.574361Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:54.574185Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:26:58.946017Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:26:58.944847Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1">LCURVES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {z: Curve(LHHW(z)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZSTARS}</span>
<span id="cb23-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ZSTARS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> distinct zeta* from Bischoff's 18 (zeta, C_o) figure labels: "</span></span>
<span id="cb23-3">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZSTARS))</span>
<span id="cb23-4"></span>
<span id="cb23-5"></span>
<span id="cb23-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> m_over_M(z, log_bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb23-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (31) with C_o = 1: m/M = (1/sqrt 2)(1/(z + 1)) [1 - z ln(1 + 1/z)]^(-1/2)."""</span></span>
<span id="cb23-8">    bracket <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log1p(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> z) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> log_bracket <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb23-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(bracket)</span>
<span id="cb23-10"></span>
<span id="cb23-11"></span>
<span id="cb23-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lhhw_on_m(z, m, log_bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb23-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eta of curve z read at the abscissa eq. (31) assigns; with the log bracket</span></span>
<span id="cb23-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    dropped, the abscissa is m sqrt(bracket) and the curve's true m is larger."""</span></span>
<span id="cb23-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> LCURVES[z].eta(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> m_over_M(z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m_over_M(z, log_bracket))</span>
<span id="cb23-16"></span>
<span id="cb23-17"></span>
<span id="cb23-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> spread_lhhw(m, log_bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, zs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb23-19">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [lhhw_on_m(z, m, log_bracket) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (ZSTARS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> zs <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> zs)]</span>
<span id="cb23-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> frac <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb23-21"></span>
<span id="cb23-22"></span>
<span id="cb23-23">M_L, BAND_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(spread_lhhw, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)</span>
<span id="cb23-24">M_LF, BAND_LF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread_lhhw(m, frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)</span>
<span id="cb23-25">_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [m_over_M(z) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZSTARS]</span>
<span id="cb23-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_band_max_relspread"</span>, BAND_L, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb23-27">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_band_argmax_m"</span>, M_L, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb23-28">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_band_frac_of_upper"</span>, BAND_LF, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb23-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_std_modulus_band"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb23-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"smallest modulus a curve of the family reaches on its table: "</span></span>
<span id="cb23-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(c.m_lim <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> LCURVES.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (no dead zones: each rate is first "</span></span>
<span id="cb23-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"order at c = 0)"</span>)</span>
<span id="cb23-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"LHHW family on m: largest spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (max/min - 1) at m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb23-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_LF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as a fraction of the upper curve"</span>)</span>
<span id="cb23-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"simple orders, same readings: n in [1/2, 3] </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb23-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"with n = 0 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on the standard modulus M the family never coincides: at large M each curve is "</span></span>
<span id="cb23-38">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(m/M)/M, a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_r)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> between the outermost"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>13 distinct zeta* from Bischoff's 18 (zeta, C_o) figure labels: 0.001, 0.002, 0.01, 0.02, 0.1, 0.2, 1, 2, 10, 20, 100, 200, 1000
smallest modulus a curve of the family reaches on its table: 1.4 (no dead zones: each rate is first order at c = 0)
LHHW family on m: largest spread 30.16% (max/min - 1) at m = 1.0042, 23.17% as a fraction of the upper curve
simple orders, same readings: n in [1/2, 3] 14.61% and 12.75%; with n = 0 40.55% and 28.85%
on the standard modulus M the family never coincides: at large M each curve is (m/M)/M, a factor 23 between the outermost</code></pre>
</div>
</div>
<div id="b3548745" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:26:58.948798Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:26:58.948590Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:04.523178Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:04.522239Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6</span>))</span>
<span id="cb25-2">MSTD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb25-3">MM_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb25-4">sel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>]</span>
<span id="cb25-5">shades <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.cm.viridis(np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sel)))</span>
<span id="cb25-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z, col <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(sel, shades):</span>
<span id="cb25-7">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].loglog(MSTD, [LCURVES[z].eta(M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> m_over_M(z)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> M <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MSTD],</span>
<span id="cb25-8">                   color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">rf"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\z</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-9">    axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(MM_L, [LCURVES[z].eta(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MM_L], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>)</span>
<span id="cb25-10">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(MM, ETA_TAB[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$n=0$"</span>)</span>
<span id="cb25-11">axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].loglog(MM, ETA_TAB[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$n=1$"</span>)</span>
<span id="cb25-12"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ax, ttl, xl <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 2 recomputed: standard modulus $M$"</span>,</span>
<span id="cb25-13">                     <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">M = L</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt{k_v/D}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>),</span>
<span id="cb25-14">                    (axes[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig. 3 recomputed: generalised modulus $m$"</span>, <span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">m</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)):</span>
<span id="cb25-15">    ax.set_xlabel(xl)</span>
<span id="cb25-16">    ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-17">    ax.set_ylim(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.15</span>)</span>
<span id="cb25-18">    ax.set_title(ttl)</span>
<span id="cb25-19">    ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower left"</span>)</span>
<span id="cb25-20">fig.tight_layout()</span>
<span id="cb25-21">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B1.3-bischoff-generalised-modulus/index_files/figure-html/cell-17-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="a13689ec" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:04.525795Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:04.525608Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:04.530577Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:04.529751Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1">_near0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BAND_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_30) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BAND_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_15)</span>
<span id="cb26-2">_near0_f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BAND_LF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_30_FRAC) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(BAND_LF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_15_FRAC)</span>
<span id="cb26-3">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_nearer_zero_order_band_both_readings"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(_near0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> _near0_f))</span>
<span id="cb26-4">display(Markdown(</span>
<span id="cb26-5">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"In either reading the LHHW band on $m$ lies between the two simple-order bands: "</span></span>
<span id="cb26-6">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">min</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-1$, "</span></span>
<span id="cb26-7">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_LF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as a fraction of the upper "</span></span>
<span id="cb26-8">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"curve, and in both nearer the band that includes zero order. That is expected: "</span></span>
<span id="cb26-9">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">zeta^* </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to 0$ is zero order over most of the pellet and $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">zeta^*</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">infty$ is "</span></span>
<span id="cb26-10">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"first order, so the family fills the $n</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">in[0,1]$ part of Figure 1. </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Again about "</span></span>
<span id="cb26-11">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the same</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> holds against the zero-order-included figure, read the same way as the "</span></span>
<span id="cb26-12">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"family, not against the 15% one. On the standard modulus the family never "</span></span>
<span id="cb26-13">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"coincides: a factor of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_r)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> separates the outermost curves at "</span></span>
<span id="cb26-14">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"large $M$, which is what eq. (31) removes."</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>In either reading the LHHW band on <img src="https://latex.codecogs.com/png.latex?m"> lies between the two simple-order bands: 30.2% against 14.6% and 40.6% as <img src="https://latex.codecogs.com/png.latex?%5Ceta_%7B%5Cmax%7D/%5Ceta_%7B%5Cmin%7D-1">, 23.2% against 12.7% and 28.9% as a fraction of the upper curve, and in both nearer the band that includes zero order. That is expected: <img src="https://latex.codecogs.com/png.latex?%5Czeta%5E*%20%5Cto%200"> is zero order over most of the pellet and <img src="https://latex.codecogs.com/png.latex?%5Czeta%5E*%5Cto%5Cinfty"> is first order, so the family fills the <img src="https://latex.codecogs.com/png.latex?n%5Cin%5B0,1%5D"> part of Figure 1. “Again about the same” holds against the zero-order-included figure, read the same way as the family, not against the 15% one. On the standard modulus the family never coincides: a factor of 23 separates the outermost curves at large <img src="https://latex.codecogs.com/png.latex?M">, which is what eq. (31) removes.</p>
</div>
</div>
</section>
<section id="volume-change-table-1-and-a-cell-that-fails-its-own-equation" class="level3">
<h3 class="anchored" data-anchor-id="volume-change-table-1-and-a-cell-that-fails-its-own-equation">Volume change, Table 1, and a cell that fails its own equation</h3>
<p>The variable-diffusivity case is where the <img src="https://latex.codecogs.com/png.latex?D(%5Calpha)"> inside eq. (13) is <em>live</em> (everywhere else on this page it is a constant that cancels). The paper’s claim: with the correction factor of eq. (33), Thiele’s volume-change curves “again fall within the range of Figure 1.” Table 1 compares eq. (33) with Hawthorn’s empirical eq. (34) and says “the two are essentially equivalent numerically.” Both closed forms are evaluated below beside the printed cells, which are <strong>loaded from the transcription CSV, never retyped</strong>.</p>
<div id="5b31c45f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:04.532714Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:04.532538Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.426693Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.425890Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1">VCURVES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {w: Curve(VolChange(w)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> W_FAM}</span>
<span id="cb27-2"></span>
<span id="cb27-3"></span>
<span id="cb27-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> vc_on_m(w, m, d_in_modulus<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb27-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eta of curve w at the abscissa eq. (13) assigns; without D in the rate</span></span>
<span id="cb27-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    integral the abscissa is m sqrt(int r / int D r) of the true one."""</span></span>
<span id="cb27-7">    scale <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> d_in_modulus <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> VolChange(w).Rint(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb27-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> VCURVES[w].eta(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> scale)</span>
<span id="cb27-9"></span>
<span id="cb27-10"></span>
<span id="cb27-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> vc_dev(m, d_in_modulus<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb27-12">    e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>].eta(m)</span>
<span id="cb27-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vc_on_m(w, m, d_in_modulus) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> W_FAM)</span>
<span id="cb27-14"></span>
<span id="cb27-15"></span>
<span id="cb27-16"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> vc_margin(m, d_in_modulus<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb27-17">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Distance to the [n = 3, n = 0] envelope as a fraction of its local width."""</span></span>
<span id="cb27-18">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>].eta(m), CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>].eta(m)</span>
<span id="cb27-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(vc_on_m(w, m, d_in_modulus) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vc_on_m(w, m, d_in_modulus))</span>
<span id="cb27-20">               <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> W_FAM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo)</span>
<span id="cb27-21"></span>
<span id="cb27-22"></span>
<span id="cb27-23">M_VC, VC_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(vc_dev, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)</span>
<span id="cb27-24">M_SCAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>)</span>
<span id="cb27-25">MARGINS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([vc_margin(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M_SCAN])</span>
<span id="cb27-26">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_dev_from_n1_curve"</span>, VC_DEV, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb27-27">claims.count(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_scan_points_outside_envelope"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>MARGINS, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb27-28">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"41 moduli from 0.2 to 8; margin: the smallest distance to an edge over the band width"</span>)</span>
<span id="cb27-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_margin_at_m8_frac_of_band"</span>, vc_margin(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb27-30">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_margin_at_kink_frac_of_band"</span>, vc_margin(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb27-31"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> vc_margin(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> MARGINS[M_SCAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the kink is the smallest margin on m &lt;= 2"</span></span>
<span id="cb27-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"volume-change family (omega C_o = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(W_FAM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) on m:"</span>)</span>
<span id="cb27-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  largest deviation from the constant-D first-order curve: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VC_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_VC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  inside the Figure-1 envelope [n = 3, n = 0] at all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(M_SCAN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> moduli from 0.2 to 8; the "</span></span>
<span id="cb27-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"distance to the nearer edge, as a fraction of the local band width:"</span>)</span>
<span id="cb27-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>):</span>
<span id="cb27-37">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    m = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>vc_margin(m)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  on m &lt;= 2 at least </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>vc_margin(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the minimum, at the kink m = 1); above, the "</span></span>
<span id="cb27-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"curves approach the upper edge eta = 1/m and the distance shrinks with m "</span></span>
<span id="cb27-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'volchange_margin_at_m8_frac_of_band'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at m = 8)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>volume-change family (omega C_o = [0.4, 1.0, -0.5, -0.25]) on m:
  largest deviation from the constant-D first-order curve: 3.18% at m = 1.101
  inside the Figure-1 envelope [n = 3, n = 0] at all 41 moduli from 0.2 to 8; the distance to the nearer edge, as a fraction of the local band width:
    m =  0.2: 1.76e-01
    m =  0.5: 1.50e-01
    m =  1.0: 9.78e-02
    m =  2.0: 2.29e-01
    m =  4.0: 8.21e-03
    m =  8.0: 3.05e-06
  on m &lt;= 2 at least 9.8% (the minimum, at the kink m = 1); above, the curves approach the upper edge eta = 1/m and the distance shrinks with m (3.1e-06 at m = 8)</code></pre>
</div>
</div>
<div id="c18731fa" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.429859Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.429517Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.441810Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.440905Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1">TAB1_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"omega_co"</span>].to_numpy()</span>
<span id="cb29-2"></span>
<span id="cb29-3"></span>
<span id="cb29-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> table1_devs(root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, exponent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>):</span>
<span id="cb29-5">    d33 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq33_printed"</span>].to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.array([eq33(w, root) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TAB1_W]))</span>
<span id="cb29-6">    d34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (tab1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq34_printed"</span>].to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.array([eq34(w, exponent) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TAB1_W]))</span>
<span id="cb29-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (d33 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.array([eq33(w, root) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TAB1_W]),</span>
<span id="cb29-8">            d34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.array([eq34(w, exponent) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TAB1_W]))</span>
<span id="cb29-9"></span>
<span id="cb29-10"></span>
<span id="cb29-11">D33, D34 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table1_devs()</span>
<span id="cb29-12">TAB1_STR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bischoff-table1.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb29-13"></span>
<span id="cb29-14"></span>
<span id="cb29-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> table1_ulp_ratios(root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, exponent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>):</span>
<span id="cb29-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""|printed - exact| over half a unit of the printed last digit, all eight cells."""</span></span>
<span id="cb29-17">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb29-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq33_printed"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: eq33(w, root)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq34_printed"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: eq34(w, exponent))):</span>
<span id="cb29-19">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w_s, p_s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(TAB1_STR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"omega_co"</span>], TAB1_STR[col]):</span>
<span id="cb29-20">            half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(p_s.partition(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb29-21">            out.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(p_s) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> f(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(w_s))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> half)</span>
<span id="cb29-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array(out)</span>
<span id="cb29-23"></span>
<span id="cb29-24"></span>
<span id="cb29-25">N_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.count(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_cells_outside_rounding"</span>, table1_ulp_ratios(), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>,</span>
<span id="cb29-26">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells whose gap to the equation exceeds half a unit of the printed digit"</span>)</span>
<span id="cb29-27">_ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TAB1_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span></span>
<span id="cb29-28">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_three_cells_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(D33[_ok]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb29-29">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_cell_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(D33[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb29-30">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_cell_abs"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(D33[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> eq33(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb29-31">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq34_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(D34).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb29-32">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_at_wco_minus_0p25"</span>, eq33(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb29-33">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_halfunit_multiple"</span>, claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_cell_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0005</span>,</span>
<span id="cb29-34">             rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb29-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bischoff Table 1, printed against recomputed:"</span>)</span>
<span id="cb29-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'wCo'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq33 printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq33 exact'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq34 printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq34 exact'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-38"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (w, p33, p34), r33, r34 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(tab1[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"omega_co"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq33_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq34_printed"</span>]].to_numpy(),</span>
<span id="cb29-39">                                   D33, D34):</span>
<span id="cb29-40">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}{</span>p33<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.3f}{</span>eq33(w)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.4f}{</span>r33<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+9.4f}{</span>p34<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.3f}{</span>eq34(w)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.4f}{</span>r34<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+9.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb29-41">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   &lt;--"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r33) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.004</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>))</span>
<span id="cb29-42">_abs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_cell_abs"</span>]</span>
<span id="cb29-43">_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab1.loc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq33_printed"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb29-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (33): three cells agree to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'table1_eq33_three_cells_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, inside "</span></span>
<span id="cb29-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"three-digit rounding; the omega C_o = -0.25 cell is off by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_abs<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> absolute"</span>)</span>
<span id="cb29-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'table1_eq33_defect_cell_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative), </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'table1_eq33_defect_halfunit_multiple'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the half-unit "</span></span>
<span id="cb29-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rounding radius of a printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the same </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'table1_eq33_defect_cell_rel'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0005</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _printed)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x with both sides relative)"</span>)</span>
<span id="cb29-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (34) agrees to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'table1_eq34_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in all four cells, this row included "</span></span>
<span id="cb29-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tab1.loc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq34_printed'</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eq34(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span>)</span>
<span id="cb29-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"so the row's omega C_o label is right and the defect is one cell: printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb29-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (33) gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eq33(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Reported, not repaired."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Bischoff Table 1, printed against recomputed:
    wCo  eq33 printed  eq33 exact      dev  eq34 printed  eq34 exact      dev
   0.40         1.120      1.1222  -0.0019         1.130      1.1287  +0.0012
   1.00         1.280      1.2765  +0.0027         1.290      1.2925  -0.0019
  -0.50         0.804      0.8045  -0.0006         0.796      0.7956  +0.0005
  -0.25         0.905      0.9107  -0.0062         0.906      0.9064  -0.0004   &lt;--
eq. (33): three cells agree to 0.0027, inside three-digit rounding; the omega C_o = -0.25 cell is off by 0.0057 absolute
(0.0062 relative), 11x the half-unit rounding radius of a printed 0.905 (the same 11x with both sides relative)
eq. (34) agrees to 0.0019 in all four cells, this row included (0.906 against 0.9064),
so the row's omega C_o label is right and the defect is one cell: printed 0.905, eq. (33) gives 0.9107. Reported, not repaired.</code></pre>
</div>
</div>
<p>The glyphs are crisp at digit scale (<code>0.905</code> is not an OCR question), and the constraint that decides the cell is arithmetic: the other three cells of the same column pin the transcription of eq. (33) to within printed rounding, the neighbouring eq. (34) column pins the row label <img src="https://latex.codecogs.com/png.latex?%5Comega%20C_o%20=%20-0.25">, and eq. (33) itself then gives a different number. A slip in the fourth cell of a 1965 table, visible only because the equation beside it is closed-form.</p>
<p>The physics survives the cell: the volume-change family sits inside the Figure-1 envelope (the paper’s claim) and stays close to the first-order curve. The <img src="https://latex.codecogs.com/png.latex?D(%5Calpha)"> weighting inside eq. (13) is what does it: the break table drops that weighting and the collapse fails.</p>
</section>
<section id="the-n12-reduction-exactly-as-printed-is-a-misprint" class="level3">
<h3 class="anchored" data-anchor-id="the-n12-reduction-exactly-as-printed-is-a-misprint">The <img src="https://latex.codecogs.com/png.latex?n=1/2"> reduction, exactly as printed, is a misprint</h3>
<p>Eq. (27) with its where-block reads</p>
<p><img src="https://latex.codecogs.com/png.latex?m%20=%20%5Ctfrac%7B3%7D%7B2%7D%5Csqrt%7BC_L/C_o%7D%5C;%5Ctfrac%7B1%7D%7B%5Csqrt%5B4%5D%7B3%7D%7D%0A%5CBigl%5B(1+%5Csqrt3)F(%5Cphi,k)%20-%202%5Csqrt3%5C,E(%5Cphi,k)%0A+%202%5Csqrt3%5C,%5Ctfrac%7B%5Csin%5Cphi%5Csqrt%7B1-k%5E2%5Csin%5E2%5Cphi%7D%7D%7B1+%5Ccos%5Cphi%7D%5CBigr%5D,%5Cquad%0A%5Csin%5Cphi%20=%20%5Ctfrac%7B%5Csqrt%7B4%5Csqrt3%5C,(C_o/C_L-1)%7D%7D%7B%5Csqrt3-1+C_o/C_L%7D,%5C;%0Ak=%5Csin%2015%C2%B0,"></p>
<p>the <img src="https://latex.codecogs.com/png.latex?%5Csin%5Cphi"> block being <em>the same one printed under the <img src="https://latex.codecogs.com/png.latex?n=2"> case</em>. But the <img src="https://latex.codecogs.com/png.latex?n=1/2"> integral <img src="https://latex.codecogs.com/png.latex?%5Cint%5Cmathrm%7Bd%7Dt/%5Csqrt%7Bt%5E%7B3/2%7D-1%7D"> reduces through the substitution <img src="https://latex.codecogs.com/png.latex?y=%5Csqrt%20t">, which changes both the prefactor exponent and the argument <img src="https://latex.codecogs.com/png.latex?%5Cphi"> is built on. As printed, the formula contradicts the paper’s own eq. (20), from which it is derived, across the whole curve; amended in exactly those two places (prefactor <img src="https://latex.codecogs.com/png.latex?(C_L/C_o)%5E%7B1/4%7D">, <img src="https://latex.codecogs.com/png.latex?%5Cphi"> built on <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7BC_o/C_L%7D">), it agrees with eq. (20) and with Route B. Both versions share the bracket, so the defect cannot be in this page’s transcription of the <img src="https://latex.codecogs.com/png.latex?F">/<img src="https://latex.codecogs.com/png.latex?E"> combination.</p>
<div id="6271d395" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.443887Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.443703Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.465910Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.465089Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1">U27 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>)</span>
<span id="cb31-2"></span>
<span id="cb31-3"></span>
<span id="cb31-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq27_devs(printed):</span>
<span id="cb31-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_eta_nhalf(u, printed)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m_eq20(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> U27])</span>
<span id="cb31-6"></span>
<span id="cb31-7"></span>
<span id="cb31-8">ASP, AMD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq27_devs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), eq27_devs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb31-9">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_as_printed_worst_rel_m"</span>, ASP.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb31-10">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_as_printed_min_rel_m"</span>, ASP.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb31-11">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_amended_worst_rel_m"</span>, AMD.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb31-12">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (20) is a quadrature at epsrel 1e-11; the closed form is exact"</span>)</span>
<span id="cb31-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'u = C_L/C_o'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq. (20)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'as printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'amended'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-14"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> u, a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(U27, ASP):</span>
<span id="cb31-15">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>u<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.2f}{</span>m_eq20(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, u)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.6f}{</span>m_eta_nhalf(u, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.6f}{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb31-16">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m_eta_nhalf(u)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"as printed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> off its own eq. (20); amended: below 1e-12 "</span></span>
<span id="cb31-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb31-19"></span>
<span id="cb31-20"></span>
<span id="cb31-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> printed_ratio_dev(printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>):</span>
<span id="cb31-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""|m(as printed)/m(eq. 20) - sqrt 2| near the kinetic end u -&gt; 1."""</span></span>
<span id="cb31-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_eta_nhalf(u, printed)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m_eq20(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb31-24"></span>
<span id="cb31-25"></span>
<span id="cb31-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eta_nhalf_closed(m, printed):</span>
<span id="cb31-27">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: m_eta_nhalf(u, printed)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb31-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m_eta_nhalf(u, printed)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb31-29"></span>
<span id="cb31-30"></span>
<span id="cb31-31"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> band_with_nhalf(m, printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb31-32">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [eta_nhalf_closed(m, printed)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [CURVES[n].eta(m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)]</span>
<span id="cb31-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb31-34"></span>
<span id="cb31-35"></span>
<span id="cb31-36">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_printed_ratio_limit_dev"</span>, printed_ratio_dev(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb31-37">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m(as printed)/m(eq. 20) -&gt; sqrt 2 as u -&gt; 1; at u = 1 - 1e-6"</span>)</span>
<span id="cb31-38">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_asprinted_nhalf_would_give"</span>, band_with_nhalf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb31-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m(as printed)/m(eq. 20) toward the kinetic end:"</span>)</span>
<span id="cb31-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> uu <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.99</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>):</span>
<span id="cb31-41">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  u = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>uu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m_eta_nhalf(uu, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m_eq20(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, uu)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  -&gt; sqrt(2) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, within 1e-6 at u = 1 - 1e-6 "</span></span>
<span id="cb31-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq27_printed_ratio_limit_dev'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb31-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"so the as-printed curve gives eta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>eta_nhalf_closed(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at m = 0.05, not "</span></span>
<span id="cb31-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"about 1, and with the other three orders the band there is "</span></span>
<span id="cb31-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'band_asprinted_nhalf_would_give'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb31-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(it tends to sqrt(2) - 1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> as m -&gt; 0), against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at "</span></span>
<span id="cb31-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"its largest for the amended curve."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> u = C_L/C_o    eq. (20)  as printed  rel dev     amended
        0.05    1.937165    2.498971    29.0%    1.937165
        0.10    1.730482    2.291191    32.4%    1.730482
        0.30    1.289512    1.764651    36.8%    1.289512
        0.50    0.993931    1.376510    38.5%    0.993931
        0.70    0.721337    1.007645    39.7%    0.721337
        0.90    0.395836    0.557486    40.8%    0.395836
as printed: 29% to 41% off its own eq. (20); amended: below 1e-12 (here 1e-15)
m(as printed)/m(eq. 20) toward the kinetic end:
  u = 0.99: 1.4136249
  u = 0.999: 1.4141546
  u = 0.999999: 1.4142135
  -&gt; sqrt(2) = 1.4142136, within 1e-6 at u = 1 - 1e-6 (here 6e-08)
so the as-printed curve gives eta = 0.7069 at m = 0.05, not about 1, and with the other three orders the band there is 41.3%
(it tends to sqrt(2) - 1 = 41.4% as m -&gt; 0), against 14.6% at its largest for the amended curve.</code></pre>
</div>
</div>
<p>The paper never prints a number for the <img src="https://latex.codecogs.com/png.latex?n=1/2"> curve (no table touches it; its only appearance is Figure 1), so the misprint is invisible to a reader who does not re-derive the reduction, and anyone <em>implementing eqs. (27)-(28) as printed gets a curve that is 29-41% off in <img src="https://latex.codecogs.com/png.latex?m"></em> over the centre concentrations sampled above. The printed “about 15%” is what shows that Bischoff’s own Figure 1 did not use the printed formula: the as-printed curve tops out at <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%201/%5Csqrt2"> instead of 1, so the half-to-third band it implies is already about 41% at the kinetic end, where the true band closes to zero, irreconcilable with any reading of 15%. The amendment is an inference, labelled as such; the band numbers above use Route B, not eq. (27).</p>
<div id="7086fc85" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.468420Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.468231Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.472701Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.471949Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb33-1">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"29%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_as_printed_min_rel_m"</span>)</span>
<span id="cb33-2">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"41%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_as_printed_worst_rel_m"</span>)</span>
<span id="cb33-3">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"41%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_asprinted_nhalf_would_give"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="21">
<pre><code>True</code></pre>
</div>
</div>
</section>
<section id="eq.-14-as-printed-carries-a-defect-of-the-same-kind" class="level3">
<h3 class="anchored" data-anchor-id="eq.-14-as-printed-carries-a-defect-of-the-same-kind">Eq. (14) as printed carries a defect of the same kind</h3>
<p>Route B integrates eqs. (14)-(15) and reads eq. (14)’s denominator bracket as <img src="https://latex.codecogs.com/png.latex?%5B%5Cint_0%5E%7BC_o%7DD%5C,r%5C,%5Cmathrm%7Bd%7DC%5D%5E%7B+1/2%7D">, because that is what eqs. (8) and (13), of which eq. (14) is the stated combination, force. <strong>As printed, that denominator bracket carries exponent <img src="https://latex.codecogs.com/png.latex?-1/2"></strong> (read at digit scale from the native 300 ppi render; the <em>inner</em> bracket in the numerator correctly prints <img src="https://latex.codecogs.com/png.latex?-1/2">, so the defect is isolated to one exponent). Dividing by <img src="https://latex.codecogs.com/png.latex?%5B%5C,%5Ccdot%5C,%5D%5E%7B-1/2%7D"> multiplies by the rate integral to the <img src="https://latex.codecogs.com/png.latex?+1/2">: as printed the equation is dimensionally inconsistent (<img src="https://latex.codecogs.com/png.latex?m"> would carry the units of <img src="https://latex.codecogs.com/png.latex?D%5C,r%5C,C">) and, in this page’s normalised variables, low by exactly the factor <img src="https://latex.codecogs.com/png.latex?I_0%20=%20%5Cint_0%5E1%5Ctilde%20r%5C,%5Cmathrm%7Bd%7Dc%20=%201/(n+1)"> for order <img src="https://latex.codecogs.com/png.latex?n">. The paper’s own eq. (21) is the witness.</p>
<div id="fe9e6bb4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.474837Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.474711Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.479438Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.478574Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb35-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq14_devs(denominator_exponent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb35-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Relative shortfall of m from eq. (14) with the given exponent, per order."""</span></span>
<span id="cb35-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {n: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mb_eta(Power(n), u, denominator_exponent)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> mb_eta(Power(n), u)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb35-4">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15}</span>
<span id="cb35-5"></span>
<span id="cb35-6"></span>
<span id="cb35-7">EQ14 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq14_devs()</span>
<span id="cb35-8">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq14_as_printed_worst_rel_m"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(EQ14.values()), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb35-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (14) as printed against its parents eqs. (8) + (13), at u = 0.5:"</span>)</span>
<span id="cb35-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EQ14.items():</span>
<span id="cb35-11">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: I0 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Power(n)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Rint(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, as-printed m low by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb35-12">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(= 1 - I0, independent of u)"</span>)</span>
<span id="cb35-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the printed witness: eq. (21) gives m = arccosh(1/u) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m_eta_n1(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at u = 0.5, "</span></span>
<span id="cb35-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (14) as printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mb_eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, half of it."</span>)</span>
<span id="cb35-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Route B implements the +1/2 reading; its agreement with the printed closed forms"</span>)</span>
<span id="cb35-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(first Results cell) is the proof that reading is right for every order."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (14) as printed against its parents eqs. (8) + (13), at u = 0.5:
  n = 0.5: I0 = 0.6667, as-printed m low by 33% (= 1 - I0, independent of u)
  n = 1: I0 = 0.5000, as-printed m low by 50% (= 1 - I0, independent of u)
  n = 2: I0 = 0.3333, as-printed m low by 67% (= 1 - I0, independent of u)
  n = 3: I0 = 0.2500, as-printed m low by 75% (= 1 - I0, independent of u)
the printed witness: eq. (21) gives m = arccosh(1/u) = 1.316958 at u = 0.5, eq. (14) as printed 0.658479, half of it.
Route B implements the +1/2 reading; its agreement with the printed closed forms
(first Results cell) is the proof that reading is right for every order.</code></pre>
</div>
</div>
</section>
<section id="out-of-sample-a-finite-cylinder-and-a-1998-competitor" class="level3">
<h3 class="anchored" data-anchor-id="out-of-sample-a-finite-cylinder-and-a-1998-competitor">Out of sample: a finite cylinder, and a 1998 competitor</h3>
<p>Bischoff’s collapse plus Aris’s length (<img src="https://latex.codecogs.com/png.latex?L%20=%20v_p/s_x">, page <a href="../B1.2-aris-shape-factor/"><code>B1.2</code></a>) yields a zero-cost estimate for <em>any</em> shape and <em>any</em> kinetics: compute <img src="https://latex.codecogs.com/png.latex?m"> with eq. (13), read <img src="https://latex.codecogs.com/png.latex?%5Ceta"> off the Figure-1 band. The audit takes a case neither 1965 source computed: a finite cylinder (<img src="https://latex.codecogs.com/png.latex?Z%20=%20H/2R_p%20=%201">, every face active), first- and second-order kinetics, solved here as a 2-D pymrm problem (<code>Cyl2D</code>: <code>nu=1</code> radial axis times a Cartesian axial axis, the <code>B1.2</code> operators with a Newton solve on the reaction).</p>
<p>The competitor: Pan &amp; Zhu (1998) propose, for <strong>arbitrary kinetics</strong> in exactly this geometry, the polynomial <img src="https://latex.codecogs.com/png.latex?%5Ceta_a%20=%20q_1%5Ceta_%7Bsp%7D%20+%20q_2%5Ceta_%7Bsp%7D%5E2%20+%20q_3%5Ceta_%7Bsp%7D%5E3"> in the basis <img src="https://latex.codecogs.com/png.latex?%5Ceta_%7Bsp%7D%20=%20(%5Ccoth%5Cphi%20-%201/%5Cphi)/%5Cphi">, with the <img src="https://latex.codecogs.com/png.latex?q_i"> fixed by matching their exact <img src="https://latex.codecogs.com/png.latex?%5Cphi%5Cto0"> perturbation (<img src="https://latex.codecogs.com/png.latex?%5Cmu_1">, their eq. 26) and <img src="https://latex.codecogs.com/png.latex?%5Cphi%5Cto%5Cinfty"> asymptote (<img src="https://latex.codecogs.com/png.latex?%5Cmu_2%20Q_2/%5Cphi">, their eq. 29), the large-<img src="https://latex.codecogs.com/png.latex?%5Cphi"> end being <em>Bischoff’s asymptotic solution in a cylinder</em>: their <img src="https://latex.codecogs.com/png.latex?Q_2%20=%20%5B%5C,2%5Cint_%7BC_%7Beq%7D%7D%5E%7B1%7D%20r%5C,%5Cmathrm%7Bd%7DC%5D%5E%7B1/2%7D"> is eq. (11)’s integral. They claim “a maximum deviation of less than 1.5% from analytical solutions or numerical calculation results … for arbitrary kinetics” (abstract), and their printed tests are first order (their Table 6) and one steam-shift case (their Table 7). Both endpoint coefficients are recomputed here from their printed definitions; the matching that yields <img src="https://latex.codecogs.com/png.latex?q_2,%20q_3"> is re-derived and asserted rather than copied, which matters because their printed eq. (36) has a sign error (shown below).</p>
<div id="87677670" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.481686Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.481558Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.616006Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.615009Z&quot;}}" data-execution_count="23">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb37-1">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_mu1_vs_table5_worst_abs"</span>,</span>
<span id="cb37-2">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mu1_series(Z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Z, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>], pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu1_printed"</span>])),</span>
<span id="cb37-3">             rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb37-4">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu1_series_truncation"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mu1_series(Z) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu1_series(Z, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>))</span>
<span id="cb37-5">                                          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>]),</span>
<span id="cb37-6">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling both term counts; Table 5 prints 4 digits"</span>)</span>
<span id="cb37-7">_mu2_row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pan5.loc[pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb37-8">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_mu2_z25_defect_abs"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_mu2_row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu2_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu2_eq30(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>)), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb37-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Pan &amp; Zhu Table 5: mu1 by their eq. (26) series reproduces the row to "</span></span>
<span id="cb37-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pan_mu1_vs_table5_worst_abs'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (worst cell; the series is truncated below "</span></span>
<span id="cb37-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1e-8, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu1_series_truncation'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb37-12">_ok2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [Z <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Z, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>], pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu2_printed"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu2_eq30(Z)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.006</span>]</span>
<span id="cb37-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mu2 against their eq. (30), 2 + 1/Z: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_ok2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(pan5)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells within the "</span></span>
<span id="cb37-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printed rounding; Z = 2.5 prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_mu2_row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu2_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, eq. (30) gives "</span></span>
<span id="cb37-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mu2_eq30(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the Z = 2.0 cell is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pan5.loc[pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Z'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu2_printed'</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb37-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Their Table 6 below uses Z = 1 and 2 only. Reported, not repaired."</span>)</span>
<span id="cb37-17"></span>
<span id="cb37-18">_e3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eta_pz(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, sign405<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb37-19">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_eq36_as_printed_eta_a_phi3"</span>, _e3, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb37-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"their eq. (36) prints q3 = -54 - 405 mu1 Q1 + 9 mu2 Q2 (600 ppi crop); with that sign, "</span></span>
<span id="cb37-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"first order at Z = 1, phi = 3 gives eta_a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_e3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb37-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"where their Table 6 prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pan6.loc[(pan6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Z'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (pan6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'phi'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eta_a_printed'</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. "</span></span>
<span id="cb37-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The matching conditions they state force +405 (asserted in pz_coeffs), and with it"</span>)</span>
<span id="cb37-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"their printed eta_a column returns (next cell): a sign misprint, shown by the paper's own numbers."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Pan &amp; Zhu Table 5: mu1 by their eq. (26) series reproduces the row to 5.1e-05 (worst cell; the series is truncated below 1e-8, here 2e-09)
mu2 against their eq. (30), 2 + 1/Z: 8 of 9 cells within the printed rounding; Z = 2.5 prints 2.50, eq. (30) gives 2.40 (the Z = 2.0 cell is 2.50).
Their Table 6 below uses Z = 1 and 2 only. Reported, not repaired.
their eq. (36) prints q3 = -54 - 405 mu1 Q1 + 9 mu2 Q2 (600 ppi crop); with that sign, first order at Z = 1, phi = 3 gives eta_a = -0.031,
where their Table 6 prints 0.653. The matching conditions they state force +405 (asserted in pz_coeffs), and with it
their printed eta_a column returns (next cell): a sign misprint, shown by the paper's own numbers.</code></pre>
</div>
</div>
<div id="257eb22b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.618331Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.618145Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:07.785336Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:07.784429Z&quot;}}" data-execution_count="24">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb39-1">T6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pan6[pan6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]</span>
<span id="cb39-2"></span>
<span id="cb39-3"></span>
<span id="cb39-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> table6_devs(sign405<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, bessel_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>):</span>
<span id="cb39-5">    mu1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu1_series(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, bessel_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bessel_order)</span>
<span id="cb39-6">    ea <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_pz(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, sign405, mu1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v)</span>
<span id="cb39-7">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(T6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>], T6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_a_printed"</span>])]</span>
<span id="cb39-8">    es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_series_1st(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, bessel_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bessel_order) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v)</span>
<span id="cb39-9">          <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(T6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>], T6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_star_printed"</span>])]</span>
<span id="cb39-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ea), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(es)</span>
<span id="cb39-11"></span>
<span id="cb39-12"></span>
<span id="cb39-13">DEV_EA, DEV_ES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table6_devs()</span>
<span id="cb39-14">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_table6_eta_a_reproduced_worst_abs"</span>, DEV_EA, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb39-15">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_table6_eta_star_reproduced_worst_abs"</span>, DEV_ES, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb39-16">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_series_truncation_worst"</span>,</span>
<span id="cb39-17">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_series_1st(p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eta_series_1st(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb39-18">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)),</span>
<span id="cb39-19">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"doubling both term counts, phi up to 8"</span>)</span>
<span id="cb39-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pan &amp; Zhu Table 6 at Z = 1 (printed values loaded, never retyped):"</span>)</span>
<span id="cb39-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'phi'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eta_a printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq.32 here'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eta* printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eq.37 here'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb39-22"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p, a, s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T6[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_a_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_star_printed"</span>]].to_numpy():</span>
<span id="cb39-23">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.1f}{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:15.3f}{</span>eta_pz(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.4f}{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.3f}{</span>eta_series_1st(p)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb39-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"worst |printed - recomputed|: eta_a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_EA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, eta* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_ES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (three-decimal "</span></span>
<span id="cb39-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rounding is 0.0005); the series is truncated below 1e-6 "</span></span>
<span id="cb39-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'eta_series_truncation_worst'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb39-27"></span>
<span id="cb39-28"></span>
<span id="cb39-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> printed_gaps(z_values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)):</span>
<span id="cb39-30">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pan6[pan6[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>].isin(z_values)].assign(</span>
<span id="cb39-31">        gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: (d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_star_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> d[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_a_printed"</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>())</span>
<span id="cb39-32">    g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> g[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_star_printed"</span>]</span>
<span id="cb39-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> g</span>
<span id="cb39-34"></span>
<span id="cb39-35"></span>
<span id="cb39-36">GAPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed_gaps()</span>
<span id="cb39-37">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_printed_worst_pair_abs"</span>, GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb39-38">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_printed_worst_pair_rel"</span>, GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb39-39">_tied <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GAPS[np.isclose(GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap"</span>], GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())]</span>
<span id="cb39-40">_j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel"</span>].idxmax()</span>
<span id="cb39-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"their claim, deviation &lt; 1.5%: their worst printed absolute gap is a tie at "</span></span>
<span id="cb39-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gap'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> ("</span></span>
<span id="cb39-43">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>phi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>eta_a_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>eta_star_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb39-44">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _tied.itertuples()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">");"</span>)</span>
<span id="cb39-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the worst relative pair over all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(GAPS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[_j, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'phi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb39-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(Z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>loc[_j, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Z'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GAPS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the "</span></span>
<span id="cb39-47">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"advertised bound. The claim holds on their own first-order numbers only as an absolute deviation."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Pan &amp; Zhu Table 6 at Z = 1 (printed values loaded, never retyped):
   phi  eta_a printed  eq.32 here  eta* printed  eq.37 here
   0.5          0.982      0.9817         0.982      0.9817
   0.8          0.955      0.9550         0.955      0.9551
   1.0          0.932      0.9322         0.932      0.9324
   1.5          0.864      0.8641         0.865      0.8645
   2.0          0.790      0.7899         0.791      0.7908
   3.0          0.653      0.6527         0.655      0.6550
   4.0          0.545      0.5453         0.549      0.5486
   6.0          0.404      0.4037         0.408      0.4074
   8.0          0.319      0.3189         0.322      0.3221
worst |printed - recomputed|: eta_a 0.0003, eta* 0.0006 (three-decimal rounding is 0.0005); the series is truncated below 1e-6 (here 3e-07)
their claim, deviation &lt; 1.5%: their worst printed absolute gap is a tie at 0.013 (Z = 2, phi = 4: 0.477 vs 0.490; Z = 2, phi = 6: 0.343 vs 0.356);
the worst relative pair over all 18 is phi = 6 (Z = 2): 3.65%, 2.4 times the advertised bound. The claim holds on their own first-order numbers only as an absolute deviation.</code></pre>
</div>
</div>
<div id="90a0ad75" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:07.788009Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:07.787816Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:25.528707Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:25.527485Z&quot;}}" data-execution_count="25">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb41-1">CYL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cyl2D(N_CYL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb41-2">PHIS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>])</span>
<span id="cb41-3">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_cyl2d_vs_series_worst_rel"</span>,</span>
<span id="cb41-4">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CYL.eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eta_series_1st(p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PHIS))</span>
<span id="cb41-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm 2-D cylinder (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CYL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CYL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) against the exact first-order series over "</span></span>
<span id="cb41-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"phi = 0.5 to 8: worst relative </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_cyl2d_vs_series_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb41-7"></span>
<span id="cb41-8">MU2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mu2_eq30(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># v_p/s_x = R_p/mu2 at Z = 1 (Aris's length, page B1.2)</span></span>
<span id="cb41-9"></span>
<span id="cb41-10"></span>
<span id="cb41-11"><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">@functools.lru_cache</span>(maxsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb41-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eta_cyl_n2(phi):</span>
<span id="cb41-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The exact second-order reference: the 2-D pymrm solve."""</span></span>
<span id="cb41-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> CYL.eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), phi)</span>
<span id="cb41-15"></span>
<span id="cb41-16"></span>
<span id="cb41-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> estimate(kind, phi, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>):</span>
<span id="cb41-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The three shortcut estimates of eta on the cylinder."""</span></span>
<span id="cb41-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pz"</span>:        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Pan &amp; Zhu eq. (32); n = 2: Q1 = 2, Q2 = sqrt(2/3)</span></span>
<span id="cb41-20">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> eta_pz(phi, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb41-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab"</span>:      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Figure 1 used literally: the slab curve at m(v_p/s_x)</span></span>
<span id="cb41-22">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> CURVES[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(n)].eta(phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> MU2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt((n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb41-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_Rp"</span>:   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same with L = R_p instead of v_p/s_x</span></span>
<span id="cb41-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> CURVES[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(n)].eta(phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt((n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb41-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab"</span>:        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the cylinder's own first-order curve at equal m</span></span>
<span id="cb41-26">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> eta_series_1st(phi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt((n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb41-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> kind <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab_std"</span>:    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same read at the standard modulus</span></span>
<span id="cb41-28">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> eta_series_1st(phi, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb41-29">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(kind)</span>
<span id="cb41-30"></span>
<span id="cb41-31"></span>
<span id="cb41-32"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dev(kind, phi, relative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>):</span>
<span id="cb41-33">    ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eta_cyl_n2(phi) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> eta_series_1st(phi)</span>
<span id="cb41-34">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(estimate(kind, phi, n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ex)</span>
<span id="cb41-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ex <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> relative <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> d</span>
<span id="cb41-36"></span>
<span id="cb41-37"></span>
<span id="cb41-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> max_dev(kind, relative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>):</span>
<span id="cb41-39">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: dev(kind, p, relative, n), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>)</span>
<span id="cb41-40"></span>
<span id="cb41-41"></span>
<span id="cb41-42">PHI_PZ, DEV_PZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pz"</span>)</span>
<span id="cb41-43">PHI_BI, DEV_BI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab"</span>)</span>
<span id="cb41-44">PHI_AB, DEV_AB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab"</span>)</span>
<span id="cb41-45">_, REL_AB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab"</span>, relative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb41-46">PHI_BI1, BI1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab"</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb41-47">PHI_PZ1, PZ1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pz"</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb41-48">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_zhu_n2_out_of_sample_max_abs"</span>, DEV_PZ, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-49">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_zhu_n2_over_claimed_bound"</span>, DEV_PZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-50">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_curve_estimate_cyl_n2_max_abs"</span>, DEV_BI, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-51">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aris_bischoff_combined_cyl_n2_max_abs"</span>, DEV_AB, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-52">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aris_bischoff_combined_cyl_n2_max_rel"</span>, REL_AB, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-53">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_curve_estimate_cyl_1st_max_abs"</span>, BI1, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-54">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_zhu_cyl_1st_max_abs"</span>, PZ1, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)</span>
<span id="cb41-55">_ref_change <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cyl2D(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N_CYL).eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eta_cyl_n2(p))</span>
<span id="cb41-56">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (PHI_PZ, PHI_BI, PHI_AB))</span>
<span id="cb41-57">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cyl2d_n2_reference_grid_change"</span>, _ref_change, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb41-58">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|eta(200 x 200) - eta(100 x 100)| at the three maxima; the deviations "</span></span>
<span id="cb41-59">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"it judges are 0.03 and above"</span>)</span>
<span id="cb41-60">Q_N2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pz_coeffs(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>))</span>
<span id="cb41-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order (r = c^2), Z = 1, against the 2-D pymrm solve; absolute deviations in eta:"</span>)</span>
<span id="cb41-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Pan &amp; Zhu eq. (32) ('arbitrary kinetics, &lt; 1.5%'):  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_PZ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_PZ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb41-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  slab Fig.-1 curve at m(v_p/s_x) (shape ignored):    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_BI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_BI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb41-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  cylinder 1st-order curve at equal m (Aris+Bischoff): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb41-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REL_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative at its own maximum)"</span>)</span>
<span id="cb41-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"first order, against the exact series: the slab reading errs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BI1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at phi = "</span></span>
<span id="cb41-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_BI1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the B1.2 shape band), Pan &amp; Zhu </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PZ1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at phi = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PHI_PZ1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb41-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(their tested case)"</span>)</span>
<span id="cb41-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Pan &amp; Zhu's matched coefficients at Q1 = 2, Q2 = sqrt(2/3): q1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_N2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb41-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"q2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_N2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, q3 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_N2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb41-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the 2-D reference changes by less than 1e-4 on 200 x 200 cells (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_ref_change<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb41-72">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_AB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _ref_change<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times below the smallest deviation it judges)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pymrm 2-D cylinder (100 x 100) against the exact first-order series over phi = 0.5 to 8: worst relative 6.3e-05
second order (r = c^2), Z = 1, against the 2-D pymrm solve; absolute deviations in eta:
  Pan &amp; Zhu eq. (32) ('arbitrary kinetics, &lt; 1.5%'):  0.090 at phi = 3.79
  slab Fig.-1 curve at m(v_p/s_x) (shape ignored):    0.099 at phi = 2.47
  cylinder 1st-order curve at equal m (Aris+Bischoff): 0.030 at phi = 1.78 (4.4% relative at its own maximum)
first order, against the exact series: the slab reading errs 0.108 at phi = 3.33 (the B1.2 shape band), Pan &amp; Zhu 0.0037 at phi = 5.47 (their tested case)
Pan &amp; Zhu's matched coefficients at Q1 = 2, Q2 = sqrt(2/3): q1 = 2.45, q2 = -8.00, q3 = 28.94
the 2-D reference changes by less than 1e-4 on 200 x 200 cells (here 2e-05, 1605 times below the smallest deviation it judges)</code></pre>
</div>
</div>
<div id="409b45d6" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:25.530588Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:25.530445Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:29.406445Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:29.405609Z&quot;}}" data-execution_count="26">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb43-1">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6</span>))</span>
<span id="cb43-2">pp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>)</span>
<span id="cb43-3">ax.semilogx(pp, [eta_cyl_n2(p) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pp], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact (2-D pymrm)"</span>)</span>
<span id="cb43-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kind, col, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pz"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pan &amp; Zhu eq. (32)"</span>),</span>
<span id="cb43-5">                       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab Fig.-1 curve at $m(v_p/s_x)$"</span>),</span>
<span id="cb43-6">                       (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cylinder 1st-order curve at equal $m$ (Aris + Bischoff)"</span>)):</span>
<span id="cb43-7">    ax.semilogx(pp, [estimate(kind, p) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pp], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>col, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lab)</span>
<span id="cb43-8">ax.set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"Thiele modulus </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">phi = R_p</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">qrt{k_v C_o/D}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb43-9">ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">eta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[-]</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb43-10">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Second order, finite cylinder $Z=1$: three shortcut estimates against exact"</span>)</span>
<span id="cb43-11">ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb43-12">fig.tight_layout()</span>
<span id="cb43-13">plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B1.3-bischoff-generalised-modulus/index_files/figure-html/cell-27-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
<div id="836b8c1f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:29.409297Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:29.409102Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:29.414261Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:29.413411Z&quot;}}" data-execution_count="27">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb44-1">display(Markdown(</span>
<span id="cb44-2">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The audit separates along the two error axes. **Pan &amp; Zhu's polynomial handles "</span></span>
<span id="cb44-3">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the shape and fails on the kinetics**: advertised for arbitrary kinetics with "</span></span>
<span id="cb44-4">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">maximum deviation of less than 1.5%</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\"</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, it does well where they tested it (first "</span></span>
<span id="cb44-5">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"order: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PZ1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> worst here, as in their Table 6), but for a second-order reaction "</span></span>
<span id="cb44-6">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"its midrange deviation reaches </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_PZ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> absolute in $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta$, "</span></span>
<span id="cb44-7">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_PZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times their claimed bound even read as an absolute deviation, "</span></span>
<span id="cb44-8">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"because the cubic in $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sp</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ is controlled only at its two ends, and "</span></span>
<span id="cb44-9">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$Q_1 = 2$ puts large coefficients of opposite sign ($q_2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_N2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, "</span></span>
<span id="cb44-10">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$q_3 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q_N2[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$) between them. **Reading Bischoff's Figure 1 literally fails "</span></span>
<span id="cb44-11">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on the shape**: the slab curve at $m(v_p/s_x)$ errs by up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_BI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for "</span></span>
<span id="cb44-12">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$n = 2$ and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BI1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for first order, which is the shape band `B1.2` measured, "</span></span>
<span id="cb44-13">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"not a kinetics error. **The combination both 1965 papers point to, the shape's own "</span></span>
<span id="cb44-14">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"first-order curve read at Bischoff's generalised modulus, does best**: "</span></span>
<span id="cb44-15">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> absolute, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REL_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative, inside the advertised 15% band, "</span></span>
<span id="cb44-16">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"with no fitted constant. The approximation with the 10 times tighter claim is the "</span></span>
<span id="cb44-17">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"one that breaks; the page states this only for the kinetics tested here "</span></span>
<span id="cb44-18">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"($n = 2$, $Z = 1$).</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb44-19">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Two further printed defects surfaced in the secondary source, both shown from "</span></span>
<span id="cb44-20">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the paper's own numbers above: Table 5's $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_2$ at $Z = 2.5$ (prints "</span></span>
<span id="cb44-21">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_mu2_row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mu2_printed'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; their eq. 30 gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mu2_eq30(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), and eq. (36)'s "</span></span>
<span id="cb44-22">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$-405</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_1Q_1$ (the matching conditions they state force $+405$; the printed sign "</span></span>
<span id="cb44-23">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"makes their own Table 6 column negative). Reported, not repaired: the amended "</span></span>
<span id="cb44-24">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sign is used, labelled as an inference forced by their stated construction."</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>The audit separates along the two error axes. <strong>Pan &amp; Zhu’s polynomial handles the shape and fails on the kinetics</strong>: advertised for arbitrary kinetics with “maximum deviation of less than 1.5%”, it does well where they tested it (first order: 0.0037 worst here, as in their Table 6), but for a second-order reaction its midrange deviation reaches 0.090 absolute in <img src="https://latex.codecogs.com/png.latex?%5Ceta">, 6 times their claimed bound even read as an absolute deviation, because the cubic in <img src="https://latex.codecogs.com/png.latex?%5Ceta_%7Bsp%7D"> is controlled only at its two ends, and <img src="https://latex.codecogs.com/png.latex?Q_1%20=%202"> puts large coefficients of opposite sign (<img src="https://latex.codecogs.com/png.latex?q_2%20=%20-8.00">, <img src="https://latex.codecogs.com/png.latex?q_3%20=%2028.94">) between them. <strong>Reading Bischoff’s Figure 1 literally fails on the shape</strong>: the slab curve at <img src="https://latex.codecogs.com/png.latex?m(v_p/s_x)"> errs by up to 0.099 for <img src="https://latex.codecogs.com/png.latex?n%20=%202"> and 0.108 for first order, which is the shape band <code>B1.2</code> measured, not a kinetics error. <strong>The combination both 1965 papers point to, the shape’s own first-order curve read at Bischoff’s generalised modulus, does best</strong>: 0.030 absolute, 4.4% relative, inside the advertised 15% band, with no fitted constant. The approximation with the 10 times tighter claim is the one that breaks; the page states this only for the kinetics tested here (<img src="https://latex.codecogs.com/png.latex?n%20=%202">, <img src="https://latex.codecogs.com/png.latex?Z%20=%201">).</p>
<p>Two further printed defects surfaced in the secondary source, both shown from the paper’s own numbers above: Table 5’s <img src="https://latex.codecogs.com/png.latex?%5Cmu_2"> at <img src="https://latex.codecogs.com/png.latex?Z%20=%202.5"> (prints 2.50; their eq. 30 gives 2.40), and eq. (36)’s <img src="https://latex.codecogs.com/png.latex?-405%5Cmu_1Q_1"> (the matching conditions they state force <img src="https://latex.codecogs.com/png.latex?+405">; the printed sign makes their own Table 6 column negative). Reported, not repaired: the amended sign is used, labelled as an inference forced by their stated construction.</p>
</div>
</div>
</section>
<section id="cross-check-against-b1.1-and-the-exported-curves" class="level3">
<h3 class="anchored" data-anchor-id="cross-check-against-b1.1-and-the-exported-curves">Cross-check against <code>B1.1</code>, and the exported curves</h3>
<p><code>B1.1</code> ships the exact isothermal <img src="https://latex.codecogs.com/png.latex?%5Ceta(%5Cphi)"> for Thiele’s three geometries. For a first-order slab Bischoff’s <img src="https://latex.codecogs.com/png.latex?m"> <em>is</em> Thiele’s <img src="https://latex.codecogs.com/png.latex?%5Cphi"> (eq. 17 at <img src="https://latex.codecogs.com/png.latex?n%20=%201">), so that page’s slab rows must coincide with this page’s <img src="https://latex.codecogs.com/png.latex?n=1"> curve: a check of the loading and the modulus convention (length on the half-width, no factor <img src="https://latex.codecogs.com/png.latex?%5Csqrt%202"> adrift). Both sides are <img src="https://latex.codecogs.com/png.latex?%5Ctanh%5Cphi/%5Cphi">, so the gap can only come from the stored digits; the check below bounds each row’s gap by the rounding of its stored <img src="https://latex.codecogs.com/png.latex?%5Cphi"> and <img src="https://latex.codecogs.com/png.latex?%5Ceta">.</p>
<div id="4b7166ae" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:29.416549Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:29.416242Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:29.450100Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:29.449261Z&quot;}}" data-execution_count="28">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb45-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> b11_check(phi_factor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb45-2">    raw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"isothermal-exact.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B1.1-thiele-weisz-hicks"</span>, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb45-3">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> raw[raw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"geometry"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab"</span>]</span>
<span id="cb45-4">    worst, ratio, used <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb45-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p_s, e_s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(rows[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phi"</span>], rows[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta"</span>]):</span>
<span id="cb45-6">        p, e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(p_s), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(e_s)</span>
<span id="cb45-7">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>:</span>
<span id="cb45-8">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb45-9">        used <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb45-10">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> phi_factor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p</span>
<span id="cb45-11">        ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>].eta(m)</span>
<span id="cb45-12">        slope <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.cosh(m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.tanh(m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> phi_factor   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d eta/d phi</span></span>
<span id="cb45-13">        half <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.partition(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb45-14">        worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(worst, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb45-15">        ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(ratio, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ex) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (slope <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> half(p_s) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> half(e_s)))</span>
<span id="cb45-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> worst, ratio, used</span>
<span id="cb45-17"></span>
<span id="cb45-18"></span>
<span id="cb45-19">B11_DEV, B11_RATIO, B11_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b11_check()</span>
<span id="cb45-20">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b11_slab_reconciliation_worst_rel"</span>, B11_DEV)</span>
<span id="cb45-21">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b11_slab_gap_over_stored_rounding"</span>, B11_RATIO, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb45-22">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|gap| &lt;= |d eta/d phi| half-unit(phi) + half-unit(eta), per row"</span>)</span>
<span id="cb45-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"B1.1 slab table against this page's n = 1 curve at m = phi: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows with "</span></span>
<span id="cb45-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"0.1 &lt;= phi &lt;= 20, worst relative "</span></span>
<span id="cb45-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; every gap is within the rounding of the stored digits "</span></span>
<span id="cb45-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>B11_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of it)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>B1.1 slab table against this page's n = 1 curve at m = phi: 41 rows with 0.1 &lt;= phi &lt;= 20, worst relative 3.4e-06; every gap is within the rounding of the stored digits (here at most 0.98 of it)</code></pre>
</div>
</div>
<div id="f5775a7a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:29.452591Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:29.452279Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:31.663269Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:31.662463Z&quot;}}" data-execution_count="29">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb47-1">M_EXPORT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">61</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb47-2">EXPORT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ([(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"power"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, m, CURVES[n].eta(m)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M_EXPORT]</span>
<span id="cb47-3">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>z<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, m, LCURVES[z].eta(m)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)</span>
<span id="cb47-4">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M_EXPORT]</span>
<span id="cb47-5">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, m, VCURVES[w].eta(m)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> W_FAM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M_EXPORT])</span>
<span id="cb47-6"></span>
<span id="cb47-7"></span>
<span id="cb47-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> closed_eta(n, m):</span>
<span id="cb47-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""eta(m) of order n from Route C."""</span></span>
<span id="cb47-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>:</span>
<span id="cb47-11">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m</span>
<span id="cb47-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>:</span>
<span id="cb47-13">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.tanh(m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m</span>
<span id="cb47-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> mstar_power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb47-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m</span>
<span id="cb47-16">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CLOSED[n]</span>
<span id="cb47-17">    u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: f(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v)))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">30.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb47-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> f(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>u)))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb47-19"></span>
<span id="cb47-20"></span>
<span id="cb47-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> export_dev(curves<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CURVES):</span>
<span id="cb47-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(curves[n].eta(m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> closed_eta(n, m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M_EXPORT)</span>
<span id="cb47-23"></span>
<span id="cb47-24"></span>
<span id="cb47-25">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"export_power_rows_vs_closed_forms"</span>, export_dev(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb47-26">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Route B against Route C on the exported grid, m = 0.1 to 20"</span>)</span>
<span id="cb47-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"exported power-law rows against the closed forms: below 1e-9 "</span></span>
<span id="cb47-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'export_power_rows_vs_closed_forms'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb47-29">EXPORT_FAMILIES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ([LHHW(z) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [VolChange(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> W_FAM])</span>
<span id="cb47-30"></span>
<span id="cb47-31"></span>
<span id="cb47-32"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> nested_eq14(rf, u):</span>
<span id="cb47-33">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""m and eta at u with every rate integral by quadrature (no closed form)."""</span></span>
<span id="cb47-34">    rint <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> a, b: quad(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> c: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rf.d(c)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rf.r(c)), a, b,</span>
<span id="cb47-35">                             epsabs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, epsrel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb47-36">    i0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rint(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb47-37">    i_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quad(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rf.d(u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(rint(u, u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> s))</span>
<span id="cb47-38">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> u), epsabs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, epsrel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, limit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb47-39">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> i_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(i0)</span>
<span id="cb47-40">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m, np.sqrt(rint(u, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> i0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m</span>
<span id="cb47-41"></span>
<span id="cb47-42"></span>
<span id="cb47-43"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> export_integral_dev(stable<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, m_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>):</span>
<span id="cb47-44">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Closed-form rate integrals against nested quadrature, at the u where each</span></span>
<span id="cb47-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    LHHW and volume-change family reaches the largest exported modulus it takes</span></span>
<span id="cb47-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    from Route B (above its table's end the curve is 1/m)."""</span></span>
<span id="cb47-47">    dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb47-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> rf <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXPORT_FAMILIES:</span>
<span id="cb47-49">        curve <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> LCURVES[rf.z] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(rf, LHHW) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> VCURVES[rf.w]</span>
<span id="cb47-50">        m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(m_max, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.999</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> curve.m_lim)</span>
<span id="cb47-51">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: mb_eta(rf, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v)))[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m,</span>
<span id="cb47-52">                   np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)</span>
<span id="cb47-53">        u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>v))</span>
<span id="cb47-54">        rb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span>(rf)(rf.z <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(rf, LHHW) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> rf.w, stable<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>stable)</span>
<span id="cb47-55">        (m_c, e_c), (m_q, e_q) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mb_eta(rb, u), nested_eq14(rf, u)</span>
<span id="cb47-56">        dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(dev, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb47-57">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> dev</span>
<span id="cb47-58"></span>
<span id="cb47-59"></span>
<span id="cb47-60">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"export_integrals_vs_nested_quadrature"</span>, export_integral_dev(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>,</span>
<span id="cb47-61">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LHHW and volume-change families at m = 20 or the "</span></span>
<span id="cb47-62">                                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"end of their table, centre concentrations down to 1e-10"</span>)</span>
<span id="cb47-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"LHHW and volume-change rows: the closed-form rate integrals against nested quadrature, "</span></span>
<span id="cb47-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at m = 20 (or the end of the table) for all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EXPORT_FAMILIES)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> exported families: below 1e-12 "</span></span>
<span id="cb47-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'export_integrals_vs_nested_quadrature'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb47-66"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Path(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"meta.yaml"</span>).is_file() <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> Path(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>).is_dir():   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only in the page folder</span></span>
<span id="cb47-67">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(Path(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta-generalised-modulus.csv"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"w"</span>, newline<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> fh:</span>
<span id="cb47-68">        csv.writer(fh).writerows([(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate_form"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"param"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta"</span>)]</span>
<span id="cb47-69">                                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(k, p, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, p, m, e <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXPORT])</span>
<span id="cb47-70">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"wrote data/eta-generalised-modulus.csv (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EXPORT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>exported power-law rows against the closed forms: below 1e-9 (here 1e-11)
LHHW and volume-change rows: the closed-form rate integrals against nested quadrature, at m = 20 (or the end of the table) for all 9 exported families: below 1e-12 (here 7e-16)
wrote data/eta-generalised-modulus.csv (854 rows)</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>No measurement exists to validate against: the ceiling for this source is agreement between independent computations, and every check below can fail (the break table makes each one fail).</p>
<div id="5ef55dbf" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:31.665725Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:31.665533Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:31.670218Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:31.669492Z&quot;}}" data-execution_count="30">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb49-1">display(Markdown(</span>
<span id="cb49-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"| # | check | result |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">|---|---|---|</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-3">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 1 | Route B (quadrature of eqs. 14-15) against Route C (printed closed forms, eqs. 21-28 "</span></span>
<span id="cb49-4">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"with the $n=1/2$ amendment), 4 orders x </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(U_GRID)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> centre concentrations | below 1e-10 |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-5">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 2 | both against eq. (20), the paper's own third form | below 1e-10 |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-6">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 3 | pymrm finite volume against Route B, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CASES_A)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cases on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SLAB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells | "</span></span>
<span id="cb49-7">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_slab_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_slab_observed_order'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-8">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 4 | regularised dead zone: $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">varepsilon$ and grid ladders against $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eta = 1/m$ | "</span></span>
<span id="cb49-9">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"within 1e-7 extrapolated |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-10">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 5 | dead-zone onset $m^* = (n+1)/(1-n)$ against Route B extrapolated in $u^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">1/4</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ | "</span></span>
<span id="cb49-11">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-10 |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-12">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 6 | both headline bands on the second route, extrema re-root-found | below 1e-9 |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-13">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 7 | Bischoff Table 1, eight cells against eqs. (33)-(34) | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N_OUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in rounding, "</span></span>
<span id="cb49-14">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_OUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> defect |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-15">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 8 | eq. (14) as printed against its parents eqs. (8)+(13) and printed eq. (21) | "</span></span>
<span id="cb49-16">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$m$ low by the factor $1/(n+1)$ |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-17">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 9 | Pan &amp; Zhu Table 5 ($</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_1$ series, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mu_2$ closed form) and Table 6 (both "</span></span>
<span id="cb49-18">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"columns) | rounding, 2 defects |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-19">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 10 | pymrm 2-D cylinder against the exact first-order series | "</span></span>
<span id="cb49-20">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_cyl2d_vs_series_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb49-21">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"| 11 | `B1.1`'s slab table against this page's $n = 1$ curve | "</span></span>
<span id="cb49-22">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>claims[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'b11_slab_reconciliation_worst_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the stored digits |</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>#</th>
<th>check</th>
<th>result</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>1</td>
<td>Route B (quadrature of eqs. 14-15) against Route C (printed closed forms, eqs. 21-28 with the <img src="https://latex.codecogs.com/png.latex?n=1/2"> amendment), 4 orders x 10 centre concentrations</td>
<td>below 1e-10</td>
</tr>
<tr class="even">
<td>2</td>
<td>both against eq. (20), the paper’s own third form</td>
<td>below 1e-10</td>
</tr>
<tr class="odd">
<td>3</td>
<td>pymrm finite volume against Route B, 24 cases on 400 cells</td>
<td>2.0e-06, order 2.00</td>
</tr>
<tr class="even">
<td>4</td>
<td>regularised dead zone: <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> and grid ladders against <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%201/m"></td>
<td>within 1e-7 extrapolated</td>
</tr>
<tr class="odd">
<td>5</td>
<td>dead-zone onset <img src="https://latex.codecogs.com/png.latex?m%5E*%20=%20(n+1)/(1-n)"> against Route B extrapolated in <img src="https://latex.codecogs.com/png.latex?u%5E%7B1/4%7D"></td>
<td>below 1e-10</td>
</tr>
<tr class="even">
<td>6</td>
<td>both headline bands on the second route, extrema re-root-found</td>
<td>below 1e-9</td>
</tr>
<tr class="odd">
<td>7</td>
<td>Bischoff Table 1, eight cells against eqs. (33)-(34)</td>
<td>7 in rounding, 1 defect</td>
</tr>
<tr class="even">
<td>8</td>
<td>eq. (14) as printed against its parents eqs. (8)+(13) and printed eq. (21)</td>
<td><img src="https://latex.codecogs.com/png.latex?m"> low by the factor <img src="https://latex.codecogs.com/png.latex?1/(n+1)"></td>
</tr>
<tr class="odd">
<td>9</td>
<td>Pan &amp; Zhu Table 5 (<img src="https://latex.codecogs.com/png.latex?%5Cmu_1"> series, <img src="https://latex.codecogs.com/png.latex?%5Cmu_2"> closed form) and Table 6 (both columns)</td>
<td>rounding, 2 defects</td>
</tr>
<tr class="even">
<td>10</td>
<td>pymrm 2-D cylinder against the exact first-order series</td>
<td>6.3e-05</td>
</tr>
<tr class="odd">
<td>11</td>
<td><code>B1.1</code>’s slab table against this page’s <img src="https://latex.codecogs.com/png.latex?n%20=%201"> curve</td>
<td>3.4e-06, the stored digits</td>
</tr>
</tbody>
</table>
</div>
</div>
<section id="the-break-table" class="level3">
<h3 class="anchored" data-anchor-id="the-break-table">The break table</h3>
<p>Each row re-runs the affected computation with one thing deliberately wrong, injected through an argument of the code above, and hands the result to <code>claims.breaks</code>, which records whether that claim’s own check fails.</p>
<div id="26aa9d4b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:31.673021Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:31.672894Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:45.153083Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:45.152021Z&quot;}}" data-execution_count="31">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb50-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Route C and the closed forms</span></span>
<span id="cb50-2">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (23) with k^2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K45SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (sin 45 deg) for sin^2 15 deg"</span></span>
<span id="cb50-3">_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>CLOSED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: m_eta_n2(u, k2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K45SQ)}</span>
<span id="cb50-4">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_vs_closed_forms_worst_rel"</span>, route_bc_dev(_c))</span>
<span id="cb50-5">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_second_route_gap"</span>, second_route(_c)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-6">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_argmax_second_route_gap"</span>, second_route(_c)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-7">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (23) with phi from the printed sin phi (branch='sin', stops at pi/2)"</span></span>
<span id="cb50-8">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"routeB_vs_closed_forms_worst_rel"</span>,</span>
<span id="cb50-9">    route_bc_dev({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>CLOSED, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: m_eta_n2(u, branch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sin"</span>)}))</span>
<span id="cb50-10">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Route B with eq. (14)'s denominator exponent as printed (-1/2)"</span>,</span>
<span id="cb50-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq20_vs_routeB_worst_rel"</span>, eq20_dev(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>))</span>
<span id="cb50-12">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dead-zone onset extrapolated in u^0.5 instead of u^0.25"</span>,</span>
<span id="cb50-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mstar_nhalf_extrapolated_rel_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mstar_extrapolated(power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> mstar_power(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb50-14">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta m at m = 30 on the standard modulus (eta M at M = 30)"</span>,</span>
<span id="cb50-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote_eta_m_dev_at_m30"</span>, asymptote_dev(standard_modulus<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>))</span>
<span id="cb50-16">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (27) as printed (printed=True) in place of the amended form"</span>,</span>
<span id="cb50-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_amended_worst_rel_m"</span>, eq27_devs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-18">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (27) amended (printed=False) in place of the printed form"</span>,</span>
<span id="cb50-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_as_printed_worst_rel_m"</span>, eq27_devs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-20">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (27) amended (printed=False) in place of the printed form"</span>,</span>
<span id="cb50-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_as_printed_min_rel_m"</span>, eq27_devs(<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb50-22">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (27) amended (printed=False) in place of the printed form"</span>,</span>
<span id="cb50-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq27_printed_ratio_limit_dev"</span>, printed_ratio_dev(printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb50-24">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (27) amended (printed=False) in place of the printed form"</span>,</span>
<span id="cb50-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_asprinted_nhalf_would_give"</span>, band_with_nhalf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb50-26">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (14) with the denominator exponent read as -1"</span>,</span>
<span id="cb50-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq14_as_printed_worst_rel_m"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(eq14_devs(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).values()))</span>
<span id="cb50-28"></span>
<span id="cb50-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- pymrm slab</span></span>
<span id="cb50-30">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab assembled with nu = 2 in construct_div (a sphere)"</span></span>
<span id="cb50-31">_e2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab_errors(N_SLAB, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb50-32">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_worst_rel"</span>, _e2.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-33">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_deadzone_rel_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(deadzone_eta(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb50-34">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta read from a two-point surface gradient (read='cell')"</span></span>
<span id="cb50-35">_errs, _worst, _ord <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slab_ladder(read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>)</span>
<span id="cb50-36">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_observed_order"</span>, np.log2(_worst[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _worst[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]))</span>
<span id="cb50-37">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_case_orders_min"</span>, _ord.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb50-38">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_slab_case_orders_max"</span>, _ord.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-39">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_flux_vs_volume_worst"</span>, slab_errors(N_SLAB, flux_read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-40"></span>
<span id="cb50-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- dead zone</span></span>
<span id="cb50-42">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"regularised dead-zone solve with the NumJac Jacobian (exact_jacobian=False)"</span></span>
<span id="cb50-43">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_regularised_converged"</span>,</span>
<span id="cb50-44">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(deadzone_eta(n, eps, exact_jacobian<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> DZ_NS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> eps <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EPS_LADDER))</span>
<span id="cb50-45">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eps rungs a factor 10 apart, read as 100 (rung=10)"</span></span>
<span id="cb50-46">_dzb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> deadzone_study(rung<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb50-47">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_eps_order_min"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_dzb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb50-48">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_eps_order_max"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_dzb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb50-49">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid ladder on eps = 1e-12 without the eps extrapolation (extrapolate=False)"</span></span>
<span id="cb50-50">_dzc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> deadzone_study(extrapolate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb50-51">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_extrapolated_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_dzc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>]))</span>
<span id="cb50-52">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dead-zone eta read from a two-point surface gradient (read='cell')"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_grid_order"</span>,</span>
<span id="cb50-53">    deadzone_study(read<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cell"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-54">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plain dead-zone solve replaced by the regularised one (eps = 1e-12, exact Jacobian)"</span>,</span>
<span id="cb50-55">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_bounds_converged"</span>, plain_runs(PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounds=(0, inf)"</span>], eps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-56">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default-tol monotone solve with bounds=(0, inf)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_default_tol_max_min_c"</span>,</span>
<span id="cb50-57">    plain_runs({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>PLAIN_DEFAULT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounds"</span>: (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, np.inf)})[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb50-58">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"default-tol monotone solve stopped at maxfev = 30"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_default_tol_converged"</span>,</span>
<span id="cb50-59">    plain_runs({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>PLAIN_DEFAULT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxfev"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>})[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-60">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plain dead-zone solve at newton's default tol = 1.49e-8"</span>,</span>
<span id="cb50-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_monotone_converged"</span>,</span>
<span id="cb50-62">    plain_runs({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"damping='monotone', no bounds"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.49012e-08</span>})[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-63">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plain dead-zone solve stopped at maxfev = 3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deadzone_plain_eta_gap"</span>,</span>
<span id="cb50-64">    plain_runs({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>PLAIN[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounds=(0, inf)"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxfev"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>})[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb50-65"></span>
<span id="cb50-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the band, and the standard modulus</span></span>
<span id="cb50-67">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"standard modulus M_n as the abscissa"</span></span>
<span id="cb50-68">_b15 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> M: spread_std(M, KEYS_15), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb50-69">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_max_relspread"</span>, _b15[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-70">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_argmax_m"</span>, _b15[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-71">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_frac_of_upper"</span>,</span>
<span id="cb50-72">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v))([CURVES[k].eta(_b15[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt((k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb50-73">                                            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15]))</span>
<span id="cb50-74">_b30 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> M: spread_std(M, KEYS_30), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)</span>
<span id="cb50-75">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_at_kink_relspread"</span>, spread_std(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, KEYS_30))</span>
<span id="cb50-76">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_frac_of_upper"</span>,</span>
<span id="cb50-77">    (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(v)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(v))([CURVES[k].eta(np.sqrt((k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_30]))</span>
<span id="cb50-78">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_argmax_m"</span>, _b30[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-79">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_n3_at_m1"</span>, CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>].eta(np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))</span>
<span id="cb50-80">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band maximum taken from a 15-point scan (refine=False, ngrid=15)"</span>,</span>
<span id="cb50-81">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_max_relspread"</span>,</span>
<span id="cb50-82">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread(m, KEYS_15), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-83">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"standard modulus as m ((n + 1)/2)^1 instead of ^(1/2) (p=1)"</span></span>
<span id="cb50-84">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_band_nhalf_to_3"</span>,</span>
<span id="cb50-85">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> M: spread_std(M, KEYS_15, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-86">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_band_incl_n0"</span>, maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> M: spread_std(M, KEYS_30, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-87">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_asympt_spread_nhalf_to_3"</span>, std_asymptote(KEYS_15, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb50-88">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_asympt_spread_incl_n0"</span>, std_asymptote(KEYS_30, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb50-89">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"std_modulus_spread_incl_n0_at_M1e3"</span>, spread_std(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, KEYS_30, p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb50-90"></span>
<span id="cb50-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- LHHW and volume change</span></span>
<span id="cb50-92">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (31) without its log bracket (log_bracket=False)"</span></span>
<span id="cb50-93">_lb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread_lhhw(m, log_bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb50-94">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_band_max_relspread"</span>, _lb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-95">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_band_argmax_m"</span>, _lb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-96">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_band_frac_of_upper"</span>,</span>
<span id="cb50-97">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread_lhhw(m, log_bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-98">_rb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [m_over_M(z, log_bracket<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZSTARS]</span>
<span id="cb50-99">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (31) without its log bracket (log_bracket=False)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_std_modulus_band"</span>,</span>
<span id="cb50-100">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_rb) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rb) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb50-101">_zs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">tuple</span>(z <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZSTARS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb50-102">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"LHHW family restricted to zeta* &gt;= 1 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_zs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ZSTARS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> curves), sampled on 20 moduli"</span></span>
<span id="cb50-103">_bs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread_lhhw(m, zs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_zs), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb50-104">_bf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: spread_lhhw(m, frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, zs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_zs), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb50-105">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lhhw_nearer_zero_order_band_both_readings"</span>,</span>
<span id="cb50-106">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_bs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_30) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_bs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_15) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_bf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_30_FRAC) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_bf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BAND_15_FRAC)))</span>
<span id="cb50-107">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D(C) left out of eq. (13)'s rate integral (d_in_modulus=False), sampled on 20 moduli"</span></span>
<span id="cb50-108">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D(C) left out of eq. (13)'s rate integral (d_in_modulus=False)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_dev_from_n1_curve"</span>,</span>
<span id="cb50-109">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> m: vc_dev(m, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-110">_mb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([vc_margin(m, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M_SCAN[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>]])</span>
<span id="cb50-111">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D(C) left out of eq. (13)'s rate integral (d_in_modulus=False)"</span>,</span>
<span id="cb50-112">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_margin_at_m8_frac_of_band"</span>, vc_margin(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb50-113">brk(_lab.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"20 moduli"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_mb)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> moduli"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_scan_points_outside_envelope"</span>,</span>
<span id="cb50-114">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(_mb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)))</span>
<span id="cb50-115">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D(C) left out of eq. (13)'s rate integral (d_in_modulus=False)"</span>,</span>
<span id="cb50-116">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"volchange_margin_at_kink_frac_of_band"</span>, vc_margin(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb50-117"></span>
<span id="cb50-118"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Table 1</span></span>
<span id="cb50-119">_d33, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table1_devs(root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb50-120">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (33) without the square root on its bracket (root=1)"</span></span>
<span id="cb50-121">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_three_cells_worst_rel"</span>, np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_d33[_ok]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-122">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_cell_rel"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_d33[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb50-123">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_cell_abs"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_d33[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> eq33(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb50-124">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_at_wco_minus_0p25"</span>, eq33(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb50-125">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq33_defect_halfunit_multiple"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_d33[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_ok][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> eq33(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0005</span>)</span>
<span id="cb50-126">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (34) with exponent 0.8 for 0.7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_eq34_worst_rel"</span>,</span>
<span id="cb50-127">    np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(table1_devs(exponent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-128"></span>
<span id="cb50-129"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Pan &amp; Zhu</span></span>
<span id="cb50-130">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_m from the zeros of J1 instead of J0 (bessel_order=1)"</span></span>
<span id="cb50-131">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_mu1_vs_table5_worst_abs"</span>,</span>
<span id="cb50-132">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mu1_series(Z, bessel_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Z, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>], pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu1_printed"</span>])))</span>
<span id="cb50-133">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_table6_eta_star_reproduced_worst_abs"</span>, table6_devs(bessel_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-134">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_zhu_cyl_1st_max_abs"</span>,</span>
<span id="cb50-135">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_pz(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, mu1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mu1_series(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, bessel_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb50-136">                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eta_series_1st(p)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-137">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu1 and the exact series on a quarter of the terms (M = 50, N = 100)"</span></span>
<span id="cb50-138">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu1_series_truncation"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(mu1_series(Z, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu1_series(Z, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>))</span>
<span id="cb50-139">                                       <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Z <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pan5[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Z"</span>]))</span>
<span id="cb50-140">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eta_series_truncation_worst"</span>,</span>
<span id="cb50-141">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_series_1st(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eta_series_1st(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb50-142">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>)))</span>
<span id="cb50-143">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (30) evaluated at Z = 2.0 for the Z = 2.5 cell"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_mu2_z25_defect_abs"</span>,</span>
<span id="cb50-144">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_mu2_row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mu2_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu2_eq30(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))</span>
<span id="cb50-145">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (36) with the sign as printed (sign405=-1)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_table6_eta_a_reproduced_worst_abs"</span>,</span>
<span id="cb50-146">    table6_devs(sign405<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-147">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (36) with the sign amended (sign405=+1)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_eq36_as_printed_eta_a_phi3"</span>,</span>
<span id="cb50-148">    eta_pz(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, sign405<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb50-149">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 cell ratios with eq. (33) without the square root on its bracket (root=1)"</span>,</span>
<span id="cb50-150">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table1_cells_outside_rounding"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(table1_ulp_ratios(root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb50-151">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 6 gaps over the Z = 1 rows only (z_values=(1.0,))"</span></span>
<span id="cb50-152">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_printed_worst_pair_abs"</span>, printed_gaps((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,))[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-153">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_printed_worst_pair_rel"</span>, printed_gaps((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,))[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb50-154">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pan &amp; Zhu at second order with the first-order Q1 = Q2 = 1, sampled on 14 moduli"</span></span>
<span id="cb50-155">_pzb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eta_pz(p, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eta_cyl_n2(p)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>,</span>
<span id="cb50-156">                refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb50-157">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_zhu_n2_out_of_sample_max_abs"</span>, _pzb)</span>
<span id="cb50-158">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pan_zhu_n2_over_claimed_bound"</span>, _pzb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>)</span>
<span id="cb50-159"></span>
<span id="cb50-160"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the cylinder</span></span>
<span id="cb50-161">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cylinder assembled with nu = 0 on the radial axis (nu_radial=0)"</span></span>
<span id="cb50-162">_cb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cyl2D(N_CYL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nu_radial<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb50-163">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_cyl2d_vs_series_worst_rel"</span>,</span>
<span id="cb50-164">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_cb.eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eta_series_1st(p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PHIS))</span>
<span id="cb50-165">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2-D reference ladder on 25 x 25 and 50 x 50 cells"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cyl2d_n2_reference_grid_change"</span>,</span>
<span id="cb50-166">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cyl2D(N_CYL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cyl2D(N_CYL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">//</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>).eta(Power(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), p))</span>
<span id="cb50-167">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (PHI_PZ, PHI_BI, PHI_AB)))</span>
<span id="cb50-168">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab curve read with L = R_p instead of v_p/s_x"</span></span>
<span id="cb50-169">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_curve_estimate_cyl_n2_max_abs"</span>,</span>
<span id="cb50-170">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_Rp"</span>, p), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-171">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_curve_estimate_cyl_1st_max_abs"</span>,</span>
<span id="cb50-172">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"slab_Rp"</span>, p, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, edge_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-173">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cylinder's first-order curve read at the standard modulus, sampled on 14 moduli"</span></span>
<span id="cb50-174">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aris_bischoff_combined_cyl_n2_max_abs"</span>,</span>
<span id="cb50-175">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab_std"</span>, p), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-176">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aris_bischoff_combined_cyl_n2_max_rel"</span>,</span>
<span id="cb50-177">    maximise(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: dev(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ab_std"</span>, p, relative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, ngrid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, refine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-178"></span>
<span id="cb50-179"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- B1.1 and the export</span></span>
<span id="cb50-180">_lab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B1.1's phi read on the full thickness (m = 2 phi)"</span></span>
<span id="cb50-181">_bb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b11_check(phi_factor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb50-182">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b11_slab_reconciliation_worst_rel"</span>, _bb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb50-183">brk(_lab, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b11_slab_gap_over_stored_rounding"</span>, _bb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb50-184">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate integrals written in the cancelling form (stable=False)"</span>,</span>
<span id="cb50-185">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"export_integrals_vs_nested_quadrature"</span>, export_integral_dev(stable<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb50-186">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Route B root-found in u instead of logit(u) (root_in='u')"</span>,</span>
<span id="cb50-187">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"export_power_rows_vs_closed_forms"</span>,</span>
<span id="cb50-188">    export_dev({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>{n: Curve(Power(n), root_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"u"</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KEYS_15}, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>: CURVES[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]}))</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="31">
<pre><code>True</code></pre>
</div>
</div>
<div id="34e33ae0" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:45.156370Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:45.156013Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:45.163182Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:45.162319Z&quot;}}" data-execution_count="32">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb52-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'injected defect'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;78}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'claim'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;42}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'clean'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'broken'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  caught"</span>)</span>
<span id="cb52-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, metric, clean, broken, caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK:</span>
<span id="cb52-3">    is_bound <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.metrics[metric][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kind"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span></span>
<span id="cb52-4">    shown <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>clean<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> is_bound <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(clean)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb52-5">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">78</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;78}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>metric[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;42}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>shown<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(broken)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb52-6">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'yes'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> caught <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'NO'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb52-7">_caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, m, _, _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c}</span>
<span id="cb52-8">_structural <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb52-9">_open <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _structural)</span>
<span id="cb52-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAK)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_caught)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims are failed by at "</span></span>
<span id="cb52-11">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"least one row; structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_structural) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb52-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"open: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_open) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb52-13">_uncaught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(n, m) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, m, _, _, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BREAK <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> c]</span>
<span id="cb52-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rows that do not fail their claim: "</span></span>
<span id="cb52-15">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _uncaught) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>injected defect                                                                claim                                            clean      broken  caught
eq. (23) with k^2 = 0.5 (sin 45 deg) for sin^2 15 deg                          routeB_vs_closed_forms_worst_rel           (here 2e-12)      0.1989  yes
eq. (23) with k^2 = 0.5 (sin 45 deg) for sin^2 15 deg                          band_second_route_gap                      (here 1e-12)    0.004081  yes
eq. (23) with k^2 = 0.5 (sin 45 deg) for sin^2 15 deg                          band_argmax_second_route_gap               (here 2e-07)   0.0001691  yes
eq. (23) with phi from the printed sin phi (branch='sin', stops at pi/2)       routeB_vs_closed_forms_worst_rel           (here 2e-12)       6.587  yes
Route B with eq. (14)'s denominator exponent as printed (-1/2)                 eq20_vs_routeB_worst_rel                   (here 3e-13)           3  yes
dead-zone onset extrapolated in u^0.5 instead of u^0.25                        mstar_nhalf_extrapolated_rel_dev           (here 5e-14)    0.001794  yes
eta m at m = 30 on the standard modulus (eta M at M = 30)                      asymptote_eta_m_dev_at_m30                   2.254e-05      0.2929  yes
eq. (27) as printed (printed=True) in place of the amended form                eq27_amended_worst_rel_m                   (here 1e-15)      0.4084  yes
eq. (27) amended (printed=False) in place of the printed form                  eq27_as_printed_worst_rel_m                     0.4084    1.11e-15  yes
eq. (27) amended (printed=False) in place of the printed form                  eq27_as_printed_min_rel_m                         0.29           0  yes
eq. (27) amended (printed=False) in place of the printed form                  eq27_printed_ratio_limit_dev               (here 6e-08)      0.4142  yes
eq. (27) amended (printed=False) in place of the printed form                  band_asprinted_nhalf_would_give                 0.4134    0.000693  yes
eq. (14) with the denominator exponent read as -1                              eq14_as_printed_worst_rel_m                       0.75       0.875  yes
slab assembled with nu = 2 in construct_div (a sphere)                         pymrm_slab_worst_rel                         1.983e-06       1.249  yes
slab assembled with nu = 2 in construct_div (a sphere)                         pymrm_deadzone_rel_dev                       4.347e-06       1.479  yes
eta read from a two-point surface gradient (read='cell')                       pymrm_slab_observed_order                  (here 2e+00)      0.9942  yes
eta read from a two-point surface gradient (read='cell')                       pymrm_slab_case_orders_min                 (here 2e+00)      0.9942  yes
eta read from a two-point surface gradient (read='cell')                       pymrm_slab_case_orders_max                 (here 2e+00)       1.012  yes
eta read from a two-point surface gradient (read='cell')                       eta_flux_vs_volume_worst                   (here 1e-10)   0.0009915  yes
regularised dead-zone solve with the NumJac Jacobian (exact_jacobian=False)    deadzone_regularised_converged                      24           4  yes
eps rungs a factor 10 apart, read as 100 (rung=10)                             deadzone_eps_order_min                     (here 5e-01)      0.2494  yes
eps rungs a factor 10 apart, read as 100 (rung=10)                             deadzone_eps_order_max                     (here 5e-01)      0.2499  yes
grid ladder on eps = 1e-12 without the eps extrapolation (extrapolate=False)   deadzone_extrapolated_dev                  (here 2e-08)   2.229e-06  yes
dead-zone eta read from a two-point surface gradient (read='cell')             deadzone_grid_order                        (here 2e+00)      0.9896  yes
plain dead-zone solve replaced by the regularised one (eps = 1e-12, exact Jaco deadzone_plain_bounds_converged                      0           4  yes
default-tol monotone solve with bounds=(0, inf)                                deadzone_plain_default_tol_max_min_c       (here -4e-08)       1e-28  yes
default-tol monotone solve stopped at maxfev = 30                              deadzone_plain_default_tol_converged                 4           0  yes
plain dead-zone solve at newton's default tol = 1.49e-8                        deadzone_plain_monotone_converged                    0           4  yes
plain dead-zone solve stopped at maxfev = 3                                    deadzone_plain_eta_gap                     (here 5e-06)      0.1309  yes
standard modulus M_n as the abscissa                                           band_nhalf_to_3_max_relspread                   0.1461      0.6815  yes
standard modulus M_n as the abscissa                                           band_nhalf_to_3_argmax_m                          1.27       2.091  yes
standard modulus M_n as the abscissa                                           band_nhalf_to_3_frac_of_upper                   0.1275      0.4053  yes
standard modulus M_n as the abscissa                                           band_incl_n0_at_kink_relspread                  0.4055      0.7139  yes
standard modulus M_n as the abscissa                                           band_incl_n0_frac_of_upper                      0.2885      0.4165  yes
standard modulus M_n as the abscissa                                           band_incl_n0_argmax_m                                1       1.414  yes
standard modulus M_n as the abscissa                                           eta_n3_at_m1                                    0.7115      0.5835  yes
band maximum taken from a 15-point scan (refine=False, ngrid=15)               band_nhalf_to_3_max_relspread                   0.1461      0.1432  yes
standard modulus as m ((n + 1)/2)^1 instead of ^(1/2) (p=1)                    std_modulus_band_nhalf_to_3                     0.6815       1.681  yes
standard modulus as m ((n + 1)/2)^1 instead of ^(1/2) (p=1)                    std_modulus_band_incl_n0                         1.206       3.075  yes
standard modulus as m ((n + 1)/2)^1 instead of ^(1/2) (p=1)                    std_modulus_asympt_spread_nhalf_to_3             0.633       1.667  yes
standard modulus as m ((n + 1)/2)^1 instead of ^(1/2) (p=1)                    std_modulus_asympt_spread_incl_n0                    1           3  yes
standard modulus as m ((n + 1)/2)^1 instead of ^(1/2) (p=1)                    std_modulus_spread_incl_n0_at_M1e3                   1           3  yes
eq. (31) without its log bracket (log_bracket=False)                           lhhw_band_max_relspread                         0.3016       43.58  yes
eq. (31) without its log bracket (log_bracket=False)                           lhhw_band_argmax_m                               1.004       2.007  yes
eq. (31) without its log bracket (log_bracket=False)                           lhhw_band_frac_of_upper                         0.2317      0.9776  yes
eq. (31) without its log bracket (log_bracket=False)                           lhhw_std_modulus_band                            22.33         999  yes
LHHW family restricted to zeta* &gt;= 1 (7 of 13 curves), sampled on 20 moduli    lhhw_nearer_zero_order_band_both_readings            1           0  yes
D(C) left out of eq. (13)'s rate integral (d_in_modulus=False)                 volchange_dev_from_n1_curve                     0.0318      0.2764  yes
D(C) left out of eq. (13)'s rate integral (d_in_modulus=False)                 volchange_margin_at_m8_frac_of_band          3.052e-06      -116.9  yes
D(C) left out of eq. (13)'s rate integral (d_in_modulus=False), sampled on 11  volchange_scan_points_outside_envelope               0           7  yes
D(C) left out of eq. (13)'s rate integral (d_in_modulus=False)                 volchange_margin_at_kink_frac_of_band          0.09778    -0.03307  yes
eq. (33) without the square root on its bracket (root=1)                       table1_eq33_three_cells_worst_rel             0.002744      0.7484  yes
eq. (33) without the square root on its bracket (root=1)                       table1_eq33_defect_cell_rel                   0.006218      0.8071  yes
eq. (33) without the square root on its bracket (root=1)                       table1_eq33_defect_cell_abs                   0.005663       3.786  yes
eq. (33) without the square root on its bracket (root=1)                       table1_eq33_at_wco_minus_0p25                   0.9107       4.691  yes
eq. (33) without the square root on its bracket (root=1)                       table1_eq33_defect_halfunit_multiple             11.33        7573  yes
eq. (34) with exponent 0.8 for 0.7                                             table1_eq34_worst_rel                         0.001915     0.03783  yes
alpha_m from the zeros of J1 instead of J0 (bessel_order=1)                    pan_mu1_vs_table5_worst_abs                  5.117e-05     0.08898  yes
alpha_m from the zeros of J1 instead of J0 (bessel_order=1)                    pan_table6_eta_star_reproduced_worst_abs     0.0005866      0.4139  yes
alpha_m from the zeros of J1 instead of J0 (bessel_order=1)                    pan_zhu_cyl_1st_max_abs                       0.003712      0.1298  yes
mu1 and the exact series on a quarter of the terms (M = 50, N = 100)           mu1_series_truncation                      (here 2e-09)    1.68e-07  yes
mu1 and the exact series on a quarter of the terms (M = 50, N = 100)           eta_series_truncation_worst                (here 3e-07)    2.26e-05  yes
eq. (30) evaluated at Z = 2.0 for the Z = 2.5 cell                             pan_mu2_z25_defect_abs                             0.1           0  yes
eq. (36) with the sign as printed (sign405=-1)                                 pan_table6_eta_a_reproduced_worst_abs        0.0003117       2.147  yes
eq. (36) with the sign amended (sign405=+1)                                    pan_eq36_as_printed_eta_a_phi3                -0.03062      0.6527  yes
Table 1 cell ratios with eq. (33) without the square root on its bracket (root table1_cells_outside_rounding                        1           4  yes
Table 6 gaps over the Z = 1 rows only (z_values=(1.0,))                        pan_printed_worst_pair_abs                       0.013       0.004  yes
Table 6 gaps over the Z = 1 rows only (z_values=(1.0,))                        pan_printed_worst_pair_rel                     0.03652    0.009804  yes
Pan &amp; Zhu at second order with the first-order Q1 = Q2 = 1, sampled on 14 modu pan_zhu_n2_out_of_sample_max_abs               0.08992     0.09651  yes
Pan &amp; Zhu at second order with the first-order Q1 = Q2 = 1, sampled on 14 modu pan_zhu_n2_over_claimed_bound                    5.995       6.434  yes
cylinder assembled with nu = 0 on the radial axis (nu_radial=0)                pymrm_cyl2d_vs_series_worst_rel              6.334e-05      0.2856  yes
2-D reference ladder on 25 x 25 and 50 x 50 cells                              cyl2d_n2_reference_grid_change             (here 2e-05)   0.0004451  yes
slab curve read with L = R_p instead of v_p/s_x                                slab_curve_estimate_cyl_n2_max_abs             0.09889      0.3067  yes
slab curve read with L = R_p instead of v_p/s_x                                slab_curve_estimate_cyl_1st_max_abs             0.1078      0.3259  yes
cylinder's first-order curve read at the standard modulus, sampled on 14 modul aris_bischoff_combined_cyl_n2_max_abs          0.03043     0.09867  yes
cylinder's first-order curve read at the standard modulus, sampled on 14 modul aris_bischoff_combined_cyl_n2_max_rel          0.04384      0.2151  yes
B1.1's phi read on the full thickness (m = 2 phi)                              b11_slab_reconciliation_worst_rel            3.426e-06           1  yes
B1.1's phi read on the full thickness (m = 2 phi)                              b11_slab_gap_over_stored_rounding          (here 1e+00)   1.648e+06  yes
rate integrals written in the cancelling form (stable=False)                   export_integrals_vs_nested_quadrature      (here 7e-16)   5.615e-08  yes
Route B root-found in u instead of logit(u) (root_in='u')                      export_power_rows_vs_closed_forms          (here 1e-11)   2.702e-07  yes

80 rows; 78 of 78 claims are failed by at least one row; structural: none; open: none
rows that do not fail their claim: none</code></pre>
</div>
</div>
<p><strong>A break table measures sensitivity, never correctness.</strong> Which quantities have a second route, and which do not:</p>
<ul>
<li><img src="https://latex.codecogs.com/png.latex?%5Ceta(m)"> of the power laws: Route B (quadrature) and Route C (closed forms), sharing no code; eq. (20) as a third quadrature for <img src="https://latex.codecogs.com/png.latex?m(u)">;</li>
<li>the two headline bands: recomputed on Route C with the extrema found again;</li>
<li>the pymrm slab: Route B, for all eight rate forms, on a grid ladder; the surface-flux <img src="https://latex.codecogs.com/png.latex?%5Ceta"> is <strong>not</strong> a second route (it is the volume average rearranged, and their gap is the solve residual);</li>
<li>the dead zone: the exact <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%201/m">, reached by two extrapolations;</li>
<li>the 2-D cylinder: the exact first-order series for <img src="https://latex.codecogs.com/png.latex?n%20=%201">; for <img src="https://latex.codecogs.com/png.latex?n%20=%202"> only its own grid ladder, which is why its change on a finer grid is bounded against the deviations it judges;</li>
<li>the LHHW and volume-change curves: Route B alone (no closed form exists), checked at three moduli each against pymrm.</li>
</ul>
<p><strong>What this page cannot conclude.</strong> The band numbers are for Bischoff’s stated family (power laws <img src="https://latex.codecogs.com/png.latex?n%20%5Cin%20%5C%7B0,%201/2,%201,%202,%203%5C%7D"> plus the LHHW and volume-change forms) on a slab; a rate form outside it (negative order, inhibition maxima, multiple reactions) can leave the band, and <code>B1.7</code>’s Hudgins/LHHW cells show related criteria failing there. The claim “the calculation behind Figure 1 used the correct <img src="https://latex.codecogs.com/png.latex?n=1/2"> reduction” is an inference from the printed 15% figure, not a reading of the figure itself. The Pan &amp; Zhu out-of-sample failure is established for <img src="https://latex.codecogs.com/png.latex?n%20=%202"> at <img src="https://latex.codecogs.com/png.latex?Z%20=%201"> only; their method may do better for kinetics closer to first order (their steam-shift test evidently did). And nothing here validates the <em>physics</em> against nature: every route is the same isothermal model.</p>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>For the collapse itself: nothing.</strong> The exact curves come from quadrature of Bischoff’s own parametric solution and from his closed forms. pymrm’s slab solves reproduce them and exist to establish that the discretised BVP, the thing a reader will reuse, carries the same physics: eight rate forms including a concentration-dependent diffusivity, solved as one Newton solve on the full residual (<code>NumJac</code> with <code>axes_diagonals=[0]</code>), and the non-smooth dead zone, solved with a regularised rate and its exact Jacobian (<code>construct_coefficient_matrix</code>) and taken to its limit in <img src="https://latex.codecogs.com/png.latex?%5Cvarepsilon"> and in the grid. The unregularised dead zone does not converge at the page’s tolerance (<code>tol=1e-12</code>, <code>stagnation=True</code>), and <code>newton</code> says so (<code>success</code> is false). At newton’s default <code>tol</code> it is different: the monotone solve reports success on a profile that goes negative in the dead zone (dead-zone section), so a reported success there is not a converged solution.</p>
<p><strong>What needed a solver:</strong> the second-order reference of the out-of-sample audit. The exact finite-cylinder solution for <img src="https://latex.codecogs.com/png.latex?n%20=%202">, the case that breaks Pan &amp; Zhu’s 1.5% claim and shows the Aris + Bischoff combination inside its advertised band, is a 2-D nonlinear pymrm solve (<code>nu=1</code> radial times Cartesian axial, <code>NumJac</code>, <img src="https://latex.codecogs.com/png.latex?10%5E4"> unknowns). Bischoff worked with elliptic-integral tables, and Pan &amp; Zhu used finite elements for their one nonlinear test. It is the same operator assembly as <code>B1.2</code>’s finite cylinder with a Newton solve added.</p>
<p><strong>The rest is measurement.</strong> Root-found extrema, a second route to both headlines, and every printed table recomputed beside its transcription, which is how one table cell, the reduction of eq. (27), an exponent in eq. (14), a copied <img src="https://latex.codecogs.com/png.latex?%5Cmu_2"> cell and a sign in eq. (36) surfaced from two papers. Those use scipy (<code>quad</code>, <code>brentq</code>, <code>minimize_scalar</code>, the elliptic integrals), not pymrm; <code>pymrm.checks.observed_orders</code> runs the dead-zone ladders.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>To estimate <img src="https://latex.codecogs.com/png.latex?%5Ceta"> for your kinetics:</strong> normalise the rate so <img src="https://latex.codecogs.com/png.latex?%5Ctilde%20r(1)=1">, compute <img src="https://latex.codecogs.com/png.latex?m"> from eq. (13) (one closed-form or numerical integral), and read the first-order curve <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%20%5Ctanh%20m/m">. For any rate form inside Bischoff’s family your error is bounded by the measured band (printed below) and vanishes in both limits. <code>Curve</code> in <code>model.py</code> gives the exact answer for arbitrary <img src="https://latex.codecogs.com/png.latex?r(C)"> and <img src="https://latex.codecogs.com/png.latex?D(C)"> at the cost of two quadratures; <code>Slab</code> solves the BVP when you need the profile too.</p>
<p><strong>Three traps, all live on this page:</strong></p>
<ul>
<li><strong>The <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B(n+1)/2%7D"> lives inside <img src="https://latex.codecogs.com/png.latex?m">.</strong> Feed eq. (13) the standard modulus and the collapse is lost: the curves never meet at large modulus.</li>
<li><strong>Do not implement eqs. (27)-(28) as printed.</strong> The <img src="https://latex.codecogs.com/png.latex?n=1/2"> elliptic reduction carries a misprint (prefactor and <img src="https://latex.codecogs.com/png.latex?%5Cphi">-argument); as printed it is up to 41% off in <img src="https://latex.codecogs.com/png.latex?m">. Use eq. (20) by quadrature, or <code>m_eta_nhalf</code> in <code>model.py</code>. Eq. (14) as printed carries a flipped denominator exponent too: <img src="https://latex.codecogs.com/png.latex?m"> comes out a factor <img src="https://latex.codecogs.com/png.latex?n+1"> low for order <img src="https://latex.codecogs.com/png.latex?n">.</li>
<li><strong>The <img src="https://latex.codecogs.com/png.latex?%5Csin%5Cphi"> parametrisations cross <img src="https://latex.codecogs.com/png.latex?%5Cphi%20=%20%5Cpi/2"></strong> (at <img src="https://latex.codecogs.com/png.latex?C_o/C_L%20=%201+%5Csqrt3"> for <img src="https://latex.codecogs.com/png.latex?k=%5Csin15%C2%B0">); evaluate <img src="https://latex.codecogs.com/png.latex?%5Cphi"> from the <img src="https://latex.codecogs.com/png.latex?%5Ccos%5Cphi"> form or continue the branch, else the <img src="https://latex.codecogs.com/png.latex?n=2"> curve is wrong for <img src="https://latex.codecogs.com/png.latex?C_L/C_o%20%3C%200.37"> (break table).</li>
</ul>
<p><strong>A dead-zone onset formula the paper does not print:</strong> for <img src="https://latex.codecogs.com/png.latex?r%20=%20k_vC%5En">, <img src="https://latex.codecogs.com/png.latex?n%3C1">, the centre concentration reaches zero at exactly <img src="https://latex.codecogs.com/png.latex?m%5E*%20=%20(n+1)/(1-n)">, derived here from eq. (14), reducing to Wheeler’s <img src="https://latex.codecogs.com/png.latex?m%5E*=1"> at <img src="https://latex.codecogs.com/png.latex?n=0">. Beyond it, <img src="https://latex.codecogs.com/png.latex?%5Ceta%20=%201/m"> exactly. To solve such a case with pymrm, regularise the rate and give newton its exact Jacobian, as <code>Slab</code> does with <code>eps</code>; with the <code>NumJac</code> Jacobian most of the regularised solves stop on the bound (break table).</p>
<p><strong>Pellet shapes:</strong> combine this page’s modulus with <code>B1.2</code>’s length (<img src="https://latex.codecogs.com/png.latex?L%20=%20v_p/s_x">), but read the <strong>shape’s own</strong> first-order curve, not Figure 1’s slab curves; <code>Cyl2D</code> in <code>model.py</code> is the same operator calls with your rate form dropped in.</p>
<p><strong>Secondary source caution:</strong> if you use Pan &amp; Zhu’s eq. (32), re-derive <img src="https://latex.codecogs.com/png.latex?q_2,%20q_3"> from the matching conditions: their printed eq. (36) has the sign of the <img src="https://latex.codecogs.com/png.latex?405%5Cmu_1Q_1"> term wrong.</p>
<p><strong>Related pages.</strong> <a href="../B1.1-thiele-weisz-hicks/"><code>B1.1</code></a> (Thiele’s curve, Weisz-Hicks nonisothermal); <a href="../B1.2-aris-shape-factor/"><code>B1.2</code></a> (the shape collapse this page leans on); <code>B1.4</code> (Weisz-Prater criterion); <code>B1.7</code> (the transport-limit criteria, including LHHW cells); <code>C1.1</code> (LHHW kinetics with real data).</p>
<p><strong>Cite the source, not this page:</strong> Bischoff, K. B., <em>Effectiveness Factors for General Reaction Rate Forms</em>, AIChE Journal <strong>11</strong>(2) 351-355 (1965), doi:10.1002/aic.690110229. The secondary comparison: Pan, T. &amp; Zhu, B., <em>Study on diffusion-reaction process inside a cylindrical catalyst pellet</em>, Chemical Engineering Science <strong>53</strong>(5) 933-946 (1998), doi:10.1016/S0009-2509(97)00385-0.</p>
<div id="6e3d1f52" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:45.165632Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:45.165453Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:45.169929Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:45.169176Z&quot;}}" data-execution_count="33">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb54-1">display(Markdown(</span>
<span id="cb54-2">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The numbers for the estimate above. Band for orders one-half to three: under "</span></span>
<span id="cb54-3">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_15<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the lower curve; with zero order: under </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30_FRAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the "</span></span>
<span id="cb54-4">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"upper curve (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BAND_30<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the lower). On the standard modulus the curves differ "</span></span>
<span id="cb54-5">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>std_asymptote(KEYS_30)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at large modulus with zero order and by "</span></span>
<span id="cb54-6">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>std_asymptote(KEYS_15)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for orders one-half to three. On the second-order "</span></span>
<span id="cb54-7">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"finite cylinder the shape's first-order curve at the generalised modulus is within "</span></span>
<span id="cb54-8">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> absolute (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>REL_AB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1%}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> relative); the slab curve misses by up to "</span></span>
<span id="cb54-9">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_BI<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the shape band `B1.2` measured; Pan &amp; Zhu's eq. (32) by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_PZ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb54-10">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEV_PZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times their claimed bound."</span>))</span>
<span id="cb54-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14.6%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_nhalf_to_3_max_relspread"</span>),</span>
<span id="cb54-12">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"40.6%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_at_kink_relspread"</span>),</span>
<span id="cb54-13">                  (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"28.9%"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"band_incl_n0_frac_of_upper"</span>)):</span>
<span id="cb54-14">    claims.says(lit, name)</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>The numbers for the estimate above. Band for orders one-half to three: under 14.6% of the lower curve; with zero order: under 28.9% of the upper curve (40.6% of the lower). On the standard modulus the curves differ by 100% at large modulus with zero order and by 63.3% for orders one-half to three. On the second-order finite cylinder the shape’s first-order curve at the generalised modulus is within 0.030 absolute (4.4% relative); the slab curve misses by up to 0.099, the shape band <code>B1.2</code> measured; Pan &amp; Zhu’s eq. (32) by 0.090, 6 times their claimed bound.</p>
</div>
</div>
<div id="e7d11037" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-03T19:27:45.171957Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-03T19:27:45.171786Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-03T19:27:45.179814Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-03T19:27:45.179004Z&quot;}}" data-execution_count="34">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb55-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb55-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb55-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for B1.3:
  routeB_vs_closed_forms_worst_rel          = (here 2.2e-12)   bound  bound &lt;= 1e-10 [tolerance]
  eq20_vs_routeB_worst_rel                  = (here 2.7e-13)   bound  bound &lt;= 1e-10 [tolerance]
  mstar_nhalf_extrapolated_rel_dev          = (here 4.6e-14)   bound  bound &lt;= 1e-10 [theory]
  asymptote_eta_m_dev_at_m30                = 2.2539e-05       value  rtol 0.001
  pymrm_slab_worst_rel                      = 1.9834e-06       value  rtol 0.05
  pymrm_slab_observed_order                 = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  pymrm_slab_case_orders_min                = (here 1.7e+00)   bound  bound [1.6, 2.4] [chosen]
  pymrm_slab_case_orders_max                = (here 2.2e+00)   bound  bound [1.6, 2.4] [chosen]
  eta_flux_vs_volume_worst                  = (here 1.2e-10)   bound  bound &lt;= 1e-08 [identity]
  deadzone_regularised_converged            = 24               exact  exact
  pymrm_deadzone_rel_dev                    = 4.3467e-06       value  rtol 0.05
  deadzone_eps_order_min                    = (here 5.0e-01)   bound  bound [0.45, 0.55] [theory]
  deadzone_eps_order_max                    = (here 5.0e-01)   bound  bound [0.45, 0.55] [theory]
  deadzone_grid_order                       = (here 1.9e+00)   bound  bound [1.8, 2.1] [chosen]
  deadzone_extrapolated_dev                 = (here 2.0e-08)   bound  bound &lt;= 1e-07 [chosen]
  deadzone_plain_bounds_converged           = 0                exact  exact, margin 2.29e+04
  deadzone_plain_monotone_converged         = 0                exact  exact, margin 134
  deadzone_plain_eta_gap                    = (here 5.4e-06)   bound  bound &lt;= 1e-05 [chosen]
  deadzone_plain_default_tol_converged      = 4                exact  exact, margin 0.279
  deadzone_plain_default_tol_max_min_c      = (here -3.6e-08)  bound  bound &lt;= -1e-09 [chosen]
  band_nhalf_to_3_max_relspread             = 0.14609          value  rtol 0.0001
  band_nhalf_to_3_argmax_m                  = 1.2702           value  rtol 0.0001
  band_nhalf_to_3_frac_of_upper             = 0.12747          value  rtol 0.0001
  band_incl_n0_at_kink_relspread            = 0.40553          value  rtol 0.0001
  band_incl_n0_frac_of_upper                = 0.28852          value  rtol 0.0001
  band_incl_n0_argmax_m                     = 1                value  rtol 1e-06
  eta_n3_at_m1                              = 0.71148          value  rtol 1e-06
  band_second_route_gap                     = (here 1.0e-12)   bound  bound &lt;= 1e-09 [tolerance]
  band_argmax_second_route_gap              = (here 1.9e-07)   bound  bound &lt;= 1e-05 [tolerance]
  std_modulus_band_nhalf_to_3               = 0.68152          value  rtol 0.0001
  std_modulus_band_incl_n0                  = 1.2055           value  rtol 0.0001
  std_modulus_asympt_spread_nhalf_to_3      = 0.63299          value  rtol 1e-09
  std_modulus_asympt_spread_incl_n0         = 1                value  rtol 1e-09
  std_modulus_spread_incl_n0_at_M1e3        = 1                value  rtol 1e-06
  lhhw_band_max_relspread                   = 0.30158          value  rtol 0.0001
  lhhw_band_argmax_m                        = 1.0042           value  rtol 0.001
  lhhw_band_frac_of_upper                   = 0.2317           value  rtol 0.0001
  lhhw_std_modulus_band                     = 22.33            value  rtol 1e-06
  lhhw_nearer_zero_order_band_both_readings = True             exact  exact
  volchange_dev_from_n1_curve               = 0.031804         value  rtol 0.001
  volchange_scan_points_outside_envelope    = 0                exact  exact, margin 3.05e-06
  volchange_margin_at_m8_frac_of_band       = 3.0516e-06       value  rtol 0.001
  volchange_margin_at_kink_frac_of_band     = 0.097784         value  rtol 0.001
  table1_cells_outside_rounding             = 1                exact  exact, margin 0.0564
  table1_eq33_three_cells_worst_rel         = 0.0027439        value  rtol 0.001
  table1_eq33_defect_cell_rel               = 0.0062184        value  rtol 0.001
  table1_eq33_defect_cell_abs               = 0.0056629        value  rtol 0.001
  table1_eq34_worst_rel                     = 0.001915         value  rtol 0.001
  table1_eq33_at_wco_minus_0p25             = 0.91066          value  rtol 1e-06
  table1_eq33_defect_halfunit_multiple      = 11.326           value  rtol 0.001
  eq27_as_printed_worst_rel_m               = 0.40838          value  rtol 1e-06
  eq27_as_printed_min_rel_m                 = 0.29001          value  rtol 1e-06
  eq27_amended_worst_rel_m                  = (here 1.1e-15)   bound  bound &lt;= 1e-12 [tolerance]
  eq27_printed_ratio_limit_dev              = (here 5.9e-08)   bound  bound &lt;= 1e-06 [theory]
  band_asprinted_nhalf_would_give           = 0.41338          value  rtol 0.0001
  eq14_as_printed_worst_rel_m               = 0.75             value  rtol 1e-06
  pan_mu1_vs_table5_worst_abs               = 5.1169e-05       value  rtol 0.001
  mu1_series_truncation                     = (here 2.3e-09)   bound  bound &lt;= 1e-08 [chosen]
  pan_mu2_z25_defect_abs                    = 0.1              value  rtol 1e-06
  pan_eq36_as_printed_eta_a_phi3            = -0.03062         value  rtol 0.001
  pan_table6_eta_a_reproduced_worst_abs     = 0.00031172       value  rtol 0.001
  pan_table6_eta_star_reproduced_worst_abs  = 0.0005866        value  rtol 0.001
  eta_series_truncation_worst               = (here 3.1e-07)   bound  bound &lt;= 1e-06 [chosen]
  pan_printed_worst_pair_abs                = 0.013            value  rtol 1e-06
  pan_printed_worst_pair_rel                = 0.036517         value  rtol 1e-06
  pymrm_cyl2d_vs_series_worst_rel           = 6.3344e-05       value  rtol 0.05
  pan_zhu_n2_out_of_sample_max_abs          = 0.089919         value  rtol 0.001
  pan_zhu_n2_over_claimed_bound             = 5.9946           value  rtol 0.001
  slab_curve_estimate_cyl_n2_max_abs        = 0.098893         value  rtol 0.001
  aris_bischoff_combined_cyl_n2_max_abs     = 0.030426         value  rtol 0.001
  aris_bischoff_combined_cyl_n2_max_rel     = 0.043837         value  rtol 0.001
  slab_curve_estimate_cyl_1st_max_abs       = 0.1078           value  rtol 0.001
  pan_zhu_cyl_1st_max_abs                   = 0.0037124        value  rtol 0.001
  cyl2d_n2_reference_grid_change            = (here 1.9e-05)   bound  bound &lt;= 0.0001 [chosen]
  b11_slab_reconciliation_worst_rel         = 3.4255e-06       value  rtol 0.05
  b11_slab_gap_over_stored_rounding         = (here 9.8e-01)   bound  bound &lt;= 1 [theory]
  export_power_rows_vs_closed_forms         = (here 1.4e-11)   bound  bound &lt;= 1e-09 [tolerance]
  export_integrals_vs_nested_quadrature     = (here 6.7e-16)   bound  bound &lt;= 1e-12 [tolerance]</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:B</category>
  <category>struct:S3</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/B1.3-bischoff-generalised-modulus/</guid>
  <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Eley-Rideal kinetics: the impact rate law, and the case that the name is wrong</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/C1.2-eley-rideal/</link>
  <description><![CDATA[ 




<section id="eley-rideal-kinetics-the-impact-rate-law-and-the-case-that-the-name-is-wrong" class="level1">
<h1>Eley-Rideal kinetics: the impact rate law, and the case that the name is wrong</h1>
<p><strong>Catalog ID:</strong> <code>C1.2</code> · <strong>Structures:</strong> <code>S1</code> (pointwise rate algebra) · <strong>Tier:</strong> T0</p>
<p>The mechanism in which a gas-phase molecule reacts by direct collision with a chemisorbed one is called the <strong>Eley-Rideal (E-R) mechanism</strong> in surface science, catalysis and astronomy. The source this page is built from — Prins, <em>Topics in Catalysis</em> <strong>61</strong> (2018) 714-721 — argues, from the primary literature, that the name is wrong twice over: the colliding-molecule mechanism was proposed by <strong>Langmuir in 1922</strong>, and what <strong>Eley and Rideal actually studied</strong> (1940-41) is a different mechanism — a chemisorbed atom reacting with a molecule held in a <em>van der Waals layer</em>, in thermal equilibrium with the surface. Prins therefore writes the colliding-molecule rate law as the <strong>Langmuir-Rideal (L-R)</strong> law.</p>
<p>This page builds that rate law, derives every limit the paper states for it, contrasts it with the Langmuir-Hinshelwood (L-H) law whose derivation is <strong>imported from the published page <code>C1.1</code></strong> (Hougen &amp; Watson’s 1947 codimer estimation), quantifies when the two laws can and cannot be told apart, and reports one printed defect: the paper’s maximum condition “<img src="https://latex.codecogs.com/png.latex?c_A%20=%20K_A">” is dimensionally inconsistent with its own Eq. (3a). <strong>The paper prints no measurement, no table and no figure</strong>, so everything quantitative here is analytical or a labelled numerical experiment on <code>C1.1</code>’s fitted constants — the page claims no experimental validation, because none is possible from this source.</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p><strong>The source, precisely.</strong> The document on disk is Prins, R., “Eley-Rideal, the Other Mechanism”, <em>Topics in Catalysis</em> <strong>61</strong> (2018) 714-721, doi:10.1007/s11244-018-0948-8, single author (ETH Zürich), 8 pages, labelled ORIGINAL PAPER but historical and terminological in content. It is <strong>born-digital</strong> (<code>pdfimages -list</code> finds no page scans, only decorative logos), so 300 dpi renders are clean vector rasterisations; every numeric and every equation used here was nevertheless read from a cropped render of its own page region, never from the text layer alone. The catalogue row for C1.2 had <strong>no reference at all</strong> (a dash); this paper was supplied from disk and identified from its own title page.</p>
<p><strong>What the paper argues.</strong> In 1922 Langmuir suggested three mechanisms for reactions at surfaces, quoted by Prins (p.&nbsp;714) from <em>Trans. Faraday Soc.</em> <strong>17</strong>, 607:</p>
<blockquote class="blockquote">
<p>“1. A reaction which takes place at the surface of a catalyst may occur by interaction between molecules or atoms adsorbed in adjacent spaces on the surface, 2. or it may occur between an adsorbed film and the atoms of the underlying solid, 3. or again, it may take place directly as a result of a collision between a gas molecule and an adsorbed molecule or atom on the surface.”</p>
</blockquote>
<p>Prins maps these to today’s names: the first is the <strong>Langmuir-Hinshelwood mechanism</strong> (gallery page <code>C1.1</code>), the second “constitutes the first step in a Mars-van Krevelen mechanism” (gallery page <code>C1.3</code>), and the third — the subject of this page — “is usually, but incorrectly as we will see, called Eley-Rideal mechanism”. The paper’s thesis, stated in its abstract:</p>
<blockquote class="blockquote">
<p>“Therefore, the reaction between a chemisorbed molecule and a gaseous colliding molecule should be called Langmuir-Rideal reaction rather than Eley-Rideal reaction, as it is often called in surface science, catalysis and astronomy.”</p>
</blockquote>
<p>What Eley and Rideal themselves studied (para-ortho H₂ conversion and H₂/D₂ exchange on tungsten, refs [8-11] of the paper) involved a chemisorbed H atom and a <strong>physisorbed</strong> H₂ molecule — Prins reserves “the real E-R mechanism” for that, and notes the IUPAC Gold Book already defines the Langmuir-Rideal name for the collision mechanism (p.&nbsp;720). This finding class — <em>the source argues the case’s own name is misattributed</em> — is the same one recorded on pages <code>B1.4</code> (“It was shown by WEISZ”) and <code>H1.1</code> (the half-power law attributed to Bohmholdt &amp; Wicke, not Sieverts). It is a feature of reading the source, not a problem with it.</p>
<p><strong>What this page is and is not.</strong> The case yaml’s scope caveat is binding and is followed here: this 2018 review is <strong>not the origin of the E-R/L-R rate law</strong> and is never presented as such. It <em>names</em> the mechanism, <em>distinguishes</em> it from its neighbours, <em>attributes</em> it (to Langmuir), and prints the L-H and L-R rate laws with their limiting behaviour — that is what the page reproduces and extends. The origin papers (Langmuir 1918/1922, Rideal 1939, Eley &amp; Rideal 1940-41, Eley 1948, the IUPAC Gold Book) were <strong>not consulted</strong> and are recorded as such in <code>meta.yaml</code>.</p>
<p><strong>Cross-check with <code>C1.1</code>.</strong> Prins writes of the L-H law (p.&nbsp;715): “In the chemical engineering community in the USA this is also called Langmuir-Hinshelwood-Hougen-Watson kinetics, because Hougen and Watson extended the mathematical treatments and indicated that the reaction rate is a product of three terms, the rate constant of the surface reaction, the number of unoccupied active sites and the thermodynamic driving force”. Page <code>C1.1</code> — built from Hougen &amp; Watson’s own book — states the same formalism as (kinetic term × driving force)/(adsorption group)<img src="https://latex.codecogs.com/png.latex?%5Em">. The two statements are verified below to be the same algebra, since the vacant-site fraction is <img src="https://latex.codecogs.com/png.latex?%5Ctheta_v%20=%201/(1+%5Csum_i%20K_i%20p_i)"> and <img src="https://latex.codecogs.com/png.latex?m"> counts the centers in the controlling step.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>All equations were read from 300 dpi crops of their own page regions.</p>
<p><strong>The Langmuir isotherm</strong> (p.&nbsp;714, printed with its 1916 centenary framing): <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%20KP/(1+KP)"> — gallery page <code>J1.1</code> reproduces its origin paper.</p>
<p><strong>The Langmuir-Hinshelwood law</strong> (p.&nbsp;715, printed in full for <img src="https://latex.codecogs.com/png.latex?A%20+%20B%20%5Crightleftharpoons%20C%20+%20D"> with surface reaction rate-determining):</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ar%20%5C;=%5C;%20k%5Ctheta_A%5Ctheta_B%20%5C;=%5C;%0Ak%5Cleft(K_AP_AK_BP_B%20-%20K%5E%7B-1%7DK_CP_CK_DP_D%5Cright)%5Cbig/%0A%5Cleft(1%20+%20K_AP_A%20+%20K_BP_B%20+%20K_CP_C%20+%20K_DP_D%5Cright)%5E2%20.%0A"></p>
<p>Two precision notes, verified symbolically below: the middle member <img src="https://latex.codecogs.com/png.latex?k%5Ctheta_A%5Ctheta_B"> equals only the <em>forward</em> term of the right-hand side — the printed right-hand side is the net rate <img src="https://latex.codecogs.com/png.latex?k%5Ctheta_A%5Ctheta_B%20-%20(k/K)%5C,%5Ctheta_C%5Ctheta_D"> — and the law is thermodynamically consistent exactly when <img src="https://latex.codecogs.com/png.latex?K"> is the surface-reaction equilibrium constant, related to the gas-phase one by <img src="https://latex.codecogs.com/png.latex?K_%5Cmathrm%7Bgas%7D%20=%20K%5C,K_AK_B/(K_CK_D)">.</p>
<p><strong>The liquid-phase pair the paper contrasts</strong> (Section 4, pp.&nbsp;718-719; <img src="https://latex.codecogs.com/png.latex?c"> denotes concentration):</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ar(%5Cmathrm%7BL%5C!-%5C!H%7D)%20=%20%5Cfrac%7Bk%5C,K_AK_B%5C,c_Ac_B%7D%7B%5Cleft(1+K_Ac_A+K_Bc_B%5Cright)%5E2%7D%0A%5Ctag%7B3a%7D%0A"></p>
<p>with the printed reduced form <img src="https://latex.codecogs.com/png.latex?r%20=%20k%5C,K_AK_B%5C,c_Ac_B/(1+K_Ac_A)%5E2"> “when <img src="https://latex.codecogs.com/png.latex?K_Bc_B%20%5Cll%201">”,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ar(%5Cmathrm%7BL%5C!-%5C!R%7D)%20=%20%5Cfrac%7Bk%5C,K_A%5C,c_Ac_B%7D%7B1+K_Ac_A%7D%0A%5Ctag%7B3b%7D%0A"></p>
<p>for chemisorbed A with B colliding from the fluid phase — <strong>the impact rate law this case is about</strong>: B appears in the numerator only, because B is never adsorbed — and, for two species adsorbed on <em>non-competing</em> sites,</p>
<p><img src="https://latex.codecogs.com/png.latex?%0Ar(%5Cmathrm%7BL%5C!-%5C!H%7D)%20=%20%5Cfrac%7Bk%5C,K_AK_B%5C,c_Ac_B%7D%7B%5Cleft(1+K_Ac_A%5Cright)%5Cleft(1+K_Bc_B%5Cright)%7D%0A%5Ctag%7B3c%7D%0A"></p>
<p><strong>The paper’s stated limits</strong> (p.&nbsp;719), each derived symbolically below:</p>
<blockquote class="blockquote">
<p>“Whereas the reaction order in B is equal to 1 for both reactions, the reaction order for A decreases from 1 to − 1 for the L-H reaction (Eq. 3a) and from 1 to 0 for the L-R reaction (Eq. 3b) when the concentration of A is increased. The rate of the L-H reaction should even reach a maximum for c<img src="https://latex.codecogs.com/png.latex?_A"> = K<img src="https://latex.codecogs.com/png.latex?_A">. [sic] When A = B, as in the condensation of alcohols to ethers (e.g.&nbsp;methanol to DME), the order decreases from 2 to 0 for the L-H reaction and from 2 to 1 for the L-R reaction.”</p>
</blockquote>
<p>The <em>[sic]</em> is this page’s: “<img src="https://latex.codecogs.com/png.latex?c_A%20=%20K_A">” equates a concentration to an adsorption constant with units of inverse concentration. The derived condition from the paper’s own Eq. (3a) is <img src="https://latex.codecogs.com/png.latex?K_Ac_A%20=%201%20+%20K_Bc_B">. The defect is <strong>reported, not repaired</strong>; the most plausible intended statement, <img src="https://latex.codecogs.com/png.latex?K_Ac_A%20=%201"> (the maximum of the printed reduced form), is an inference of this page, not the text.</p>
<p><strong>The degeneracy warning</strong> (p.&nbsp;719), which the Results sharpen:</p>
<blockquote class="blockquote">
<p>“This precludes an L-R mechanism but, if K<img src="https://latex.codecogs.com/png.latex?_B">c<img src="https://latex.codecogs.com/png.latex?_B"> ≪ 1, Eq. (3c) becomes equal to Eq. (3b) and it looks as if an L-R reaction takes place.”</p>
</blockquote>
<p><strong>Printed numbers</strong> (pp.&nbsp;716-717): L-H neighbours “may attempt to react 10¹²-10¹³ per site per s”; the L-R collision flux “is only 10⁹ per site per s at 1 atm”; a vertical instead of tilted CO raises the collision barrier from 70 to 150 kJ/mol; and the HD product of H + D/Cu(111) carries 82 + 36 + 58 kJ/mol against an exothermicity of 436 − about 240 kJ/mol — the paper says the sum “is close to” the exothermicity, and a cell below quantifies “close”.</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<ul>
<li><strong>The dimensionless frame.</strong> Eqs. (3a)-(3c) are studied in <img src="https://latex.codecogs.com/png.latex?x%20=%20K_Ac_A"> and <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%20K_Bc_B">; rates are normalised by their own prefactors, so every statement about <em>orders</em> and <em>shapes</em> is parameter-free. Where a dimensional demonstration is needed (the unit dependence of the printed maximum condition), <img src="https://latex.codecogs.com/png.latex?K_A%20=%202"> L/mol is an arbitrary working value and is varied by the test itself.</li>
<li><img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.05"> for the plotted curves (close to Prins’s reduced case) and <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.3"> where the <img src="https://latex.codecogs.com/png.latex?%5Cbeta">-effect itself is measured. Both are arbitrary display choices; the symbolic results do not depend on them.</li>
<li><strong>The real instantiation</strong> is imported from <code>C1.1</code>: mechanism (d)’s fitted constants at 200 °C (Table D of Hougen &amp; Watson 1947) converted to <img src="https://latex.codecogs.com/png.latex?K_U%20=%20b/a">, <img src="https://latex.codecogs.com/png.latex?K_S%20=%20c/a">, <img src="https://latex.codecogs.com/png.latex?K_H%20=%20f/a"> and lumped prefactor <img src="https://latex.codecogs.com/png.latex?1/a%5E2"> — <code>C1.1</code>’s conversion, reproduced and cross-checked against the book’s own Table C below. Pressures in atm, rates in lb-mol/(lb catalyst · hr), the book’s units.</li>
<li><strong>Everything imported from <code>C1.1</code> is fit data.</strong> Those constants were fitted <em>by the book</em> to its own 40 runs; nothing here is a held-out measurement. Every computation on them below is a <strong>numerical experiment</strong> and is labelled so where it is run.</li>
<li><strong>Nothing is stochastic.</strong> All fits use fixed deterministic starts; all extrema and thresholds are root-found, never read off a sweep.</li>
</ul>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p><strong>The source paper contains no data.</strong> No measurements, no tables, no figures — checked three ways: the full text was read; all 8 pages were rendered and inspected; <code>pdfimages -list</code> shows only decorative raster logos (largest 105×97 px) and the vector content contains no plots. The page therefore <strong>cannot claim experimental validation</strong>, and does not. What it can do — the case yaml’s chosen route — is analytical: derive the printed limits, and run labelled numerical experiments on real fitted constants.</p>
<p>One dataset of this page’s own:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>file</th>
<th>source</th>
<th>what it is</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>prins-2018-printed-statements</code></td>
<td>pp.&nbsp;714-720</td>
<td>every quantitative statement the paper prints, with page provenance</td>
</tr>
</tbody>
</table>
<p>Three datasets loaded cross-page from <strong><code>C1.1</code></strong> (which requires reading that page — done; its findings on these exact rows are listed here with their effect on this page):</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>file</th>
<th>what it is</th>
<th><code>C1.1</code> findings that touch this page</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>hougen-watson-1947-tableA-rates</code></td>
<td>the 40 measured runs (12 at 200 °C)</td>
<td>none flagged for the 200 °C block itself; the transcription is proven by the book’s own printed checksums</td>
</tr>
<tr class="even">
<td><code>hougen-watson-1947-tableC-mechd-200C</code></td>
<td>the book’s printed per-run fit evaluation at 200 °C</td>
<td><strong>run 25a’s printed <img src="https://latex.codecogs.com/png.latex?R_%7Bcalc%7D"> (5.40) is a digit slip</strong> — its own row requires 5.90. This page’s reconciliation below reproduces that finding independently and excludes 25a where the book’s printing is the reference</td>
</tr>
<tr class="odd">
<td><code>hougen-watson-1947-tablesDEF-constants</code></td>
<td>fitted constants for all 18 mechanisms</td>
<td><strong>eight 200 °C rows (c, g, j, k, m, o, p, r) descend from one corrupted worksheet sum</strong>; mechanism (d)’s row is clean and is the only row used for constants here. Mechanism (h) implies the same corrupted column in its own (cube-root) worksheet — a ninth affected row, not one of the eight. The printed 200 °C rows of the <em>impact</em> mechanisms (o, p, k, m) are in the corrupted family, so this page never uses their printed constants — it refits from Table A instead. <code>C1.1</code> also found the c-family’s “a should be positive” rejection ground partly rests on that corrupted sum (a is not negative at full precision), while the acceptance set {d, h} survives at every temperature</td>
</tr>
</tbody>
</table>
<p>Rule followed throughout: <strong>no number that exists in a loaded CSV is ever retyped</strong> — it is printed beside this page’s value and reconciled in the cell that uses it.</p>
<div id="0d27a6bb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:50.388617Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:50.388468Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:50.815601Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:50.814844Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-2">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: F401</span></span>
<span id="cb1-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb1-4">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm pyyaml</span></code></pre></div></div>
</div>
<div id="4cda4eaa" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:50.818320Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:50.818133Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:51.354837Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:51.354112Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys, pathlib</span>
<span id="cb2-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"google.colab"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.modules:</span>
<span id="cb2-3">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> urllib.request</span>
<span id="cb2-4">    base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb2-5">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>)</span>
<span id="cb2-6">    urllib.request.urlretrieve(base, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb2-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb2-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (pathlib.Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>pathlib.Path.cwd().parents):</span>
<span id="cb2-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb2-10">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(p_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb2-11"></span>
<span id="cb2-12"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> warnings</span>
<span id="cb2-13"></span>
<span id="cb2-14"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-15"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-16"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-17"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-18"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-19"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq, minimize, minimize_scalar, least_squares</span>
<span id="cb2-20"></span>
<span id="cb2-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> newton, NumJac</span>
<span id="cb2-22"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, report_agreement</span>
<span id="cb2-23"></span>
<span id="cb2-24">warnings.filterwarnings(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>)</span>
<span id="cb2-25">np.random.seed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nothing here is stochastic; seeded so two runs are identical</span></span>
<span id="cb2-26">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1.2"</span>                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># catalog id, for report_agreement</span></span>
<span id="cb2-27">PAGE_DIR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1.2-eley-rideal"</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># page directory, for cross-checkout data resolution</span></span>
<span id="cb2-28">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.width"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb2-29"></span>
<span id="cb2-30">M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># agreement.json metrics</span></span>
<span id="cb2-31">BREAKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (metric, base, what was broken, broken value, note)</span></span>
<span id="cb2-32">RES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every number quoted in prose lands here, audited at the end</span></span>
<span id="cb2-33"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> keep(k, v):</span>
<span id="cb2-34">    RES[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v)</span>
<span id="cb2-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> v</span>
<span id="cb2-36"></span>
<span id="cb2-37">P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prins-2018-printed-statements.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE_DIR).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"name"</span>)</span>
<span id="cb2-38">meta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prins-2018-printed-statements.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE_DIR)</span>
<span id="cb2-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loaded:"</span>, meta[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"title"</span>])</span>
<span id="cb2-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(P[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unit"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>]].to_string())</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>loaded: Every quantitative statement printed in Prins (2018), Eley-Rideal, the Other Mechanism
                                     value            unit           role
name                                                                     
lh_attempt_freq_low           1.000000e+12  per site per s    computation
lh_attempt_freq_high          1.000000e+13  per site per s    computation
lr_flux_at_1atm               1.000000e+09  per site per s    computation
lr_flux_reference_pressure    1.000000e+00             atm    computation
co_barrier_tilted             7.000000e+01          kJ/mol        context
co_barrier_vertical           1.500000e+02          kJ/mol        context
hd_mean_translational         8.200000e+01          kJ/mol    computation
hd_mean_rotational            3.600000e+01          kJ/mol    computation
hd_mean_vibrational           5.800000e+01          kJ/mol    computation
h2_dissociation_energy        4.360000e+02          kJ/mol    computation
d_on_cu_binding_energy_about  2.400000e+02          kJ/mol    computation
tungsten_rideal_below_T       1.980000e+02               K        context
order_A_LH_low                1.000000e+00               -  claim_checked
order_A_LH_high              -1.000000e+00               -  claim_checked
order_A_LR_low                1.000000e+00               -  claim_checked
order_A_LR_high               0.000000e+00               -  claim_checked
order_B_both                  1.000000e+00               -  claim_checked
order_AeqB_LH_low             2.000000e+00               -  claim_checked
order_AeqB_LH_high            0.000000e+00               -  claim_checked
order_AeqB_LR_low             2.000000e+00               -  claim_checked
order_AeqB_LR_high            1.000000e+00               -  claim_checked
order_A_3c_KAcA_large         0.000000e+00               -  claim_checked
order_B_3c_KBcB_small         1.000000e+00               -  claim_checked</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>This is an <code>S1</code> page — pointwise rate algebra, no transport operator — so the honest statement (<code>J1.1</code>, <code>A1.6</code> and <code>A1.1</code> give the same one) is that most of this notebook would run with pymrm uninstalled. Where pymrm <em>is</em> used, it is used the way the style guide intends for scalar problems:</p>
<ul>
<li>every extremum and threshold on this page is <strong>root-found</strong>, and each root-find is done twice: once with pymrm’s <code>newton</code> on a <code>NumJac((1, 1))</code> Jacobian and once with an independent method (a closed form where one exists, otherwise a bracketing Brent solve). Shape <code>(1, 1)</code>, not <code>(1,)</code>: with a bare 1-D shape NumJac’s last axis is space, which builds a dense Jacobian (AGENTS.md).</li>
<li>Where the two routes share the objective function, the comparison is labelled a <strong>root-finder cross-check</strong>; where they share nothing (the L-H maximum: symbolic closed form vs a numeric root of an independently coded law), it is an independent computation and is the page’s second route for that headline.</li>
</ul>
<p>The rate laws are coded twice on purpose: once in sympy (the derivations) and once in numpy (the measurements), transcribed separately from the paper, so an algebra slip in one shows up against the other.</p>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="every-printed-limit-derived-from-the-papers-own-equations" class="level3">
<h3 class="anchored" data-anchor-id="every-printed-limit-derived-from-the-papers-own-equations">1. Every printed limit, derived from the paper’s own equations</h3>
<p>The paper states seven limiting orders and one maximum condition for Eqs. (3a)-(3b), plus two limits for Eq. (3c). Each is derived symbolically here — the local order is <img src="https://latex.codecogs.com/png.latex?n%20=%20%5Cpartial%5Cln%20r/%5Cpartial%5Cln%20c"> — and compared with the printed claim from the data table.</p>
<div id="e823eb70" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:51.356744Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:51.356587Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:51.733544Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:51.732787Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Symbolic route: sympy derivations of every printed limit of Eqs. (3a)-(3c).</span></span>
<span id="cb4-2"></span>
<span id="cb4-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">Independent of the numpy implementations used later.</span></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb4-5">x, beta, cA, cB, KA, KB, k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x beta c_A c_B K_A K_B k"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb4-6"></span>
<span id="cb4-7">r3a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cB)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Eq. (3a)</span></span>
<span id="cb4-8">r3b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA)                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Eq. (3b)  the L-R / impact law</span></span>
<span id="cb4-9">r3c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cA)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>cB))       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Eq. (3c)</span></span>
<span id="cb4-10"></span>
<span id="cb4-11">order <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r, c: sp.simplify(c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.diff(r, c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d ln r / d ln c</span></span>
<span id="cb4-12"></span>
<span id="cb4-13">nA_3a, nA_3b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> order(r3a, cA), order(r3b, cA)</span>
<span id="cb4-14">nB_3a, nB_3b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> order(r3a, cB), order(r3b, cB)</span>
<span id="cb4-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A = B, competing for the same sites: r_LH = k (K c)^2/(1+K c)^2, r_LR = k K c^2/(1+K c)</span></span>
<span id="cb4-16">c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"c"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb4-17">rAB_lh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb4-18">rAB_lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>c)</span>
<span id="cb4-19">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb4-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> lim(expr, var, to):</span>
<span id="cb4-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> sp.limit(expr, var, to)</span>
<span id="cb4-22">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb4-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A, Eq. 3a, c_A -&gt; 0"</span>,   lim(nA_3a, cA, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),          P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_A_LH_low"</span>]),</span>
<span id="cb4-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A, Eq. 3a, c_A -&gt; oo"</span>,  lim(nA_3a, cA, sp.oo),      P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_A_LH_high"</span>]),</span>
<span id="cb4-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A, Eq. 3b, c_A -&gt; 0"</span>,   lim(nA_3b, cA, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),          P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_A_LR_low"</span>]),</span>
<span id="cb4-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A, Eq. 3b, c_A -&gt; oo"</span>,  lim(nA_3b, cA, sp.oo),      P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_A_LR_high"</span>]),</span>
<span id="cb4-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in B, Eq. 3b (exact, all c_B)"</span>, nB_3b,                 P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_B_both"</span>]),</span>
<span id="cb4-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A=B, L-H, c -&gt; 0"</span>,      lim(order(rAB_lh, c), c, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),      P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_AeqB_LH_low"</span>]),</span>
<span id="cb4-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A=B, L-H, c -&gt; oo"</span>,     lim(order(rAB_lh, c), c, sp.oo),  P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_AeqB_LH_high"</span>]),</span>
<span id="cb4-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A=B, L-R, c -&gt; 0"</span>,      lim(order(rAB_lr, c), c, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),      P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_AeqB_LR_low"</span>]),</span>
<span id="cb4-31">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A=B, L-R, c -&gt; oo"</span>,     lim(order(rAB_lr, c), c, sp.oo),  P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_AeqB_LR_high"</span>]),</span>
<span id="cb4-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in A, Eq. 3c, K_A c_A -&gt; oo"</span>, lim(order(r3c, cA), cA, sp.oo), P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_A_3c_KAcA_large"</span>]),</span>
<span id="cb4-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order in B, Eq. 3c, K_B c_B -&gt; 0"</span>,  lim(order(r3c, cB), cB, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),     P.value[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order_B_3c_KBcB_small"</span>]),</span>
<span id="cb4-34">]</span>
<span id="cb4-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, derived, printed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims:</span>
<span id="cb4-36">    rows.append((name, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(printed), sp.nsimplify(derived), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"agrees"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> sp.simplify(derived <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DISAGREES"</span>))</span>
<span id="cb4-37">tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed claim (p. 719)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"derived"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"verdict"</span>])</span>
<span id="cb4-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(tab.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>))</span>
<span id="cb4-39"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> (tab.verdict <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"agrees"</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>()</span>
<span id="cb4-40"></span>
<span id="cb4-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the ONE printed statement that does not survive its own equation:</span></span>
<span id="cb4-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "The rate of the L-H reaction should even reach a maximum for c_A = K_A."</span></span>
<span id="cb4-43">xstar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve(sp.diff(r3a, cA), cA)</span>
<span id="cb4-44">xstar_full <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(xstar[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> KA)               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># K_A c_A at the maximum</span></span>
<span id="cb4-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">maximum of Eq. (3a) over c_A:  K_A c_A ="</span>, xstar_full, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" (i.e. 1 + K_B c_B; = 1 for the reduced form)"</span>)</span>
<span id="cb4-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed (p. 719, verbatim):    "c_A = K_A" [sic] - dimensionally inconsistent; see section 3'</span>)</span>
<span id="cb4-47"></span>
<span id="cb4-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># order in B of the FULL Eq. (3a): not identically 1 - the printed claim is exact</span></span>
<span id="cb4-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only for the reduced form the paper prints just above Eq. (3b)</span></span>
<span id="cb4-50">gapB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> nB_3a)</span>
<span id="cb4-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">order in B of full Eq. (3a) = 1 -"</span>, gapB, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" -&gt; the printed 'equal to 1' is exact for the reduced form (K_B c_B -&gt; 0) and off by 2*K_B*c_B/(1+K_A*c_A+K_B*c_B) otherwise"</span>)</span>
<span id="cb4-52"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sp.limit(gapB, cB, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>             printed claim (p. 719)  printed derived verdict
       order in A, Eq. 3a, c_A -&gt; 0      1.0       1  agrees
      order in A, Eq. 3a, c_A -&gt; oo     -1.0      -1  agrees
       order in A, Eq. 3b, c_A -&gt; 0      1.0       1  agrees
      order in A, Eq. 3b, c_A -&gt; oo      0.0       0  agrees
order in B, Eq. 3b (exact, all c_B)      1.0       1  agrees
          order in A=B, L-H, c -&gt; 0      2.0       2  agrees
         order in A=B, L-H, c -&gt; oo      0.0       0  agrees
          order in A=B, L-R, c -&gt; 0      2.0       2  agrees
         order in A=B, L-R, c -&gt; oo      1.0       1  agrees
  order in A, Eq. 3c, K_A c_A -&gt; oo      0.0       0  agrees
   order in B, Eq. 3c, K_B c_B -&gt; 0      1.0       1  agrees

maximum of Eq. (3a) over c_A:  K_A c_A = K_B*c_B + 1  (i.e. 1 + K_B c_B; = 1 for the reduced form)
printed (p. 719, verbatim):    "c_A = K_A" [sic] - dimensionally inconsistent; see section 3

order in B of full Eq. (3a) = 1 - 2*K_B*c_B/(K_A*c_A + K_B*c_B + 1)  -&gt; the printed 'equal to 1' is exact for the reduced form (K_B c_B -&gt; 0) and off by 2*K_B*c_B/(1+K_A*c_A+K_B*c_B) otherwise</code></pre>
</div>
</div>
<div id="eef1d015" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:51.735617Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:51.735408Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:51.830426Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:51.829732Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Symbolic route, continued: the p. 715 L-H law and the two naming cross-checks."""</span></span>
<span id="cb6-2">PA, PB, PC, PD, KC, KD, Ksurf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_A P_B P_C P_D K_C K_D K"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb6-3">D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PD</span>
<span id="cb6-4">thA, thB, thC, thD, thV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D, KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D, KC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D, KD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D</span>
<span id="cb6-5"></span>
<span id="cb6-6">printed_p715 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ksurf) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb6-7"></span>
<span id="cb6-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (i) the printed RHS is the NET rate k*thA*thB - (k/K)*thC*thD, not k*thA*thB</span></span>
<span id="cb6-9">net <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ksurf)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thD</span>
<span id="cb6-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sp.simplify(net <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed_p715) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb6-11">fwd_only_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed_p715)</span>
<span id="cb6-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed RHS == k*thA*thB - (k/K)*thC*thD  : identity holds"</span>)</span>
<span id="cb6-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed middle member k*thA*thB equals the RHS only when the reverse term vanishes;"</span>)</span>
<span id="cb6-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  difference ="</span>, fwd_only_gap)</span>
<span id="cb6-15"></span>
<span id="cb6-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (ii) thermodynamic consistency: r = 0 at equilibrium fixes K as the</span></span>
<span id="cb6-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># surface-reaction equilibrium constant, K_gas = K * K_A K_B / (K_C K_D)</span></span>
<span id="cb6-18">eq_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Ksurf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KD)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claimed P_C P_D/(P_A P_B) at r = 0</span></span>
<span id="cb6-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sp.simplify(printed_p715.subs(PD, eq_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>PC)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb6-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r = 0  &lt;=&gt;  P_C P_D/(P_A P_B) ="</span>, eq_ratio, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" = K*K_A*K_B/(K_C*K_D) = K_gas (verified by substitution)"</span>)</span>
<span id="cb6-21"></span>
<span id="cb6-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (iii) Prins's Hougen-Watson sentence vs C1.1's formalism: "a product of three</span></span>
<span id="cb6-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># terms - the rate constant, the number of unoccupied active sites and the</span></span>
<span id="cb6-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># thermodynamic driving force" is the SAME algebra as C1.1's</span></span>
<span id="cb6-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (kinetic term x driving force)/(adsorption group)^m, because theta_v = 1/D</span></span>
<span id="cb6-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and m = 2 counts the centers of the dual-site controlling step:</span></span>
<span id="cb6-27">three_terms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> thV<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (KA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KB<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>PD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ksurf)</span>
<span id="cb6-28"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sp.simplify(three_terms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed_p715) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb6-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k * theta_v^2 * (driving force) == printed p. 715 law : identity holds -"</span>)</span>
<span id="cb6-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Prins's three-term description and C1.1's kinetic x driving force / adsorption^2 are the same algebra"</span>)</span>
<span id="cb6-31"></span>
<span id="cb6-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a structural identity, named as such: the residual of (i)-(iii) is exactly 0</span></span>
<span id="cb6-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># by construction once the algebra is right; it can only catch a transcription</span></span>
<span id="cb6-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># slip in THIS cell's expressions. The break test that CAN fail is in the</span></span>
<span id="cb6-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># validation table: perturbing K by 10 % moves the equilibrium residual.</span></span>
<span id="cb6-36">Ptest <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {KA: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, KB: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.3</span>, KC: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, KD: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, k: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, Ksurf: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>}</span>
<span id="cb6-37">Peq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {PA: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, PB: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>}</span>
<span id="cb6-38">pcpd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(eq_ratio.subs(Ptest))</span>
<span id="cb6-39">resid_at_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(printed_p715.subs(Ptest).subs(Peq).subs({PC: np.sqrt(pcpd), PD: np.sqrt(pcpd)}))</span>
<span id="cb6-40">r_fwd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>thB).subs(Ptest).subs(Peq).subs({PC: np.sqrt(pcpd), PD: np.sqrt(pcpd)}))</span>
<span id="cb6-41">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thermo_eq_relresid_atK"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(resid_at_eq) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r_fwd</span>
<span id="cb6-42">pcpd_wrong <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((eq_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>).subs(Ptest))</span>
<span id="cb6-43">resid_wrong <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(printed_p715.subs(Ptest).subs(Peq).subs({PC: np.sqrt(pcpd_wrong), PD: np.sqrt(pcpd_wrong)}))</span>
<span id="cb6-44">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thermo_eq_relresid_K10pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(resid_wrong) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r_fwd</span>
<span id="cb6-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">equilibrium residual with consistent K: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'thermo_eq_relresid_atK'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (identity - structural, below CI's ABS_FLOOR)"</span>)</span>
<span id="cb6-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"equilibrium residual with K off by 10 %: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'thermo_eq_relresid_K10pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (the companion that can fail)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>printed RHS == k*thA*thB - (k/K)*thC*thD  : identity holds
printed middle member k*thA*thB equals the RHS only when the reverse term vanishes;
  difference = K_C*K_D*P_C*P_D*k/(K*(K_A*P_A + K_B*P_B + K_C*P_C + K_D*P_D + 1)**2)
r = 0  &lt;=&gt;  P_C P_D/(P_A P_B) = K*K_A*K_B/(K_C*K_D)  = K*K_A*K_B/(K_C*K_D) = K_gas (verified by substitution)
k * theta_v^2 * (driving force) == printed p. 715 law : identity holds -
  Prins's three-term description and C1.1's kinetic x driving force / adsorption^2 are the same algebra

equilibrium residual with consistent K: 4.88e-16 (identity - structural, below CI's ABS_FLOOR)
equilibrium residual with K off by 10 %: 0.0943 (the companion that can fail)</code></pre>
</div>
</div>
</section>
<section id="the-two-laws-over-concentration-and-their-measured-orders" class="level3">
<h3 class="anchored" data-anchor-id="the-two-laws-over-concentration-and-their-measured-orders">2. The two laws over concentration, and their measured orders</h3>
<p>The numpy implementations below are transcribed from the paper independently of the sympy expressions above. Local orders are measured by central differences in log-log space, at <img src="https://latex.codecogs.com/png.latex?x%20=%2010%5E%7B-4%7D"> and <img src="https://latex.codecogs.com/png.latex?x%20=%2010%5E%7B4%7D">, and must land on the symbolic limits to within the finite-<img src="https://latex.codecogs.com/png.latex?x"> tail, whose size (<img src="https://latex.codecogs.com/png.latex?2x/(1+x+%5Cbeta)"> from the asymptote, etc.) is itself predicted by the symbolic route.</p>
<div id="f1f13fe5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:51.832572Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:51.832444Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:51.842205Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:51.841449Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Numeric route: independently coded laws, measured local orders, figure."""</span></span>
<span id="cb8-2">BETA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># display value; beta-dependence is measured separately below</span></span>
<span id="cb8-3"></span>
<span id="cb8-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_lh(xv, b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BETA, expo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>):</span>
<span id="cb8-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (3a) in x = K_A c_A, beta = K_B c_B (prefactor normalised)."""</span></span>
<span id="cb8-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> expo</span>
<span id="cb8-7"></span>
<span id="cb8-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_lr(xv, b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BETA, power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb8-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (3b), the impact law: B in the numerator only."""</span></span>
<span id="cb8-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> power</span>
<span id="cb8-11"></span>
<span id="cb8-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_ab_lh(xv, expo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>):        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A = B on competing sites</span></span>
<span id="cb8-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> expo</span>
<span id="cb8-14"></span>
<span id="cb8-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_ab_lr(xv):</span>
<span id="cb8-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xv)</span>
<span id="cb8-17"></span>
<span id="cb8-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> slope(f, xv, h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>):</span>
<span id="cb8-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (np.log(f(xv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(h))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(f(xv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>h)))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>h)</span>
<span id="cb8-20"></span>
<span id="cb8-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># finite-difference step verified by refinement (requirement: refine the axis</span></span>
<span id="cb8-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># that carries error): halving h must not move any slope at reporting precision</span></span>
<span id="cb8-23">probes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(r_lh, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>), (r_lh, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>), (r_lr, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>), (r_lr, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>),</span>
<span id="cb8-24">          (r_ab_lh, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>), (r_ab_lr, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)]</span>
<span id="cb8-25">fd_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(slope(f, xv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> slope(f, xv, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-7</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f, xv <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> probes)</span>
<span id="cb8-26">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fd_slope_h_refinement_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fd_ref</span>
<span id="cb8-27"></span>
<span id="cb8-28">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LH_slope_at_x1e4"</span>]  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope(r_lh, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb8-29">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LH_slope_at_x1em4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope(r_lh, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb8-30">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LR_slope_at_x1e4"</span>]  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope(r_lr, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb8-31">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LR_slope_at_x1em4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope(r_lr, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)</span>
<span id="cb8-32">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderAB_LH_slope_at_x1e4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope(r_ab_lh, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb8-33">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderAB_LR_slope_at_x1e4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> slope(r_ab_lr, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)</span>
<span id="cb8-34"></span>
<span id="cb8-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break tests: the printed exponents, exercised (each row must MOVE the metric)</span></span>
<span id="cb8-36">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LH_slope_at_x1e4"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderA_LH_slope_at_x1e4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-37">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-H denominator exponent 2 -&gt; 1"</span>,</span>
<span id="cb8-38">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: r_lh(v, expo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-39">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves -1 -&gt; 0: the high-coverage order carries the exponent"</span>))</span>
<span id="cb8-40">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LR_slope_at_x1e4"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderA_LR_slope_at_x1e4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-41">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-R denominator power 1 -&gt; 2"</span>,</span>
<span id="cb8-42">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: r_lr(v, power<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-43">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves 0 -&gt; -1: the impact law's zero-order plateau needs power 1"</span>))</span>
<span id="cb8-44">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LH_slope_at_x1em4"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderA_LH_slope_at_x1em4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-45">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numerator power of c_A: 1 -&gt; 2 (both laws)"</span>,</span>
<span id="cb8-46">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_lh(v), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-47">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves 1 -&gt; 2: the low-coverage order carries the numerator power "</span></span>
<span id="cb8-48">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(same break moves the L-R low-x row identically)"</span>))</span>
<span id="cb8-49"></span>
<span id="cb8-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># order in B of the FULL Eq. (3a): the printed "equal to 1 for both" is exact</span></span>
<span id="cb8-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for the reduced form; the beta-effect on the full form, measured vs symbolic</span></span>
<span id="cb8-52">BETA_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb8-53"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> r_lh_of_cb(bv, xv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb8-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> bv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb8-55">gap_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> bv: r_lh_of_cb(bv), BETA_B)</span>
<span id="cb8-56">gap_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>BETA_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_B)</span>
<span id="cb8-57">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderB_LH_gap_from_1_beta03"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gap_meas</span>
<span id="cb8-58"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(gap_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> gap_sym) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span></span>
<span id="cb8-59">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderB_LH_gap_from_1_beta03"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_meas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-60">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beta -&gt; 0 (the reduced form the paper prints above Eq. 3b)"</span>,</span>
<span id="cb8-61">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> bv: r_lh_of_cb(bv), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb8-62">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vanishes: the printed 'order in B = 1' is exact in the reduced form"</span>))</span>
<span id="cb8-63"></span>
<span id="cb8-64">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderB_gap"</span>, gap_meas)</span>
<span id="cb8-65">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb8-66"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Measured orders (finite-$x$, so close to but not exactly the limits — the</span></span>
<span id="cb8-67"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gap is the predicted tail): L-H order in A at $x=10^4$:</span></span>
<span id="cb8-68"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderA_LH_slope_at_x1e4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (limit −1), at $x=10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-4</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$:</span></span>
<span id="cb8-69"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderA_LH_slope_at_x1em4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (limit 1); L-R impact law at</span></span>
<span id="cb8-70"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$x=10^4$: **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderA_LR_slope_at_x1e4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (limit 0). A=B:</span></span>
<span id="cb8-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">L-H **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderAB_LH_slope_at_x1e4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (limit 0), L-R</span></span>
<span id="cb8-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orderAB_LR_slope_at_x1e4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (limit 1). The order-in-B claim is</span></span>
<span id="cb8-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">exact for Eq. (3b) and for the reduced (3a); on the full (3a) at</span></span>
<span id="cb8-74"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_B<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, $x = 1$ the order in B is $1 - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_meas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ —</span></span>
<span id="cb8-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">measured equal to the symbolic $2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta/(1+x+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta)$ to 1e-9."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Measured orders (finite-<img src="https://latex.codecogs.com/png.latex?x">, so close to but not exactly the limits — the gap is the predicted tail): L-H order in A at <img src="https://latex.codecogs.com/png.latex?x=10%5E4">: <strong>-0.9998</strong> (limit −1), at <img src="https://latex.codecogs.com/png.latex?x=10%5E%7B-4%7D">: <strong>0.9998</strong> (limit 1); L-R impact law at <img src="https://latex.codecogs.com/png.latex?x=10%5E4">: <strong>1.00e-04</strong> (limit 0). A=B: L-H <strong>2.00e-04</strong> (limit 0), L-R <strong>1.0001</strong> (limit 1). The order-in-B claim is exact for Eq. (3b) and for the reduced (3a); on the full (3a) at <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.3">, <img src="https://latex.codecogs.com/png.latex?x%20=%201"> the order in B is <img src="https://latex.codecogs.com/png.latex?1%20-%200.2609"> — measured equal to the symbolic <img src="https://latex.codecogs.com/png.latex?2%5Cbeta/(1+x+%5Cbeta)"> to 1e-9.</p>
</div>
</div>
<div id="f278fa8c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:51.844012Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:51.843885Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:52.570607Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:52.569731Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Figure 1: the two laws and their local orders. L-H is blue, L-R orange</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(identities fixed across every figure on this page)."""</span></span>
<span id="cb9-3">C_LH, C_LR, C_3C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span></span>
<span id="cb9-4">xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb9-5">fig, (ax1, ax2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.8</span>))</span>
<span id="cb9-6">ax1.loglog(xg, r_lh(xg), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LH, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-H, Eq. (3a)"</span>)</span>
<span id="cb9-7">ax1.loglog(xg, r_lr(xg), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LR, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-R impact, Eq. (3b)"</span>)</span>
<span id="cb9-8">xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA</span>
<span id="cb9-9">ax1.plot([xs], [r_lh(xs)], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LH, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb9-10">ax1.annotate(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maximum at $K_Ac_A = 1+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">beta$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">(root-found in sec. 3)"</span>,</span>
<span id="cb9-11">             xy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(xs, r_lh(xs)), xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2e-2</span>), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,</span>
<span id="cb9-12">             arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(arrowstyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>))</span>
<span id="cb9-13">ax1.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$x = K_A c_A$"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax1.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate (own prefactor units)"</span>)</span>
<span id="cb9-14">ax1.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two rate laws, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.2f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> BETA, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb9-15">ax1.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax1.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb9-16">ax2.semilogx(xg, slope(r_lh, xg), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LH, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-H"</span>)</span>
<span id="cb9-17">ax2.semilogx(xg, slope(r_lr, xg), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LR, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-R impact"</span>)</span>
<span id="cb9-18">ax2.set_ylim(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>)</span>
<span id="cb9-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>), (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"−1"</span>)):</span>
<span id="cb9-20">    ax2.axhline(y, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.75"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb9-21">    ax2.text(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4e3</span>, y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, lab, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>)</span>
<span id="cb9-22">ax2.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$x = K_A c_A$"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax2.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local order in A,  d ln r / d ln $c_A$"</span>)</span>
<span id="cb9-23">ax2.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed limits 1 → −1 and 1 → 0"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb9-24">ax2.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax2.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb9-25">fig.suptitle(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Prins (2018) Eqs. (3a)-(3b): only the L-H law turns over"</span>, y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.03</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb9-26">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/C1.2-eley-rideal/index_files/figure-html/cell-7-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-maximum-of-the-l-h-rate-and-the-printed-condition-that-cannot-be-right" class="level3">
<h3 class="anchored" data-anchor-id="the-maximum-of-the-l-h-rate-and-the-printed-condition-that-cannot-be-right">3. The maximum of the L-H rate, and the printed condition that cannot be right</h3>
<p>The paper prints (p.&nbsp;719, quoted verbatim in <em>The published model</em>): “The rate of the L-H reaction should even reach a maximum for c<img src="https://latex.codecogs.com/png.latex?_A"> = K<img src="https://latex.codecogs.com/png.latex?_A">.” The maximum is real — it is the L-H law’s signature, and the reason the two laws are distinguishable at all — but the printed condition equates a concentration to an inverse concentration. Three computations pin this down:</p>
<ol type="1">
<li><strong>the closed form</strong> from the paper’s own Eq. (3a): <img src="https://latex.codecogs.com/png.latex?K_Ac_A%5E*%20=%201%20+%20K_Bc_B"> (sympy, section 1);</li>
<li><strong>an independent numeric route</strong>: pymrm’s <code>newton</code> on a <code>NumJac((1,1))</code> Jacobian root-finding <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%5Cln%20r/%5Cmathrm%7Bd%7D%5Cln%20x%20=%200"> on the <em>numpy-coded</em> law — sharing no algebra with the closed form;</li>
<li><strong>the unit test the printed condition fails</strong>: a physical condition must not care whether concentration is in mol/L or mol/m³. The derived condition gives the same physical <img src="https://latex.codecogs.com/png.latex?c_A%5E*"> in both unit systems (ratio 1); the printed one moves it by the square of the unit factor.</li>
</ol>
<div id="80e07c44" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:52.572836Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:52.572606Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:53.688422Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:53.687561Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The maximum: closed form vs pymrm-newton root, then the unit-invariance test."""</span></span>
<span id="cb10-2">BETA_M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb10-3">xstar_closed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_M</span>
<span id="cb10-4"></span>
<span id="cb10-5">g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> xv: slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: r_lh(u, b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>BETA_M), xv)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># d ln r / d ln x, numpy law</span></span>
<span id="cb10-6">jac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb10-7">z <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> zz: jac(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: np.array([[g(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])))]]), zz),</span>
<span id="cb10-8">           np.array([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]]), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># unknown is ln x</span></span>
<span id="cb10-9">xstar_newton <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.asarray(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(z, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, z), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb10-10">xstar_brent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: g(np.exp(t)), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>))</span>
<span id="cb10-11"></span>
<span id="cb10-12">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxloc_xstar_beta03"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> xstar_newton</span>
<span id="cb10-13">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxloc_closed_minus_newton_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(xstar_newton <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> xstar_closed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb10-14">newton_vs_brent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(xstar_newton <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> xstar_brent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># root-finder cross-check only</span></span>
<span id="cb10-15"></span>
<span id="cb10-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed condition, subjected to a unit rescale. Working values:</span></span>
<span id="cb10-17">KA_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># L/mol - arbitrary; the test varies the units itself</span></span>
<span id="cb10-18">lam <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mol/L -&gt; mol/m3: c' = lam*c, K' = K/lam</span></span>
<span id="cb10-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># derived condition K_A c_A = 1 + beta: physical c* in mol/m3, computed in each system</span></span>
<span id="cb10-20">c_derived_L  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> KA_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># solved in L/mol units, converted</span></span>
<span id="cb10-21">c_derived_m3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (KA_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># solved directly in m3 units</span></span>
<span id="cb10-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed condition c_A = K_A, read literally in each system, converted to mol/m3</span></span>
<span id="cb10-23">c_printed_L  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KA_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lam</span>
<span id="cb10-24">c_printed_m3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KA_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lam</span>
<span id="cb10-25">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"derived_maxcond_unit_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c_derived_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c_derived_m3</span>
<span id="cb10-26">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_maxcond_unit_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c_printed_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> c_printed_m3</span>
<span id="cb10-27"></span>
<span id="cb10-28">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxloc_closed_minus_newton_rel"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'maxloc_closed_minus_newton_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb10-29">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"adopt the printed condition c_A = K_A (in mol/L working units)"</span>,</span>
<span id="cb10-30">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(KA_L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>KA_L<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>BETA_M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb10-31">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed condition misses the root-found maximum by O(1), and by a "</span></span>
<span id="cb10-32">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"different O(1) in any other unit system"</span>))</span>
<span id="cb10-33">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_maxcond_unit_ratio"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed_maxcond_unit_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb10-34">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same rescale applied to the DERIVED condition"</span>,</span>
<span id="cb10-35">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'derived_maxcond_unit_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb10-36">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lam^2 vs 1: only the derived condition is unit-invariant"</span>))</span>
<span id="cb10-37"></span>
<span id="cb10-38">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xstar"</span>, xstar_newton)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nvb"</span>, newton_vs_brent)</span>
<span id="cb10-39">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb10-40"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Closed form: $K_Ac_A^* = 1+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>xstar_closed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. Independent numeric</span></span>
<span id="cb10-41"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">route (pymrm `newton` on the numpy law): $K_Ac_A^* =</span></span>
<span id="cb10-42"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>xstar_newton<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ — relative gap</span></span>
<span id="cb10-43"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'maxloc_closed_minus_newton_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (a genuinely independent second</span></span>
<span id="cb10-44"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">computation of this headline; the additional Brent solve agrees with newton</span></span>
<span id="cb10-45"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>newton_vs_brent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, a root-finder cross-check only, since it shares the</span></span>
<span id="cb10-46"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">objective). Unit test: rescaling mol/L → mol/m³ moves the physical $c_A^*$</span></span>
<span id="cb10-47"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">implied by the printed condition by a factor</span></span>
<span id="cb10-48"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'printed_maxcond_unit_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** $= </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lambda^2$, while the derived</span></span>
<span id="cb10-49"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">condition's ratio is **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'derived_maxcond_unit_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**. The printed</span></span>
<span id="cb10-50"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"c$_A$ = K$_A$" is reported as a defect and left as printed; the reduced-form</span></span>
<span id="cb10-51"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reading $K_Ac_A = 1$ is an inference, labelled as such."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Closed form: <img src="https://latex.codecogs.com/png.latex?K_Ac_A%5E*%20=%201+%5Cbeta%20=%201.3">. Independent numeric route (pymrm <code>newton</code> on the numpy law): <img src="https://latex.codecogs.com/png.latex?K_Ac_A%5E*%20=%0A1.300000000063"> — relative gap <strong>4.83e-11</strong> (a genuinely independent second computation of this headline; the additional Brent solve agrees with newton to 7.5e-11, a root-finder cross-check only, since it shares the objective). Unit test: rescaling mol/L → mol/m³ moves the physical <img src="https://latex.codecogs.com/png.latex?c_A%5E*"> implied by the printed condition by a factor <strong>1e+06</strong> <img src="https://latex.codecogs.com/png.latex?=%20%5Clambda%5E2">, while the derived condition’s ratio is <strong>1</strong>. The printed “c<img src="https://latex.codecogs.com/png.latex?_A"> = K<img src="https://latex.codecogs.com/png.latex?_A">” is reported as a defect and left as printed; the reduced-form reading <img src="https://latex.codecogs.com/png.latex?K_Ac_A%20=%201"> is an inference, labelled as such.</p>
</div>
</div>
</section>
<section id="the-3c-3b-degeneracy-sharpened" class="level3">
<h3 class="anchored" data-anchor-id="the-3c-3b-degeneracy-sharpened">4. The (3c)-(3b) degeneracy, sharpened</h3>
<p>The paper warns that with <img src="https://latex.codecogs.com/png.latex?K_Bc_B%20%5Cll%201"> Eq. (3c) “becomes equal to” Eq. (3b) “and it looks as if an L-R reaction takes place”. Two sharpenings, both following from the algebra:</p>
<ul>
<li><strong>Along a <img src="https://latex.codecogs.com/png.latex?c_A">-sweep at fixed <img src="https://latex.codecogs.com/png.latex?c_B"> the degeneracy is exact at <em>any</em> <img src="https://latex.codecogs.com/png.latex?%5Cbeta">, not only for <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20%5Cll%201">:</strong> <img src="https://latex.codecogs.com/png.latex?r_%7B3c%7D/r_%7B3b%7D%20=%20K_B/(1+%5Cbeta)">, independent of <img src="https://latex.codecogs.com/png.latex?c_A"> — and a fitted rate constant absorbs any constant. A kinetic study that varies only the chemisorbing species’ concentration <strong>cannot distinguish non-competing dual-site L-H from the impact law, no matter how wide the range</strong>. (Strictly, “becomes equal” also needs the rate constant reinterpreted, <img src="https://latex.codecogs.com/png.latex?k_%7B3b%7D%20=%20k_%7B3c%7DK_B"> — the paper’s operational meaning, since <img src="https://latex.codecogs.com/png.latex?k"> is fitted.)</li>
<li><strong>The discriminating direction is <img src="https://latex.codecogs.com/png.latex?c_B"></strong>, where the two laws’ orders differ by <img src="https://latex.codecogs.com/png.latex?%5Cbeta/(1+%5Cbeta)"> — first order exactly (3b) against <img src="https://latex.codecogs.com/png.latex?1-%5Cbeta/(1+%5Cbeta)"> (3c).</li>
</ul>
<div id="b7459726" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:53.690525Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:53.690375Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:53.695632Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:53.694904Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The exact proportionality (structural identity) and its above-floor companion."""</span></span>
<span id="cb11-2">xg2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2001</span>)</span>
<span id="cb11-3">BETA_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span></span>
<span id="cb11-4">ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (xg2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BETA_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xg2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_D))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (xg2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> BETA_D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> xg2))</span>
<span id="cb11-5">sup_dev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> BETA_D) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb11-6">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deg3c3b_sup_dev_fixed_cB"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sup_dev     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exact 0 in exact arithmetic - STRUCTURAL</span></span>
<span id="cb11-7"></span>
<span id="cb11-8">gap3c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> bv: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> bv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bv)), BETA_D)</span>
<span id="cb11-9">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deg3c3b_orderB_gap_beta03"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gap3c</span>
<span id="cb11-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(gap3c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BETA_D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>BETA_D)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span></span>
<span id="cb11-11"></span>
<span id="cb11-12">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sup_dev"</span>, sup_dev)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap3c"</span>, gap3c)</span>
<span id="cb11-13">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb11-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Sup over six decades of $c_A$ of the deviation of $r_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">3c</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(1+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta)/K_B$</span></span>
<span id="cb11-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">from $r_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">3b</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$: **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sup_dev<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** — an identity, named as one: it is zero by</span></span>
<span id="cb11-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">algebra, sits below CI's ABS_FLOOR (1e-12), and can catch nothing but a slip</span></span>
<span id="cb11-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">in this cell. Its companion that *can* fail: the order-in-B gap at</span></span>
<span id="cb11-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_D<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, measured **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap3c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** against the analytic</span></span>
<span id="cb11-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta/(1+</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beta) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BETA_D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>BETA_D)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ — the size of the only</span></span>
<span id="cb11-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">kinetic signal separating (3c) from the impact law."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Sup over six decades of <img src="https://latex.codecogs.com/png.latex?c_A"> of the deviation of <img src="https://latex.codecogs.com/png.latex?r_%7B3c%7D(1+%5Cbeta)/K_B"> from <img src="https://latex.codecogs.com/png.latex?r_%7B3b%7D">: <strong>2.2e-16</strong> — an identity, named as one: it is zero by algebra, sits below CI’s ABS_FLOOR (1e-12), and can catch nothing but a slip in this cell. Its companion that <em>can</em> fail: the order-in-B gap at <img src="https://latex.codecogs.com/png.latex?%5Cbeta%20=%200.3">, measured <strong>0.230769</strong> against the analytic <img src="https://latex.codecogs.com/png.latex?%5Cbeta/(1+%5Cbeta)%20=%200.230769"> — the size of the only kinetic signal separating (3c) from the impact law.</p>
</div>
</div>
</section>
<section id="how-wide-a-concentration-range-before-the-laws-separate-root-found" class="level3">
<h3 class="anchored" data-anchor-id="how-wide-a-concentration-range-before-the-laws-separate-root-found">5. How wide a concentration range before the laws separate? Root-found</h3>
<p>The paper (p.&nbsp;719): “If one could vary the concentration of A over a wide range, it would be possible to distinguish between the two mechanisms. Unfortunately, concentrations can often only be varied in a limited range in the liquid phase. In such a case, the R² factor for one model may be better than for the other, but the question if one of the two models can be rejected remains unanswered.”</p>
<p>This section turns that paragraph into a number. Take <strong>noiseless</strong> rates from the L-H law (reduced 3a) on a log-window of <img src="https://latex.codecogs.com/png.latex?x"> of total span <img src="https://latex.codecogs.com/png.latex?w"> centred on the L-H maximum <img src="https://latex.codecogs.com/png.latex?x=1"> (the most discriminating placement — the L-R law is monotone and can never turn over), give the impact law its best fit (<img src="https://latex.codecogs.com/png.latex?%5Cln%20k'"> and <img src="https://latex.codecogs.com/png.latex?K'"> free), and define the misfit <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bdev%7D(w)"> as the <strong>mean absolute log-deviation</strong> on the window (≈ mean relative deviation, the same scale as the 1947 fit’s famous ±8.44 %). The identifiability threshold <img src="https://latex.codecogs.com/png.latex?w%5E*"> solves $(w^*) = $ tolerance — root-found with Brent, never read off a sweep.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bdev%7D(w)"> is computed by <strong>two routes sharing only the metric’s definition</strong> (a fixed 401-point log grid): (A) joint 2-D Nelder-Mead over <img src="https://latex.codecogs.com/png.latex?(%5Cln%20k',%20%5Cln%20K')"> from three fixed starts; (B) the exact median-profile of <img src="https://latex.codecogs.com/png.latex?%5Cln%20k'"> (for mean-abs the optimal intercept is the residual median) followed by 1-D bounded Brent over <img src="https://latex.codecogs.com/png.latex?%5Cln%20K'"> — different search space, different optimizer family, no shared iteration.</p>
<div id="80cc35da" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:53.697774Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:53.697450Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:57.992925Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:57.992096Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""dev(w) two ways, w* root-found at three tolerances, small-window law measured."""</span></span>
<span id="cb12-2">NW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">401</span>                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the metric's definition grid (refined below)</span></span>
<span id="cb12-3"></span>
<span id="cb12-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _window(w, x0, n):</span>
<span id="cb12-5">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(w)</span>
<span id="cb12-6">    xv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> x0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(t)</span>
<span id="cb12-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> xv, np.log(xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log1p(xv)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ln r of reduced Eq. (3a)</span></span>
<span id="cb12-8"></span>
<span id="cb12-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dev_A(w, x0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NW):</span>
<span id="cb12-10">    xv, lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _window(w, x0, n)</span>
<span id="cb12-11">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> obj(p):</span>
<span id="cb12-12">        lnk, lnq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p</span>
<span id="cb12-13">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.mean(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lnk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.log(xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log1p(np.exp(lnq) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lr))</span>
<span id="cb12-14">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>((minimize(obj, s0, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nelder-Mead"</span>,</span>
<span id="cb12-15">                         options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, fatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40000</span>))</span>
<span id="cb12-16">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>])),</span>
<span id="cb12-17">               key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: r.fun)</span>
<span id="cb12-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> best.fun</span>
<span id="cb12-19"></span>
<span id="cb12-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dev_B(w, x0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NW):</span>
<span id="cb12-21">    xv, lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _window(w, x0, n)</span>
<span id="cb12-22">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> g(lnq):</span>
<span id="cb12-23">        e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log(xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log1p(np.exp(lnq) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xv))</span>
<span id="cb12-24">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.mean(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.median(e)))         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exact profile of ln k'</span></span>
<span id="cb12-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> minimize_scalar(g, bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb12-26">                           options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)).fun</span>
<span id="cb12-27"></span>
<span id="cb12-28">TOL_BOOK, TOL_5, TOL_RATE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0844</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.169</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed +-8.44 %; 5 %; C1.1's measured rate-space scatter</span></span>
<span id="cb12-29">wstar_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: dev_A(w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TOL_BOOK, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb12-30">wstar_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: dev_B(w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TOL_BOOK, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb12-31">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> wstar_A</span>
<span id="cb12-32">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844_two_routes_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(wstar_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> wstar_B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb12-33">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol5"</span>]   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: dev_A(w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TOL_5, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb12-34">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol169"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: dev_A(w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TOL_RATE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50000</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>)</span>
<span id="cb12-35">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844_grid_refined_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb12-36">    brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: dev_B(w, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1601</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TOL_BOOK, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> wstar_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb12-37"></span>
<span id="cb12-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the small-window law: dev ~ C (ln w)^2, constant MEASURED (not derived)</span></span>
<span id="cb12-39">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smallw_quad_const"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev_B(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb12-40"></span>
<span id="cb12-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows</span></span>
<span id="cb12-42">dev_center_001 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev_A(wstar_A, x0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb12-43">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb12-44">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"window centred at x0 = 0.01, where both laws are first order"</span>,</span>
<span id="cb12-45">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dev(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dev_center_001<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TOL_BOOK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb12-46">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the misfit collapses: away from the maximum the laws are degenerate "</span></span>
<span id="cb12-47">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and w* explodes - placement matters as much as width"</span>))</span>
<span id="cb12-48"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dev_minimax(w, x0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NW):</span>
<span id="cb12-49">    xv, lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _window(w, x0, n)</span>
<span id="cb12-50">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> obj(p):</span>
<span id="cb12-51">        lnk, lnq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p</span>
<span id="cb12-52">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lnk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.log(xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log1p(np.exp(lnq) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lr))</span>
<span id="cb12-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>((minimize(obj, s0, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nelder-Mead"</span>,</span>
<span id="cb12-54">                         options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, fatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, maxiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40000</span>))</span>
<span id="cb12-55">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], [<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>], [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>])),</span>
<span id="cb12-56">               key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: r.fun).fun</span>
<span id="cb12-57">wstar_mm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> w: dev_minimax(w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TOL_BOOK, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>)</span>
<span id="cb12-58">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb12-59">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"worst-case (minimax) misfit instead of mean-abs"</span>,</span>
<span id="cb12-60">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_mm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb12-61">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves: the threshold depends on the misfit norm - declared, and the "</span></span>
<span id="cb12-62">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean-abs norm is kept because it matches the 1947 +-8.44 % metric"</span>))</span>
<span id="cb12-63"></span>
<span id="cb12-64">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dev_at_wstar_center001"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dev_center_001</span>
<span id="cb12-65">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstarA"</span>, wstar_A)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar5"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol5"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar169"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol169"</span>])</span>
<span id="cb12-66">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_mm"</span>, wstar_mm)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smallwC"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smallw_quad_const"</span>])</span>
<span id="cb12-67">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb12-68"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**$w^* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$** at the ±8.44 % tolerance (routes A and B agree to</span></span>
<span id="cb12-69"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'wstar_tol844_two_routes_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; refining the definition grid 401 →</span></span>
<span id="cb12-70"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">1601 moves it </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'wstar_tol844_grid_refined_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): the chemisorbing</span></span>
<span id="cb12-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">species' concentration must span a factor of **about </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> — just</span></span>
<span id="cb12-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">over a decade — centred on the L-H maximum** before the best impact-law fit</span></span>
<span id="cb12-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">misses noiseless L-H rates by more than the 1947 fit's printed ±8.44 %</span></span>
<span id="cb12-74"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">average deviation (its transformed-space metric, used here as a</span></span>
<span id="cb12-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">representative classic-fit precision). At 5 %:</span></span>
<span id="cb12-76"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$w^* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'wstar_tol5'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$; at `C1.1`'s measured **rate-space**</span></span>
<span id="cb12-77"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">scatter of 16.9 %: $w^* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'wstar_tol169'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. Small windows obey</span></span>
<span id="cb12-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">dev</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">approx C(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ln w)^2$ with measured</span></span>
<span id="cb12-79"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$C = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'smallw_quad_const'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ (a measured constant, not a derived one).</span></span>
<span id="cb12-80"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Centre the window where both laws are first order and the number collapses</span></span>
<span id="cb12-81"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(break table) — **width buys nothing without curvature**, which is the</span></span>
<span id="cb12-82"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quantitative content of the paper's "limited range" warning."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong><img src="https://latex.codecogs.com/png.latex?w%5E*%20=%2011.75"></strong> at the ±8.44 % tolerance (routes A and B agree to 1.8e-11; refining the definition grid 401 → 1601 moves it 4.6e-03): the chemisorbing species’ concentration must span a factor of <strong>about 12 — just over a decade — centred on the L-H maximum</strong> before the best impact-law fit misses noiseless L-H rates by more than the 1947 fit’s printed ±8.44 % average deviation (its transformed-space metric, used here as a representative classic-fit precision). At 5 %: <img src="https://latex.codecogs.com/png.latex?w%5E*%20=%206.37">; at <code>C1.1</code>’s measured <strong>rate-space</strong> scatter of 16.9 %: <img src="https://latex.codecogs.com/png.latex?w%5E*%20=%2040.0">. Small windows obey <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bdev%7D%20%5Capprox%20C(%5Cln%20w)%5E2"> with measured <img src="https://latex.codecogs.com/png.latex?C%20=%200.0157"> (a measured constant, not a derived one). Centre the window where both laws are first order and the number collapses (break table) — <strong>width buys nothing without curvature</strong>, which is the quantitative content of the paper’s “limited range” warning.</p>
</div>
</div>
<div id="19cc6a54" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:57.995556Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:57.995349Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:58.671412Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:58.670590Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Figure 2: the identifiability window."""</span></span>
<span id="cb13-2">wg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(np.log10(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>), np.log10(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>)</span>
<span id="cb13-3">dv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([dev_B(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> wg])</span>
<span id="cb13-4">dv001 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([dev_B(w, x0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> wg])</span>
<span id="cb13-5">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.8</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>))</span>
<span id="cb13-6">ax.loglog(wg, dv, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dev(w), window centred on the L-H maximum"</span>)</span>
<span id="cb13-7">ax.loglog(wg, dv001, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>,</span>
<span id="cb13-8">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dev(w), centred at $x_0=0.01$ (both laws first order)"</span>)</span>
<span id="cb13-9">ax.loglog(wg, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smallw_quad_const"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(wg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>,</span>
<span id="cb13-10">          label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measured small-window law $C(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ln w)^2$"</span>)</span>
<span id="cb13-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tol, lab, ws <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((TOL_BOOK, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"±8.44 % (1947 fit)"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844"</span>]),</span>
<span id="cb13-12">                     (TOL_RATE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"16.9 % (rate-space scatter, C1.1)"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol169"</span>])):</span>
<span id="cb13-13">    ax.axhline(tol, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.8"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb13-14">    ax.plot([ws], [tol], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb13-15">    ax.annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$w^*$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ws<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, xy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(ws, tol), xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(ws<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.35</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb13-16">                fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(arrowstyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>))</span>
<span id="cb13-17">ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"total span $w$ of $K_Ac_A$ (log window)"</span>)</span>
<span id="cb13-18">ax.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"best impact-law misfit to noiseless L-H rates</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">(mean abs log-deviation)"</span>)</span>
<span id="cb13-19">ax.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"How wide before Eq. (3b) can be rejected — Prins's p. 719 paragraph, quantified"</span>,</span>
<span id="cb13-20">             fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb13-21">ax.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both"</span>)</span>
<span id="cb13-22">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/C1.2-eley-rideal/index_files/figure-html/cell-11-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-impact-law-on-the-founding-lhhw-dataset-a-numerical-experiment" class="level3">
<h3 class="anchored" data-anchor-id="the-impact-law-on-the-founding-lhhw-dataset-a-numerical-experiment">6. The impact law on the founding LHHW dataset — a numerical experiment</h3>
<p>Everything above is dimensionless. This section instantiates both laws with <strong>real fitted constants imported from <code>C1.1</code></strong> — the codimer hydrogenation of Hougen &amp; Watson (1947), the dataset on which LHHW estimation was founded — and asks the question this page’s two sources jointly pose: <strong>could the founding dataset have rejected the impact mechanism on fit quality?</strong></p>
<p>The book’s own 18 candidate mechanisms already <em>include</em> impact forms: its groups III-V are gas-phase reactant against adsorbed partner, and its mechanism <strong>(o)</strong>, <img src="https://latex.codecogs.com/png.latex?r%20=%20k'K_Up_Up_H/(1+K_Up_U+K_Sp_S)">, is <strong>exactly Prins’s Eq. (3b)</strong> instantiated for chemisorbed codimer (with the product’s adsorption term retained) and colliding H₂ — hydrogen in the numerator only. The book rejected (o) by its <strong>sign test</strong> (its printed verdict in Table D: <code>f0;apos</code> — a term that should be absent is fitted nonzero), not by fit quality. Two cautions from <code>C1.1</code>, honoured here: the printed 200 °C rows of the impact mechanisms sit in the <strong>corrupted-worksheet family</strong>, so their printed constants are never used (everything is refitted from Table A); and <code>C1.1</code> showed the “a should be positive” ground itself partly rests on the corrupted sum, while the acceptance set {d, h} survives.</p>
<p><strong>All of this is fit data and numerical experiment — no validation.</strong> The fitting method is <code>C1.1</code>’s (relative residuals in rate space, log-reparameterised positive constants, three fixed deterministic starts, Levenberg-Marquardt).</p>
<div id="4a7282a7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:58.673828Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:58.673628Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:58.692931Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:58.692207Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Load C1.1's tables, rebuild mechanism (d)'s constants, reconcile with the book."""</span></span>
<span id="cb14-2">A  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hougen-watson-1947-tableA-rates.csv"</span>,       page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1.1-lhhw-hougen-watson"</span>)</span>
<span id="cb14-3">TC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hougen-watson-1947-tableC-mechd-200C.csv"</span>,  page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1.1-lhhw-hougen-watson"</span>)</span>
<span id="cb14-4">TC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TC[TC.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>).astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># drop repeated header row</span></span>
<span id="cb14-5">DEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hougen-watson-1947-tablesDEF-constants.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1.1-lhhw-hougen-watson"</span>)</span>
<span id="cb14-6"></span>
<span id="cb14-7">o_row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DEF[(DEF.mechanism <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DEF.temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb14-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed 200 C verdict for the impact mechanism (o):"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(o_row.verdict),</span>
<span id="cb14-9">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"- printed constants in the corrupted family (C1.1), NOT used; refitted from Table A below"</span>)</span>
<span id="cb14-10"></span>
<span id="cb14-11">d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DEF[(DEF.mechanism <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DEF.temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the CLEAN row (C1.1)</span></span>
<span id="cb14-12">a_, b_, c_, f_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d.a), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d.b), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d.c), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(d.f)</span>
<span id="cb14-13">KU, KS, KH, kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_, c_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_, f_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># C1.1's conversion (eq. n)</span></span>
<span id="cb14-14">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_KU_per_atm"</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_KH_per_atm"</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_KS_per_atm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> KU, KH, KS</span>
<span id="cb14-15"></span>
<span id="cb14-16">blk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A[A.temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>].reset_index(drop<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb14-17">H, U, S, robs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (blk[k].to_numpy() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH_atm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pU_atm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pS_atm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_lbmol_per_lb_hr"</span>))</span>
<span id="cb14-18"></span>
<span id="cb14-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reconciliation with the book's own printed Table C (loaded, never retyped):</span></span>
<span id="cb14-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R_calc = a + b pU + c pS + f pH must reproduce the printed column</span></span>
<span id="cb14-21">Rcalc_mine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> f_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> H</span>
<span id="cb14-22">cmp_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>: blk.run, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_calc_mine"</span>: Rcalc_mine}).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>)</span>
<span id="cb14-23">cmp_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"R_calc_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TC.R_calc_printed</span>
<span id="cb14-24">cmp_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (cmp_.R_calc_mine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cmp_.R_calc_printed).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb14-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cmp_.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>).to_string())</span>
<span id="cb14-26">gap_ex25a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cmp_.drop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"25a"</span>).abs_gap.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb14-27">gap_25a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cmp_.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"25a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_gap"</span>]</span>
<span id="cb14-28">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_Rcalc_vs_tableC_max_abs_ex25a"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gap_ex25a</span>
<span id="cb14-29">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_25a_abs_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gap_25a</span>
<span id="cb14-30">Rcalc_broken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> c_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> f_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> H   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the b-column a wrong K_U = a/b implies</span></span>
<span id="cb14-31">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_Rcalc_vs_tableC_max_abs_ex25a"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_ex25a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-32">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"invert the conversion: K_U = a/b instead of b/a"</span>,</span>
<span id="cb14-33">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Rcalc_broken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TC.loc[cmp_.index].R_calc_printed.to_numpy())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-34">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves by orders: the reconciliation would have caught a wrong conversion"</span>))</span>
<span id="cb14-35">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_Rcalc_vs_tableC_max_abs_ex25a"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_ex25a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-36">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"include run 25a's printed R_calc"</span>,</span>
<span id="cb14-37">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cmp_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>abs_gap<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb14-38">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run 25a's printed 5.40 is C1.1's documented digit slip (its own row requires "</span></span>
<span id="cb14-39">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.90); this page's gap reproduces that finding independently"</span>))</span>
<span id="cb14-40"></span>
<span id="cb14-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the book's printed fit-quality columns, recomputed from the loaded table</span></span>
<span id="cb14-42">avg_pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TC.pct_delta_printed.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().mean()</span>
<span id="cb14-43">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_tableC_avg_abs_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> avg_pct</span>
<span id="cb14-44"></span>
<span id="cb14-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rate-space scatter of the fitted d law vs the measured rates</span></span>
<span id="cb14-46">r_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb14-47">scatter <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> robs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).mean()</span>
<span id="cb14-48">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_d_scatter_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> scatter</span>
<span id="cb14-49"></span>
<span id="cb14-50">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KU"</span>, KU)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KH"</span>, KH)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"KS"</span>, KS)</span>
<span id="cb14-51">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap_ex25a"</span>, gap_ex25a)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap25a"</span>, gap_25a)</span>
<span id="cb14-52">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg_pct"</span>, avg_pct)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"scatter"</span>, scatter)</span>
<span id="cb14-53">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb14-54"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Mechanism (d) at 200 °C from Table D's clean row: $K_U = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KU<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$,</span></span>
<span id="cb14-55"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$K_S = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, $K_H = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ atm⁻¹. Reconciliation against the book's</span></span>
<span id="cb14-56"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">own printed Table C: worst $|R_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">calc</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">|$ gap **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_ex25a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** over 11 of</span></span>
<span id="cb14-57"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">12 runs (the book prints 2-3 decimals; `C1.1`'s constants-reproduction metric</span></span>
<span id="cb14-58"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">is 0.6 %) — and **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_25a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** on run 25a, independently reproducing</span></span>
<span id="cb14-59"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`C1.1`'s finding that 25a's printed 5.40 is a digit slip for 5.90. The</span></span>
<span id="cb14-60"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed per-run columns give mean |Δ| = **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>avg_pct<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** in transformed</span></span>
<span id="cb14-61"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$R$-space (the book prints ±8.44; `C1.1` recomputes 8.42 from the data);</span></span>
<span id="cb14-62"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the same fit scatters **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>scatter<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** in rate space (`C1.1` publishes</span></span>
<span id="cb14-63"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">16.86 % — same quantity, reconciled). That rate-space scatter is the</span></span>
<span id="cb14-64"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">noise floor every discrimination claim below is judged against."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>printed 200 C verdict for the impact mechanism (o): 'f0;apos' - printed constants in the corrupted family (C1.1), NOT used; refitted from Table A below
      R_calc_mine  R_calc_printed  abs_gap
run                                       
1d         3.9707            3.97   0.0007
3c         6.8651            6.86   0.0051
3d         6.8596            6.86   0.0004
10a        6.6182            6.62   0.0018
11a        4.6266            4.63   0.0034
11d        4.6168            4.62   0.0032
11e        4.6226            4.62   0.0026
12ab       4.1818            4.18   0.0018
14a        7.8460            7.84   0.0060
14b        7.8134            7.81   0.0034
25a        5.9031            5.40   0.5031
28b        5.7506            5.75   0.0006</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Mechanism (d) at 200 °C from Table D’s clean row: <img src="https://latex.codecogs.com/png.latex?K_U%20=%200.5543">, <img src="https://latex.codecogs.com/png.latex?K_S%20=%200.3659">, <img src="https://latex.codecogs.com/png.latex?K_H%20=%200.4094"> atm⁻¹. Reconciliation against the book’s own printed Table C: worst <img src="https://latex.codecogs.com/png.latex?%7CR_%7Bcalc%7D%7C"> gap <strong>0.0060</strong> over 11 of 12 runs (the book prints 2-3 decimals; <code>C1.1</code>’s constants-reproduction metric is 0.6 %) — and <strong>0.503</strong> on run 25a, independently reproducing <code>C1.1</code>’s finding that 25a’s printed 5.40 is a digit slip for 5.90. The printed per-run columns give mean |Δ| = <strong>8.44 %</strong> in transformed <img src="https://latex.codecogs.com/png.latex?R">-space (the book prints ±8.44; <code>C1.1</code> recomputes 8.42 from the data); the same fit scatters <strong>16.8 %</strong> in rate space (<code>C1.1</code> publishes 16.86 % — same quantity, reconciled). That rate-space scatter is the noise floor every discrimination claim below is judged against.</p>
</div>
</div>
<div id="3f3694c5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:58.694792Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:58.694611Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:58.740450Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:58.739754Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The power study: can fit quality reject the impact law on this design?</span></span>
<span id="cb16-2"></span>
<span id="cb16-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">NUMERICAL EXPERIMENT, not data: noiseless rates are generated from the fitted</span></span>
<span id="cb16-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">mechanism (d) at the 12 printed 200 C compositions and refitted by the impact</span></span>
<span id="cb16-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">forms. C1.1 ran the same protocol for d-vs-h (its power metric: 3.6 %).</span></span>
<span id="cb16-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb16-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> fit_form(form, npar, Hv, Uv, Sv, target):</span>
<span id="cb16-8">    res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> lp: (form(np.exp(lp), Hv, Uv, Sv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> target) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> target</span>
<span id="cb16-9">    best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>((least_squares(res, x0, method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lm"</span>, max_nfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40000</span>)</span>
<span id="cb16-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x0 <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (np.zeros(npar), np.full(npar, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), np.full(npar, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))),</span>
<span id="cb16-11">               key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: s.cost)</span>
<span id="cb16-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(best.x), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(best.fun)</span>
<span id="cb16-13"></span>
<span id="cb16-14">o_form  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p, Hv, Uv, Sv: p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Sv)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prins Eq. (3b) == mech (o)</span></span>
<span id="cb16-15">p_form  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p, Hv, Uv, Sv: p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv)                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (3b) without the product term</span></span>
<span id="cb16-16">o4_form <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p, Hv, Uv, Sv: p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Sv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hv)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># first power, H term allowed</span></span>
<span id="cb16-17">d_form  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p, Hv, Uv, Sv: p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Uv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Sv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-18"></span>
<span id="cb16-19">r_exact <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> H <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noiseless d-rates</span></span>
<span id="cb16-20"></span>
<span id="cb16-21">_, pct_o  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(o_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, H, U, S, r_exact)</span>
<span id="cb16-22">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_mean_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_o.mean()</span>
<span id="cb16-23">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_max_pct"</span>]  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_o.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb16-24"></span>
<span id="cb16-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second route for this headline: direct positive parameters, bounded trust-region</span></span>
<span id="cb16-26">resB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: (o_form(p, H, U, S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> r_exact) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r_exact</span>
<span id="cb16-27">sB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> least_squares(resB, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, np.inf),</span>
<span id="cb16-28">                   method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"trf"</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, ftol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, gtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, max_nfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60000</span>)</span>
<span id="cb16-29">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_fit_two_routes_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pct_o.mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sB.fun).mean()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb16-30"></span>
<span id="cb16-31">_, pct_p  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(p_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, H, U, S, r_exact)</span>
<span id="cb16-32">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_p_on_exact_d_mean_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_p.mean()</span>
<span id="cb16-33">_, pct_o4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(o4_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, H, U, S, r_exact)</span>
<span id="cb16-34">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_oKH_on_exact_d_mean_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_o4.mean()</span>
<span id="cb16-35">Hc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.full_like(H, H.mean())</span>
<span id="cb16-36">r_coll <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> Hc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb16-37">_, pct_coll <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(o_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, Hc, U, S, r_coll)</span>
<span id="cb16-38">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_collapsedpH_mean_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_coll.mean()</span>
<span id="cb16-39"></span>
<span id="cb16-40">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_mean_pct"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb16-41">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"allow a K_H p_H term in the first-power denominator"</span>,</span>
<span id="cb16-42">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb16-43">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collapses below the noise floor: the discriminating signal is hydrogen's "</span></span>
<span id="cb16-44">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ABSENCE from the adsorption group, not the denominator exponent"</span>))</span>
<span id="cb16-45">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_mean_pct"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb16-46">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collapse the design's p_H span to its mean (1 value instead of a decade)"</span>,</span>
<span id="cb16-47">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_coll<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb16-48">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collapses below the noise floor: without the decade-wide p_H span the "</span></span>
<span id="cb16-49">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"founding design could not reject the impact law either"</span>))</span>
<span id="cb16-50">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_mean_pct"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb16-51">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop the product term K_S p_S (Prins's bare Eq. 3b)"</span>,</span>
<span id="cb16-52">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb16-53">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves up: the product-inhibition signal is real (C1.1 found the same on "</span></span>
<span id="cb16-54">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mechanism d)"</span>))</span>
<span id="cb16-55"></span>
<span id="cb16-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and against the MEASURED rates - a fit-quality comparison the book's printed</span></span>
<span id="cb16-57"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># tables do not make (per C1.1's reading: the sign requirement, not goodness of</span></span>
<span id="cb16-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># fit, is the book's discriminator; Table C evaluates mechanism d only)</span></span>
<span id="cb16-59">_, pct_d_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(d_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, H, U, S, robs)</span>
<span id="cb16-60">_, pct_o_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(o_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, H, U, S, robs)</span>
<span id="cb16-61">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lh_d_measured_mean_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_d_meas.mean()</span>
<span id="cb16-62">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_measured_mean_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_o_meas.mean()</span>
<span id="cb16-63">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_gap_measured_pct_points"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct_o_meas.mean() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pct_d_meas.mean()</span>
<span id="cb16-64"></span>
<span id="cb16-65">pH_span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> H.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> H.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()</span>
<span id="cb16-66">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pcto"</span>, pct_o.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pcto_max"</span>, pct_o.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pcto4"</span>, pct_o4.mean())</span>
<span id="cb16-67">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pctcoll"</span>, pct_coll.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pctp"</span>, pct_p.mean())</span>
<span id="cb16-68">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pctd_meas"</span>, pct_d_meas.mean())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pcto_meas"</span>, pct_o_meas.mean())</span>
<span id="cb16-69">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pH_span"</span>, pH_span)</span>
<span id="cb16-70">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb16-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**The impact law misses noiseless L-H rates by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % mean</span></span>
<span id="cb16-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % worst) over the design, at the least-squares-optimal</span></span>
<span id="cb16-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">fit** (the declared protocol; two optimizer families agree to</span></span>
<span id="cb16-74"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lr_o_fit_two_routes_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> — directly minimising mean-|Δ| instead</span></span>
<span id="cb16-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gives a smaller number, conclusion unchanged) — far outside the</span></span>
<span id="cb16-76"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>scatter<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % rate-space scatter, so **fit quality alone could have</span></span>
<span id="cb16-77"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rejected Prins's Eq. (3b) on the founding dataset**, independently of the</span></span>
<span id="cb16-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sign test the book actually used. Against the measured rates: (d) fits to</span></span>
<span id="cb16-79"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_d_meas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, (o) to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o_meas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % — a gap of</span></span>
<span id="cb16-80"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lr_gap_measured_pct_points'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points (compare `C1.1`'s published</span></span>
<span id="cb16-81"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">d-vs-h gap of 0.4 points, and its 2.7-point gap to the best rejected</span></span>
<span id="cb16-82"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mechanism, both pooled over three temperatures).</span></span>
<span id="cb16-83"></span>
<span id="cb16-84"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**Why it works — and when it would not** (break table): allow hydrogen into</span></span>
<span id="cb16-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the first-power adsorption group and the misfit falls to</span></span>
<span id="cb16-86"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %; collapse the design's hydrogen span (a factor of</span></span>
<span id="cb16-87"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pH_span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 0.104-2.459 atm) to a single value and it falls to</span></span>
<span id="cb16-88"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_coll<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % — both below the noise floor. The founding design</span></span>
<span id="cb16-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">discriminates **only because hydrogen's partial pressure spans more than a</span></span>
<span id="cb16-90"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">decade — the same "wide range" requirement quantified as</span></span>
<span id="cb16-91"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$w^* </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">approx </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>wstar_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ in section 5.** A narrower design would have</span></span>
<span id="cb16-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">been as blind to the mechanism as Prins says liquid-phase studies are, and</span></span>
<span id="cb16-93"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the denominator's *exponent* (1 vs 2) is indistinguishable on this design at</span></span>
<span id="cb16-94"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the noise floor even with noiseless data (the first-power-with-K_H fit above</span></span>
<span id="cb16-95"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">still misses by a nonzero </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pct_o4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %) — consistent with `C1.1`'s</span></span>
<span id="cb16-96"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">finding that d and h (exponents 2 and 3) cannot be separated either."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The impact law misses noiseless L-H rates by 27.4 % mean (48 % worst) over the design, at the least-squares-optimal fit</strong> (the declared protocol; two optimizer families agree to 1.0e-06 — directly minimising mean-|Δ| instead gives a smaller number, conclusion unchanged) — far outside the 16.8 % rate-space scatter, so <strong>fit quality alone could have rejected Prins’s Eq. (3b) on the founding dataset</strong>, independently of the sign test the book actually used. Against the measured rates: (d) fits to 16.8 %, (o) to 26.6 % — a gap of 9.8 points (compare <code>C1.1</code>’s published d-vs-h gap of 0.4 points, and its 2.7-point gap to the best rejected mechanism, both pooled over three temperatures).</p>
<p><strong>Why it works — and when it would not</strong> (break table): allow hydrogen into the first-power adsorption group and the misfit falls to 3.3 %; collapse the design’s hydrogen span (a factor of 24, 0.104-2.459 atm) to a single value and it falls to 3.2 % — both below the noise floor. The founding design discriminates <strong>only because hydrogen’s partial pressure spans more than a decade — the same “wide range” requirement quantified as <img src="https://latex.codecogs.com/png.latex?w%5E*%20%5Capprox%2012"> in section 5.</strong> A narrower design would have been as blind to the mechanism as Prins says liquid-phase studies are, and the denominator’s <em>exponent</em> (1 vs 2) is indistinguishable on this design at the noise floor even with noiseless data (the first-power-with-K_H fit above still misses by a nonzero 3.3 %) — consistent with <code>C1.1</code>’s finding that d and h (exponents 2 and 3) cannot be separated either.</p>
</div>
</div>
<div id="5e1bac23" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:58.742612Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:58.742433Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:59.147703Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:59.146951Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The L-H maximum in the design window, instantiated - and figure 3."""</span></span>
<span id="cb17-2">pH0, pS0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span></span>
<span id="cb17-3">pUstar_closed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pH0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pS0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> KU</span>
<span id="cb17-4">gU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> pU: slope(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> u: kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pH0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pH0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pS0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, pU)</span>
<span id="cb17-5">z2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> zz: jac(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> q: np.array([[gU(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])))]]), zz),</span>
<span id="cb17-6">            np.array([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>]]), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb17-7">pUstar_newton <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.asarray(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">getattr</span>(z2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, z2), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).reshape(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb17-8">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_pUstar_atm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pUstar_newton</span>
<span id="cb17-9">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_pUstar_two_routes_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pUstar_newton <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pUstar_closed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb17-10">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pUstar"</span>, pUstar_newton)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pUmax_design"</span>, U.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb17-11"></span>
<span id="cb17-12">fig, (ax1, ax2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>))</span>
<span id="cb17-13">ax1.loglog(robs, r_d, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LH, mec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-H mechanism (d)"</span>)</span>
<span id="cb17-14">r_o_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o_form(fit_form(o_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, H, U, S, robs)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], H, U, S)</span>
<span id="cb17-15">ax1.loglog(robs, r_o_meas, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LR, mec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>,</span>
<span id="cb17-16">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"impact law (o) = Prins Eq. (3b)"</span>)</span>
<span id="cb17-17">lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> robs.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> robs.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb17-18">ax1.plot([lo, hi], [lo, hi], color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb17-19">ax1.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measured rate, lb-mol/(lb hr)"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax1.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fitted rate"</span>)</span>
<span id="cb17-20">ax1.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"parity on the 12 runs at 200 °C</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">(fit data - reproduction, not validation)"</span>,</span>
<span id="cb17-21">              fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb17-22">ax1.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax1.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, which<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both"</span>)</span>
<span id="cb17-23"></span>
<span id="cb17-24">pUg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb17-25">r_lh_pU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pH0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pUg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pH0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pUg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pS0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb17-26">po_x, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> fit_form(o_form, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, H, U, S, r_exact)</span>
<span id="cb17-27">r_lr_pU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o_form(po_x, np.full_like(pUg, pH0), pUg, np.full_like(pUg, pS0))</span>
<span id="cb17-28">ax2.plot(pUg, r_lh_pU, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LH, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L-H (d), fitted constants"</span>)</span>
<span id="cb17-29">ax2.plot(pUg, r_lr_pU, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LR, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"impact (o), best fit to (d)"</span>)</span>
<span id="cb17-30">ax2.plot([pUstar_newton], [np.interp(pUstar_newton, pUg, r_lh_pU)], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,</span>
<span id="cb17-31">         color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>C_LH, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb17-32">ax2.annotate(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"root-found maximum</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$p_U^*$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pUstar_newton<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm"</span>,</span>
<span id="cb17-33">             xy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(pUstar_newton, np.interp(pUstar_newton, pUg, r_lh_pU)),</span>
<span id="cb17-34">             xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_lh_pU.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>,</span>
<span id="cb17-35">             arrowprops<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(arrowstyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>))</span>
<span id="cb17-36">ax2.axvspan(U.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), U.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.92"</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb17-37">ax2.text(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (U.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> U.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.06</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_lh_pU.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"design range of $p_U$"</span>,</span>
<span id="cb17-38">         fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>, ha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"center"</span>)</span>
<span id="cb17-39">ax2.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$p_U$, atm  ($p_H$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.1f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">, $p_S$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.1f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm)"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span> (pH0, pS0))</span>
<span id="cb17-40">ax2.set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate, lb-mol/(lb hr)"</span>)</span>
<span id="cb17-41">ax2.set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"only the L-H law turns over -</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">and the 1947 design straddles the turnover"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb17-42">ax2.legend(frameon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper right"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax2.grid(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>)</span>
<span id="cb17-43">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb17-44"></span>
<span id="cb17-45">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb17-46"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The codimer instantiation closes the loop on section 3: the L-H maximum sits</span></span>
<span id="cb17-47"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at $p_U^* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pUstar_newton<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ atm (closed form vs pymrm-newton root:</span></span>
<span id="cb17-48"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'codimer_pUstar_two_routes_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) at $p_H = p_S = 0.5$ atm —</span></span>
<span id="cb17-49"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**inside the 1947 design range** ($p_U$ up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>U<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm). The</span></span>
<span id="cb17-50"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">impact law is monotone in every partial pressure; a design that straddles</span></span>
<span id="cb17-51"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the turnover is exactly a design that can see the difference."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/C1.2-eley-rideal/index_files/figure-html/cell-14-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>The codimer instantiation closes the loop on section 3: the L-H maximum sits at <img src="https://latex.codecogs.com/png.latex?p_U%5E*%20=%202.50"> atm (closed form vs pymrm-newton root: 3.2e-10) at <img src="https://latex.codecogs.com/png.latex?p_H%20=%20p_S%20=%200.5"> atm — <strong>inside the 1947 design range</strong> (<img src="https://latex.codecogs.com/png.latex?p_U"> up to 2.84 atm). The impact law is monotone in every partial pressure; a design that straddles the turnover is exactly a design that can see the difference.</p>
</div>
</div>
</section>
<section id="the-papers-own-numbers-checked" class="level3">
<h3 class="anchored" data-anchor-id="the-papers-own-numbers-checked">7. The paper’s own numbers, checked</h3>
<p>Two of the paper’s printed quantitative statements are internally checkable, and both check out — quantified here rather than left as “close” and “very high”.</p>
<div id="0a6a6c2f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:59.150005Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:59.149875Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:59.155238Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:59.154636Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The Mullins-Weinberg flux comparison and the HD energy budget."""</span></span>
<span id="cb18-2">v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P.value</span>
<span id="cb18-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># flux parity: the L-R collision flux scales with pressure; the printed numbers</span></span>
<span id="cb18-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># imply the pressure at which it matches the L-H attempt frequency</span></span>
<span id="cb18-5">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_parity_atm_low"</span>]  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lh_attempt_freq_low"</span>]  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_flux_at_1atm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_flux_reference_pressure"</span>])</span>
<span id="cb18-6">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_parity_atm_high"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lh_attempt_freq_high"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_flux_at_1atm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_flux_reference_pressure"</span>])</span>
<span id="cb18-7"></span>
<span id="cb18-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># energy budget: "The sum ... is close to the exothermicity"</span></span>
<span id="cb18-9">e_sum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hd_mean_translational"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hd_mean_rotational"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"hd_mean_vibrational"</span>]</span>
<span id="cb18-10">e_exo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2_dissociation_energy"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d_on_cu_binding_energy_about"</span>]</span>
<span id="cb18-11">M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_sum_kJmol"</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_exo_kJmol"</span>], M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> e_sum, e_exo, e_sum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> e_exo</span>
<span id="cb18-12">BREAKS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_ratio"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_sum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e_exo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb18-13">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"transcription slip 82 -&gt; 28 in the translational energy"</span>,</span>
<span id="cb18-14">               <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">28</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hd_mean_rotational'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'hd_mean_vibrational'</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e_exo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb18-15">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves far from 1: the budget check guards the transcription"</span>))</span>
<span id="cb18-16"></span>
<span id="cb18-17">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"par_lo"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_parity_atm_low"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"par_hi"</span>, M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_parity_atm_high"</span>])</span>
<span id="cb18-18">keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e_sum"</span>, e_sum)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e_exo"</span>, e_exo)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> keep(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e_ratio"</span>, e_sum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e_exo)</span>
<span id="cb18-19">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb18-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**"Very high pressures", quantified:** the printed 10¹²-10¹³ attempts per</span></span>
<span id="cb18-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">site per s (L-H) against 10⁹ per site per s at 1 atm (L-R) put flux parity at</span></span>
<span id="cb18-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mw_parity_atm_low'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mw_parity_atm_high'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> atm** — the</span></span>
<span id="cb18-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">arithmetic behind the paper's "very high pressures are required to make the</span></span>
<span id="cb18-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">L-R mechanism compatible with the L-H mechanism".</span></span>
<span id="cb18-25"></span>
<span id="cb18-26"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**"Close to", quantified:** the HD product's 82 + 36 + 58 =</span></span>
<span id="cb18-27"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_sum<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kJ/mol** against an exothermicity of 436 − about 240 =</span></span>
<span id="cb18-28"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_exo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kJ/mol**: a ratio of **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e_sum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e_exo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, i.e. about 10 %</span></span>
<span id="cb18-29"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">below — consistent with the paper's "close to the exothermicity" and with</span></span>
<span id="cb18-30"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"about" on the 240."""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>“Very high pressures”, quantified:</strong> the printed 10¹²-10¹³ attempts per site per s (L-H) against 10⁹ per site per s at 1 atm (L-R) put flux parity at <strong>1000-10000 atm</strong> — the arithmetic behind the paper’s “very high pressures are required to make the L-R mechanism compatible with the L-H mechanism”.</p>
<p><strong>“Close to”, quantified:</strong> the HD product’s 82 + 36 + 58 = <strong>176 kJ/mol</strong> against an exothermicity of 436 − about 240 = <strong>196 kJ/mol</strong>: a ratio of <strong>0.898</strong>, i.e.&nbsp;about 10 % below — consistent with the paper’s “close to the exothermicity” and with “about” on the 240.</p>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p><strong>What validation can mean here.</strong> The source prints no measurement, so nothing on this page is experimental validation and nothing is presented as such. The checks are: (i) symbolic derivation of every printed limit from the paper’s own equations (section 1); (ii) independent double computation of every headline — the L-H maximum by closed form vs a pymrm-newton root on an independently coded law, <img src="https://latex.codecogs.com/png.latex?w%5E*"> by two optimizer routes plus a grid refinement, the impact-law misfit by two optimizer families; (iii) reconciliation of every imported <code>C1.1</code> number against the book’s own printed Table C, which independently reproduced <code>C1.1</code>’s run-25a digit-slip finding; and (iv) the defect-injection table below, in which every reported metric is moved by a deliberate break, or named structural.</p>
<p><strong>Blind spots, declared.</strong> The two <img src="https://latex.codecogs.com/png.latex?w%5E*"> routes share the metric’s <em>definition</em> (grid, norm, noiseless generator) — they guard the search, not the definition; the norm-dependence is quantified in its break row. The symbolic identities (thermo consistency, the (3c)∝(3b) proportionality) are structural: exact by algebra, below CI’s ABS_FLOOR, able to catch only a transcription slip in their own cell — each carries an above-floor companion. The impact-law conclusions are conditional on mechanism (d) being the true generator, which is itself only the book’s accepted fit — that is why every codimer number is labelled a numerical experiment on fit data.</p>
<div id="5485267c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:59.157130Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:59.157006Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:59.165472Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:59.164733Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The defect-injection table, and the metric coverage map (asserted key-for-key)."""</span></span>
<span id="cb19-2">bt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAKS, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"base"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what was broken"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what it shows"</span>])</span>
<span id="cb19-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(bt.to_string(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, max_colwidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">78</span>))</span>
<span id="cb19-4"></span>
<span id="cb19-5">COVERAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb19-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metric -&gt; how it can fail (break row above, companion, or named structural)</span></span>
<span id="cb19-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thermo_eq_relresid_atK"</span>:               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL identity (below ABS_FLOOR, outside CI); companion thermo_eq_relresid_K10pct"</span>,</span>
<span id="cb19-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thermo_eq_relresid_K10pct"</span>:            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"companion that moves when K is wrong (its own row IS the break value)"</span>,</span>
<span id="cb19-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fd_slope_h_refinement_max_abs"</span>:        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"convergence guard for the FD axis (halving h); fails if slopes are h-limited"</span>,</span>
<span id="cb19-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LH_slope_at_x1e4"</span>:              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: exponent 2 -&gt; 1"</span>,</span>
<span id="cb19-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LH_slope_at_x1em4"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: numerator power 1 -&gt; 2"</span>,</span>
<span id="cb19-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LR_slope_at_x1e4"</span>:              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: power 1 -&gt; 2"</span>,</span>
<span id="cb19-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderA_LR_slope_at_x1em4"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moved by the same numerator-power break (identically for both laws at low x)"</span>,</span>
<span id="cb19-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderAB_LH_slope_at_x1e4"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"guarded by the exponent break (2 -&gt; 1 moves 0 -&gt; 1)"</span>,</span>
<span id="cb19-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderAB_LR_slope_at_x1e4"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"guarded by the power break (1 -&gt; 2 moves 1 -&gt; 0)"</span>,</span>
<span id="cb19-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orderB_LH_gap_from_1_beta03"</span>:          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: beta -&gt; 0"</span>,</span>
<span id="cb19-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxloc_xstar_beta03"</span>:                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: adopt the printed condition c_A = K_A"</span>,</span>
<span id="cb19-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"maxloc_closed_minus_newton_rel"</span>:       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap (independent routes); break row shows the printed condition missing by O(1)"</span>,</span>
<span id="cb19-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_maxcond_unit_ratio"</span>:           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the unit-rescale demonstration; its break row applies the same rescale to the derived condition"</span>,</span>
<span id="cb19-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"derived_maxcond_unit_ratio"</span>:           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same row, other arm"</span>,</span>
<span id="cb19-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deg3c3b_sup_dev_fixed_cB"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"STRUCTURAL identity (below ABS_FLOOR, outside CI); companion deg3c3b_orderB_gap_beta03"</span>,</span>
<span id="cb19-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"deg3c3b_orderB_gap_beta03"</span>:            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"companion that moves with beta (beta -&gt; 0 collapses it, same break as orderB gap)"</span>,</span>
<span id="cb19-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844"</span>:                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"breaks: window centred off the maximum; minimax norm"</span>,</span>
<span id="cb19-24">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844_two_routes_rel"</span>:          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap (guards the search, not the definition - declared)"</span>,</span>
<span id="cb19-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol5"</span>:                           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves with the same breaks as wstar_tol844 (same dev(w) machinery)"</span>,</span>
<span id="cb19-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol169"</span>:                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves with the same breaks as wstar_tol844"</span>,</span>
<span id="cb19-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wstar_tol844_grid_refined_rel"</span>:        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"convergence guard for the window grid (401 -&gt; 1601)"</span>,</span>
<span id="cb19-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"smallw_quad_const"</span>:                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measured constant; moves with the norm break (minimax roughly doubles it)"</span>,</span>
<span id="cb19-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dev_at_wstar_center001"</span>:               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the break value of wstar_tol844's centring row, kept as a metric"</span>,</span>
<span id="cb19-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_KU_per_atm"</span>:                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: inverted conversion a/b"</span>,</span>
<span id="cb19-31">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_KH_per_atm"</span>:                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"guarded by the same conversion break via the R_calc reconciliation"</span>,</span>
<span id="cb19-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_KS_per_atm"</span>:                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"guarded by the same conversion break via the R_calc reconciliation"</span>,</span>
<span id="cb19-33">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_Rcalc_vs_tableC_max_abs_ex25a"</span>:<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"breaks: inverted conversion; include 25a"</span>,</span>
<span id="cb19-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_25a_abs_gap"</span>:                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reproduces C1.1's documented digit slip; the include-25a row shows its size"</span>,</span>
<span id="cb19-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_tableC_avg_abs_pct"</span>:           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recomputation of the book's printed +-8.44 from loaded printed columns; a transcription slip in any pct cell moves it"</span>,</span>
<span id="cb19-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_d_scatter_pct"</span>:                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reconciled against C1.1's published 16.86 %; moves with the conversion break"</span>,</span>
<span id="cb19-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_pUstar_atm"</span>:                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route (closed form vs newton); moves with the conversion break"</span>,</span>
<span id="cb19-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"codimer_pUstar_two_routes_rel"</span>:        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap"</span>,</span>
<span id="cb19-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_mean_pct"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"breaks: allow K_H p_H; collapse p_H span; drop K_S"</span>,</span>
<span id="cb19-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_on_exact_d_max_pct"</span>:              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves with the same three breaks"</span>,</span>
<span id="cb19-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_fit_two_routes_rel"</span>:              <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap (different optimizer families)"</span>,</span>
<span id="cb19-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_oKH_on_exact_d_mean_pct"</span>:           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the break value of the allow-K_H row, kept as a metric"</span>,</span>
<span id="cb19-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_collapsedpH_mean_pct"</span>:            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the break value of the collapse-p_H row, kept as a metric"</span>,</span>
<span id="cb19-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_p_on_exact_d_mean_pct"</span>:             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the break value of the drop-K_S row, kept as a metric"</span>,</span>
<span id="cb19-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lh_d_measured_mean_pct"</span>:               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"guarded by the conversion break (wrong constants move the d fit)"</span>,</span>
<span id="cb19-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_o_measured_mean_pct"</span>:               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves with the drop-K_S / allow-K_H breaks applied to the measured-rate fit"</span>,</span>
<span id="cb19-47">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lr_gap_measured_pct_points"</span>:           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"difference of the two rows above"</span>,</span>
<span id="cb19-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_parity_atm_low"</span>:                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pure arithmetic on printed values; a transcription slip in any flux row moves it"</span>,</span>
<span id="cb19-49">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mw_parity_atm_high"</span>:                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"as above"</span>,</span>
<span id="cb19-50">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_sum_kJmol"</span>:                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: 82 -&gt; 28 transcription slip"</span>,</span>
<span id="cb19-51">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_exo_kJmol"</span>:                     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves with a slip in 436 or 240 (same guard class as the sum)"</span>,</span>
<span id="cb19-52">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"energy_ratio"</span>:                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"break: 82 -&gt; 28"</span>,</span>
<span id="cb19-53">}</span>
<span id="cb19-54">missing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE)</span>
<span id="cb19-55">extra <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(COVERAGE) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(M)</span>
<span id="cb19-56"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> missing, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"metrics without coverage: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>missing<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-57"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> extra, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"coverage rows without metrics: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>extra<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb19-58">below_floor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> M.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v_) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>]</span>
<span id="cb19-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">coverage map: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(COVERAGE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, matches agreement metrics key-for-key"</span>)</span>
<span id="cb19-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metrics at or below check_agreement.py's ABS_FLOOR = 1e-12 (outside CI, named structural above):"</span>)</span>
<span id="cb19-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> below_floor:</span>
<span id="cb19-62">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"="</span>, M[k])</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>                               metric      base                                                          what was broken                     broken value                                                                  what it shows
              orderA_LH_slope_at_x1e4 -0.999790                                          L-H denominator exponent 2 -&gt; 1                         0.000105                    moves -1 -&gt; 0: the high-coverage order carries the exponent
              orderA_LR_slope_at_x1e4  0.000100                                             L-R denominator power 1 -&gt; 2                        -0.999800               moves 0 -&gt; -1: the impact law's zero-order plateau needs power 1
             orderA_LH_slope_at_x1em4  0.999810                               numerator power of c_A: 1 -&gt; 2 (both laws)                         1.999810 moves 1 -&gt; 2: the low-coverage order carries the numerator power (same brea...
          orderB_LH_gap_from_1_beta03  0.260870               beta -&gt; 0 (the reduced form the paper prints above Eq. 3b)                         7.48e-10            vanishes: the printed 'order in B = 1' is exact in the reduced form
       maxloc_closed_minus_newton_rel  4.83e-11           adopt the printed condition c_A = K_A (in mol/L working units)                            2.077 the printed condition misses the root-found maximum by O(1), and by a diffe...
           printed_maxcond_unit_ratio     1e+06                            same rescale applied to the DERIVED condition                                1                       lam^2 vs 1: only the derived condition is unit-invariant
                         wstar_tol844    11.751             window centred at x0 = 0.01, where both laws are first order dev(11.8) = 5.31e-05 (vs 0.0844) the misfit collapses: away from the maximum the laws are degenerate and w* ...
                         wstar_tol844    11.751                          worst-case (minimax) misfit instead of mean-abs                            5.294 moves: the threshold depends on the misfit norm - declared, and the mean-ab...
codimer_Rcalc_vs_tableC_max_abs_ex25a    0.0060                          invert the conversion: K_U = a/b instead of b/a                             9.80       moves by orders: the reconciliation would have caught a wrong conversion
codimer_Rcalc_vs_tableC_max_abs_ex25a    0.0060                                         include run 25a's printed R_calc                           0.5031 run 25a's printed 5.40 is C1.1's documented digit slip (its own row require...
             lr_o_on_exact_d_mean_pct      27.4                      allow a K_H p_H term in the first-power denominator                              3.3 collapses below the noise floor: the discriminating signal is hydrogen's AB...
             lr_o_on_exact_d_mean_pct      27.4 collapse the design's p_H span to its mean (1 value instead of a decade)                              3.2 collapses below the noise floor: without the decade-wide p_H span the found...
             lr_o_on_exact_d_mean_pct      27.4                      drop the product term K_S p_S (Prins's bare Eq. 3b)                             30.3 moves up: the product-inhibition signal is real (C1.1 found the same on mec...
                         energy_ratio    0.8980                  transcription slip 82 -&gt; 28 in the translational energy                           0.6224                    moves far from 1: the budget check guards the transcription

coverage map: 46 rows, matches agreement metrics key-for-key
metrics at or below check_agreement.py's ABS_FLOOR = 1e-12 (outside CI, named structural above):
   thermo_eq_relresid_atK = 4.880101207143546e-16
   deg3c3b_sup_dev_fixed_cB = 2.220446049250313e-16</code></pre>
</div>
</div>
<div id="811c1b1b" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:59.167069Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:59.166942Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:59.170801Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:59.170095Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1">out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> report_agreement(PAGE, M)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Agreement metrics for C1.2:
  thermo_eq_relresid_atK                = 4.8801e-16
  thermo_eq_relresid_K10pct             = 0.094333
  fd_slope_h_refinement_max_abs         = 8.8818e-10
  orderA_LH_slope_at_x1e4               = -0.99979
  orderA_LH_slope_at_x1em4              = 0.99981
  orderA_LR_slope_at_x1e4               = 9.999e-05
  orderA_LR_slope_at_x1em4              = 0.9999
  orderAB_LH_slope_at_x1e4              = 0.00019998
  orderAB_LR_slope_at_x1e4              = 1.0001
  orderB_LH_gap_from_1_beta03           = 0.26087
  maxloc_xstar_beta03                   = 1.3
  maxloc_closed_minus_newton_rel        = 4.8285e-11
  derived_maxcond_unit_ratio            = 1
  printed_maxcond_unit_ratio            = 1e+06
  deg3c3b_sup_dev_fixed_cB              = 2.2204e-16
  deg3c3b_orderB_gap_beta03             = 0.23077
  wstar_tol844                          = 11.751
  wstar_tol844_two_routes_rel           = 1.8342e-11
  wstar_tol5                            = 6.3663
  wstar_tol169                          = 40.001
  wstar_tol844_grid_refined_rel         = 0.0046056
  smallw_quad_const                     = 0.015691
  dev_at_wstar_center001                = 5.3101e-05
  codimer_KU_per_atm                    = 0.55435
  codimer_KH_per_atm                    = 0.40942
  codimer_KS_per_atm                    = 0.36594
  codimer_Rcalc_vs_tableC_max_abs_ex25a = 0.006
  codimer_25a_abs_gap                   = 0.50309
  codimer_tableC_avg_abs_pct            = 8.4408
  codimer_d_scatter_pct                 = 16.847
  lr_o_on_exact_d_mean_pct              = 27.409
  lr_o_on_exact_d_max_pct               = 48.119
  lr_o_fit_two_routes_rel               = 1.0244e-06
  lr_p_on_exact_d_mean_pct              = 30.342
  lr_oKH_on_exact_d_mean_pct            = 3.2607
  lr_o_collapsedpH_mean_pct             = 3.1566
  lh_d_measured_mean_pct                = 16.802
  lr_o_measured_mean_pct                = 26.619
  lr_gap_measured_pct_points            = 9.8174
  codimer_pUstar_atm                    = 2.5033
  codimer_pUstar_two_routes_rel         = 3.1596e-10
  mw_parity_atm_low                     = 1000
  mw_parity_atm_high                    = 10000
  energy_sum_kJmol                      = 176
  energy_exo_kJmol                      = 196
  energy_ratio                          = 0.89796</code></pre>
</div>
</div>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p>Honestly: this is an <code>S1</code> pointwise-algebra page, and most of it would run with pymrm uninstalled — the same answer <code>J1.1</code>, <code>A1.6</code> and <code>A1.1</code> give. pymrm’s <code>newton</code> on <code>NumJac((1, 1))</code> Jacobians carries the root-finds (the L-H maximum in both the dimensionless and the codimer frame), each paired with an independent route, so no extremum on this page is a sampled sweep value. What the <em>gallery</em> adds is the cross-page structure: the L-H law and its derivation are imported from <code>C1.1</code> rather than re-derived, the imported constants are reconciled against the book’s own printed table (independently reproducing one of <code>C1.1</code>’s defect findings in the process), and the discrimination question is answered on the formalism’s founding dataset with <code>C1.1</code>’s own refit protocol. The page merely reproduces the source’s algebra; its extensions — the identifiability window <img src="https://latex.codecogs.com/png.latex?w%5E*">, the unit-invariance test of the printed maximum condition, and the impact-law power study — are labelled as this page’s own throughout.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<ul>
<li><strong>The impact (E-R/L-R) rate closure</strong>, ready for any pymrm reactor page: <img src="https://latex.codecogs.com/png.latex?r%20=%20k'K_Ac_Ac_B/(1+K_Ac_A%20+%20%5Cdots)"> — the colliding species appears in the numerator only; every <em>adsorbed</em> species (including products) appears in the first-power adsorption group. Do not add the colliding species to the denominator: section 6 shows that single term is the entire identifiable difference from L-H on a realistic design.</li>
<li><strong>Naming, for any page that cites this mechanism:</strong> the source argues the collision mechanism is Langmuir’s (1922) and that the IUPAC-defined name is Langmuir-Rideal; what Eley and Rideal studied was a chemisorbed + <em>physisorbed</em> pair. This page keeps “Eley-Rideal” in its title because that is the catalogue’s and the literature’s name, and reports the attribution finding rather than adjudicating primary literature it has not read.</li>
<li><strong>Designing a discrimination experiment:</strong> vary the concentration of the <em>non-adsorbing</em> candidate over at least a decade <strong>and place the window to straddle the suspected L-H maximum</strong> (<img src="https://latex.codecogs.com/png.latex?K_Ac_A%5E*%20=%201%20+%20K_Bc_B">, not the printed “<img src="https://latex.codecogs.com/png.latex?c_A%20=%20K_A">”). Width without curvature buys nothing (section 5’s break row); a single-collision-partner span below <img src="https://latex.codecogs.com/png.latex?w%5E*%20%5Capprox"> a decade cannot reject the impact law at classic-fit precision even with noiseless data (section 6’s collapsed-design row).</li>
<li><strong>What this page cannot support:</strong> any claim of experimental validation of either rate law — the source prints no data — and any claim about what Langmuir, Rideal, Eley, or the IUPAC Gold Book actually wrote beyond what Prins (2018) quotes of them; those originals are recorded as <code>origin_not_consulted</code> in <code>meta.yaml</code>.</li>
</ul>
<div id="75b17d3f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T03:58:59.172609Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T03:58:59.172490Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T03:58:59.176990Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T03:58:59.176256Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Audit: every number quoted in this page's prose was computed and kept."""</span></span>
<span id="cb23-2">audit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.Series(RES).sort_index()</span>
<span id="cb23-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(audit.to_string(float_format<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb23-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(audit)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> kept quantities; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(M)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> agreement metrics; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BREAKS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> break rows"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>KH                 0.40942
KS                0.365942
KU                0.554348
avg_pct            8.44083
e_exo                  196
e_ratio           0.897959
e_sum                  176
gap25a             0.50309
gap3c             0.230769
gap_ex25a            0.006
nvb            7.49047e-11
orderB_gap         0.26087
pH_span            23.6442
pUmax_design          2.84
pUstar             2.50327
par_hi               10000
par_lo                1000
pctcoll            3.15662
pctd_meas           16.802
pcto               27.4086
pcto4              3.26072
pcto_max           48.1187
pcto_meas          26.6194
pctp               30.3421
scatter             16.847
smallwC          0.0156907
sup_dev        2.22045e-16
wstar169           40.0009
wstar5             6.36628
wstarA             11.7506
wstar_mm           5.29426
xstar                  1.3

32 kept quantities; 46 agreement metrics; 14 break rows</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:C</category>
  <category>struct:S1</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas</category>
  <category>phase:gas-solid</category>
  <category>phase:liquid-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/C1.2-eley-rideal/</guid>
  <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>The Robeson upper bound, revisited: where the 2008 line moved, and what “primarily the front factor” can mean</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/H1.8-robeson-upper-bound/</link>
  <description><![CDATA[ 




<section id="the-robeson-upper-bound-revisited" class="level1">
<h1>The Robeson upper bound, revisited</h1>
<p><strong>Catalog ID:</strong> <code>H1.8</code> · <strong>Structures:</strong> none (see below) · <strong>Tier:</strong> T0</p>
<p>Every polymer membrane paper that plots selectivity against permeability draws one diagonal line on it. That line is</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AP_i%20%5C;=%5C;%20k%5C,%5Calpha_%7Bij%7D%5E%7B%5C,n%7D,%0A%5Cqquad%20%5Calpha_%7Bij%7D=%5Cfrac%7BP_i%7D%7BP_j%7D,%5Cqquad%20n%3C0,%0A"></p>
<p>Robeson’s empirical <strong>upper bound</strong>: for a given selectivity there is a permeability no homogeneous polymer film has beaten. In 1991 he drew it for nine gas pairs. In 2008 he redrew it against seventeen more years of literature and printed both sets of <img src="https://latex.codecogs.com/png.latex?(k,n)"> side by side, together with the 2008 data points that set the new line, together with a Knudsen-transition analysis computed from those same <img src="https://latex.codecogs.com/png.latex?(k,n)">.</p>
<p>The paper’s central testable claim is a <strong>decomposition</strong>: the bound moved, and <em>“the shift observed is primarily due to a change in the front factor, <img src="https://latex.codecogs.com/png.latex?k">, whereas the slope of the resultant upper bound relationship remains similar to the prior data correlations.”</em> That is arithmetic on one printed table, and this page does it, on the <strong>nine</strong> gas pairs that actually support it (not the thirteen the table lists), at a <strong>stated</strong> reference selectivity, because a shift decomposed into “front factor” and “slope” parts is <strong>meaningless until the reference is named</strong>: two log–log lines with different slopes pivot, so moving the reference moves the split.</p>
<p>Four results, all from printed numbers:</p>
<ol type="1">
<li><strong>Nine, not thirteen.</strong> H2/O2 and He/O2 have a prior bound and no present one; CO2/N2 and N2/CH4 have a present bound and no prior one. Any statement about “the shift” lives on nine pairs. Robeson’s own Conclusions name exactly those nine.</li>
<li><strong>The claim holds where the paper says it holds, and the number to quote is not <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k">.</strong> Because <img src="https://latex.codecogs.com/png.latex?%7Cn%7C"> varies by a factor of more than 7 across Table 12, the same <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k"> buys wildly different amounts of separation. Ranked by the <strong>selectivity gain at fixed permeability</strong>, the paper’s three <em>“significant”</em> pairs (He/CH4, He/CO2, He/H2) come out as the top three with a clean gap. Ranked by <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k">, or by the permeability gain at fixed selectivity, they do not: CO2/CH4, which the paper calls <em>modest</em>, interleaves with them.</li>
<li><strong>The two H2/CO2 bounds cross inside the paper’s own data range.</strong> For <img src="https://latex.codecogs.com/png.latex?%5Calpha%20%5Cgtrsim%2037"> the 2008 “upper bound” lies <em>below</em> the 1994 one, and Table 10 has <strong>one</strong> point out there, which is the whole of the “inside the range” half of this claim and is stated as such wherever it appears. The paper notices the slope change and warns its low-permeability end may be skewed; it does not state the crossing.</li>
<li><strong>19 of the 117 points the paper tables as “close to the present empirical upper bound” lie above it</strong>, by up to a factor 3.5 in permeability. That is not an error: the line is drawn <em>“by eye”</em>, as the paper says. It is what “by eye” amounts to, measured.</li>
</ol>
<p>The page is a <strong>correlation audit</strong>, not a reactor model. There is no PDE, no grid and no pymrm operator in it, and the <em>What pymrm adds</em> section says so plainly.</p>
<div id="c75a281a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:52.963696Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:52.963454Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:52.978697Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:52.977723Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H1.8-robeson-upper-bound"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="9f941b91" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:52.980610Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:52.980361Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.608704Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.607895Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Imports. Nothing beyond the Colab defaults; pymrm is installed by the bootstrap</span></span>
<span id="cb2-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># but this page calls none of it (see "PyMRM implementation").</span></span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> textwrap</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np, pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd, matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, Claims</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> P_bound, alpha_bound, excursion, envelope_fit</span>
<span id="cb2-8"></span>
<span id="cb2-9">np.set_printoptions(precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, suppress<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb2-10">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.width"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>)</span>
<span id="cb2-11">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-12">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p><strong>The source, precisely.</strong> Lloyd M. Robeson, <em>“The upper bound revisited”</em>, Journal of Membrane Science <strong>320</strong>(1–2) 390–400 (2008), doi:<code>10.1016/j.memsci.2008.04.030</code>, Lehigh University, 1801 Mill Creek Road, Macungie, PA 18062, United States. Identified from the article’s own running header (<em>“Journal of Membrane Science 320 (2008) 390–400”</em>), display title, by-line and affiliation block, all read on a 300 dpi render of p.&nbsp;390; the PDF’s own Title metadata carries the DOI.</p>
<p>The file is <strong>born-digital</strong> (Elsevier / Acrobat Distiller 7.0), so the text layer is a faithful extraction rather than OCR. It was still not trusted: every numeric cell used on this page was read a second time from cropped 300 dpi renders at digit scale, and the two readings compared. They agree on all 382 <strong>numeric cells</strong>: 44 in Table 12 (its four <code>NA</code> rows aside), 234 in Tables 1–11 and 104 in Tables 13a/13b, counted in the loading cell below rather than asserted. These are cells, not numerals; the digit count is several times larger. The reason for the caution is specific to this paper: its tables carry <strong>comma thousands separators inside cells</strong> (the loading cell lists the Table 12 cells that carry them), which is exactly the class of glyph a naive read drops or mis-parses. A break row below drops one.</p>
<p><strong>The 1991 and 1994 papers are the ORIGIN of the “prior” numbers and were not consulted.</strong> Robeson (1991), <em>J. Membr. Sci.</em> <strong>62</strong>, 165, and Robeson, Burgoyne, Langsam, Savoca &amp; Tien (1994), <em>Polymer</em> <strong>35</strong>, 4970, are not on disk. Every prior-bound value on this page was read from the 2008 paper, which restates them under its own heading <em>“Prior upper bound data (1,2)”</em>. That is the legitimate reprint route (<code>AGENTS.md</code>), and it has a limit this page respects throughout: <strong>nothing here can establish that the 2008 restatement of the 1991 bounds is faithful to the 1991 paper.</strong> Where a prior value carries a result, the page says it is read from the 2008 restatement.</p>
<p><strong>What the paper does.</strong> It re-reviews the literature since 1991 (<em>“the number of papers where the data were obtained approached 300”</em>), redraws the bound for eleven gas pairs (adding CO2/N2 and N2/CH4, which had no prior correlation), tabulates the points that set each new line (Tables 1–11), tabulates old and new <img src="https://latex.codecogs.com/png.latex?(k,n)"> together (Table 12), and then uses the new bounds to estimate where solution–diffusion transport must give way to Knudsen diffusion (Tables 13a and 13b). Its physical headline is that the big moves are almost all in <strong>He-based pairs</strong> and are driven by a family of perfluorinated commercial polymers (Nafion, Hyflon AD, Viton, Cytop, Teflon AF) that were barely in the 1991 dataset.</p>
<p><strong>How the line is drawn matters, and the paper is honest about it.</strong> From p.&nbsp;391: <em>“It is noted that the ‘upper bound’ line is determined empirically (‘by eye’) as in the original reference [1] with sufficient data to establish a realistic bound over several decades of permeability.”</em> So <img src="https://latex.codecogs.com/png.latex?(k,n)"> are <strong>not a fit</strong> to Tables 1–11 in any least-squares sense. Nothing on this page treats them as one, and result 4 above is the quantitative consequence.</p>
<p><strong>Where it sits in the gallery.</strong> <a href="../H1.7-solution-diffusion/"><code>H1.7</code></a> is the transport model underneath, permeability as solubility times diffusivity, same units, same barrer. This page supplies the empirical <em>ceiling</em> that model lives under; it does not derive it. <a href="../H1.1-sieverts-permeation/"><code>H1.1</code></a> and <a href="../H1.9-zeolite-membrane-maxwell-stefan-mixture/"><code>H1.9</code></a> are the metal and zeolite membranes to which the bound explicitly does <strong>not</strong> apply (p.&nbsp;391: <em>“Heterogeneous membranes, surface modified membranes and molecular sieve membranes are not considered in the same class of polymeric materials”</em>). Methodologically the nearest sibling is <a href="../B2.1-voorhies-coking-law/"><code>B2.1</code></a>: the origin of an empirical power law, tested only on what the source itself prints.</p>
<p><strong>What this page deliberately does not do.</strong> Twelve figures carry the actual data clouds; none is digitised, and none needs to be, because Tables 1–13 print everything the arguments here use. Figure 12a/b, the correlation of <img src="https://latex.codecogs.com/png.latex?-1/n"> against gas-diameter difference, <strong>cannot</strong> be checked from this paper: it needs Lennard-Jones kinetic diameters, which the 2008 paper cites to Breck [65] and never prints. That is a checked claim, not an assumption: every occurrence of the string <code>diameter</code> in the full text layer is prose, a caption or eq. (1), and the only numeric diameters printed anywhere in the paper are PTMSP’s pore size, <em>“in the range of 0.9–1.2 nm”</em>. Eq. (2), Freeman’s theoretical prediction of <img src="https://latex.codecogs.com/png.latex?k">, is likewise uncheckable here: it needs solubility constants the paper does not tabulate. Both are out of scope and stay out.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Equation numbers are the paper’s.</p>
<p><strong>The bound itself</strong> (abstract, and p.&nbsp;396 in the form Table 12 heads):</p>
<p><img src="https://latex.codecogs.com/png.latex?P_i%20=%20k%5C,%5Calpha_%7Bij%7D%5E%7B%5C,n%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?P_i"> the permeability of the <strong>fast</strong> gas in barrers (<img src="https://latex.codecogs.com/png.latex?1%5C%20%5Ctext%7Bbarrer%7D%20=%2010%5E%7B-10%7D%5C%20%5Cmathrm%7Bcm%5E3(STP)%5C,cm%5C,cm%5E%7B-2%7D%5C,s%5E%7B-1%7D%5C,cmHg%5E%7B-1%7D%7D">), <img src="https://latex.codecogs.com/png.latex?%5Calpha_%7Bij%7D=P_i/P_j"> the separation factor, <img src="https://latex.codecogs.com/png.latex?k"> the <em>“front factor”</em>, and <img src="https://latex.codecogs.com/png.latex?n"> the slope of the log–log plot. Since <img src="https://latex.codecogs.com/png.latex?n%3C0">, in the plane the field actually plots, <img src="https://latex.codecogs.com/png.latex?%5Clog%5Calpha"> against <img src="https://latex.codecogs.com/png.latex?%5Clog%20P">, the bound is the falling diagonal <img src="https://latex.codecogs.com/png.latex?%5Clog%5Calpha%20=%20(%5Clog%20P%20-%20%5Clog%20k)/n">, and <em>“below this line … virtually all the experimental data points exist”</em>.</p>
<p><strong>The shift, decomposed.</strong> Write the prior bound <img src="https://latex.codecogs.com/png.latex?(k_0,n_0)"> and the present one <img src="https://latex.codecogs.com/png.latex?(k_1,n_1)">. At a selectivity <img src="https://latex.codecogs.com/png.latex?%5Calpha"> the bound permeability moves by</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cunderbrace%7B%5CDelta%20%5Clog_%7B10%7D%20P(%5Calpha)%7D_%7B%5Ctext%7Bvertical%20shift%7D%7D%0A=%5Cunderbrace%7B%5CDelta%5Clog_%7B10%7Dk%7D_%7B%5Ctext%7Bfront-factor%20part%7D%7D%0A+%5Cunderbrace%7B%5CDelta%20n%20%5C,%5Clog_%7B10%7D%5Calpha%7D_%7B%5Ctext%7Bslope%20part%7D%7D%20.%0A"></p>
<p>Three things follow immediately, and they organise the whole page.</p>
<p><em>First</em>, <strong>the split depends on where you stand.</strong> The front-factor part is the shift evaluated at <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%201">, where the membrane does not separate at all. That selectivity has no special standing in the data: it lies inside the tabulated range of 5 of the nine pairs and below every point of the others (Result 1 counts them). Reparameterise the same two lines about any other reference <img src="https://latex.codecogs.com/png.latex?%5Calpha_0">, writing <img src="https://latex.codecogs.com/png.latex?P%20=%20k'(%5Calpha/%5Calpha_0)%5En">, and the “front-factor part” becomes <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k%20+%20%5CDelta%20n%20%5Clog%5Calpha_0">. So “primarily the front factor” is not a property of the pair of lines; it is a property of the pair of lines <em>and a chosen reference</em>. This page always states the reference.</p>
<p><em>Second</em>, the statement that <strong>is</strong> reference-free is that the two lines are nearly <strong>parallel</strong>: <img src="https://latex.codecogs.com/png.latex?%7C%5CDelta%20n%7C%5Clog_%7B10%7D(%5Calpha_%7B%5Cmax%7D/%5Calpha_%7B%5Cmin%7D)">, the amount the vertical shift varies across the selectivity range the data actually span, compared with the shift itself. That is the honest reading of Robeson’s claim, and it is what gets measured below.</p>
<p><em>Third</em>, two non-parallel lines <strong>cross</strong>, at <img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D%5Calpha%5E%5Cstar%20=%20-%5CDelta%5Clog_%7B10%7Dk/%5CDelta%20n">. If <img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%5Cstar"> falls inside the data range, the “new” bound is <em>lower</em> than the old one over part of that range.</p>
<p><strong>A second, orthogonal way to measure the same move.</strong> A membrane engineer does not ask how much permeability the bound gained at fixed selectivity; they ask how much <strong>selectivity</strong> it gained at fixed permeability:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CDelta%20%5Clog_%7B10%7D%5Calpha(P)=%5Cfrac%7B%5Clog_%7B10%7DP-%5Clog_%7B10%7Dk_1%7D%7Bn_1%7D%0A-%5Cfrac%7B%5Clog_%7B10%7DP-%5Clog_%7B10%7Dk_0%7D%7Bn_0%7D.%0A"></p>
<p>These two measures are <em>not</em> monotonically related across pairs, because they differ by a factor <img src="https://latex.codecogs.com/png.latex?%5Csim%201/%7Cn%7C"> and <img src="https://latex.codecogs.com/png.latex?%7Cn%7C"> runs from 0.79 to 5.8 in Table 12. Which one reproduces Robeson’s own verbal ranking is a result, not a convention.</p>
<p><strong>The Knudsen transition</strong> (eqs. 3–5, Tables 13a/13b). Knudsen diffusion selectivity is <img src="https://latex.codecogs.com/png.latex?D_i/D_j=(M_j/M_i)%5E%7B1/2%7D"> (eq. 3), and the solubility selectivity <img src="https://latex.codecogs.com/png.latex?k_s=S_i/S_j"> is taken invariant with permeability, so the separation factor at which solution–diffusion selectivity has fallen to the Knudsen value is</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Calpha_%7Bij%7D=k_s%5C,(M_j/M_i)%5E%7B1/2%7D,"></p>
<p>and the permeability there is read off the bound as <img src="https://latex.codecogs.com/png.latex?P_i%20=%20k%5C,%5Calpha_%7Bij%7D%5E%7Bn%7D">. <img src="https://latex.codecogs.com/png.latex?k_s"> itself comes from one of two correlations Freeman gives, eq. (4) from critical temperatures, <img src="https://latex.codecogs.com/png.latex?%5Cln(S_i/S_j)=0.016(T_%7Bci%7D-T_%7Bcj%7D)">, giving Table 13a; eq. (5) from Lennard-Jones temperatures, <img src="https://latex.codecogs.com/png.latex?%5Cln(S_i/S_j)=0.023%5B(%5Cvarepsilon_i/k)-(%5Cvarepsilon_j/k)%5D">, giving Table 13b. Neither temperature set is printed, so <strong><img src="https://latex.codecogs.com/png.latex?k_s"> is an input here, not a checkable quantity</strong>. The last column, however, is entirely checkable against Table 12, and reproducing all 26 of its rows is this page’s strongest test of its own transcription (V1 below).</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>symbol</th>
<th>meaning</th>
<th>source</th>
<th>status here</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?k"></td>
<td>front factor, barrers</td>
<td>Table 12, both blocks</td>
<td>transcribed; prior block via the 2008 restatement</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?n"></td>
<td>log–log slope, dimensionless, <img src="https://latex.codecogs.com/png.latex?%3C0"></td>
<td>Table 12, both blocks</td>
<td>transcribed</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?P_i,%5Calpha_%7Bij%7D"></td>
<td>the 117 near-bound points</td>
<td>Tables 1–11</td>
<td>transcribed; <strong>compiled by Robeson from ~300 papers, none consulted here</strong></td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?k_s"></td>
<td>solubility selectivity</td>
<td>Tables 13a/13b, col.&nbsp;1</td>
<td><strong>input</strong>: eqs. (4)/(5) need temperatures the paper does not print</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?(M_j/M_i)%5E%7B1/2%7D"></td>
<td>Knudsen selectivity</td>
<td>Tables 13a/13b, col.&nbsp;2</td>
<td>checkable, and checked, from integer molecular weights</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5Calpha_0"></td>
<td>reference selectivity for the decomposition</td>
<td><strong>not printed anywhere</strong></td>
<td><em>chosen here</em>, and always stated</td>
</tr>
</tbody>
</table>
<p>Assumptions, each one a decision that could have gone otherwise:</p>
<ol type="1">
<li><strong>The reference selectivity <img src="https://latex.codecogs.com/png.latex?%5Calpha_0"> is the geometric mean of the printed near-bound <img src="https://latex.codecogs.com/png.latex?%5Calpha"> for that pair.</strong> It is data-driven, it is deterministic, and it comes from the paper’s own tables, but it is a choice, it is not Robeson’s, and the page reports the whole <img src="https://latex.codecogs.com/png.latex?%5Calpha"> range beside it so the choice can be audited. Robeson’s implicit reference is <img src="https://latex.codecogs.com/png.latex?%5Calpha_0=1">, which lies inside the data of only 5 of the nine pairs.</li>
<li><strong>Molecular weights are integers</strong> (He 4, H2 2, O2 32, N2 28, CO2 44, CH4 16). This is not a convenience: it is <em>identified from the paper</em>. For H2/N2 the table prints <strong>3.742</strong>, which is <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7B28/2%7D">; IUPAC standard atomic weights do not reproduce it (V1 prints both). All eleven pairs follow.</li>
<li><strong>The printed rounding band is taken literally</strong>: half a unit in the last printed digit position, so a <img src="https://latex.codecogs.com/png.latex?k"> printed to the unit carries <img src="https://latex.codecogs.com/png.latex?%5Cpm%200.5"> and an <img src="https://latex.codecogs.com/png.latex?n"> printed to three decimals carries <img src="https://latex.codecogs.com/png.latex?%5Cpm0.0005">. Where a conclusion depends on the band, the page also reports the <strong>generous</strong> band that treats trailing zeros as placeholders (four significant figures on <img src="https://latex.codecogs.com/png.latex?k"> and on <img src="https://latex.codecogs.com/png.latex?P">), and states which reading the conclusion survives.</li>
<li><strong>A point lies above the bound when <img src="https://latex.codecogs.com/png.latex?r=P/(k%5Calpha%5E%7Bn%7D)%3E1">.</strong> With <img src="https://latex.codecogs.com/png.latex?n%3C0"> this is the correct direction and it is worth deriving once: a point beats the bound if its selectivity exceeds the bound’s at its permeability, <img src="https://latex.codecogs.com/png.latex?%5Clog%5Calpha%3E(%5Clog%20P-%5Clog%20k)/n">; multiplying by the <em>negative</em> <img src="https://latex.codecogs.com/png.latex?n"> flips the inequality to <img src="https://latex.codecogs.com/png.latex?%5Clog%20k+n%5Clog%5Calpha%3C%5Clog%20P">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?r%3E1">. Getting this backwards counts the points below the bound instead, which is break row
<ol type="I">
<li>below.</li>
</ol></li>
<li><strong>Nothing is refit as a substitute for the printed bound.</strong> The line is drawn by eye; a least-squares line through Tables 1–11 is a <em>different object</em> and is labelled as one wherever it appears.</li>
</ol>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Four datasets, all transcription of printed tables and printed sentences. <strong>Tier 2</strong> throughout: the paper’s own tabulated values, no figure digitised, no number inferred. Each has a provenance sidecar, and what the sidecars record about the rows is collected here.</p>
<ul>
<li><code>robeson-2008-table12-upper-bounds</code>: Table 12, a prior and a present row for each of 13 gas pairs. <strong>The <code>NA</code> structure is load-bearing</strong>: H2/O2 and He/O2 have no present bound, CO2/N2 and N2/CH4 no prior one, so only nine pairs support a comparison. The <code>prior</code> rows are the 1991 and 1994 bounds as the 2008 paper restates them; the originals were not consulted. The prior block prints <code>He/CO2</code> without the final subscript, a typographic slip normalised in the CSV. The <code>*_as_printed</code> columns keep the printed glyphs (commas, trailing zeros) and are loaded as strings, because the printed digits set the rounding bands of V1.</li>
<li><code>robeson-2008-near-bound-points</code>: Tables 1–11, one row per printed row, in printed order (not always monotone in permeability). Two rows are flagged <strong>by the paper itself</strong> and used as printed: an O2/N2 point whose position above the bound the paper questions, and an N2/CH4 point whose CH4 permeability the paper corrects in prose while its Table 9 keeps the unrepaired <img src="https://latex.codecogs.com/png.latex?%5Calpha">. Result 4 locates both from the numbers in the paper’s own sentences and checks which value the table carries. Polymer names are verbatim, including Table 2’s <code>Polypyrrole</code> where Tables 1, 5 and 6 print <code>Polypyrrolone</code> for the same material, and Table 9’s <code>Poly(pyrrolone)(6FDA-TAB)</code> where Tables 5 and 6 print <code>Polypyrrolone (6FDA-TAB)</code>. The <code>ref_bracket</code> column counts the cited references below.</li>
<li><code>robeson-2008-table13-knudsen-transition</code>: Tables 13a/13b, 26 rows. The <code>dataset</code> column is this page’s encoding of the printed “(prior data)” label. <img src="https://latex.codecogs.com/png.latex?k_s"> is not checkable from this paper. The table is an independent check on this page’s transcription of Table 12, which is what V1 tests; it shares Table 12 as an input, so it is not a second route to Robeson’s numbers (V2 says why). Its product column is read a second time as strings, because a float drops printed trailing zeros (<code>0.270</code>) and with them the rounding band.</li>
<li><code>robeson-2008-printed-claims</code>: the prose claims tested here, verbatim. Its <code>shift_class</code> column is this page’s one-word encoding of the Conclusions’ wording. Two quoted sentences are printed defects, kept as printed: the Conclusions name He/CO2 twice and drop He/CH4, and the author repairs the N2/CH4 permeability in prose and not in Table 9.</li>
</ul>
<p>No dataset from another gallery page is loaded, so the cross-page reconciliation rule has nothing to bite on here.</p>
<p>The provenance depth of the second dataset bounds every result drawn from it: <strong>these are not Robeson’s measurements.</strong> Each row cites the primary paper that reported it; the rows cite 44 distinct references (counted below), none of which was consulted. This page can show that a tabulated point sits above the line Robeson drew; it cannot show that the point is right.</p>
<div id="b3c72247" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.610697Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.610509Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.637603Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.636805Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># `dtype=str` + `keep_default_na=False` so the as-printed columns keep their trailing</span></span>
<span id="cb3-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># zeros and their literal "NA" - both are load-bearing below.</span></span>
<span id="cb3-3">T12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robeson-2008-table12-upper-bounds.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE,</span>
<span id="cb3-4">                dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>, keep_default_na<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb3-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>):</span>
<span id="cb3-6">    T12[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.to_numeric(T12[c].replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, np.nan))</span>
<span id="cb3-7">PTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robeson-2008-near-bound-points.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-8">T13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robeson-2008-table13-knudsen-transition.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the product column as printed, for its rounding band: "0.270" read as a float loses its zero</span></span>
<span id="cb3-10">T13[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ks_D_as_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robeson-2008-table13-knudsen-transition.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE,</span>
<span id="cb3-11">                                   dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>).ks_D_ratio</span>
<span id="cb3-12">CLM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robeson-2008-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-13"></span>
<span id="cb3-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"robeson-2008-table12-upper-bounds.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb3-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 12: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T12)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows | Tables 1-11: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PTS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points | "</span></span>
<span id="cb3-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Tables 13a/13b: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T13)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows | printed claims: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(CLM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The transcription burden, counted rather than asserted: every one of these was read twice,</span></span>
<span id="cb3-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># once from the text layer and once from a digit-scale crop of a 300 dpi render.</span></span>
<span id="cb3-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># These are numeric CELLS, not numerals - the digit count is several times larger.</span></span>
<span id="cb3-20">N_NUM_T12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T12.k_barrer.notna().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb3-21">N_NUM_PTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PTS)</span>
<span id="cb3-22">N_NUM_T13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T13)</span>
<span id="cb3-23">N_NUMERALS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_NUM_T12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> N_NUM_PTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> N_NUM_T13</span>
<span id="cb3-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Numeric cells transcribed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_NUM_T12<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Table 12, excluding the 4 NA rows) + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_NUM_PTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb3-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(Tables 1-11) + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_NUM_T13<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (Tables 13a/13b) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_NUMERALS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 12 cells printed with thousands commas:"</span>,</span>
<span id="cb3-27">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dataset<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>gas_pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_as_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb3-28">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T12.itertuples() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r.k_as_printed))</span>
<span id="cb3-29"></span>
<span id="cb3-30">prior <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T12[T12.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>)</span>
<span id="cb3-31">present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T12[T12.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>)</span>
<span id="cb3-32">PAIRS_ALL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(prior.index)</span>
<span id="cb3-33">PAIRS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS_ALL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(prior.k_barrer[g]) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> np.isfinite(present.k_barrer[g])]</span>
<span id="cb3-34">N_PAIRS_TABLE, N_PAIRS_COMPARABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS_ALL), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS)</span>
<span id="cb3-35"></span>
<span id="cb3-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table 12 lists </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_PAIRS_TABLE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> gas pairs; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_PAIRS_COMPARABLE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> carry BOTH a prior and a present bound."</span>)</span>
<span id="cb3-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  present bound NA (prior only):"</span>,</span>
<span id="cb3-38">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS_ALL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(present.k_barrer[g])))</span>
<span id="cb3-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  prior bound NA (present only):"</span>,</span>
<span id="cb3-40">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS_ALL <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(prior.k_barrer[g])))</span>
<span id="cb3-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  comparable:"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(PAIRS))</span>
<span id="cb3-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Tables 1-11 exist for exactly the 11 pairs with a PRESENT bound:"</span>)</span>
<span id="cb3-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(PTS.gas_pair.unique())))</span>
<span id="cb3-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  pairs with a present bound but no table:"</span>,</span>
<span id="cb3-45">      <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(present.index[np.isfinite(present.k_barrer)]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PTS.gas_pair.unique())) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Robeson, L. M. (2008) — Journal of Membrane Science 320(1-2) 390-400 — doi:10.1016/j.memsci.2008.04.030 — transcribed from the printed table. The PDF is born-digital (Acrobat Distiller 7.0, Elsevier); the text layer was extracted with `pdftotext -layout` AND the whole table was independently read from a 300 dpi `pdftoppm` render cropped to digit scale (two crops, prior block and present block). The two readings agree glyph for glyph, including every thousands comma. Nothing on this page was taken from the text layer alone.

Table 12: 26 rows | Tables 1-11: 117 points | Tables 13a/13b: 26 rows | printed claims: 24
Numeric cells transcribed: 44 (Table 12, excluding the 4 NA rows) + 234 (Tables 1-11) + 104 (Tables 13a/13b) = 382
Table 12 cells printed with thousands commas: prior O2/N2 k = 389,224, prior CO2/CH4 k = 1,073,700, prior H2/N2 k = 52,918, prior H2/CH4 k = 18,500, prior He/N2 k = 12,500, prior He/CH4 k = 5,002, prior H2/O2 k = 35,760, prior He/O2 k = 4,600, present O2/N2 k = 1,396,000, present CO2/CH4 k = 5,369,140, present H2/N2 k = 97,650, present H2/CH4 k = 27,200, present He/N2 k = 19,890, present He/CH4 k = 19,800, present He/H2 k = 59,910, present CO2/N2 k = 30,967,000, present N2/CH4 k = 2,570, present H2/CO2 k = 4,515, present He/CO2 k = 3,760

Table 12 lists 13 gas pairs; 9 carry BOTH a prior and a present bound.
  present bound NA (prior only): H2/O2, He/O2
  prior bound NA (present only): CO2/N2, N2/CH4
  comparable: O2/N2, CO2/CH4, H2/N2, H2/CH4, He/N2, He/CH4, He/H2, H2/CO2, He/CO2

Tables 1-11 exist for exactly the 11 pairs with a PRESENT bound:
   CO2/CH4, CO2/N2, H2/CH4, H2/CO2, H2/N2, He/CH4, He/CO2, He/H2, He/N2, N2/CH4, O2/N2
  pairs with a present bound but no table: none</code></pre>
</div>
</div>
<div id="6ac11ab5" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.639306Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.639123Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.644791Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.644057Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The paper's own three-way classification of how far each bound moved, joined onto Table 12.</span></span>
<span id="cb5-2">CLASS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (CLM[CLM.shift_class.notna() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (CLM.gas_pair.notna())]</span>
<span id="cb5-3">         .drop_duplicates(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>).shift_class.to_dict())</span>
<span id="cb5-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Robeson's Conclusions classify these pairs, and only these:"</span>)</span>
<span id="cb5-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb5-6">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLASS[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-7">missing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PAIRS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(CLASS))</span>
<span id="cb5-8">extra <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(CLASS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PAIRS))</span>
<span id="cb5-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">classified but not comparable: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>extra <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb5-10">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  |  comparable but unclassified: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>missing <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb5-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> missing <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> extra, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the Conclusions' pair list must be exactly the nine comparable pairs"</span></span>
<span id="cb5-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">So the paper itself confines its shift discussion to the nine pairs the NA structure allows."</span>)</span>
<span id="cb5-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A page that compared thirteen would be comparing four pairs against nothing."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Robeson's Conclusions classify these pairs, and only these:
  O2/N2     modest
  CO2/CH4   modest
  H2/N2     modest
  H2/CH4    modest
  He/N2     modest
  He/CH4    significant
  He/H2     significant
  H2/CO2    minor
  He/CO2    significant

classified but not comparable: none  |  comparable but unclassified: none

So the paper itself confines its shift discussion to the nine pairs the NA structure allows.
A page that compared thirteen would be comparing four pairs against nothing.</code></pre>
</div>
</div>
<div id="dd06ffc9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.646646Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.646417Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.650888Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.650090Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># H2/O2 and He/O2: prior bound printed, present bound NA, no section, no table, no figure.</span></span>
<span id="cb7-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A negative claim, so here is the search. The text layer is born-digital; extraction inserts a</span></span>
<span id="cb7-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># space before the slash for H2 but not for He, so both spellings are counted.</span></span>
<span id="cb7-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Where do H2/O2 and He/O2 appear in the paper?"</span>)</span>
<span id="cb7-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Searched: the complete `pdftotext -layout` extraction of all 11 pages, for both the"</span>)</span>
<span id="cb7-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  hyphen-free spellings and the space-before-slash form the extractor produces."</span>)</span>
<span id="cb7-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Result: they occur only as cells of Table 12, in its prior block and in its present block"</span>)</span>
<span id="cb7-8"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (as 'NA'). No section heading, no data table, no figure, and no sentence anywhere in the"</span>)</span>
<span id="cb7-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  paper mentions either pair. The paper does not say why they were dropped."</span>)</span>
<span id="cb7-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Consistency check available here: Tables 1-11 cover 11 pairs and neither of these two."</span>)</span>
<span id="cb7-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PTS.gas_pair.unique()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(present.index[np.isfinite(present.k_barrer)]), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"every present bound must have a data table and vice versa"</span></span>
<span id="cb7-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  -&gt; verified: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> data tables, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> present bounds, same set."</span>.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span>(</span>
<span id="cb7-14">    PTS.gas_pair.nunique(), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.isfinite(present.k_barrer).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Where do H2/O2 and He/O2 appear in the paper?
  Searched: the complete `pdftotext -layout` extraction of all 11 pages, for both the
  hyphen-free spellings and the space-before-slash form the extractor produces.
  Result: they occur only as cells of Table 12, in its prior block and in its present block
  (as 'NA'). No section heading, no data table, no figure, and no sentence anywhere in the
  paper mentions either pair. The paper does not say why they were dropped.
  Consistency check available here: Tables 1-11 cover 11 pairs and neither of these two.
  -&gt; verified: 11 data tables, 11 present bounds, same set.</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p><strong>There is none, and that is the honest answer.</strong></p>
<p>The Robeson upper bound is a two-parameter algebraic relation between two scalars. It has no spatial coordinate, no time coordinate, no conservation law, no boundary condition and no unknown field. Nothing in pymrm’s operator library (<code>construct_grad</code>, <code>construct_div</code>, <code>construct_convflux_upwind</code>, <code>NumJac</code>, <code>newton</code>) has anything to act on. Building a grid here would be decoration, and the gallery’s structure taxonomy (<code>S1</code>–<code>S13</code> in <a href="../../docs/taxonomy.md"><code>docs/taxonomy.md</code></a>) has no code that fits: the page’s <code>structures</code> field is <strong>empty</strong>, deliberately, and its <code>pymrm_api</code> list is empty too.</p>
<p>What the page uses is numpy for the algebra, one <code>scipy.optimize.brentq</code> call per threshold (thresholds are root-found, never swept), and an exact enumeration of the active sets of one small constrained least-squares problem for the envelope estimator in <em>Validation</em>. The four functions that are reusable outside this page, <code>P_bound</code>, <code>alpha_bound</code>, <code>excursion</code> and <code>envelope_fit</code>, live in <code>model.py</code>, with docstrings and a test; the bootstrap cell installs pymrm only because every gallery page pins it.</p>
<p>Where the bound <em>does</em> meet pymrm is one layer up, and this page does not cross that layer: <img src="https://latex.codecogs.com/png.latex?(P_i,%20%5Calpha_%7Bij%7D)"> is the closure a module-scale membrane model consumes. <a href="../H1.7-solution-diffusion/"><code>H1.7</code></a> builds the transport side of that closure from solubility and diffusivity in the same units; the bound tells you which <img src="https://latex.codecogs.com/png.latex?(P,%5Calpha)"> pairs that model is entitled to be handed. The two pages are complementary and neither computes the other.</p>
<p>The rest of this page is therefore arithmetic on printed tables, which is exactly what auditing an empirical correlation is.</p>
<div id="88e4f6eb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.652198Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.652069Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.657619Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.656916Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The bound and its inverse (model.py) are written once and used everywhere below, so</span></span>
<span id="cb9-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a sign error cannot hide in one branch. The round trip is an identity, registered as a</span></span>
<span id="cb9-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># claim; break row (N) writes the inverse with n instead of 1/n.</span></span>
<span id="cb9-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> roundtrip_max(pre, pairs, inv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alpha_bound):</span>
<span id="cb9-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Worst relative error of inv(P_bound(alpha)) over four selectivities and the pairs."""</span></span>
<span id="cb9-6">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">900.0</span>])</span>
<span id="cb9-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(inv(P_bound(a, pre.k_barrer[g], pre.n[g]),</span>
<span id="cb9-8">                                       pre.k_barrer[g], pre.n[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs)</span>
<span id="cb9-9"></span>
<span id="cb9-10"></span>
<span id="cb9-11">ROUNDTRIP_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> roundtrip_max(present, PAIRS)</span>
<span id="cb9-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"P_bound / alpha_bound round trip, worst over the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs: below 1e-12 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROUNDTRIP_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb9-13"></span>
<span id="cb9-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a point exactly ON the bound has r = 1, by construction; a point at twice the bound</span></span>
<span id="cb9-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># permeability has r = 2. Sanity, and the sign convention made explicit.</span></span>
<span id="cb9-16">kk, nn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>], present.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>]</span>
<span id="cb9-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sign check on He/H2 (k=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>kk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, n=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">):"</span>)</span>
<span id="cb9-18"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> fac <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>):</span>
<span id="cb9-19">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a point at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>fac<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the bound permeability at alpha=2.5 has r = "</span></span>
<span id="cb9-20">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(excursion(fac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P_bound(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, kk, nn), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, kk, nn))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>P_bound / alpha_bound round trip, worst over the 9 pairs: below 1e-12 (here 6e-16)
sign check on He/H2 (k=59,910, n=-4.864):
  a point at 0.5x the bound permeability at alpha=2.5 has r = 0.500
  a point at 1.0x the bound permeability at alpha=2.5 has r = 1.000
  a point at 2.0x the bound permeability at alpha=2.5 has r = 2.000</code></pre>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="result-1-the-shift-decomposed-at-a-stated-selectivity" class="level3">
<h3 class="anchored" data-anchor-id="result-1-the-shift-decomposed-at-a-stated-selectivity">Result 1: The shift, decomposed at a stated selectivity</h3>
<p>For each of the nine comparable pairs: <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog_%7B10%7Dk">, <img src="https://latex.codecogs.com/png.latex?%5CDelta%20n">, the range of selectivity its own near-bound points span, the vertical shift at the geometric-mean selectivity of those points, and the <strong>front-factor share</strong> <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k/%5CDelta%5Clog%20P(%5Calpha_0)">, the fraction of the shift the front factor accounts for <em>at that reference</em>.</p>
<p>The column that carries the reference-free version of Robeson’s claim is <strong><code>spread/shift</code></strong>: how much the vertical shift varies across the pair’s own selectivity range, relative to the shift itself. Small means the two lines are parallel and “primarily the front factor” is safe wherever you stand; large means the split is an artefact of where you stood. The cell also counts the pairs whose own data reach <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%201">, the reference at which <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k"> is the shift.</p>
<div id="af4c7b02" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.659043Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.658789Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.679977Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.679044Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb11-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb11-3">    k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[g], prior.n[g]</span>
<span id="cb11-4">    k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[g], present.n[g]</span>
<span id="cb11-5">    sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb11-6">    a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub.alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb11-7">    a_lo, a_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), a.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()</span>
<span id="cb11-8">    a_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(a))))</span>
<span id="cb11-9">    dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(k1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k0)</span>
<span id="cb11-10">    dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n0</span>
<span id="cb11-11">    shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> al: dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(al)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731 - one line, used thrice</span></span>
<span id="cb11-12">    spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dn) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_lo)</span>
<span id="cb11-13">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, verdict<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLASS[g], dlogk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlk, dn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dn, n_pres<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n1,</span>
<span id="cb11-14">                     a_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_lo, a_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_hi, a_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_gm,</span>
<span id="cb11-15">                     shift_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>shift(a_gm), share<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> shift(a_gm),</span>
<span id="cb11-16">                     spread<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>spread, spread_over_shift<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(shift(a_gm)),</span>
<span id="cb11-17">                     shift_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>shift(a_lo), shift_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>shift(a_hi)))</span>
<span id="cb11-18">SH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb11-19"></span>
<span id="cb11-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(</span>
<span id="cb11-21">    [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Shift of the upper bound, nine comparable pairs.  All logs base 10; 'decades' = log10 units."</span>,</span>
<span id="cb11-22">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'paper'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlog k'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dn'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha range'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb11-23">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'a_gm'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift@a_gm'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k-share'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'spread/shift'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb11-24">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>verdict<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb11-25">       <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&lt;7.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_gm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shift_gm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb11-26">       <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>spread_over_shift<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SH.iterrows()]))</span>
<span id="cb11-27"></span>
<span id="cb11-28">SHARE_MIN, SHARE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb11-29">SHARE_MED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.share.median())</span>
<span id="cb11-30">PARALLEL_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((SH.spread_over_shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb11-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Front-factor share at the geometric-mean selectivity: median </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHARE_MED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb11-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"range </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHARE_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHARE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb11-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Two lines are near-parallel (spread/shift &lt; 0.20) for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PARALLEL_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the "</span></span>
<span id="cb11-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SH)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs. For those, 'primarily the front"</span>)</span>
<span id="cb11-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor' is a statement about the lines, not about a chosen reference. For the rest it is not:"</span>)</span>
<span id="cb11-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SH[SH.spread_over_shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>].iterrows():</span>
<span id="cb11-37">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the vertical shift runs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shift_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shift_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades across "</span></span>
<span id="cb11-38">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_hi<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">And note what the reference does to the headline pair. He/H2's front factor moves"</span>)</span>
<span id="cb11-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>prior<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrers, a factor "</span></span>
<span id="cb11-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>prior<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: dlog k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb11-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Its slope moves </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>prior<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SH.dn[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>prior.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of itself."</span>)</span>
<span id="cb11-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Over the selectivity range its OWN data span (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_lo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_hi[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), the "</span></span>
<span id="cb11-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shift_gm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-decade shift"</span>)</span>
<span id="cb11-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"varies by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>spread[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SH.shift_gm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of itself, and the slope term "</span></span>
<span id="cb11-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dn log10(alpha) is at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SH.dn[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(SH.a_hi[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shift_gm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span></span>
<span id="cb11-47">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" of it. There the claim is airtight."</span>)</span>
<span id="cb11-48"></span>
<span id="cb11-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Robeson's own reference, alpha = 1, measured against the data rather than assumed outside it.</span></span>
<span id="cb11-50">IN1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SH[(SH.a_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (SH.a_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb11-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">alpha = 1, where dlog k IS the shift, lies inside the tabulated range of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(IN1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the "</span></span>
<span id="cb11-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SH)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs:"</span>)</span>
<span id="cb11-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of "</span></span>
<span id="cb11-54">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points below alpha = 1 (alpha_min </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_lo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span></span>
<span id="cb11-55">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> IN1.iterrows()))</span>
<span id="cb11-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and outside it, below every tabulated point, for "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(SH.index[SH.a_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Shift of the upper bound, nine comparable pairs.  All logs base 10; 'decades' = log10 units.
pair      paper         dlog k       dn        alpha range    a_gm shift@a_gm  k-share spread/shift
O2/N2     modest        0.5547  +0.1340     2.98 - 19.8       7.78     0.6741    0.823         0.16
CO2/CH4   modest        0.6990  -0.0096     4.42 - 2200       33.4     0.6844    1.021         0.04
H2/N2     modest        0.2661  +0.0434      2.5 - 960        37.8     0.3345    0.795         0.34
H2/CH4    modest        0.1674  +0.1042    0.953 - 325        13.5     0.2853    0.587         0.93
He/N2     modest        0.2017  +0.0072     0.97 - 622        37.6     0.2131    0.947         0.09
He/CH4    significant   0.5975  -0.0233    0.406 - 3041       56.5     0.5567    1.073         0.16
He/H2     significant   1.7952  +0.0895     1.06 - 4.39       2.29     1.8274    0.982         0.03
H2/CO2    minor         0.5755  -0.3657    0.489 - 100.9      2.78     0.4129    1.394         2.05
He/CO2    significant   0.7270  +0.0280    0.187 - 20.3       2.83     0.7397    0.983         0.08

Front-factor share at the geometric-mean selectivity: median 0.98, range 0.59 to 1.39.
Two lines are near-parallel (spread/shift &lt; 0.20) for 6 of the 9 pairs. For those, 'primarily the front
factor' is a statement about the lines, not about a chosen reference. For the rest it is not:
  H2/N2     the vertical shift runs +0.283 -&gt; +0.395 decades across alpha = 2.5 to 960
  H2/CH4    the vertical shift runs +0.165 -&gt; +0.429 decades across alpha = 0.953 to 325
  H2/CO2    the vertical shift runs +0.689 -&gt; -0.157 decades across alpha = 0.489 to 100.9

And note what the reference does to the headline pair. He/H2's front factor moves
960 -&gt; 59,910 barrers, a factor 62.4: dlog k = 1.7952.
Its slope moves -4.9535 -&gt; -4.864, i.e. 1.8 % of itself.
Over the selectivity range its OWN data span (1.06 to 4.39), the 1.83-decade shift
varies by 3.0 % of itself, and the slope term dn log10(alpha) is at most 3.1 % of it. There the claim is airtight.

alpha = 1, where dlog k IS the shift, lies inside the tabulated range of 5 of the 9 pairs:
  H2/CH4    2 of 8 points below alpha = 1 (alpha_min 0.953)
  He/N2     1 of 9 points below alpha = 1 (alpha_min 0.97)
  He/CH4    2 of 11 points below alpha = 1 (alpha_min 0.406)
  H2/CO2    4 of 7 points below alpha = 1 (alpha_min 0.489)
  He/CO2    3 of 12 points below alpha = 1 (alpha_min 0.187)
and outside it, below every tabulated point, for O2/N2, CO2/CH4, H2/N2, He/H2.</code></pre>
</div>
</div>
</section>
<section id="result-2-where-the-two-bounds-cross" class="level3">
<h3 class="anchored" data-anchor-id="result-2-where-the-two-bounds-cross">Result 2: Where the two bounds cross</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20P(%5Calpha)=0"> at <img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D%5Calpha%5E%5Cstar=-%5CDelta%5Clog_%7B10%7Dk/%5CDelta%20n">. Computed two ways, the closed form, and <code>brentq</code> root-finding the shift function itself, and then asked whether <img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%5Cstar"> falls inside the range of the paper’s own tabulated points for that pair.</p>
<p>Two separate claims live here and they are of very different strengths. That the two H2/CO2 lines cross at <img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%5Cstar%5Capprox%2037"> is a property of four printed numbers in Table 12. That the crossing happens <strong>inside the range Table 10 spans</strong> is a property of a <em>single tabulated point</em>: the cell below names it, prints the gap it sits across, and says what is left without it. A break row further down mis-reads that one decimal point and takes the result to zero.</p>
<div id="319bd2ac" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.681390Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.681171Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.696435Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.695599Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">_lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha* (closed form)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;21s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha* (brentq)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb13-2">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'|diff|'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'inside its own alpha range?'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;29s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb13-3">cross_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb13-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb13-5">    k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[g], prior.n[g]</span>
<span id="cb13-6">    k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[g], present.n[g]</span>
<span id="cb13-7">    dlk, dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(k1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k0), n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n0</span>
<span id="cb13-8">    a_star_cf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dn)</span>
<span id="cb13-9">    f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> la: dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> la                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731 - shift in log-alpha</span></span>
<span id="cb13-10">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(SH.a_lo[g]), np.log10(SH.a_hi[g])</span>
<span id="cb13-11">    inside <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> f(lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> f(hi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb13-12">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same bracket as the registered claim: [-3, 6] decades holds every printed selectivity</span></span>
<span id="cb13-13">    a_star_rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> brentq(f, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inside <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan</span>
<span id="cb13-14">    diff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a_star_rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_star_cf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inside <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan</span>
<span id="cb13-15">    cross_rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, a_star<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_star_cf, a_star_rf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_star_rf, inside<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>inside))</span>
<span id="cb13-16">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a_star_cf<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:21.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a_star_rf <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inside <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nan'</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb13-17">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'&lt; 1e-12'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inside <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> diff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n/a'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb13-18">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'YES - inside '</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_lo[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_hi[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> inside <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'no'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;29s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span>
<span id="cb13-20">CROSS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(cross_rows).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb13-21">N_CROSSING_INSIDE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(CROSS.inside.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb13-22">G_CROSS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CROSS.index[CROSS.inside][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb13-23">ALPHA_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CROSS.a_star[G_CROSS])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ALPHA_STAR_RF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(CROSS.a_star_rf[G_CROSS])</span>
<span id="cb13-24">ALPHA_STAR_AGREE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ALPHA_STAR_RF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ALPHA_STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb13-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_CROSSING_INSIDE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs cross inside their own tabulated selectivity range: "</span></span>
<span id="cb13-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_CROSS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, at alpha* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(closed form and brentq agree below 1e-12 relative (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_STAR_AGREE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) - the root-find exists to"</span>)</span>
<span id="cb13-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" catch a sign or reciprocal slip in the closed form, not to add precision.)"</span>)</span>
<span id="cb13-29"></span>
<span id="cb13-30">k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[G_CROSS], prior.n[G_CROSS]</span>
<span id="cb13-31">k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[G_CROSS], present.n[G_CROSS]</span>
<span id="cb13-32">sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> G_CROSS].sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha"</span>)</span>
<span id="cb13-33">above <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub[sub.alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> ALPHA_STAR]</span>
<span id="cb13-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Above alpha* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> the PRESENT </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>G_CROSS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bound lies BELOW the prior one."</span>)</span>
<span id="cb13-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(above)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sub)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points Table 10 tabulates sit in that region:"</span>)</span>
<span id="cb13-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> above.iterrows():</span>
<span id="cb13-37">    Pp, Pq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_bound(r.alpha, k1, n1)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_bound(r.alpha, k0, n0))</span>
<span id="cb13-38">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  point P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P_fast_barrer<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> | present bound "</span></span>
<span id="cb13-39">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> | prior bound </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pq<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (present is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(Pp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Pq<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of prior)"</span>)</span>
<span id="cb13-40">PRESENT_BELOW_PRIOR_PCT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (P_bound(sub.alpha.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), k1, n1)</span>
<span id="cb13-41">                                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P_bound(sub.alpha.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), k0, n0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb13-42"></span>
<span id="cb13-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># How much does this verdict rest on? Exactly one tabulated point, and the page must say so.</span></span>
<span id="cb13-44">_below <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub[sub.alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> ALPHA_STAR]</span>
<span id="cb13-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AND HOW THIN IS THAT. 'Inside the paper's own tabulated range' rests on "</span></span>
<span id="cb13-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(above)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> point</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(above) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of"</span>)</span>
<span id="cb13-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sub)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: alpha* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sits between the tabulated alpha = "</span></span>
<span id="cb13-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_below<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>above<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb13-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a gap of a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>above<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_below<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with nothing in it. Delete the "</span></span>
<span id="cb13-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>above<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>polymer<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">38</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"point at alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>above<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - or mis-read its decimal point, which is a break "</span></span>
<span id="cb13-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"row below - and"</span>)</span>
<span id="cb13-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"alpha* falls outside Table 10's range and Result 2 has nothing to stand on. The crossing"</span>)</span>
<span id="cb13-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"itself would survive: it is a property of the two printed lines and moves only with them."</span>)</span>
<span id="cb13-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"What would not survive is the claim that it happens where the paper has data. Any use of"</span>)</span>
<span id="cb13-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"this result has to carry that sentence with it."</span>)</span>
<span id="cb13-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The paper anticipates the cause and says so on p. 396 - the H2/CO2 shift is"</span>)</span>
<span id="cb13-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'"primarily a slight slope change" and "the limited number of data points at the lower'</span>)</span>
<span id="cb13-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'permeability area of the dataset may have skewed the slope versus the original'</span>)</span>
<span id="cb13-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'correlation [2]". Searched the full text for any statement that the two lines CROSS or'</span>)</span>
<span id="cb13-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"that the new bound falls below the old one anywhere: none - the words cross/crossing/"</span>)</span>
<span id="cb13-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"intersect appear only inside the polymer name 'crosslinked' and in reference titles."</span>)</span>
<span id="cb13-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"So the crossing is a consequence of what the paper says, not a contradiction of it -"</span>)</span>
<span id="cb13-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"but it is a consequence the paper does not draw, and it is the one place in the table"</span>)</span>
<span id="cb13-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"where 'upper bound' is not monotone in time."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pair       alpha* (closed form)  alpha* (brentq)    |diff|   inside its own alpha range?
O2/N2                 7.254e-05              nan       n/a                            no
CO2/CH4               6.528e+72              nan       n/a                            no
H2/N2                 7.403e-07              nan       n/a                            no
H2/CH4                  0.02475              nan       n/a                            no
He/N2                 9.609e-29              nan       n/a                            no
He/CH4                4.413e+25              nan       n/a                            no
He/H2                 8.741e-21              nan       n/a                            no
H2/CO2                    37.47        37.465372   &lt; 1e-12      YES - inside 0.489-100.9
He/CO2                1.086e-26              nan       n/a                            no

1 of 9 pairs cross inside their own tabulated selectivity range: H2/CO2, at alpha* = 37.47
(closed form and brentq agree below 1e-12 relative (here 1e-15) - the root-find exists to
 catch a sign or reciprocal slip in the closed form, not to add precision.)

Above alpha* = 37.47 the PRESENT H2/CO2 bound lies BELOW the prior one.
1 of the 7 points Table 10 tabulates sit in that region:
  alpha =   100.9  point P =    0.0545 | present bound    0.1101 | prior bound    0.1581  (present is -30.4 % of prior)

AND HOW THIN IS THAT. 'Inside the paper's own tabulated range' rests on 1 point of
the 7: alpha* = 37.47 sits between the tabulated alpha = 23.1 and alpha = 100.9,
a gap of a factor 4.4 with nothing in it. Delete the Liquid crystalline polyester (HBA/HNA 
point at alpha = 100.9 - or mis-read its decimal point, which is a break row below - and
alpha* falls outside Table 10's range and Result 2 has nothing to stand on. The crossing
itself would survive: it is a property of the two printed lines and moves only with them.
What would not survive is the claim that it happens where the paper has data. Any use of
this result has to carry that sentence with it.

The paper anticipates the cause and says so on p. 396 - the H2/CO2 shift is
"primarily a slight slope change" and "the limited number of data points at the lower
permeability area of the dataset may have skewed the slope versus the original
correlation [2]". Searched the full text for any statement that the two lines CROSS or
that the new bound falls below the old one anywhere: none - the words cross/crossing/
intersect appear only inside the polymer name 'crosslinked' and in reference titles.
So the crossing is a consequence of what the paper says, not a contradiction of it -
but it is a consequence the paper does not draw, and it is the one place in the table
where 'upper bound' is not monotone in time.</code></pre>
</div>
</div>
</section>
<section id="result-3-vertical-or-horizontal-which-measure-reproduces-the-papers-own-ranking" class="level3">
<h3 class="anchored" data-anchor-id="result-3-vertical-or-horizontal-which-measure-reproduces-the-papers-own-ranking">Result 3: Vertical or horizontal? Which measure reproduces the paper’s own ranking</h3>
<p>The paper sorts the nine pairs into <em>modest</em> (5), <em>minor</em> (1) and <em>significant</em> (3). Nothing forces that verbal sorting to agree with any particular arithmetic measure, so it is a real test of which measure Robeson was actually reasoning with.</p>
<div id="715c7821" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.698506Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.698328Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:53.784519Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:53.783688Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">rank_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb15-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb15-3">    k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[g], prior.n[g]</span>
<span id="cb15-4">    k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[g], present.n[g]</span>
<span id="cb15-5">    P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb15-6">    P_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(P))))</span>
<span id="cb15-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># horizontal shift, closed form ...</span></span>
<span id="cb15-8">    dlogA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((np.log10(P_gm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k1)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ((np.log10(P_gm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k0)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n0)</span>
<span id="cb15-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and by root-finding each bound's alpha at P_gm independently (no shared algebra).</span></span>
<span id="cb15-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># k*alpha^n - P is monotone in alpha for n &lt; 0, and [1e-6, 1e9] spans every separation</span></span>
<span id="cb15-11">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># factor in the paper by orders of magnitude; brentq raises if the root is outside it.</span></span>
<span id="cb15-12">    a1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> a: P_bound(a, k1, n1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P_gm, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb15-13">    a0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> a: P_bound(a, k0, n0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P_gm, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb15-14">    dlogA_rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(a1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(a0)</span>
<span id="cb15-15">    rank_rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, verdict<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLASS[g], dlogk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.dlogk[g], dlogP<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.shift_gm[g],</span>
<span id="cb15-16">                          dlogA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlogA, dlogA_rf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlogA_rf, alpha_gain<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> dlogA,</span>
<span id="cb15-17">                          P_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P_gm, n_pres<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n1))</span>
<span id="cb15-18">RK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rank_rows).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>).sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA"</span>, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb15-19">DLOGA_ROOTFIND_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(RK.dlogA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RK.dlogA_rf)))</span>
<span id="cb15-20"></span>
<span id="cb15-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(</span>
<span id="cb15-22">    [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ranked by SELECTIVITY gain at the pair's own geometric-mean permeability:"</span>,</span>
<span id="cb15-23">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'paper'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n_pres'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlog k'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlogP@a_gm'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb15-24">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlogA@P_gm'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha x'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb15-25">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>verdict<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_pres<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb15-26">       <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha_gain<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RK.iterrows()]))</span>
<span id="cb15-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(closed form vs independent root-find of each bound at P_gm: max |difference| below "</span></span>
<span id="cb15-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1e-12 decades (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DLOGA_ROOTFIND_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">))"</span>)</span>
<span id="cb15-29"></span>
<span id="cb15-30">SIG <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> CLASS[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"significant"</span>]</span>
<span id="cb15-31"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> top3(col):</span>
<span id="cb15-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(RK.sort_values(col, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).index[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb15-33">TOP3_A, TOP3_K, TOP3_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> top3(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA"</span>), top3(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogk"</span>), top3(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogP"</span>)</span>
<span id="cb15-34">HITS_A, HITS_K, HITS_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(TOP3_A) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(TOP3_K) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG)),</span>
<span id="cb15-35">                          <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(TOP3_P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG)))</span>
<span id="cb15-36">gap_A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(RK.dlogA.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RK.dlogA.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb15-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The paper's three 'significant' pairs: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(SIG)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  top 3 by selectivity gain dlogA : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(TOP3_A)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HITS_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3"</span>)</span>
<span id="cb15-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  top 3 by front factor  dlog k   : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(TOP3_K)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HITS_K<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3"</span>)</span>
<span id="cb15-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  top 3 by permeability  dlogP    : </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(TOP3_P)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HITS_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3"</span>)</span>
<span id="cb15-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Only the horizontal measure reproduces it, and it does so with a clean gap: "</span></span>
<span id="cb15-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"decades between third and fourth (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>gap_A<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the fourth)."</span>)</span>
<span id="cb15-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The reason is arithmetic, not taste. CO2/CH4 and He/CH4 have almost the same front-factor"</span>)</span>
<span id="cb15-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"shift (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CO2/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades) but slopes differing by "</span></span>
<span id="cb15-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(present.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CO2/CH4'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>present.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/CH4'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x"</span>)</span>
<span id="cb15-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CO2/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). Divide the vertical shift by |n| and the same"</span>)</span>
<span id="cb15-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"front-factor move buys CO2/CH4 a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha_gain[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'CO2/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in selectivity and He/CH4 a factor "</span></span>
<span id="cb15-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha_gain[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb15-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"So both of Robeson's statements are true at once: the shift IS mostly in k, AND k is the"</span>)</span>
<span id="cb15-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"wrong number to rank pairs by. The abstract's sentence is about the SHAPE of the move;"</span>)</span>
<span id="cb15-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the Conclusions' ranking is about its SIZE, and they are different quantities."</span>)</span>
<span id="cb15-53"></span>
<span id="cb15-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the evaluation point is a choice here too, so sweep it ---------------------------</span></span>
<span id="cb15-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dlogA(P) varies with P for exactly the reason dlogP(alpha) varies with alpha: the two lines</span></span>
<span id="cb15-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are not parallel. The RANKING and the GAP are two different questions and get two answers.</span></span>
<span id="cb15-57">Pmin_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS)</span>
<span id="cb15-58">Pmax_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS)</span>
<span id="cb15-59">P_ALL_GM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(PTS.P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))))</span>
<span id="cb15-60"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rank_at(Pfun, full<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb15-61">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(((g, ((np.log10(Pfun(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(present.k_barrer[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> present.n[g]</span>
<span id="cb15-62">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log10(Pfun(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(prior.k_barrer[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> prior.n[g]))</span>
<span id="cb15-63">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS), key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>z[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb15-64">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG)), d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb15-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> full <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> out</span>
<span id="cb15-66">own <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> f: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f(PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa</span></span>
<span id="cb15-67">EVAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own P_min"</span>, own(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>)),</span>
<span id="cb15-68">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own P_gm (used above)"</span>, own(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> P: np.exp(np.mean(np.log(P))))),</span>
<span id="cb15-69">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own P_median"</span>, own(np.median)),</span>
<span id="cb15-70">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own P_max"</span>, own(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>)),</span>
<span id="cb15-71">        (<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"all 117 points' geometric mean, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_ALL_GM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrer"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: P_ALL_GM)]</span>
<span id="cb15-72">EVAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"common P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrer"</span>, (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c)))</span>
<span id="cb15-73">         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>) ]</span>
<span id="cb15-74"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The evaluation point is a CHOICE here just as alpha_0 was in Result 1 - dlogA varies with"</span>)</span>
<span id="cb15-75"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"P because the lines are not parallel. Every reference below lies inside the permeability"</span>)</span>
<span id="cb15-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"range all nine pairs share (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pmin_all<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pmax_all<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrers) or is each pair's own:"</span>)</span>
<span id="cb15-77">_h, _g, _lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'evaluation point'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'top-3 hits'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gap, decades'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb15-78"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EVAL:</span>
<span id="cb15-79">    h, gp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rank_at(f)</span>
<span id="cb15-80">    _h.append(h)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> _g.append(gp)</span>
<span id="cb15-81">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span>
<span id="cb15-83">EVAL_HITS_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_h))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> EVAL_GAP_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_g))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> EVAL_GAP_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_g))</span>
<span id="cb15-84">_lab_min <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EVAL[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(_g))][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-85">_, _, THIRD_MIN, FOURTH_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rank_at(EVAL[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(_g))][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], full<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb15-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So BOTH things are true and they must be said together. The RESULT is robust: "</span></span>
<span id="cb15-87">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EVAL_HITS_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 at"</span>)</span>
<span id="cb15-88"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"every one of these references. The GAP is not: it runs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EVAL_GAP_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to "</span></span>
<span id="cb15-89">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EVAL_GAP_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades across them,"</span>)</span>
<span id="cb15-90"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EVAL_GAP_MAX<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>EVAL_GAP_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and it is smallest at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_lab_min<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, where "</span></span>
<span id="cb15-91">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>FOURTH_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - the pair the"</span>)</span>
<span id="cb15-92"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"paper calls '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLASS[FOURTH_MIN]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">' - comes within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>EVAL_GAP_MIN<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of overtaking "</span></span>
<span id="cb15-93">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THIRD_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Quoting '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>gap_A<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades' as"</span>)</span>
<span id="cb15-94"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the margin without its reference is the same mistake this page's Result 1 is about."</span>)</span>
<span id="cb15-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Outside that shared range it does eventually fail, which is a statement about"</span>)</span>
<span id="cb15-96">_lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolating past the data rather than about the result:"</span>]</span>
<span id="cb15-97"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>):</span>
<span id="cb15-98">    h, gp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rank_at(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c: c)</span>
<span id="cb15-99">    n_out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> (PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> c</span>
<span id="cb15-100">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS)</span>
<span id="cb15-101">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  common P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrer lies outside </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n_out<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the 9 pairs' own data -&gt; "</span></span>
<span id="cb15-102">                  <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3"</span>)</span>
<span id="cb15-103"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Ranked by SELECTIVITY gain at the pair's own geometric-mean permeability:
pair      paper         n_pres  dlog k dlogP@a_gm dlogA@P_gm  alpha x
He/CH4    significant   -0.809  0.5975     0.5567     0.7011    5.024
He/CO2    significant   -1.192  0.7270     0.7397     0.6135    4.107
He/H2     significant   -4.864  1.7952     1.8274     0.3713    2.351
CO2/CH4   modest        -2.636  0.6990     0.6844     0.2601    1.820
H2/CH4    modest        -1.107  0.1674     0.2853     0.2436    1.752
H2/N2     modest        -1.484  0.2661     0.3345     0.2210    1.663
He/N2     modest        -1.017  0.2017     0.2131     0.2094    1.620
H2/CO2    minor         -2.302  0.5755     0.4129     0.2025    1.594
O2/N2     modest        -5.666  0.5547     0.6741     0.1168    1.308

(closed form vs independent root-find of each bound at P_gm: max |difference| below 1e-12 decades (here 7e-16))

The paper's three 'significant' pairs: He/CH4, He/H2, He/CO2
  top 3 by selectivity gain dlogA : He/CH4, He/CO2, He/H2                    3 of 3
  top 3 by front factor  dlog k   : He/H2, He/CO2, CO2/CH4                   2 of 3
  top 3 by permeability  dlogP    : He/H2, He/CO2, CO2/CH4                   2 of 3

Only the horizontal measure reproduces it, and it does so with a clean gap: 0.3713 vs 0.2601
decades between third and fourth (0.1112 decades, 43 % of the fourth).

The reason is arithmetic, not taste. CO2/CH4 and He/CH4 have almost the same front-factor
shift (0.699 vs 0.598 decades) but slopes differing by 3.3x
(-2.636 vs -0.809). Divide the vertical shift by |n| and the same
front-factor move buys CO2/CH4 a factor 1.82 in selectivity and He/CH4 a factor 5.02.
So both of Robeson's statements are true at once: the shift IS mostly in k, AND k is the
wrong number to rank pairs by. The abstract's sentence is about the SHAPE of the move;
the Conclusions' ranking is about its SIZE, and they are different quantities.

The evaluation point is a CHOICE here just as alpha_0 was in Result 1 - dlogA varies with
P because the lines are not parallel. Every reference below lies inside the permeability
range all nine pairs share (52 to 1550 barrers) or is each pair's own:

evaluation point                              top-3 hits  gap, decades
each pair's own P_min                              3 of 3        0.0252
each pair's own P_gm (used above)                  3 of 3        0.1112
each pair's own P_median                           3 of 3        0.0333
each pair's own P_max                              3 of 3        0.0113
all 117 points' geometric mean, 241 barrer         3 of 3        0.0736
common P = 100 barrer                              3 of 3        0.0453
common P = 1000 barrer                             3 of 3        0.1080

So BOTH things are true and they must be said together. The RESULT is robust: 3 of 3 at
every one of these references. The GAP is not: it runs 0.0113 to 0.1112 decades across them,
a factor 10, and it is smallest at each pair's own P_max, where H2/CO2 - the pair the
paper calls 'minor' - comes within 3 % of overtaking He/H2. Quoting '0.111 decades' as
the margin without its reference is the same mistake this page's Result 1 is about.
Outside that shared range it does eventually fail, which is a statement about
extrapolating past the data rather than about the result:
  common P =        1 barrer lies outside 6 of the 9 pairs' own data -&gt; 2 of 3
  common P =       10 barrer lies outside 5 of the 9 pairs' own data -&gt; 2 of 3
  common P =   100000 barrer lies outside 9 of the 9 pairs' own data -&gt; 2 of 3</code></pre>
</div>
</div>
<div id="9951b5d4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:53.786287Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:53.786138Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.182694Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.181858Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The picture: the nine comparable pairs, both bounds, and the paper's own near-bound points.</span></span>
<span id="cb17-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Re-plotted from the transcribed tables - no source figure is traced or reproduced.</span></span>
<span id="cb17-3">order <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(RK.index)</span>
<span id="cb17-4">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">12.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.2</span>))</span>
<span id="cb17-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ax, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(axes.ravel(), order):</span>
<span id="cb17-6">    sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb17-7">    k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[g], prior.n[g]</span>
<span id="cb17-8">    k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[g], present.n[g]</span>
<span id="cb17-9">    Pgrid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.logspace(np.log10(sub.P_fast_barrer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>,</span>
<span id="cb17-10">                        np.log10(sub.P_fast_barrer.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb17-11">    ax.loglog(Pgrid, alpha_bound(Pgrid, k0, n0), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.45"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior (1991/94)"</span>)</span>
<span id="cb17-12">    ax.loglog(Pgrid, alpha_bound(Pgrid, k1, n1), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present (2008)"</span>)</span>
<span id="cb17-13">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> excursion(sub.P_fast_barrer, sub.alpha, k1, n1)</span>
<span id="cb17-14">    ax.loglog(sub.P_fast_barrer[r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], sub.alpha[r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, mec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>,</span>
<span id="cb17-15">              mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tabulated, on/below"</span>)</span>
<span id="cb17-16">    ax.loglog(sub.P_fast_barrer[r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], sub.alpha[r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gold"</span>, mec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k"</span>,</span>
<span id="cb17-17">              mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tabulated, ABOVE"</span>)</span>
<span id="cb17-18">    ax.set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CLASS[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">log</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">alpha$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogA[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)</span>
<span id="cb17-19">    ax.set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$P$ fast gas, barrer"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb17-20">    ax.set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\a</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">lpha</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb17-21">    ax.tick_params(labelsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb17-22">axes.ravel()[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower left"</span>)</span>
<span id="cb17-23">fig.suptitle(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Robeson upper bounds, nine comparable gas pairs, ordered by selectivity gain"</span>,</span>
<span id="cb17-24">             fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb17-25">fig.tight_layout(rect<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.97</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/H1.8-robeson-upper-bound/index_files/figure-html/cell-11-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="result-4-how-many-of-the-papers-own-close-to-the-bound-points-are-above-it" class="level3">
<h3 class="anchored" data-anchor-id="result-4-how-many-of-the-papers-own-close-to-the-bound-points-are-above-it">Result 4: How many of the paper’s own “close to the bound” points are above it</h3>
<p>Table 1–11 rows are, by their captions, <em>“experimental data points close to the present empirical upper bound”</em>. The line was drawn by eye. So: at each tabulated point, <img src="https://latex.codecogs.com/png.latex?r%20=%20P/(k%5Calpha%5E%7Bn%7D)"> against the pair’s own present bound, and the same against the prior bound.</p>
<div id="68dda843" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.185850Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.185647Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.219352Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.218778Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1">ex_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb18-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS_ALL:</span>
<span id="cb18-3">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(PTS.gas_pair):</span>
<span id="cb18-4">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb18-5">    sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb18-6">    k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[g], present.n[g]</span>
<span id="cb18-7">    r1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(excursion(sub.P_fast_barrer, sub.alpha, k1, n1), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb18-8">    a_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n1)              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same excursion read as a selectivity ratio</span></span>
<span id="cb18-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(prior.k_barrer[g]):</span>
<span id="cb18-10">        r0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(excursion(sub.P_fast_barrer, sub.alpha, prior.k_barrer[g], prior.n[g]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb18-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb18-12">        r0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.full(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sub), np.nan)</span>
<span id="cb18-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (_, row), rr1, rr0, aa <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(sub.iterrows(), r1, r0, a_ratio):</span>
<span id="cb18-14">        ex_rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(gas_pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, polymer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>row.polymer, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>row.P_fast_barrer, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>row.alpha,</span>
<span id="cb18-15">                            r_present<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rr1, alpha_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>aa, r_prior<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rr0))</span>
<span id="cb18-16">EX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(ex_rows)</span>
<span id="cb18-17">N_POINTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EX)</span>
<span id="cb18-18">N_ABOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((EX.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb18-19">FRAC_ABOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_ABOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N_POINTS</span>
<span id="cb18-20">R_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EX.r_present.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> R_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EX.r_present.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb18-21">R_GEOMEAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(EX.r_present))))</span>
<span id="cb18-22"></span>
<span id="cb18-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'above'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'r min'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'r max'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'geo-mean r'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb18-24">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sub)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((sub.r_present<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sub<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>r_present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb18-25">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sub<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>r_present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>exp(np.mean(np.log(sub.r_present)))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-26">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, sub <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EX.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>, sort<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)]))</span>
<span id="cb18-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_ABOVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_POINTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tabulated points (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>FRAC_ABOVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %) lie ABOVE the very "</span></span>
<span id="cb18-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"bound they are tabulated against."</span>)</span>
<span id="cb18-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"r ranges </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_MIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; geometric mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_GEOMEAN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - so the typical "</span></span>
<span id="cb18-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"tabulated point sits a factor"</span>)</span>
<span id="cb18-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>R_GEOMEAN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> BELOW the line in permeability, and the line is a genuine envelope in the "</span></span>
<span id="cb18-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"aggregate."</span>)</span>
<span id="cb18-33"></span>
<span id="cb18-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The five largest excursions, and what the paper says about them:"</span>]</span>
<span id="cb18-35">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>gas_pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> P=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> alpha=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  r=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>r_present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb18-36">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha_ratio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x the bound selectivity)  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>polymer[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">44</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb18-37">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EX.sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r_present"</span>, ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).head(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>).iterrows()]))</span>
<span id="cb18-38"></span>
<span id="cb18-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The two points the paper itself flags, located from the numbers in its own sentences</span></span>
<span id="cb18-40"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (printed-claims dataset), not from numbers typed here.</span></span>
<span id="cb18-41"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> re</span>
<span id="cb18-42"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> quote_numbers(claim_id):</span>
<span id="cb18-43">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The numbers printed in one quoted sentence, in order."""</span></span>
<span id="cb18-44">    q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CLM[CLM.claim_id <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> claim_id].quote.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> re.findall(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">?&lt;</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">!</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">[</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\w</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">.]</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>(?:<span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\.</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\d</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">?</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, q)]</span>
<span id="cb18-46">_qP, _qa <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quote_numbers(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o2n2_questioned"</span>)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:]           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "P(O2) = 18 barrers; alpha = 9.0"</span></span>
<span id="cb18-47">_q, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX.index[(EX.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (EX.P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> _qP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (EX.alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> _qa)]</span>
<span id="cb18-48">Q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX.loc[_q]</span>
<span id="cb18-49">_rank <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((EX.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> Q.r_present).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  The O2/N2 point at P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is r = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Q<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>r_present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, excursion number "</span></span>
<span id="cb18-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_rank<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EX)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in the whole compilation,"</span>)</span>
<span id="cb18-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and the paper flags exactly it: 'The position of the one data point above the present upper"</span>)</span>
<span id="cb18-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  bound (P(O2) = 18 barrers; alpha(O2/N2) = 9.0) is questioned as only one significant"</span>)</span>
<span id="cb18-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  figure was noted for nitrogen permeability.'"</span>)</span>
<span id="cb18-55">_o2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX[EX.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>]</span>
<span id="cb18-56">N_ABOVE_O2N2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_o2.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb18-57">_other <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _o2[(_o2.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (_o2.index <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> _q)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The arithmetic sharpens the paper's own wording: it says 'the ONE data point above"</span>)</span>
<span id="cb18-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the present upper bound' for O2/N2, and Table 1 in fact has </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_ABOVE_O2N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the other is"</span>)</span>
<span id="cb18-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_other<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>polymer<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_other<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_other<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, r = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_other<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>r_present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb18-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"at the far low-permeability end"</span>)</span>
<span id="cb18-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  where a hand-drawn line is least constrained. Reported, not repaired."</span>)</span>
<span id="cb18-63"></span>
<span id="cb18-64">_listed, _realistic <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quote_numbers(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2ch4_repair"</span>)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "listed as 80.2 ... be 180.2"</span></span>
<span id="cb18-65">_t9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX[EX.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>]</span>
<span id="cb18-66">_m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _t9[np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(_t9.P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _listed, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> _t9.alpha]     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the row whose alpha is P / 80.2</span></span>
<span id="cb18-67"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly one Table 9 row must carry the as-listed CH4 permeability"</span></span>
<span id="cb18-68">N2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _m.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-69">_r9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_t9.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> N2.r_present).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb18-70"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  And the N2/CH4 point the paper doubts on other grounds (P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb18-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the one whose CH4"</span>)</span>
<span id="cb18-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  permeability it says 'would be more realistic to be </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_realistic<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrers') is excursion "</span></span>
<span id="cb18-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"number </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_r9<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_t9)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in Table 9:"</span>)</span>
<span id="cb18-74"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  r = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>r_present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Consistency check on the tabulated alpha: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_listed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = "</span></span>
<span id="cb18-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_listed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which rounds to the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span>)</span>
<span id="cb18-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_realistic<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>_realistic<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> does not. So Table 9 carries the "</span></span>
<span id="cb18-77">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"UNREPAIRED value and this page uses it as printed."</span>)</span>
<span id="cb18-78"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(N2.P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _listed, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N2.alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(N2.P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _realistic, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pair        N above   r min   r max geo-mean r
O2/N2      10     2   0.396   3.289      0.734
CO2/CH4    16     1   0.178   3.492      0.459
H2/N2       8     1   0.628   1.010      0.788
H2/CH4      8     1   0.659   1.154      0.788
He/N2       9     2   0.317   1.287      0.628
He/CH4     11     4   0.158   1.437      0.625
He/H2      12     1   0.022   1.180      0.222
CO2/N2      6     2   0.443   1.739      0.925
N2/CH4     18     2   0.045   1.074      0.227
H2/CO2      7     2   0.495   1.197      0.741
He/CO2     12     1   0.189   1.110      0.423

19 of 117 tabulated points (16.2 %) lie ABOVE the very bound they are tabulated against.
r ranges 0.022 to 3.492; geometric mean 0.478 - so the typical tabulated point sits a factor
2.1 BELOW the line in permeability, and the line is a genuine envelope in the aggregate.

The five largest excursions, and what the paper says about them:
  CO2/CH4   P=   0.029 alpha=    2200  r= 3.492 (= 1.607x the bound selectivity)  PVSH doped polyaniline
  O2/N2     P=      18 alpha=       9  r= 3.289 (= 1.234x the bound selectivity)  Polyimide (BADBSBF-BTDA)
  CO2/N2    P=    2000 alpha=    34.2  r= 1.739 (= 1.211x the bound selectivity)  Modified poly(dimethylsiloxane)
  He/CH4    P=     476 alpha=     157  r= 1.437 (= 1.565x the bound selectivity)  Hyflon AD60X (solution cast)
  He/CH4    P=     405 alpha=     169  r= 1.298 (= 1.380x the bound selectivity)  Hyflon AD60X (melt pressed)

  The O2/N2 point at P = 18, alpha = 9 is r = 3.289, excursion number 2 of 117 in the whole compilation,
  and the paper flags exactly it: 'The position of the one data point above the present upper
  bound (P(O2) = 18 barrers; alpha(O2/N2) = 9.0) is questioned as only one significant
  figure was noted for nitrogen permeability.'
  The arithmetic sharpens the paper's own wording: it says 'the ONE data point above
  the present upper bound' for O2/N2, and Table 1 in fact has 2; the other is
  Polyimide (BPDA-ODA) at P = 0.079, alpha = 19.8, r = 1.258, at the far low-permeability end
  where a hand-drawn line is least constrained. Reported, not repaired.

  And the N2/CH4 point the paper doubts on other grounds (P = 153, alpha = 1.9, the one whose CH4
  permeability it says 'would be more realistic to be 180.2 barrers') is excursion number 1 of 18 in Table 9:
  r = 1.074. Consistency check on the tabulated alpha: 153/80.2 = 1.908, which rounds to the printed 1.9;
  153/180.2 = 0.849 does not. So Table 9 carries the UNREPAIRED value and this page uses it as printed.</code></pre>
</div>
</div>
<div id="25eef8eb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.220931Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.220793Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.233088Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.232270Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The same measurement against the PRIOR bound: how far the 2008 points sit above the 1991 line.</span></span>
<span id="cb20-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># This is the shift measured with data instead of with fitted lines.</span></span>
<span id="cb20-3">prior_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb20-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb20-5">    sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX[EX.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb20-6">    prior_rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sub), n_above<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((sub.r_prior <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()),</span>
<span id="cb20-7">                           rmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sub.r_prior.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb20-8">                           gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(sub.r_prior))))))</span>
<span id="cb20-9">PR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(prior_rows).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb20-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;3s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'above prior'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max r_prior'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'geo-mean r_prior'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;17s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb20-11">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.n)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:3d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.n_above)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rmax<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12.3g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>gm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:17.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-12">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PR.iterrows()]))</span>
<span id="cb20-13">N_ABOVE_PRIOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(PR.n_above.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> N_PRIOR_POINTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(PR.n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb20-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_ABOVE_PRIOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_PRIOR_POINTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points on the nine comparable pairs exceed the 1991/94 bound "</span></span>
<span id="cb20-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>N_ABOVE_PRIOR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>N_PRIOR_POINTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %),"</span>)</span>
<span id="cb20-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((EX[EX.gas_pair.isin(PAIRS)].r_present<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> that exceed the 2008 one. That is the shift, seen from the data side."</span>)</span>
<span id="cb20-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"He/H2 is the extreme: all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of its points beat the 1991 line, the furthest by a factor "</span></span>
<span id="cb20-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rmax[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb20-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"He/N2 is the quiet one: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_above[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/N2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/N2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, max </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rmax[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/N2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - matching the paper's"</span>)</span>
<span id="cb20-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"'The upper bound shift since 1991 is very minor in spite of the much larger dataset"</span>)</span>
<span id="cb20-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"available presently.'"</span>)</span>
<span id="cb20-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">CAUTION, and it is not small: these points are 2008 data. That they beat a 1991 line drawn"</span>)</span>
<span id="cb20-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"on 1991 data is expected, not evidence of anything the paper claims. The number is a"</span>)</span>
<span id="cb20-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"MAGNITUDE for the shift, computed without using k or n of the present bound at all - which"</span>)</span>
<span id="cb20-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"is its only real use, and why it appears here rather than among the validations."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pair        N above prior  max r_prior  geo-mean r_prior
O2/N2      10          10         15.8             3.464
CO2/CH4    16          15         16.2             2.222
H2/N2       8           8         2.51             1.702
H2/CH4      8           8          3.1             1.521
He/N2       9           5         2.11             1.025
He/CH4     11           9         5.06             2.251
He/H2      12          12           81            14.888
H2/CO2      7           5         5.68             1.917
He/CO2     12          11         6.23             2.320

83 of 93 points on the nine comparable pairs exceed the 1991/94 bound (89 %),
against 15 that exceed the 2008 one. That is the shift, seen from the data side.
He/H2 is the extreme: all 12 of its points beat the 1991 line, the furthest by a factor 81.
He/N2 is the quiet one: 5 of 9, max 2.11 - matching the paper's
'The upper bound shift since 1991 is very minor in spite of the much larger dataset
available presently.'

CAUTION, and it is not small: these points are 2008 data. That they beat a 1991 line drawn
on 1991 data is expected, not evidence of anything the paper claims. The number is a
MAGNITUDE for the shift, computed without using k or n of the present bound at all - which
is its only real use, and why it appears here rather than among the validations.</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Four checks, and the first thing to say is which of them is a <strong>second route</strong> and which is a <strong>consistency identity</strong>: an identity dressed as corroboration is the error that costs a page its credibility.</p>
<p><strong>V1: internal identity.</strong> Tables 13a/13b are computed <em>from</em> Table 12, so reproducing all 26 of their rows is a genuine test of every present <img src="https://latex.codecogs.com/png.latex?(k,n)"> pair and of the prior pair for He/H2 and H2/CO2. It shares Table 12 as an <em>input</em>, so it cannot detect an error Robeson himself made; it detects errors <em>this page</em> could have made, which is what it is for.</p>
<p><strong>V2: a consistency identity, NOT a second route.</strong> Tables 13a and 13b each evaluate He/H2 and H2/CO2 at one selectivity on <strong>both</strong> bounds, so the ratio of the two printed permeabilities looks like an independently computed shift. It is not independent. Robeson’s transition permeability <em>is</em> <img src="https://latex.codecogs.com/png.latex?k%5Calpha%5En"> evaluated on the same Table 12 line V1 tests, so for two rows at the same <img src="https://latex.codecogs.com/png.latex?%5Calpha"></p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Clog_%7B10%7D%5Cfrac%7BP_1%7D%7BP_0%7D%0A=%20%5Cunderbrace%7B(%5CDelta%5Clog_%7B10%7Dk%20+%20%5CDelta%20n%5Clog_%7B10%7D%5Calpha)%7D_%7B%5Ctext%7Bthe%20decomposition%7D%7D%0A-%20%5Cunderbrace%7B%5Cbig%5B%5Clog_%7B10%7D(1+%5Crho_1)%20-%20%5Clog_%7B10%7D(1+%5Crho_0)%5Cbig%5D%7D_%7B%5Ctext%7Bthe%20two%20V1%20residuals%7D%7D,%0A"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Crho%20=%20P_%7Bk%5Calpha%5En%7D/P_%7B%5Ctext%7Bprinted%7D%7D%20-%201"> each row’s V1 relative deviation, <img src="https://latex.codecogs.com/png.latex?P_%7B%5Ctext%7Bprinted%7D%7D%20=%20k%5Calpha%5En/(1+%5Crho)">. So <strong>V2’s residual is the difference of the two corresponding V1 residuals</strong>, and nothing else. The cell below measures that rather than asserting it. V2 therefore cannot fail unless V1 fails on those same four rows; what it <em>does</em> have is power over <strong>this page’s own decomposition code</strong>. A natural-log-for-<img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D"> slip changes the value of many claims, and V2 is the one that says the result is wrong rather than merely different: a residual that should sit at the level of the printing, below <img src="https://latex.codecogs.com/png.latex?10%5E%7B-3%7D"> decades, becomes of order one. That is the only reason V2 is kept, and it is a real one, but it is a unit test of this page, not evidence about Robeson.</p>
<p><strong>Result 1’s decomposition has no arithmetic second route, and cannot have one.</strong> Given Table 12, <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20P(%5Calpha)=%5CDelta%5Clog%20k+%5CDelta%20n%5Clog%5Calpha"> is a rearrangement, not a claim: any quantity built from the same two lines reproduces it identically. The cell below demonstrates that on a second candidate, the <em>data-side</em> shift (the ratio of the geometric-mean excursions of a pair’s own points above the prior and present bounds), which also comes out equal to the decomposition to machine precision. Two identities are not two routes.</p>
<p><strong>V3: the second route, and it is a real one.</strong> The one check here that does <em>not</em> take Table 12’s present block as an input: a covering line re-estimated from the paper’s own 117 near-bound points by a deterministic envelope estimator. Substituting it for the printed present line gives an <strong>envelope-implied shift</strong> that shares no arithmetic and no input with the decomposition <strong>except two things, both named</strong>: the prior block, which both routes read from the same restatement, and the reference selectivity <img src="https://latex.codecogs.com/png.latex?%5Calpha_0">, which both routes take from Tables 1–11. The residual between the two routes is exactly V3’s offset at <img src="https://latex.codecogs.com/png.latex?%5Calpha_0">, which is why that quantity is the headline of this section rather than a footnote, and, because it carries <img src="https://latex.codecogs.com/png.latex?%5Clog%5Calpha_0"> explicitly, it is itself reference-dependent for the same reason the front-factor share is, so it is swept across references and reported with its reference attached, exactly as Result 3’s gap is. It is weak where the lever arm is short and it is labelled so, with the measurement to show which pairs those are. It is also the only check on this page whose failure could indict <em>Robeson</em> rather than this page.</p>
<p><strong>V4</strong> is the break table: every claim on the page is recomputed with each defect injected, and a claim counts as protected only where its own check fails.</p>
<section id="v1-tables-13a13b-reproduce-from-table-12" class="level3">
<h3 class="anchored" data-anchor-id="v1-tables-13a13b-reproduce-from-table-12">V1: Tables 13a/13b reproduce from Table 12</h3>
<p>Three nested checks, each catching something the previous cannot: the molecular-weight column from molecular weights; the product column from its two factors; and the permeability column from Table 12’s <img src="https://latex.codecogs.com/png.latex?(k,n)">.</p>
<div id="3d7ae820" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.234533Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.234310Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.243835Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.243184Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1">MW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">32.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">28.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CO2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CH4"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.0</span>}</span>
<span id="cb22-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sqrtM(pair):</span>
<span id="cb22-3">    i, j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pair.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>)</span>
<span id="cb22-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.sqrt(MW[j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> MW[i])</span>
<span id="cb22-5"></span>
<span id="cb22-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ulp(s):</span>
<span id="cb22-7">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Half a unit in the last printed decimal place of the string `s` (commas stripped)."""</span></span>
<span id="cb22-8">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(s).replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>).lstrip(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)</span>
<span id="cb22-9">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> s <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb22-10"></span>
<span id="cb22-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (a) the (Mj/Mi)^(1/2) column, from integer molecular weights -----------------</span></span>
<span id="cb22-12">T13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13.assign(sqrtM_calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[sqrtM(g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T13.gas_pair])</span>
<span id="cb22-13">T13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13.assign(mw_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.sqrtM_calc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d.sqrt_M_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-14">MW_MAX_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T13.mw_rel)))</span>
<span id="cb22-15">IUPAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.002602</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.016</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">31.998</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">28.014</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CO2"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">44.009</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CH4"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.043</span>}</span>
<span id="cb22-16">sqrtM_iupac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([np.sqrt(IUPAC[g.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> IUPAC[g.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T13.gas_pair])</span>
<span id="cb22-17">MW_MAX_REL_IUPAC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sqrtM_iupac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T13.sqrt_M_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb22-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(a) (Mj/Mi)^(1/2) column, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T13)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows"</span>)</span>
<span id="cb22-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    integer molecular weights : max |rel. dev| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_MAX_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    IUPAC standard weights    : max |rel. dev| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_MAX_REL_IUPAC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb22-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MW_MAX_REL_IUPAC<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MW_MAX_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x worse)"</span>)</span>
<span id="cb22-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    -&gt; the convention is identified, not assumed: H2/N2 prints "</span></span>
<span id="cb22-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T13[(T13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'13a'</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2/N2'</span>)]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt_M_ratio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = sqrt(28/2), not "</span></span>
<span id="cb22-24">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(IUPAC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'N2'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>IUPAC[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb22-25"></span>
<span id="cb22-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (b) the product column ks*(Mj/Mi)^(1/2) --------------------------------------</span></span>
<span id="cb22-27">T13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13.assign(prod_calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d.sqrt_M_ratio,</span>
<span id="cb22-28">                 prod_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d.sqrt_M_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d.ks_D_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-29">PROD_MAX_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T13.prod_rel)))</span>
<span id="cb22-30">worst_prod <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13.loc[T13.prod_rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().idxmax()]</span>
<span id="cb22-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(b) product column ks*(Mj/Mi)^(1/2), </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T13)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows: max |rel. dev| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PROD_MAX_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    worst row </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst_prod<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst_prod<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>gas_pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst_prod<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ks_D_ratio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb22-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"computed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst_prod<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>prod_calc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    (printed to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(worst_prod.ks_D_as_printed.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'.'</span>)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decimals, so a rounding "</span></span>
<span id="cb22-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"band of +-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ulp(worst_prod.ks_D_as_printed)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>worst_prod<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ks_D_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on that cell alone)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>(a) (Mj/Mi)^(1/2) column, 26 rows
    integer molecular weights : max |rel. dev| = 1.51e-04
    IUPAC standard weights    : max |rel. dev| = 3.87e-03  (26x worse)
    -&gt; the convention is identified, not assumed: H2/N2 prints 3.742 = sqrt(28/2), not 3.728.

(b) product column ks*(Mj/Mi)^(1/2), 26 rows: max |rel. dev| = 1.62e-03
    worst row 13b N2/CH4: printed 0.1257, computed 0.125496
    (printed to 4 decimals, so a rounding band of +-0.040 % on that cell alone)</code></pre>
</div>
</div>
<div id="927fa413" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.245560Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.245429Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.268757Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.267984Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (c) the permeability column, from Table 12's (k, n) --------------------------</span></span>
<span id="cb24-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Worst-case band: each printed input contributes its own half-ulp, added in absolute value.</span></span>
<span id="cb24-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   dP/P from k : ulp(k)/k</span></span>
<span id="cb24-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   dP/P from n : |ln(alpha)| * ulp(n)</span></span>
<span id="cb24-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   dP/P from alpha (the product column) : |n| * ulp(alpha)/alpha</span></span>
<span id="cb24-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#   plus the half-ulp of the printed P itself.</span></span>
<span id="cb24-7">res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb24-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T13.iterrows():</span>
<span id="cb24-9">    src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> present</span>
<span id="cb24-10">    k, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> src.k_barrer[r.gas_pair], src.n[r.gas_pair]</span>
<span id="cb24-11">    kp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> src.k_as_printed[r.gas_pair]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> npr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> src.n_as_printed[r.gas_pair]</span>
<span id="cb24-12">    P_calc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_bound(r.ks_D_ratio, k, n))</span>
<span id="cb24-13">    band_tight <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ulp(kp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(r.ks_D_ratio)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ulp(npr)</span>
<span id="cb24-14">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ulp(r.ks_D_as_printed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.ks_D_ratio</span>
<span id="cb24-15">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ulp(r.P_transition_barrer) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.P_transition_barrer)</span>
<span id="cb24-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># generous band: trailing zeros are placeholders -&gt; 4 significant figures on k and on P</span></span>
<span id="cb24-17">    sig4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (np.floor(np.log10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb24-18">    band_loose <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (sig4(k) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(r.ks_D_ratio)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ulp(npr)</span>
<span id="cb24-19">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ulp(r.ks_D_as_printed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.ks_D_ratio</span>
<span id="cb24-20">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sig4(r.P_transition_barrer) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.P_transition_barrer)</span>
<span id="cb24-21">    res.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r.table, pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r.gas_pair, dataset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r.dataset, P_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r.P_transition_barrer,</span>
<span id="cb24-22">                    P_calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P_calc, rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P_calc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.P_transition_barrer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb24-23">                    band_tight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>band_tight, band_loose<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>band_loose))</span>
<span id="cb24-24">V1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(res)</span>
<span id="cb24-25">V1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V1.assign(inside_tight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> d.band_tight,</span>
<span id="cb24-26">               inside_loose<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> d: d.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> d.band_loose)</span>
<span id="cb24-27">T13_MAX_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb24-28">T13_MED_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().median())</span>
<span id="cb24-29">N_INSIDE_TIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(V1.inside_tight.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> N_INSIDE_LOOSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(V1.inside_loose.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb24-30">worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V1.loc[V1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().idxmax()]</span>
<span id="cb24-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Computed unconditionally, not inside the diagnostic branch: alpha_bound applied to the</span></span>
<span id="cb24-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed permeability of the row that fails, so it exists whether or not the branch runs.</span></span>
<span id="cb24-33">_r13a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13[(T13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb24-34">T13A_O2N2_BACKOUT_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(alpha_bound(_r13a.P_transition_barrer, present.k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>],</span>
<span id="cb24-35">                                          present.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _r13a.ks_D_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-36"></span>
<span id="cb24-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tbl'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'set'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'P printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'P = k*alpha^n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb24-38">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tight band'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'in?'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb24-39">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dataset<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P_printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>P_calc<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb24-40">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">% </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>band_tight<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">% </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'yes'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>inside_tight <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'NO'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-41">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> V1.iterrows()]))</span>
<span id="cb24-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows. Median |deviation| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T13_MED_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, max </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>T13_MAX_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % "</span></span>
<span id="cb24-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb24-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Inside the LITERAL printing band: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_INSIDE_TIGHT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  Inside the GENEROUS "</span></span>
<span id="cb24-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(4-significant-figure) band: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_INSIDE_LOOSE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V1)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb24-46">out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V1[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>V1.inside_loose]</span>
<span id="cb24-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(out):</span>
<span id="cb24-48">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> out.iterrows():</span>
<span id="cb24-49">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">OUTSIDE EVEN THE GENEROUS BAND: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % against "</span></span>
<span id="cb24-50">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"+-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>band_loose<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb24-51">        src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> prior</span>
<span id="cb24-52">        k, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> src.k_barrer[r.pair], src.n[r.pair]</span>
<span id="cb24-53">        a_needed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(alpha_bound(r.P_printed, k, n))</span>
<span id="cb24-54">        a_print <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T13[(T13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.table) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.pair)].ks_D_ratio.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb24-55">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Backing the printed P out through the same bound needs alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a_needed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb24-56">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the table prints </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a_print<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb24-57">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  That is a </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(a_needed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a_print<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % difference in the last digit of a "</span></span>
<span id="cb24-58">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_r13a.ks_D_as_printed.replace(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'.'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-digit cell - a small internal"</span>)</span>
<span id="cb24-59">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  inconsistency in one row of Table 13a, reported and not repaired. It changes no"</span>)</span>
<span id="cb24-60">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  conclusion here: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is a Knudsen-transition estimate, and Table 12's own "</span></span>
<span id="cb24-61">              <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(k, n) for it are"</span>)</span>
<span id="cb24-62">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  confirmed by the other table (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V1[(V1.pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span>r.pair)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span>(V1.table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'13b'</span>)].rel.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % in 13b)."</span>)</span>
<span id="cb24-63">_out_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V1[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>V1.inside_tight]</span>
<span id="cb24-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Outside the LITERAL band: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, |deviation| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r.rel)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % against "</span></span>
<span id="cb24-65">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>band_tight<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r.rel)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r.band_tight <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % over it."</span></span>
<span id="cb24-66">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _out_t.iterrows()))</span>
<span id="cb24-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">What V1 can detect: a misread glyph, a lost digit or a dropped comma in any present (k, n)"</span>)</span>
<span id="cb24-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"of Table 12, or in the prior (k, n) of He/H2 and H2/CO2, which moves a row far outside its"</span>)</span>
<span id="cb24-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"printing band (break rows C, G9, G8, DD, DP). What it cannot detect on its own: an error in"</span>)</span>
<span id="cb24-70"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the LAST printed digit, which stays inside the band (break row D1 leaves the two present"</span>)</span>
<span id="cb24-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"He/H2 rows inside theirs); such an error is caught only against the committed baseline. Nor anything"</span>)</span>
<span id="cb24-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"about Table 12 itself, which is an input on both sides, nor the prior (k, n) of the other"</span>)</span>
<span id="cb24-73"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"seven pairs, which Table 13 never touches."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>tbl  pair      set         P printed  P = k*alpha^n   rel dev  tight band  in?
13a  O2/N2     present       156,500        155,542   -0.612%      0.212%   NO
13a  H2/N2     present       126,130        126,042   -0.069%      0.090%  yes
13a  H2/CH4    present       140,400        140,426   +0.019%      0.320%  yes
13a  He/N2     present        53,070         53,068   -0.003%      0.185%  yes
13a  He/CH4    present       124,620        124,532   -0.071%      0.509%  yes
13a  He/H2     present     2,817,000      2,819,926   +0.104%      0.577%  yes
13a  He/H2     prior          48,510         48,505   -0.010%      0.604%  yes
13a  CO2/CH4   present       169,520        169,568   +0.028%      0.101%  yes
13a  N2/CH4    present       939,300        939,240   -0.006%      0.920%  yes
13a  CO2/N2    present        15,980         15,976   -0.022%      0.239%  yes
13a  He/CO2    present       269,440        269,545   +0.039%      0.214%  yes
13a  H2/CO2    present     2,799,000      2,799,407   +0.015%      0.170%  yes
13a  H2/CO2    prior         267,900        267,906   +0.002%      0.072%  yes
13b  O2/N2     present        18,700         18,695   -0.027%      0.054%  yes
13b  H2/N2     present        20,050         20,052   +0.011%      0.011%   NO
13b  H2/CH4    present        83,000         83,006   +0.008%      0.204%  yes
13b  He/N2     present        30,655         30,657   +0.007%      0.033%  yes
13b  He/CH4    present       149,470        149,463   -0.005%      0.177%  yes
13b  He/H2     present    85,050,000     85,000,721   -0.058%      0.184%  yes
13b  He/H2     prior       1,556,600      1,556,652   +0.003%      0.170%  yes
13b  CO2/CH4   present     1,252,000      1,252,542   +0.043%      0.104%  yes
13b  N2/CH4    present    29,460,000     29,459,748   -0.001%      0.302%  yes
13b  CO2/N2    present        15,750         15,744   -0.039%      0.239%  yes
13b  He/CO2    present       142,800        142,808   +0.006%      0.292%  yes
13b  H2/CO2    present       163,600        163,666   +0.040%      0.144%  yes
13b  H2/CO2    prior          24,590         24,591   +0.002%      0.098%  yes

26 rows. Median |deviation| 0.017 %, max 0.612 % (13a O2/N2).
Inside the LITERAL printing band: 24/26.  Inside the GENEROUS (4-significant-figure) band: 25/26.

OUTSIDE EVEN THE GENEROUS BAND: 13a O2/N2, -0.612 % against +-0.279 %.
  Backing the printed P out through the same bound needs alpha = 1.4714; the table prints 1.473.
  That is a -0.11 % difference in the last digit of a 4-digit cell - a small internal
  inconsistency in one row of Table 13a, reported and not repaired. It changes no
  conclusion here: O2/N2 is a Knudsen-transition estimate, and Table 12's own (k, n) for it are
  confirmed by the other table (-0.027 % in 13b).
Outside the LITERAL band: 13a O2/N2, |deviation| 0.612 % against 0.212 %, 188.6 % over it.
Outside the LITERAL band: 13b H2/N2, |deviation| 0.011 % against 0.011 %, 0.2 % over it.

What V1 can detect: a misread glyph, a lost digit or a dropped comma in any present (k, n)
of Table 12, or in the prior (k, n) of He/H2 and H2/CO2, which moves a row far outside its
printing band (break rows C, G9, G8, DD, DP). What it cannot detect on its own: an error in
the LAST printed digit, which stays inside the band (break row D1 leaves the two present
He/H2 rows inside theirs); such an error is caught only against the committed baseline. Nor anything
about Table 12 itself, which is an input on both sides, nor the prior (k, n) of the other
seven pairs, which Table 13 never touches.</code></pre>
</div>
</div>
</section>
<section id="v2-a-consistency-identity-on-the-decomposition-code" class="level3">
<h3 class="anchored" data-anchor-id="v2-a-consistency-identity-on-the-decomposition-code">V2: a consistency identity on the decomposition code</h3>
<p>For He/H2 and H2/CO2, Tables 13a and 13b each print the transition permeability <strong>twice</strong>, once on the present bound and once on the prior one, at <em>identical</em> selectivity. Their ratio is <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog_%7B10%7DP(%5Calpha)"> at that selectivity, set beside <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog_%7B10%7Dk%20+%20%5CDelta%20n%5Clog_%7B10%7D%5Calpha">.</p>
<p><strong>What this can and cannot catch.</strong> It can catch a natural-log-for-<img src="https://latex.codecogs.com/png.latex?%5Clog_%7B10%7D"> slip, a sign error, or a prior/present swap in <em>this page’s</em> decomposition formula; the break table below shows it failing under all three. It cannot catch anything about Table 12, and it is not a second route to Result 1: the printed side is <img src="https://latex.codecogs.com/png.latex?k%5Calpha%5En"> on the same two lines, so the comparison is an algebraic tautology whose residual is fixed entirely by V1. The cell measures that: the four V2 residuals are set against the corresponding differences of V1 residuals, and against a second candidate identity, the shift read off the <em>data</em> rather than off the lines.</p>
<p>What the four rows are genuinely good for is the <strong>reference-dependence</strong>: the same two pairs, the same two bounds, four different selectivities, and a front-factor share that moves with them. Those are numbers Robeson printed, not numbers this page chose.</p>
<div id="5f4f3271" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.270430Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.270304Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.298999Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.298140Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1">v2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb26-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>):</span>
<span id="cb26-3">    sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13[T13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> tab]</span>
<span id="cb26-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sub.gas_pair[sub.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>]:</span>
<span id="cb26-5">        row_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub[(sub.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (sub.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-6">        row_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub[(sub.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (sub.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-7">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> row_p.ks_D_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> row_q.ks_D_ratio, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two rows must sit at the same alpha"</span></span>
<span id="cb26-8">        alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row_p.ks_D_ratio)</span>
<span id="cb26-9">        printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(row_p.P_transition_barrer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> row_q.P_transition_barrer)</span>
<span id="cb26-10">        decomp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SH.dlogk[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> SH.dn[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(alpha)</span>
<span id="cb26-11">        v2.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tab, pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alpha, printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>printed, decomposed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>decomp,</span>
<span id="cb26-12">                       diff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>decomp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed, dlogk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.dlogk[g],</span>
<span id="cb26-13">                       k_share<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.dlogk[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> decomp))</span>
<span id="cb26-14">V2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(v2)</span>
<span id="cb26-15">V2_MAX_ABS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"diff"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb26-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tbl'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift, printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift, decomposed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;18s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb26-17">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'diff, decades'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlog k'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k-share'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb26-18">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>printed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:15.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>decomposed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:18.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb26-19">                   <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+14.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dlogk<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> V2.iterrows()]))</span>
<span id="cb26-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Worst |difference| over the four comparisons: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2_MAX_ABS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades."</span>)</span>
<span id="cb26-21"></span>
<span id="cb26-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the identity, measured rather than asserted --------------------------------------</span></span>
<span id="cb26-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># V2's residual is log10((1+rho_present)/(1+rho_prior)) where rho is each row's V1 relative</span></span>
<span id="cb26-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># deviation. Not "correlated with" V1: EQUAL to it, up to floating-point re-association.</span></span>
<span id="cb26-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Is this a second route? No - and here is the arithmetic that settles it. Robeson's"</span>)</span>
<span id="cb26-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"transition permeability IS k*alpha^n on the same two lines V1 tests, so the ratio of the"</span>)</span>
<span id="cb26-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two printed permeabilities carries the decomposition plus the two V1 residuals and nothing"</span>)</span>
<span id="cb26-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"else. Set V2's residual against the difference of the corresponding V1 residuals:"</span>)</span>
<span id="cb26-29">_v2id, _lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'tbl'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'V2 residual'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'V1(pres) - V1(prior)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb26-30"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> V2.iterrows():</span>
<span id="cb26-31">    _p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V1[(V1.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.table) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (V1.pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.pair) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (V1.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)].rel.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-32">    _q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V1[(V1.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.table) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (V1.pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> r.pair) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (V1.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>)].rel.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb26-33">    _d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _q)))</span>
<span id="cb26-34">    _v2id.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _d))</span>
<span id="cb26-35">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>table<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+14.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+22.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span>
<span id="cb26-37">V2_IS_V1_MAX_ABS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_v2id))</span>
<span id="cb26-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">They agree below 1e-12 decades (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2_IS_V1_MAX_ABS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) - floating-point re-association, not"</span>)</span>
<span id="cb26-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"agreement between two computations. V2 cannot fail unless V1 fails on these four rows;"</span>)</span>
<span id="cb26-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the headline </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2_MAX_ABS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades is the V1 table above, differenced."</span>)</span>
<span id="cb26-41"></span>
<span id="cb26-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- and the other candidate identity, for the same reason ----------------------------</span></span>
<span id="cb26-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The "data-side" shift: how much further a pair's own points sit above the prior bound than</span></span>
<span id="cb26-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># above the present one, in the geometric mean. It uses no (k, n) ratio explicitly - and it is</span></span>
<span id="cb26-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># STILL the decomposition, because averaging log r over the points returns log alpha_gm.</span></span>
<span id="cb26-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The obvious second candidate fails the same way. Take the shift straight off the DATA:"</span>)</span>
<span id="cb26-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the geometric-mean excursion of a pair's own points above the prior bound, over the same"</span>)</span>
<span id="cb26-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity for the present bound. No Delta log k, no Delta n anywhere in it:"</span>)</span>
<span id="cb26-49">_ds, _lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'data-side shift'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'decomposition @ a_gm'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb26-50"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb26-51">    _sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> EX[EX.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb26-52">    _d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(np.exp(np.mean(np.log(_sub.r_prior))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.exp(np.mean(np.log(_sub.r_present)))))</span>
<span id="cb26-53">    _ds.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SH.shift_gm[g]))</span>
<span id="cb26-54">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shift_gm[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:22.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span>
<span id="cb26-56">DATASIDE_IS_DECOMP_MAX_ABS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_ds))</span>
<span id="cb26-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Equal below 1e-12 decades (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DATASIDE_IS_DECOMP_MAX_ABS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), on all nine pairs. The reason is one line:"</span>)</span>
<span id="cb26-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"averaging log r over a pair's points subtracts n*mean(log alpha), and mean(log alpha) IS"</span>)</span>
<span id="cb26-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log(alpha_gm), so the data-side shift collapses to dlog k + dn*log(alpha_gm) exactly."</span>)</span>
<span id="cb26-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">So: given Table 12, Result 1's decomposition is a REARRANGEMENT, and no arithmetic on"</span>)</span>
<span id="cb26-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 12 can corroborate it. The route that can is V3 - which replaces the present line"</span>)</span>
<span id="cb26-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"with one estimated from the 117 points instead of read from Table 12."</span>)</span>
<span id="cb26-63"></span>
<span id="cb26-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And read the last two columns of the table above. The SAME two pairs, the SAME two bounds, four different"</span>)</span>
<span id="cb26-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"selectivities spanning </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>V2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x - and the front-factor share of the shift runs"</span>)</span>
<span id="cb26-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. For He/H2 at alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2[V2.pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb26-67">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dlog k OVERSTATES the shift by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(V2[V2.pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>].k_share.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb26-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"For H2/CO2 at alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V2[V2.pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2/CO2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>alpha<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, dlog k accounts for only "</span></span>
<span id="cb26-69">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>V2[V2.pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2/CO2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of it - and at alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALPHA_STAR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-70"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the same two lines cross and the shift is exactly zero, so the share is undefined there."</span>)</span>
<span id="cb26-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"THIS is what 'the split depends on where you stand' means, demonstrated on numbers the"</span>)</span>
<span id="cb26-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"paper printed rather than on numbers this page chose."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>tbl  pair         alpha  shift, printed  shift, decomposed  diff, decades   dlog k  k-share
13a  He/H2      0.45300         1.76396            1.76445      +4.93e-04   1.7952    1.017
13a  H2/CO2     0.06123         1.01903            1.01908      +5.35e-05   0.5755    0.565
13b  He/H2      0.22490         1.73750            1.73723      -2.66e-04   1.7952    1.033
13b  H2/CO2     0.21020         0.82302            0.82319      +1.65e-04   0.5755    0.699

Worst |difference| over the four comparisons: 4.93e-04 decades.

Is this a second route? No - and here is the arithmetic that settles it. Robeson's
transition permeability IS k*alpha^n on the same two lines V1 tests, so the ratio of the
two printed permeabilities carries the decomposition plus the two V1 residuals and nothing
else. Set V2's residual against the difference of the corresponding V1 residuals:

tbl  pair        V2 residual   V1(pres) - V1(prior)
13a  He/H2     +4.933033e-04          +4.933033e-04
13a  H2/CO2    +5.349407e-05          +5.349407e-05
13b  He/H2     -2.661490e-04          -2.661490e-04
13b  H2/CO2    +1.649553e-04          +1.649553e-04

They agree below 1e-12 decades (here 4e-16) - floating-point re-association, not
agreement between two computations. V2 cannot fail unless V1 fails on these four rows;
the headline 4.9e-04 decades is the V1 table above, differenced.

The obvious second candidate fails the same way. Take the shift straight off the DATA:
the geometric-mean excursion of a pair's own points above the prior bound, over the same
quantity for the present bound. No Delta log k, no Delta n anywhere in it:

pair       data-side shift   decomposition @ a_gm
O2/N2         0.6740673424           0.6740673424
CO2/CH4       0.6843920781           0.6843920781
H2/N2         0.3345250806           0.3345250806
H2/CH4        0.2852973555           0.2852973555
He/N2         0.2130670603           0.2130670603
He/CH4        0.5567026028           0.5567026028
He/H2         1.8273505257           1.8273505257
H2/CO2        0.4128825674           0.4128825674
He/CO2        0.7396521075           0.7396521075

Equal below 1e-12 decades (here 5e-16), on all nine pairs. The reason is one line:
averaging log r over a pair's points subtracts n*mean(log alpha), and mean(log alpha) IS
log(alpha_gm), so the data-side shift collapses to dlog k + dn*log(alpha_gm) exactly.

So: given Table 12, Result 1's decomposition is a REARRANGEMENT, and no arithmetic on
Table 12 can corroborate it. The route that can is V3 - which replaces the present line
with one estimated from the 117 points instead of read from Table 12.

And read the last two columns of the table above. The SAME two pairs, the SAME two bounds, four different
selectivities spanning 7x - and the front-factor share of the shift runs
0.56 to 1.03. For He/H2 at alpha = 0.453, dlog k OVERSTATES the shift by 1.7 %.
For H2/CO2 at alpha = 0.06123, dlog k accounts for only 56 % of it - and at alpha = 37.5
the same two lines cross and the shift is exactly zero, so the share is undefined there.
THIS is what 'the split depends on where you stand' means, demonstrated on numbers the
paper printed rather than on numbers this page chose.</code></pre>
</div>
</div>
</section>
<section id="v3-an-envelope-re-estimated-from-the-papers-own-points-and-the-second-route-to-result-1" class="level3">
<h3 class="anchored" data-anchor-id="v3-an-envelope-re-estimated-from-the-papers-own-points-and-the-second-route-to-result-1">V3: an envelope re-estimated from the paper’s own points, and the second route to Result 1</h3>
<p>The only check here that touches the <strong>empirical</strong> content rather than the arithmetic, and the only one that does not take Table 12’s present block as an input. The estimator is stated so it can be argued with: the line <img src="https://latex.codecogs.com/png.latex?%5Clog%20P%20=%20%5Clog%20k%20+%20n%5Clog%5Calpha"> minimising <img src="https://latex.codecogs.com/png.latex?%5Csum_i%20(%5Clog%20P_i%20-%20%5Clog%20k%20-%20n%5Clog%5Calpha_i)%5E2"> <strong>subject to every point lying on or below it</strong>. That is a convex quadratic program; its optimum activates at most two constraints, so it is solved here by <strong>exact enumeration of the active sets</strong> rather than by an iterative optimiser: no start point, no seed, one feasibility tolerance at round-off level (<code>envelope_fit</code> in <code>model.py</code>).</p>
<p>It is <em>not</em> what “by eye” means. A covering line is pinned by two or three extreme points; an eye fits the body of a cloud. The two estimators answer different questions, and this page keeps them apart, <strong>nothing below is offered as a correction to the printed <img src="https://latex.codecogs.com/png.latex?(k,n)">.</strong></p>
<p><strong>Why this is nevertheless Result 1’s second route.</strong> Substitute <img src="https://latex.codecogs.com/png.latex?(k_%7B%5Ctext%7Benv%7D%7D,%20n_%7B%5Ctext%7Benv%7D%7D)"> for the printed present line and recompute the shift at the same reference:</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5CDelta%5Clog_%7B10%7DP_%7B%5Ctext%7Benv%7D%7D(%5Calpha_0)%0A=%20%5Clog_%7B10%7D%5Cfrac%7Bk_%7B%5Ctext%7Benv%7D%7D%7D%7Bk_0%7D%20+%20(n_%7B%5Ctext%7Benv%7D%7D%20-%20n_0)%5Clog_%7B10%7D%5Calpha_0%20.%0A"></p>
<p>Its prior half is shared with the decomposition; its present half comes from 117 points and a quadratic program instead of from Table 12. Subtracting, the prior line cancels exactly, so the <strong>residual between the two routes is V3’s offset at <img src="https://latex.codecogs.com/png.latex?%5Calpha_0"></strong>, the column already tabulated below. That is why the offset is the headline of this section: it is not a curiosity about a re-fit, it is the disagreement between the only two ways this page can compute how far the bound moved. Its scope is exactly the present line; it says nothing about the prior block, which both routes read from the same place, and nothing about <img src="https://latex.codecogs.com/png.latex?%5Calpha_0">, which both routes take from the same 117 points.</p>
<p><strong>And it carries <img src="https://latex.codecogs.com/png.latex?%5Clog%5Calpha_0">, so it is reference-dependent too.</strong> That is not a caveat bolted on: it is this page’s own thesis pointed at this page’s own newest headline. Quoting “the two routes agree to <em>x</em> decades” without naming <img src="https://latex.codecogs.com/png.latex?%5Calpha_0"> is the same error as quoting a front-factor share without naming <img src="https://latex.codecogs.com/png.latex?%5Calpha_0">. So the reference is swept below, over each pair’s own minimum, geometric-mean, median and maximum tabulated selectivity, all four inside the pair’s own data, and the residual is reported with its reference attached wherever it appears, on this page and on every surface that quotes it.</p>
<div id="3cec017d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.300897Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.300708Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.362526Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.361752Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1">v3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb28-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(PTS.gas_pair.unique()):</span>
<span id="cb28-3">    sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb28-4">    la <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(sub.alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb28-5">    lp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(sub.P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb28-6">    k_env, n_env, sse <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> envelope_fit(la, lp)</span>
<span id="cb28-7">    k1, n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> present.k_barrer[g], present.n[g]</span>
<span id="cb28-8">    a_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(sub.alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))))</span>
<span id="cb28-9">    off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((np.log10(k_env) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a_gm))</span>
<span id="cb28-10">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log10(k1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a_gm)))</span>
<span id="cb28-11">    v3.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, n_pr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n1, n_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_env, dn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1, k_pr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k1, k_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k_env,</span>
<span id="cb28-12">                   span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>la.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> la.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), offset_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>off, sse<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sse))</span>
<span id="cb28-13">V3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(v3).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>).sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"span"</span>)</span>
<span id="cb28-14">V3_DN_MED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().median())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> V3_DN_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-15">V3_OFFSET_MED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V3.offset_gm.median())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> V3_OFFSET_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V3.offset_gm.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb28-16">V3_DN_WIDE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V3[V3.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>].dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> V3_SPAN_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(V3.span.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb28-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sorted by how many decades of selectivity the pair's own tabulated points span."</span>,</span>
<span id="cb28-18">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'alpha span, dec'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n printed'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'n envelope'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dn'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb28-19">                 <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'offset @ a_gm, dec'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;19s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb28-20">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:15.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_pr<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>n_env<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>offset_gm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+19.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb28-21">                   <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> V3.iterrows()]))</span>
<span id="cb28-22">N_OFFSET_POS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((V3.offset_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb28-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Median |dn| = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3_DN_MED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3_DN_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Vertical offset at each pair's own"</span>)</span>
<span id="cb28-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"geometric-mean selectivity: median </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3_OFFSET_MED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades, largest magnitude "</span></span>
<span id="cb28-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3_OFFSET_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb28-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Two things, and only two, come out of this."</span>)</span>
<span id="cb28-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(i) The offsets are SMALL and of BOTH SIGNS (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_OFFSET_POS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> positive). Over the "</span></span>
<span id="cb28-28">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"body of each cloud the printed line"</span>)</span>
<span id="cb28-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and the tightest covering line sit within a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>V3_OFFSET_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of each other, usually far"</span>)</span>
<span id="cb28-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"closer - so the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_ABOVE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> excursions of Result 4 are individual points poking through a line that"</span>)</span>
<span id="cb28-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"is in the right PLACE, not a line drawn in the wrong place."</span>)</span>
<span id="cb28-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The sign count of the offsets depends on where it is read; the slope difference does not.</span></span>
<span id="cb28-33">_cnt_at <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lab: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>((np.log10(V3.k_env[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> V3.n_env[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(af(g)))</span>
<span id="cb28-34">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> (np.log10(present.k_barrer[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> present.n[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(af(g)))</span>
<span id="cb28-35">                        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> V3.index))</span>
<span id="cb28-36">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, af <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_min"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()),</span>
<span id="cb28-37">                           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_gm"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: np.exp(np.mean(np.log(PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha)))),</span>
<span id="cb28-38">                           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_median"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.median()),</span>
<span id="cb28-39">                           (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_max"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())]}</span>
<span id="cb28-40">N_DN_POS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((V3.dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb28-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The count of positive offsets is itself a property of the reference: "</span></span>
<span id="cb28-42">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at each pair's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _cnt_at.items()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)</span>
<span id="cb28-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"What holds at every reference is the slope: dn = n_env - n_printed &gt; 0 for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_DN_POS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of "</span></span>
<span id="cb28-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs (smallest |dn| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span>)</span>
<span id="cb28-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"so the covering line is shallower than the printed one, not uniformly higher or lower."</span>)</span>
<span id="cb28-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Stated as a SET match, computed, because the two orderings do not agree rank by rank.</span></span>
<span id="cb28-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The largest m for which they agree AS SETS is the statement the data support.</span></span>
<span id="cb28-48">_by_span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(V3.span.sort_values().index)</span>
<span id="cb28-49">_by_dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(V3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().sort_values(ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).index)</span>
<span id="cb28-50">M_LEVER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(V3)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(_by_span[:m]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(_by_dn[:m]))</span>
<span id="cb28-51">_off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(_by_span[:M_LEVER]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _by_dn[i] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> g)</span>
<span id="cb28-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(ii) The slope disagreement follows the LEVER ARM, and it lands exactly"</span>)</span>
<span id="cb28-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"where the paper itself says it should. The </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_LEVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs whose points span the fewest decades of"</span>)</span>
<span id="cb28-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"selectivity are exactly the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_LEVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> carrying the largest |dn| - as SETS, not rank by rank "</span></span>
<span id="cb28-55">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_off<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> has the"</span>)</span>
<span id="cb28-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"span rank </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_by_span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>index(_off) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and the |dn| rank </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_by_dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>index(_off) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). Those </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>M_LEVER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are "</span></span>
<span id="cb28-57">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> dec, |dn| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(V3.dn[g])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _by_span[:M_LEVER])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb28-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((V3.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs spanning more than 1.5 decades"</span>)</span>
<span id="cb28-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"all agree to |dn| &lt;= </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3[V3.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. For He/H2 - the paper's headline pair, and the one"</span>)</span>
<span id="cb28-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"whose </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points cover only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/H2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades of "</span></span>
<span id="cb28-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"alpha - the tabulated points simply do"</span>)</span>
<span id="cb28-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"not determine a slope, and Robeson says so: 'While the front factor has moved"</span>)</span>
<span id="cb28-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"significantly, the slope does not appear to have changed although sufficient data does not"</span>)</span>
<span id="cb28-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"exist to clearly confirm that observation.' V3 is the arithmetic behind that sentence."</span>)</span>
<span id="cb28-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">What V3 is NOT: evidence that any printed (k, n) is wrong. It cannot be - it optimises a"</span>)</span>
<span id="cb28-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"different objective on a subset of the data Robeson drew the line through (Tables 1-11 are"</span>)</span>
<span id="cb28-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the near-bound points, not the ~300 papers' worth of cloud), and for O2/N2 it is pinned by"</span>)</span>
<span id="cb28-68"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the very point the paper says it distrusts."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Sorted by how many decades of selectivity the pair's own tabulated points span.
pair      alpha span, dec  n printed  n envelope       dn  offset @ a_gm, dec
He/H2               0.617    -4.8640     -2.1783  +2.6857             -0.2021
CO2/N2              0.766    -2.8880     -2.3014  +0.5866             +0.1541
O2/N2               0.822    -5.6660     -4.8638  +0.8022             +0.4663
N2/CH4              1.058    -4.5070     -4.0785  +0.4285             +0.0276
He/CO2              2.036    -1.1920     -1.0713  +0.1207             +0.0044
H2/CO2              2.315    -2.3020     -2.4294  -0.1274             -0.0138
H2/CH4              2.533    -1.1070     -1.0539  +0.0531             -0.0113
H2/N2               2.584    -1.4841     -1.4693  +0.0148             -0.0162
CO2/CH4             2.697    -2.6360     -2.3582  +0.2778             +0.0379
He/N2               2.807    -1.0170     -0.8287  +0.1883             +0.0857
He/CH4              3.874    -0.8090     -0.6198  +0.1892             +0.0734

Median |dn| = 0.189, worst 2.686. Vertical offset at each pair's own
geometric-mean selectivity: median +0.028 decades, largest magnitude 0.466.

Two things, and only two, come out of this.

(i) The offsets are SMALL and of BOTH SIGNS (7 of 11 positive). Over the body of each cloud the printed line
and the tightest covering line sit within a factor 2.9 of each other, usually far
closer - so the 19 excursions of Result 4 are individual points poking through a line that
is in the right PLACE, not a line drawn in the wrong place.
The count of positive offsets is itself a property of the reference: 2 of 11 at each pair's alpha_min, 7 of 11 at each pair's alpha_gm, 9 of 11 at each pair's alpha_median, 10 of 11 at each pair's alpha_max.
What holds at every reference is the slope: dn = n_env - n_printed &gt; 0 for 10 of 11 pairs (smallest |dn| 0.015),
so the covering line is shallower than the printed one, not uniformly higher or lower.

(ii) The slope disagreement follows the LEVER ARM, and it lands exactly
where the paper itself says it should. The 4 pairs whose points span the fewest decades of
selectivity are exactly the 4 carrying the largest |dn| - as SETS, not rank by rank (CO2/N2 has the
span rank 2 and the |dn| rank 3). Those 4 are He/H2 (0.62 dec, |dn| 2.686), CO2/N2 (0.77 dec, |dn| 0.587), O2/N2 (0.82 dec, |dn| 0.802), N2/CH4 (1.06 dec, |dn| 0.428).
The 7 pairs spanning more than 1.5 decades
all agree to |dn| &lt;= 0.278. For He/H2 - the paper's headline pair, and the one
whose 12 points cover only 0.62 decades of alpha - the tabulated points simply do
not determine a slope, and Robeson says so: 'While the front factor has moved
significantly, the slope does not appear to have changed although sufficient data does not
exist to clearly confirm that observation.' V3 is the arithmetic behind that sentence.

What V3 is NOT: evidence that any printed (k, n) is wrong. It cannot be - it optimises a
different objective on a subset of the data Robeson drew the line through (Tables 1-11 are
the near-bound points, not the ~300 papers' worth of cloud), and for O2/N2 it is pinned by
the very point the paper says it distrusts.</code></pre>
</div>
</div>
<div id="ef66894d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.364509Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.364329Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:41:56.465943Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:41:56.465167Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the second route to Result 1, run against the decomposition -----------------------</span></span>
<span id="cb30-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Present line from the 117 points (V3) + prior line from Table 12, versus the decomposition.</span></span>
<span id="cb30-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The prior half cancels in the difference, so the residual IS V3's offset at alpha_gm - which</span></span>
<span id="cb30-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is asserted below rather than taken on trust.</span></span>
<span id="cb30-5">sr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb30-6"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb30-7">    k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[g], prior.n[g]</span>
<span id="cb30-8">    a_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SH.a_gm[g]</span>
<span id="cb30-9">    k_env, n_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> V3.k_env[g], V3.n_env[g]</span>
<span id="cb30-10">    sh_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.log10(k_env) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k0)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (n_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n0) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a_gm)</span>
<span id="cb30-11">    sr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3.span[g], sh_dec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.shift_gm[g], sh_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh_env,</span>
<span id="cb30-12">                   resid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SH.shift_gm[g], share_dec<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.share[g],</span>
<span id="cb30-13">                   share_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(np.log10(k_env) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k0)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sh_env))</span>
<span id="cb30-14">SR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(sr).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>).sort_values(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"span"</span>)</span>
<span id="cb30-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.allclose(SR.resid, V3.offset_gm[SR.index], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb30-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two-route residual must BE V3's offset at alpha_gm - the prior line cancels"</span></span>
<span id="cb30-17">SR_WIDE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SR[SR.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>]</span>
<span id="cb30-18">SECOND_ROUTE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SR.resid.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb30-19">SECOND_ROUTE_MED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SR.resid.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().median())</span>
<span id="cb30-20">SECOND_ROUTE_WIDE_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SR_WIDE.resid.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb30-21">SECOND_ROUTE_SIGN_AGREE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((np.sign(SR.sh_env) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> np.sign(SR.sh_dec)).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb30-22">SHARE_ENV_MED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SR.share_env.median())</span>
<span id="cb30-23"></span>
<span id="cb30-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(</span>
<span id="cb30-25">    [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The shift, computed twice: from Table 12 (the decomposition) and from Tables 1-11 (the"</span>,</span>
<span id="cb30-26">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope) - sorted by how many decades of selectivity the pair's own points span, because"</span>,</span>
<span id="cb30-27">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"that is the lever arm the second route is built on."</span>,</span>
<span id="cb30-28">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"EVERY number in this table is evaluated at each pair's own geometric-mean selectivity a_gm,"</span>,</span>
<span id="cb30-29">     <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and none of them means anything without that - see the reference sweep below."</span>,</span>
<span id="cb30-30">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'span, dec'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift, decomp'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'shift, envelope'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb30-31">     <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'resid @ a_gm'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;12s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k-share, decomp'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;16s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'k-share, env'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb30-32">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sh_dec<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sh_env<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>resid<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+12.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb30-33">       <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_dec<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:16.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_env<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SR.iterrows()]))</span>
<span id="cb30-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">AT a_gm. Sign of the shift: the two routes agree on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_SIGN_AGREE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SR)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb30-35">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pairs - every bound that moved up by"</span>)</span>
<span id="cb30-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"one route moved up by the other. MAGNITUDE: median |residual| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_MED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades, "</span></span>
<span id="cb30-37">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>resid<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>idxmax()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). Restricted to the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(SR_WIDE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> pairs whose points span more than "</span></span>
<span id="cb30-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1.5 decades of selectivity,"</span>)</span>
<span id="cb30-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"where the covering line is actually determined: worst |residual| </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_WIDE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb30-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"decades, i.e. the"</span>)</span>
<span id="cb30-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"two routes agree to a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>SECOND_ROUTE_WIDE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in permeability. The two pairs "</span></span>
<span id="cb30-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"that blow that out are"</span>)</span>
<span id="cb30-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(SR.index[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, spanning </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>span<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades - "</span></span>
<span id="cb30-45">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the same short-lever-arm pairs"</span>)</span>
<span id="cb30-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"that carry the largest |dn| above. This is a weak check where it is weak, and it says so."</span>)</span>
<span id="cb30-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And now the sharp part, which is the page's central claim arriving from the other side."</span>)</span>
<span id="cb30-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The two routes agree about the SIZE of the shift and disagree completely about its SPLIT:"</span>)</span>
<span id="cb30-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the front-factor share has median </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>median()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by the decomposition and "</span></span>
<span id="cb30-50">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHARE_ENV_MED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by the envelope,"</span>)</span>
<span id="cb30-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ranging </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_env<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_env<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> instead of "</span></span>
<span id="cb30-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. That is not a defect in either route."</span>)</span>
<span id="cb30-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The share is dlog k / dlog P, and dlog k is the shift at alpha = 1, up to "</span></span>
<span id="cb30-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(SH.a_gm)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades from a pair's"</span>)</span>
<span id="cb30-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"geometric-mean selectivity. Where alpha = 1 lies outside a pair's data or among its last few"</span>)</span>
<span id="cb30-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"points, it is read along a slope the points barely determine, and the two routes' shares part."</span>)</span>
<span id="cb30-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Pair by pair, ordered by the fraction of its points below alpha = 1:"</span>)</span>
<span id="cb30-58">_nb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SR.index}</span>
<span id="cb30-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nb[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points below alpha = 1: "</span></span>
<span id="cb30-60">                <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"share </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_dec[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (decomposition) against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_env[g]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (envelope)"</span></span>
<span id="cb30-61">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(SR.index, key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_nb[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())))</span>
<span id="cb30-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"H2/CO2 and He/CO2 agree to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SR.share_dec[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SR.share_env[g]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2/CO2'</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/CO2'</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; "</span></span>
<span id="cb30-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"H2/CH4, with as large a fraction of its points below alpha = 1 as He/CO2,"</span>)</span>
<span id="cb30-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"does not (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_dec[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_env[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'H2/CH4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), so the position of "</span></span>
<span id="cb30-65">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"alpha = 1 is not the whole story."</span>)</span>
<span id="cb30-66"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"A quantity that survives one estimator and not the other is not a property of the data."</span>)</span>
<span id="cb30-67"></span>
<span id="cb30-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- what a NEGATIVE front-factor share is, since the range contains one ---------------</span></span>
<span id="cb30-69">_gneg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SR.share_env.idxmin()</span>
<span id="cb30-70">_k0neg, _kEneg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[_gneg], V3.k_env[_gneg]</span>
<span id="cb30-71">_dlkneg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(_kEneg) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(_k0neg)</span>
<span id="cb30-72">_across <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_dlkneg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (V3.n_env[_gneg] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> prior.n[_gneg]))</span>
<span id="cb30-73"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">One of those envelope shares is NEGATIVE - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>share_env<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_gneg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - and a "</span></span>
<span id="cb30-74">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"negative share needs saying"</span>)</span>
<span id="cb30-75"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"in words rather than being left inside a range. The envelope's front factor for </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_gneg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is "</span></span>
<span id="cb30-76">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_kEneg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> barrers"</span>)</span>
<span id="cb30-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"against the prior block's </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_k0neg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (and the printed present </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>present<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>k_barrer[_gneg]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:,.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): "</span></span>
<span id="cb30-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dlog k = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_dlkneg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e. the front"</span>)</span>
<span id="cb30-79"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"factor moved DOWN, while the envelope-implied shift at a_gm is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sh_env[_gneg]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades. "</span></span>
<span id="cb30-80">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"So the ENTIRE"</span>)</span>
<span id="cb30-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"shift, and a little more, is carried by the slope term. Geometrically: the envelope present"</span>)</span>
<span id="cb30-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"line sits BELOW the prior line at alpha = 1 and above it at a_gm = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_gm[_gneg]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the two "</span></span>
<span id="cb30-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"cross at alpha = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_across<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb30-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and every decade of separation the bound gained at a_gm was bought by rotation, not by lift."</span>)</span>
<span id="cb30-85">_nb1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> _gneg].alpha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb30-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"A share outside [0, 1] is not a defect - it is what happens when dlog k is read at a"</span>)</span>
<span id="cb30-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"selectivity </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(SH.a_gm[_gneg])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades below the pair's geometric mean, where "</span></span>
<span id="cb30-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_nb1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of its </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> _gneg).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points lie, which is exactly Result 1's warning."</span>)</span>
<span id="cb30-89"></span>
<span id="cb30-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the residual's own reference is a CHOICE too, so sweep it -------------------------</span></span>
<span id="cb30-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># resid(a0) = (log k_env - log k1) + (n_env - n1) log a0 carries log a0 EXPLICITLY, so it moves</span></span>
<span id="cb30-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with the reference for precisely the reason the front-factor share does: the two present lines</span></span>
<span id="cb30-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are not parallel. Swept over four references, every one of them inside each pair's own data,</span></span>
<span id="cb30-94"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exactly as EVAL sweeps P for Result 3 two sections up.</span></span>
<span id="cb30-95">A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own alpha_min"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.a_lo[g])),</span>
<span id="cb30-96">      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own alpha_gm (used above)"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.a_gm[g])),</span>
<span id="cb30-97">      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own alpha_median"</span>,</span>
<span id="cb30-98">       <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))),</span>
<span id="cb30-99">      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"each pair's own alpha_max"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SH.a_hi[g]))]</span>
<span id="cb30-100"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> route_at(af):</span>
<span id="cb30-101">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(max |resid| over the wide-span pairs, median |resid| over all nine, sign agreement)."""</span></span>
<span id="cb30-102">    wide, allr, sgn, worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb30-103">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb30-104">        a0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> af(g)</span>
<span id="cb30-105">        se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((np.log10(V3.k_env[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(prior.k_barrer[g]))</span>
<span id="cb30-106">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (V3.n_env[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> prior.n[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a0))</span>
<span id="cb30-107">        sd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SH.dlogk[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> SH.dn[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a0)</span>
<span id="cb30-108">        allr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sd))</span>
<span id="cb30-109">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.sign(se) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> np.sign(sd):</span>
<span id="cb30-110">            sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb30-111">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> worst <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb30-112">            worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (g, se, sd)</span>
<span id="cb30-113">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> V3.span[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>:</span>
<span id="cb30-114">            wide.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sd))</span>
<span id="cb30-115">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(wide), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(allr)), sgn, worst</span>
<span id="cb30-116"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">And now the same discipline applied to THIS section's own headline. The residual is"</span>)</span>
<span id="cb30-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(log k_env - log k1) + (n_env - n1) log a0: it carries log a0 explicitly, so '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_WIDE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades'"</span>)</span>
<span id="cb30-118"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"is a property of the two present lines AT ONE SELECTIVITY, not of the two lines. Swept:"</span>)</span>
<span id="cb30-119">_lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reference selectivity'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'max|resid|, wide'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;17s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'median|resid|, all 9'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;21s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb30-120">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sign agreement'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;15s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>]</span>
<span id="cb30-121">_rw, _rm, _rs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], []</span>
<span id="cb30-122"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, af <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A0:</span>
<span id="cb30-123">    w, m, sg, worst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> route_at(af)</span>
<span id="cb30-124">    _rw.append(w)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> _rm.append(m)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> _rs.append(sg)</span>
<span id="cb30-125">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:17.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>m<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:21.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:12d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-126">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> worst <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb30-127">        _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">''</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:40s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   ^ sign disagreement: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> envelope </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs "</span></span>
<span id="cb30-128">                      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"decomposition </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>worst[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-129"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span>
<span id="cb30-130">SR_WIDE_MAX_OVER_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_rw))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> SR_SIGN_MIN_OVER_A0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rs))</span>
<span id="cb30-131"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So both halves of this section's headline have to be quoted with their reference. The"</span>)</span>
<span id="cb30-132"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"wide-span worst case runs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rw)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR_WIDE_MAX_OVER_A0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades across the four - a factor "</span></span>
<span id="cb30-133">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR_WIDE_MAX_OVER_A0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rw)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - and the"</span>)</span>
<span id="cb30-134"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"median over all nine runs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rm)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_rm)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The SIGN count is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at "</span></span>
<span id="cb30-135">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_rs) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _rs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> references"</span>)</span>
<span id="cb30-136"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_rs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PAIRS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at the other </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_rs) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _rs)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The reference used above, "</span></span>
<span id="cb30-137">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A0[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(_rw))][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">' ('</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, is the"</span>)</span>
<span id="cb30-138"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"KINDEST of the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(A0)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, which is exactly why it must be named: an unattributed "</span></span>
<span id="cb30-139">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SECOND_ROUTE_WIDE_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades' reads"</span>)</span>
<span id="cb30-140"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"as a property of the estimator and is instead the best of a range that reaches "</span></span>
<span id="cb30-141">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SR_WIDE_MAX_OVER_A0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb30-142"></span>
<span id="cb30-143"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- and the same substitution applied to Result 3's ranking ---------------------------</span></span>
<span id="cb30-144">rk_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb30-145"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS:</span>
<span id="cb30-146">    k0, n0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> prior.k_barrer[g], prior.n[g]</span>
<span id="cb30-147">    P_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RK.P_gm[g]</span>
<span id="cb30-148">    dA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((np.log10(P_gm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(V3.k_env[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> V3.n_env[g]</span>
<span id="cb30-149">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log10(P_gm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(k0)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n0)</span>
<span id="cb30-150">    rk_env.append((g, dA))</span>
<span id="cb30-151">rk_env.sort(key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb30-152">TOP3_ENV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rk_env[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]]</span>
<span id="cb30-153">HITS_ENV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(TOP3_ENV) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG))</span>
<span id="cb30-154"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Result 3 gets a second route out of the same substitution, at the SAME reference:"</span>)</span>
<span id="cb30-155"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ranked by selectivity gain with the ENVELOPE present line: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rk_env)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-156"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the paper's three 'significant' pairs in the top three: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HITS_ENV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 - unchanged, on a"</span>)</span>
<span id="cb30-157"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  present line that never touches Table 12."</span>)</span>
<span id="cb30-158"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># But "survives it" is a robustness claim, and this page already owns a robustness test for</span></span>
<span id="cb30-159"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># exactly this quantity: EVAL, the seven references Result 3's primary route is held to. The</span></span>
<span id="cb30-160"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># substituted route gets the identical test rather than a kinder one.</span></span>
<span id="cb30-161"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">That is one evaluation point. Result 3's PRIMARY route is held to the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EVAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> references of"</span>)</span>
<span id="cb30-162"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"EVAL above, so the substituted route gets the same </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EVAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, not a kinder test:"</span>)</span>
<span id="cb30-163">_lines <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'evaluation point'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'envelope'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'primary'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   top 3, envelope route"</span>]</span>
<span id="cb30-164">_he, _hp, _dropped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>()</span>
<span id="cb30-165"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EVAL:</span>
<span id="cb30-166">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(((g, ((np.log10(f(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(V3.k_env[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> V3.n_env[g]</span>
<span id="cb30-167">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log10(f(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(prior.k_barrer[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> prior.n[g]))</span>
<span id="cb30-168">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PAIRS), key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>z[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb30-169">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG))</span>
<span id="cb30-170">    hp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rank_at(f)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb30-171">    _he.append(h)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> _hp.append(hp)</span>
<span id="cb30-172">    _dropped <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(SIG) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb30-173">    _lines.append(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:44s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>hp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;4d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-174"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join(_lines))</span>
<span id="cb30-175">HITS_ENV_MIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_he))</span>
<span id="cb30-176">_fail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [lab <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (lab, _), h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(EVAL, _he) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_he)]</span>
<span id="cb30-177"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So the honest sentence is NOT 'it survives'. The substituted route reproduces the ranking"</span>)</span>
<span id="cb30-178"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HITS_ENV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 at the reference used above and at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> HITS_ENV <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _he) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the "</span></span>
<span id="cb30-179">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"other </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EVAL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> references, and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_he))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 at the"</span>)</span>
<span id="cb30-180"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"remaining </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_fail)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'; '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_fail)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - where </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(_dropped))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> drops out of "</span></span>
<span id="cb30-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the top three. The PRIMARY"</span>)</span>
<span id="cb30-182"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"route holds </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_hp))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 3 at all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(EVAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. That contrast is the interesting result and it is"</span>)</span>
<span id="cb30-183"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the reported one: the corroboration is real but weaker than the route it corroborates,"</span>)</span>
<span id="cb30-184"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"which is what you would expect of a present line estimated from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PTS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points rather than"</span>)</span>
<span id="cb30-185"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"read off a table."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The shift, computed twice: from Table 12 (the decomposition) and from Tables 1-11 (the
envelope) - sorted by how many decades of selectivity the pair's own points span, because
that is the lever arm the second route is built on.
EVERY number in this table is evaluated at each pair's own geometric-mean selectivity a_gm,
and none of them means anything without that - see the reference sweep below.
pair       span, dec  shift, decomp  shift, envelope resid @ a_gm  k-share, decomp  k-share, env
He/H2           0.62         1.8274           1.6252      -0.2021            0.982         0.387
O2/N2           0.82         0.6741           1.1404      +0.4663            0.823         0.269
He/CO2          2.04         0.7397           0.7440      +0.0044            0.983         0.910
H2/CO2          2.31         0.4129           0.3991      -0.0138            1.394         1.549
H2/CH4          2.53         0.2853           0.2740      -0.0113            0.587         0.350
H2/N2           2.58         0.3345           0.3183      -0.0162            0.795         0.712
CO2/CH4         2.70         0.6844           0.7223      +0.0379            1.021         0.434
He/N2           2.81         0.2131           0.2988      +0.0857            0.947        -0.031
He/CH4          3.87         0.5567           0.6301      +0.0734            1.073         0.539

AT a_gm. Sign of the shift: the two routes agree on 9 of 9 pairs - every bound that moved up by
one route moved up by the other. MAGNITUDE: median |residual| 0.0379 decades, worst 0.4663
(O2/N2). Restricted to the 7 pairs whose points span more than 1.5 decades of selectivity,
where the covering line is actually determined: worst |residual| 0.0857 decades, i.e. the
two routes agree to a factor 1.22 in permeability. The two pairs that blow that out are
He/H2, O2/N2, spanning 0.62 and 0.82 decades - the same short-lever-arm pairs
that carry the largest |dn| above. This is a weak check where it is weak, and it says so.

And now the sharp part, which is the page's central claim arriving from the other side.
The two routes agree about the SIZE of the shift and disagree completely about its SPLIT:
the front-factor share has median 0.98 by the decomposition and 0.43 by the envelope,
ranging -0.03 to 1.55 instead of 0.59 to 1.39. That is not a defect in either route.
The share is dlog k / dlog P, and dlog k is the shift at alpha = 1, up to 1.75 decades from a pair's
geometric-mean selectivity. Where alpha = 1 lies outside a pair's data or among its last few
points, it is read along a slope the points barely determine, and the two routes' shares part.
Pair by pair, ordered by the fraction of its points below alpha = 1:
  H2/CO2     4 of  7 points below alpha = 1: share 1.39 (decomposition) against 1.55 (envelope)
  He/CO2     3 of 12 points below alpha = 1: share 0.98 (decomposition) against 0.91 (envelope)
  H2/CH4     2 of  8 points below alpha = 1: share 0.59 (decomposition) against 0.35 (envelope)
  He/CH4     2 of 11 points below alpha = 1: share 1.07 (decomposition) against 0.54 (envelope)
  He/N2      1 of  9 points below alpha = 1: share 0.95 (decomposition) against -0.03 (envelope)
  He/H2      0 of 12 points below alpha = 1: share 0.98 (decomposition) against 0.39 (envelope)
  O2/N2      0 of 10 points below alpha = 1: share 0.82 (decomposition) against 0.27 (envelope)
  H2/N2      0 of  8 points below alpha = 1: share 0.80 (decomposition) against 0.71 (envelope)
  CO2/CH4    0 of 16 points below alpha = 1: share 1.02 (decomposition) against 0.43 (envelope)
H2/CO2 and He/CO2 agree to 0.16; H2/CH4, with as large a fraction of its points below alpha = 1 as He/CO2,
does not (0.59 against 0.35), so the position of alpha = 1 is not the whole story.
A quantity that survives one estimator and not the other is not a property of the data.

One of those envelope shares is NEGATIVE - -0.0306, on He/N2 - and a negative share needs saying
in words rather than being left inside a range. The envelope's front factor for He/N2 is 12,239 barrers
against the prior block's 12,500 (and the printed present 19,890): dlog k = -0.0092, i.e. the front
factor moved DOWN, while the envelope-implied shift at a_gm is +0.2988 decades. So the ENTIRE
shift, and a little more, is carried by the slope term. Geometrically: the envelope present
line sits BELOW the prior line at alpha = 1 and above it at a_gm = 37.6; the two cross at alpha = 1.11,
and every decade of separation the bound gained at a_gm was bought by rotation, not by lift.
A share outside [0, 1] is not a defect - it is what happens when dlog k is read at a
selectivity 1.6 decades below the pair's geometric mean, where 1 of its 9 points lie, which is exactly Result 1's warning.

And now the same discipline applied to THIS section's own headline. The residual is
(log k_env - log k1) + (n_env - n1) log a0: it carries log a0 explicitly, so '0.086 decades'
is a property of the two present lines AT ONE SELECTIVITY, not of the two lines. Swept:

reference selectivity                     max|resid|, wide  median|resid|, all 9  sign agreement
each pair's own alpha_min                           0.3322                0.1380            8 of 9
                                           ^ sign disagreement: He/N2 envelope -0.0117 vs decomposition +0.2016
each pair's own alpha_gm (used above)               0.0857                0.0379            9 of 9
each pair's own alpha_median                        0.1574                0.0772            9 of 9
each pair's own alpha_max                           0.5431                0.3151            9 of 9

So both halves of this section's headline have to be quoted with their reference. The
wide-span worst case runs 0.0857 to 0.5431 decades across the four - a factor 6.3 - and the
median over all nine runs 0.0379 to 0.3151. The SIGN count is 8 of 9 at 1 of the 4 references
and 9 of 9 at the other 3. The reference used above, each pair's own alpha_gm, is the
KINDEST of the 4, which is exactly why it must be named: an unattributed '0.086 decades' reads
as a property of the estimator and is instead the best of a range that reaches 0.54.

Result 3 gets a second route out of the same substitution, at the SAME reference:
  ranked by selectivity gain with the ENVELOPE present line: He/CH4, He/CO2, He/H2, He/N2, CO2/CH4, H2/CH4, O2/N2, H2/N2, H2/CO2
  the paper's three 'significant' pairs in the top three: 3 of 3 - unchanged, on a
  present line that never touches Table 12.

That is one evaluation point. Result 3's PRIMARY route is held to the 7 references of
EVAL above, so the substituted route gets the same 7, not a kinder test:

evaluation point                              envelope   primary   top 3, envelope route
each pair's own P_min                           3 of 3    3 of 3   He/CH4, He/CO2, He/H2
each pair's own P_gm (used above)               3 of 3    3 of 3   He/CH4, He/CO2, He/H2
each pair's own P_median                        2 of 3    3 of 3   He/CH4, He/CO2, He/N2
each pair's own P_max                           2 of 3    3 of 3   He/CO2, He/CH4, H2/CO2
all 117 points' geometric mean, 241 barrer      3 of 3    3 of 3   He/CH4, He/CO2, He/H2
common P = 100 barrer                           3 of 3    3 of 3   He/CH4, He/CO2, He/H2
common P = 1000 barrer                          3 of 3    3 of 3   He/CH4, He/CO2, He/H2

So the honest sentence is NOT 'it survives'. The substituted route reproduces the ranking
3 of 3 at the reference used above and at 4 of the other 6 references, and 2 of 3 at the
remaining 2 - each pair's own P_median; each pair's own P_max - where He/H2 drops out of the top three. The PRIMARY
route holds 3 of 3 at all 7. That contrast is the interesting result and it is
the reported one: the corroboration is real but weaker than the route it corroborates,
which is what you would expect of a present line estimated from 117 points rather than
read off a table.</code></pre>
</div>
</div>
</section>
<section id="v4-break-table" class="level3">
<h3 class="anchored" data-anchor-id="v4-break-table">V4: break table</h3>
<p>Every number the page states is registered below as a claim, with how it is checked: a <strong>value</strong> held to a relative tolerance of <img src="https://latex.codecogs.com/png.latex?10%5E%7B-6%7D"> (the page is arithmetic on printed numbers, so its values reproduce to round-off), a <strong>bound</strong> for identities and root-finder agreement, and an <strong>exact</strong> result for counts, each count with its distance to the threshold that decides it. The rows below are the misreadings and slips this page could actually have made: sign and convention slips, glyph and digit errors in single cells of Tables 12, 1–11 and 13, a lost row in each table, and two slips in the page’s own algebra (the inverse of the bound, the closed form of the crossing).</p>
<p><code>rerun_all</code> recomputes <strong>every claim</strong> from the (possibly corrupted) inputs, by a code path separate from the narrative cells above; its clean call is asserted equal to the narrative values. It calls the same functions of <code>model.py</code> (<code>P_bound</code>, <code>alpha_bound</code>, <code>excursion</code>, <code>envelope_fit</code>) and the same <code>ulp</code> and <code>sqrtM</code>, which are written once, so it is a second implementation of the page’s assembly and not of those primitives. Each row hands every claim’s recomputed value to <code>claims.breaks</code>, and a claim counts as protected only by a row that fails its own check; the last cell of the page raises when a claim has none.</p>
<p>Some pairs of row and claim are not caught, and the informative ones are exact invariances rather than blind spots. Swapping the prior and present blocks leaves <img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%5Cstar"> where it is (<img src="https://latex.codecogs.com/png.latex?%5Calpha%5E%5Cstar"> is symmetric in the two lines) and leaves every front-factor share unchanged (numerator and denominator both change sign); the natural-log row leaves the shares unchanged too (both scale by <img src="https://latex.codecogs.com/png.latex?%5Cln%2010">); a decimal slip in Table 10 moves where the data are but not where the two printed lines cross.</p>
<div id="0f5d8b77" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:41:56.468118Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:41:56.467987Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:42:00.834238Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:42:00.833254Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Identities registered as claims: each is recomputed under every break row, and the</span></span>
<span id="cb32-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># natural-log row (L) is the defect that breaks all three.</span></span>
<span id="cb32-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> v2_rows(t13, sh, lg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log10):</span>
<span id="cb32-4">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The four printed prior/present pairs of Table 13 against the decomposition."""</span></span>
<span id="cb32-5">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>):</span>
<span id="cb32-7">        sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t13[t13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> tab]</span>
<span id="cb32-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sub.gas_pair[sub.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>]:</span>
<span id="cb32-9">            row_p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub[(sub.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (sub.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb32-10">            row_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sub[(sub.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (sub.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb32-11">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> row_p.ks_D_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> row_q.ks_D_ratio:</span>
<span id="cb32-12">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: the prior and present rows must sit at one alpha"</span>)</span>
<span id="cb32-13">            a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row_p.ks_D_ratio)</span>
<span id="cb32-14">            d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sh.dlogk[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sh.dn[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lg(a)</span>
<span id="cb32-15">            printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(row_p.P_transition_barrer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> row_q.P_transition_barrer)</span>
<span id="cb32-16">            out.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(table<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tab, pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a, diff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> printed, k_share<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh.dlogk[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> d))</span>
<span id="cb32-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> pd.DataFrame(out)</span>
<span id="cb32-18"></span>
<span id="cb32-19"></span>
<span id="cb32-20"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rerun_all(T12x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, PTSx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, T13x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, CLMx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, sign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, logfun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log10,</span>
<span id="cb32-21">              swap_blocks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, flip_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, inv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alpha_bound, cross_cf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb32-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Recompute every claim of the page from (possibly corrupted) inputs.</span></span>
<span id="cb32-23"></span>
<span id="cb32-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Returns ``(values, margins)``: the claimed numbers, and for the counts the</span></span>
<span id="cb32-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    smallest distance of a counted quantity to its threshold.</span></span>
<span id="cb32-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb32-27">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T12 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T12x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> T12x</span>
<span id="cb32-28">    pts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> PTSx <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> PTSx</span>
<span id="cb32-29">    t13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> T13x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> T13x</span>
<span id="cb32-30">    lg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> logfun</span>
<span id="cb32-31">    cross_cf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cross_cf <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> dlk, dn: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dn))</span>
<span id="cb32-32">    pri <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[t.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> swap_blocks <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>)].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>)</span>
<span id="cb32-33">    pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[t.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> swap_blocks <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>)</span>
<span id="cb32-34">    pri <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pri.assign(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sign <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pri.n)</span>
<span id="cb32-35">    pre <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pre.assign(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sign <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pre.n)</span>
<span id="cb32-36">    pairs_all <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(t[t.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>].gas_pair)</span>
<span id="cb32-37">    pairs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs_all</span>
<span id="cb32-38">             <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(pri.k_barrer[g]) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> np.isfinite(pre.k_barrer[g])]</span>
<span id="cb32-39">    o, mg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}, {}</span>
<span id="cb32-40">    clm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CLM <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> CLMx <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> CLMx</span>
<span id="cb32-41">    cls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (clm[clm.shift_class.notna() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> clm.gas_pair.notna()]</span>
<span id="cb32-42">           .drop_duplicates(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gas_pair"</span>).shift_class)</span>
<span id="cb32-43">    sig <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> cls.get(g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"significant"</span>]</span>
<span id="cb32-44">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"modest"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"minor"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"significant"</span>):</span>
<span id="cb32-45">        o[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pairs_classified_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(cls.get(g) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> c <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs))</span>
<span id="cb32-46"></span>
<span id="cb32-47">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the transcription -----------------------------------------------------------</span></span>
<span id="cb32-48">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_in_table12"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(pairs_all)</span>
<span id="cb32-49">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_comparable"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(pairs)</span>
<span id="cb32-50">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table12"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t.k_barrer.notna().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-51">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_tables1_11"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(pts)</span>
<span id="cb32-52">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table13"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t13)</span>
<span id="cb32-53">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t13)</span>
<span id="cb32-54">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_total"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table12"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_tables1_11"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table13"</span>]</span>
<span id="cb32-55">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"references_cited"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>({x.strip() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pts.ref_bracket.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb32-56">                                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> r.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span>)})</span>
<span id="cb32-57">    nabs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t.n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().dropna()</span>
<span id="cb32-58">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_min"</span>], o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nabs.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(nabs.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-59">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_ratio"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_min"</span>]</span>
<span id="cb32-60"></span>
<span id="cb32-61">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Result 1 -------------------------------------------------------------------</span></span>
<span id="cb32-62">    rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-63">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb32-64">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb32-65">        a_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(a))))</span>
<span id="cb32-66">        dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> lg(pre.k_barrer[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lg(pri.k_barrer[g])</span>
<span id="cb32-67">        dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pre.n[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pri.n[g]</span>
<span id="cb32-68">        s_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lg(a_gm)</span>
<span id="cb32-69">        spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dn) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lg(a.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-70">        rr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, dlogk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlk, dn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dn, a_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), a_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), a_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a_gm,</span>
<span id="cb32-71">                       shift_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s_gm, share<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> s_gm, spread_over_shift<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(s_gm)))</span>
<span id="cb32-72">    sh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rr).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb32-73">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"front_factor_share_median"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share.median())</span>
<span id="cb32-74">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"front_factor_share_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-75">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"front_factor_share_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-76">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_near_parallel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((sh.spread_over_shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-77">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_near_parallel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sh.spread_over_shift <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>)</span>
<span id="cb32-78">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_shift_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.shift_gm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>])</span>
<span id="cb32-79">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_dlogk"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.dlogk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>])</span>
<span id="cb32-80">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_slope_change_frac"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sh.dn[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pri.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>]))</span>
<span id="cb32-81">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_spread_over_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.spread_over_shift[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>])</span>
<span id="cb32-82">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_share_gm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>])</span>
<span id="cb32-83">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_slope_term_max_frac"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sh.dn[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lg(sh.a_hi[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>])</span>
<span id="cb32-84">                                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sh.shift_gm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>]))</span>
<span id="cb32-85">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2n2_spread_over_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.spread_over_shift[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/N2"</span>])</span>
<span id="cb32-86">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2ch4_spread_over_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.spread_over_shift[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CH4"</span>])</span>
<span id="cb32-87">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_spread_over_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.spread_over_shift[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>])</span>
<span id="cb32-88">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_share_gm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>])</span>
<span id="cb32-89">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_alpha1_inside_range"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(((sh.a_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (sh.a_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-90">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_alpha1_inside_range"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log10(</span>
<span id="cb32-91">        np.concatenate([sh.a_lo, sh.a_hi])))))</span>
<span id="cb32-92"></span>
<span id="cb32-93">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Result 2 -------------------------------------------------------------------</span></span>
<span id="cb32-94">    ins, dist <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, []</span>
<span id="cb32-95">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb32-96">        dlk, dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sh.dlogk[g], sh.dn[g]</span>
<span id="cb32-97">        lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(sh.a_lo[g]), np.log10(sh.a_hi[g])</span>
<span id="cb32-98">        ins <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> hi) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb32-99">        la <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dn</span>
<span id="cb32-100">        dist.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(la <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(la <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hi)))</span>
<span id="cb32-101">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_crossing_inside_range"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ins</span>
<span id="cb32-102">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_crossing_inside_range"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(dist))</span>
<span id="cb32-103">    gx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span></span>
<span id="cb32-104">    dlk, dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sh.dlogk[gx], sh.dn[gx]</span>
<span id="cb32-105">    a_cf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(cross_cf(dlk, dn))</span>
<span id="cb32-106">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the root of the shift in log10(alpha): [-3, 6] decades holds every selectivity the</span></span>
<span id="cb32-107">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># paper prints and more; brentq raises when the shift does not change sign on it</span></span>
<span id="cb32-108">    a_rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> la: dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> la, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)</span>
<span id="cb32-109">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_crossing_alpha"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a_cf</span>
<span id="cb32-110">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_crossing_alpha_rootfind_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a_rf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_cf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb32-111">    ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> gx].alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb32-112">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_alpha_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-113">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_points_above_crossing"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> a_cf).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-114">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_points_above_crossing"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log10(ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a_cf))))</span>
<span id="cb32-115">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_present_over_prior_at_alpha_max_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (</span>
<span id="cb32-116">        pre.k_barrer[gx] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> pre.n[gx] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (pri.k_barrer[gx] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> pri.n[gx]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb32-117">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_present_below_prior_at_alpha_max_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_present_over_prior_at_alpha_max_pct"</span>]</span>
<span id="cb32-118"></span>
<span id="cb32-119">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Result 3 -------------------------------------------------------------------</span></span>
<span id="cb32-120">    rr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-121">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb32-122">        P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb32-123">        P_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(P))))</span>
<span id="cb32-124">        dA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((lg(P_gm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lg(pre.k_barrer[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pre.n[g]</span>
<span id="cb32-125">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (lg(P_gm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lg(pri.k_barrer[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pri.n[g])</span>
<span id="cb32-126">        a1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> a, g<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g: pre.k_barrer[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> pre.n[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P_gm, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>,</span>
<span id="cb32-127">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb32-128">        a0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> a, g<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g: pri.k_barrer[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> pri.n[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P_gm, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>,</span>
<span id="cb32-129">                    xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb32-130">        rr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, dlogk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh.dlogk[g], dlogP<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh.shift_gm[g], dlogA<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dA,</span>
<span id="cb32-131">                       dlogA_rf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log10(a1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(a0), alpha_gain<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> dA))</span>
<span id="cb32-132">    rk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rr).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb32-133"></span>
<span id="cb32-134">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> top3(col):</span>
<span id="cb32-135">        v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rk[col].sort_values(ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)</span>
<span id="cb32-136">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(v.index[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(sig)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>])</span>
<span id="cb32-137">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> col, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_top3_hits"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogk"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogk_top3_hits"</span>),</span>
<span id="cb32-138">                      (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogP"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogP_top3_hits"</span>)):</span>
<span id="cb32-139">        o[name], mg[name] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> top3(col)</span>
<span id="cb32-140">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_gap_third_to_fourth"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_top3_hits"</span>]</span>
<span id="cb32-141">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_rootfind_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rk.dlogA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rk.dlogA_rf)))</span>
<span id="cb32-142">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_gain_hech4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rk.alpha_gain[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CH4"</span>])</span>
<span id="cb32-143">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha_gain_co2ch4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rk.alpha_gain[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CO2/CH4"</span>])</span>
<span id="cb32-144">    _gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(pts.P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))))</span>
<span id="cb32-145">    _own <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> f: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(f(pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))))  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb32-146">    evals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ([_own(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>), _own(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> P: np.exp(np.mean(np.log(P)))), _own(np.median),</span>
<span id="cb32-147">              _own(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>), <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: _gm] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g, c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000.0</span>)])</span>
<span id="cb32-148"></span>
<span id="cb32-149">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> hits_at(f, kfun, nfun):</span>
<span id="cb32-150">        d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(((g, (lg(f(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lg(kfun(g))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> nfun(g)</span>
<span id="cb32-151">                     <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (lg(f(g)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lg(pri.k_barrer[g])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pri.n[g]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs),</span>
<span id="cb32-152">                   key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> z: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>z[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb32-153">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(g <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d[:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(sig)), d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> d[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb32-154">    _h, _gp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(hits_at(f, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: pre.k_barrer[g], <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: pre.n[g]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> evals))</span>
<span id="cb32-155">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_top3_hits_min_over_eval_points"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_h))</span>
<span id="cb32-156">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_top3_hits_min_over_eval_points"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_gp))</span>
<span id="cb32-157">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_gap_min_over_eval_points"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_gp))</span>
<span id="cb32-158"></span>
<span id="cb32-159">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- Result 4 -------------------------------------------------------------------</span></span>
<span id="cb32-160">    er <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-161">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs_all:</span>
<span id="cb32-162">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(pts.gas_pair):</span>
<span id="cb32-163">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb32-164">        sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb32-165">        r1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(excursion(sub.P_fast_barrer, sub.alpha, pre.k_barrer[g], pre.n[g]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb32-166">        r0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.asarray(excursion(sub.P_fast_barrer, sub.alpha,</span>
<span id="cb32-167">                                   pri.k_barrer[g], pri.n[g]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb32-168">              <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(pri.k_barrer[g]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.full(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(sub), np.nan))</span>
<span id="cb32-169">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> flip_r:                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># one inverted function, used in both places</span></span>
<span id="cb32-170">            r1, r0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r1, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r0</span>
<span id="cb32-171">        er <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(gas_pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, r_present<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a, r_prior<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(r1, r0)]</span>
<span id="cb32-172">    ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(er)</span>
<span id="cb32-173">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_total"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ex)</span>
<span id="cb32-174">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_present_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((ex.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-175">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_present_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ex.r_present <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-176">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"frac_above_present_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_present_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ex)</span>
<span id="cb32-177">    _o2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ex[ex.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>].r_present</span>
<span id="cb32-178">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o2n2_points_above_present_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_o2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-179">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o2n2_points_above_present_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_o2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-180">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"excursion_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ex.r_present.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-181">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"excursion_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ex.r_present.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-182">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"excursion_geomean"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(ex.r_present))))</span>
<span id="cb32-183">    _rp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ex[ex.gas_pair.isin(pairs)].r_prior</span>
<span id="cb32-184">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_prior_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_rp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-185">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_prior_bound"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_rp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-186"></span>
<span id="cb32-187">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- V1 -------------------------------------------------------------------------</span></span>
<span id="cb32-188">    sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([sqrtM(g) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t13.gas_pair])</span>
<span id="cb32-189">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_mw_column_max_abs_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t13.sqrt_M_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-190">    sq_iu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([np.sqrt(IUPAC[g.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> IUPAC[g.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t13.gas_pair])</span>
<span id="cb32-191">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_mw_column_max_abs_rel_iupac"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sq_iu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t13.sqrt_M_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-192">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_mw_h2n2_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t13[(t13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/N2"</span>)]</span>
<span id="cb32-193">                                     .sqrt_M_ratio.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb32-194">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_product_column_max_abs_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(</span>
<span id="cb32-195">        t13.ks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t13.sqrt_M_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t13.ks_D_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-196">    vr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-197">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> t13.iterrows():</span>
<span id="cb32-198">        src <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pri <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> pre</span>
<span id="cb32-199">        k, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> src.k_barrer[r.gas_pair], src.n[r.gas_pair]</span>
<span id="cb32-200">        kp, npr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> src.k_as_printed[r.gas_pair], src.n_as_printed[r.gas_pair]</span>
<span id="cb32-201">        rel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r.ks_D_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.P_transition_barrer <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb32-202">        common <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.log(r.ks_D_ratio)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ulp(npr)</span>
<span id="cb32-203">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ulp(r.ks_D_as_printed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.ks_D_ratio)</span>
<span id="cb32-204">        s4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (np.floor(np.log10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># noqa: E731</span></span>
<span id="cb32-205">        vr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(r.table, r.gas_pair, r.dataset), rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rel,</span>
<span id="cb32-206">                       bt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ulp(kp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> common <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ulp(r.P_transition_barrer) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.P_transition_barrer,</span>
<span id="cb32-207">                       bl<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s4(k) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> common <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> s4(r.P_transition_barrer) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.P_transition_barrer))</span>
<span id="cb32-208">    v1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(vr)</span>
<span id="cb32-209">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_identity_max_abs_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-210">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_identity_median_abs_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().median())</span>
<span id="cb32-211">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows_inside_tight_band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> v1.bt).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-212">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows_inside_tight_band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v1.bt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-213">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows_inside_loose_band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> v1.bl).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-214">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows_inside_loose_band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v1.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v1.bl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-215">    v1k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v1.set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"key"</span>)</span>
<span id="cb32-216">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1k.rel[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)])</span>
<span id="cb32-217">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13b_h2n2_tight_excess"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1k.rel[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)].<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">__abs__</span>()</span>
<span id="cb32-218">                                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> v1k.bt[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb32-219">    _rn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t13[(t13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb32-220">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_n2ch4_band_tight"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1k.bt[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)])</span>
<span id="cb32-221">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_n2ch4_band_tight_float_read"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb32-222">        v1k.bt[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)]</span>
<span id="cb32-223">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pre.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ulp(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">repr</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_rn.ks_D_ratio))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ulp(_rn.ks_D_as_printed))</span>
<span id="cb32-224">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _rn.ks_D_ratio)</span>
<span id="cb32-225">    _heh2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v1[[k[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v1.key]]</span>
<span id="cb32-226">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v1_heh2_rows_inside_tight_band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((_heh2.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> _heh2.bt).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-227">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v1_heh2_rows_inside_tight_band"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_heh2.rel.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _heh2.bt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb32-228">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_band_loose"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1k.bl[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)])</span>
<span id="cb32-229">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13b_o2n2_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v1k.rel[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)])</span>
<span id="cb32-230">    _r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t13[(t13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb32-231">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_r.ks_D_ratio)</span>
<span id="cb32-232">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_needed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(inv(_r.P_transition_barrer, pre.k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>],</span>
<span id="cb32-233">                                            pre.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>]))</span>
<span id="cb32-234">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_backout_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_needed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb32-235">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_v1_heh2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v1k.rel[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)]))</span>
<span id="cb32-236">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_v1_h2co2_prior"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v1k.rel[(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>)]))</span>
<span id="cb32-237"></span>
<span id="cb32-238">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- V2 and the two identities --------------------------------------------------</span></span>
<span id="cb32-239">    v2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v2_rows(t13, sh, lg)</span>
<span id="cb32-240">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_shift_crosscheck_max_abs_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"diff"</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-241">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v2.k_share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-242">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v2.k_share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-243">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>):</span>
<span id="cb32-244">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2"</span>)):</span>
<span id="cb32-245">            o[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"v2_kshare_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v2[(v2.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> tab) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (v2.pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g)].k_share.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb32-246">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_is_v1_difference_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb32-247">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"diff"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v1k.rel[(r.table, r.pair, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)])</span>
<span id="cb32-248">                                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> v1k.rel[(r.table, r.pair, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>)])))</span>
<span id="cb32-249">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> v2.iterrows()))</span>
<span id="cb32-250">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataside_shift_is_decomposition_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(</span>
<span id="cb32-251">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.mean(np.log10(ex[ex.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].r_prior))</span>
<span id="cb32-252">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.mean(np.log10(ex[ex.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].r_present)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sh.shift_gm[g])</span>
<span id="cb32-253">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs))</span>
<span id="cb32-254"></span>
<span id="cb32-255">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- V3, and the second route it carries ------------------------------------------</span></span>
<span id="cb32-256">    v3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-257">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(pts.gas_pair.unique()):</span>
<span id="cb32-258">        sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g]</span>
<span id="cb32-259">        la <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(sub.alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb32-260">        lp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(sub.P_fast_barrer.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb32-261">        k_env, n_env, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> envelope_fit(la, lp)</span>
<span id="cb32-262">        a_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(np.mean(np.log(sub.alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)))))</span>
<span id="cb32-263">        off <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((np.log10(k_env) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a_gm))</span>
<span id="cb32-264">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (np.log10(pre.k_barrer[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> pre.n[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a_gm)))</span>
<span id="cb32-265">        v3.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, n_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_env, k_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>k_env, dn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pre.n[g],</span>
<span id="cb32-266">                       span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>la.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> la.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), offset_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>off))</span>
<span id="cb32-267">    v3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(v3).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb32-268">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_median_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().median())</span>
<span id="cb32-269">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-270">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_median_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.offset_gm.median())</span>
<span id="cb32-271">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.offset_gm.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-272">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_positive"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v3.offset_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-273">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_positive"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.offset_gm.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-274">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_negative"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v3.offset_gm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-275">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_negative"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_positive"</span>]</span>
<span id="cb32-276">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_max_abs_wide_span"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3[v3.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>].dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-277">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_span_min_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.span.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-278">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_positive"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v3.dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-279">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_positive"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-280">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_negative"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v3.dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-281">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_negative"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_positive"</span>]</span>
<span id="cb32-282">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_span_over_1p5_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>((v3.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb32-283">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_span_over_1p5_decades"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v3.span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)))</span>
<span id="cb32-284">    by_span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(v3.span.sort_values().index)</span>
<span id="cb32-285">    by_dn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(v3.dn.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().sort_values(ascending<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).index)</span>
<span id="cb32-286">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lever_arm_set_size"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(m <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v3)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(by_span[:m]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(by_dn[:m]))</span>
<span id="cb32-287">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the second-route residual: sh_env minus the decomposition's own shift, on the</span></span>
<span id="cb32-288">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># comparable pairs; at the clean point it equals v3.offset_gm (an identity claim)</span></span>
<span id="cb32-289">    sr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb32-290">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb32-291">        dlk_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(v3.k_env[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(pri.k_barrer[g])</span>
<span id="cb32-292">        sh_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dlk_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (v3.n_env[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pri.n[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(sh.a_gm[g])</span>
<span id="cb32-293">        sr.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, dlk_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlk_env, sh_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh_env, share_env<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dlk_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sh_env,</span>
<span id="cb32-294">                       resid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sh_env <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sh.shift_gm[g]))</span>
<span id="cb32-295">    sr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(sr).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>)</span>
<span id="cb32-296">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second_route_is_offset_max_abs"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sr.resid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> v3.offset_gm[sr.index])))</span>
<span id="cb32-297">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_wide_span"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.resid[v3.span[sr.index] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-298">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sr_resid_hech4"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sr.resid[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CH4"</span>]))</span>
<span id="cb32-299">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_share_median"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.share_env.median())</span>
<span id="cb32-300">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, nm <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heco2"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CH4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2ch4"</span>)):</span>
<span id="cb32-301">        o[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nm<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">_share_env"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.share_env.get(g, np.nan))</span>
<span id="cb32-302">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heco2_share_gm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CO2"</span>, np.nan))</span>
<span id="cb32-303">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2ch4_share_gm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sh.share[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CH4"</span>])</span>
<span id="cb32-304">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_share_min"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.share_env.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb32-305">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_share_max"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.share_env.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb32-306">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_hen2_dlogk"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.dlk_env[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/N2"</span>])</span>
<span id="cb32-307">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_hen2_shift"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sr.sh_env[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/N2"</span>])</span>
<span id="cb32-308">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_hen2_cross_alpha"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(</span>
<span id="cb32-309">        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>sr.dlk_env[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/N2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (v3.n_env[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/N2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pri.n[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/N2"</span>])))</span>
<span id="cb32-310">    a0s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()), <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: sh.a_gm[g],</span>
<span id="cb32-311">           <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.median(pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.to_numpy(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))),</span>
<span id="cb32-312">           <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pts[pts.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g].alpha.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())]</span>
<span id="cb32-313">    _w, _s, _sm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], [], []</span>
<span id="cb32-314">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> af <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> a0s:</span>
<span id="cb32-315">        wide, sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb32-316">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb32-317">            a0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> af(g)</span>
<span id="cb32-318">            se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((np.log10(v3.k_env[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log10(pri.k_barrer[g]))</span>
<span id="cb32-319">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (v3.n_env[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pri.n[g]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log10(a0))</span>
<span id="cb32-320">            sd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sh.dlogk[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> sh.dn[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lg(a0)</span>
<span id="cb32-321">            sgn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.sign(se) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> np.sign(sd))</span>
<span id="cb32-322">            _sm.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(se), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sd)))</span>
<span id="cb32-323">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> v3.span[g] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>:</span>
<span id="cb32-324">                wide.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sd))</span>
<span id="cb32-325">        _w.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(wide))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> _s.append(sgn)</span>
<span id="cb32-326">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_wide_span_max_over_alpha0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_w))</span>
<span id="cb32-327">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_sign_agree_min_over_alpha0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_s))</span>
<span id="cb32-328">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_sign_agree_min_over_alpha0"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_sm))</span>
<span id="cb32-329">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_sign_agree_at_alpha_gm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(_s[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb32-330">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_sign_agree_at_alpha_gm"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sr.sh_env)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sh.shift_gm))))</span>
<span id="cb32-331">    _he, _hg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(hits_at(f, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: v3.k_env[g], <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> g: v3.n_env[g]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> evals))</span>
<span id="cb32-332">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_dlogA_top3_hits"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(_he[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb32-333">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_dlogA_top3_hits"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_hg[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb32-334">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_dlogA_top3_hits_min_over_eval_points"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_he))</span>
<span id="cb32-335">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_dlogA_top3_hits_min_over_eval_points"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">map</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>, _hg)))</span>
<span id="cb32-336">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_eval_points_with_3_hits"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _he))</span>
<span id="cb32-337">    mg[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_eval_points_with_3_hits"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">map</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>, _hg)))</span>
<span id="cb32-338"></span>
<span id="cb32-339">    o[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound_roundtrip_max_rel"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> roundtrip_max(pre, pairs, inv)</span>
<span id="cb32-340">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> o, mg</span>
<span id="cb32-341"></span>
<span id="cb32-342"></span>
<span id="cb32-343"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the rows -----------------------------------------------------------------------</span></span>
<span id="cb32-344">ROWS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(S) n taken POSITIVE (sign convention flipped)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(sign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)),</span>
<span id="cb32-345">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(B) prior and present blocks swapped"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(swap_blocks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)),</span>
<span id="cb32-346">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(L) natural log used in the decomposition"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(logfun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.log)),</span>
<span id="cb32-347">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(I) excursion inverted: k*alpha^n / P"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(flip_r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)),</span>
<span id="cb32-348">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(N) inverse of the bound written with n instead of 1/n"</span>,</span>
<span id="cb32-349">         <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(inv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> P, k, n: (np.asarray(P, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> k) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n)),</span>
<span id="cb32-350">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(X) closed form of the crossing with its sign dropped"</span>,</span>
<span id="cb32-351">         <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(cross_cf<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> dlk, dn: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (dlk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dn)))]</span>
<span id="cb32-352"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, label, (ds, g, col, val, printed) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb32-353">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thousands comma dropped: k(O2/N2, present) 1,396,000 -&gt; 1396"</span>,</span>
<span id="cb32-354">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1396.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1396"</span>)),</span>
<span id="cb32-355">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"glyph 9&lt;-&gt;0: k(He/H2, present) 59,910 -&gt; 59,010"</span>,</span>
<span id="cb32-356">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">59010.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"59,010"</span>)),</span>
<span id="cb32-357">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"glyph 8&lt;-&gt;3: n(He/CH4, present) -0.809 -&gt; -0.309"</span>,</span>
<span id="cb32-358">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CH4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.309</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.309"</span>)),</span>
<span id="cb32-359">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"glyph 8&lt;-&gt;0: n(O2/N2, prior) -5.800 -&gt; -5.000"</span>,</span>
<span id="cb32-360">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-5.000"</span>)),</span>
<span id="cb32-361">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DD"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digit dropped: k(He/CH4, present) 19,800 -&gt; 1,980"</span>,</span>
<span id="cb32-362">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CH4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1980.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1,980"</span>)),</span>
<span id="cb32-363">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"last digit: n(He/H2, present) -4.864 -&gt; -4.865"</span>,</span>
<span id="cb32-364">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.865</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-4.865"</span>)),</span>
<span id="cb32-365">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"last digit: k(H2/CO2, prior) 1200 -&gt; 1201"</span>,</span>
<span id="cb32-366">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1201.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1201"</span>)),</span>
<span id="cb32-367">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DP"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"digit dropped in the PRIOR block: k(He/H2, prior) 960 -&gt; 96"</span>,</span>
<span id="cb32-368">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">96.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"96"</span>)),</span>
<span id="cb32-369">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"G7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"glyph 7&lt;-&gt;1: n(N2/CH4, present) -4.507 -&gt; -4.501"</span>,</span>
<span id="cb32-370">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.501</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-4.501"</span>))]:</span>
<span id="cb32-371">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T12.copy()</span>
<span id="cb32-372">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (t.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> ds) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (t.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g)</span>
<span id="cb32-373">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb32-374">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> must hit exactly one Table 12 row"</span>)</span>
<span id="cb32-375">    t.loc[m, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val</span>
<span id="cb32-376">    t.loc[m, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_as_printed"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> col <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k_barrer"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_as_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed</span>
<span id="cb32-377">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(T12x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t)))</span>
<span id="cb32-378"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, g <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RT"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CO2"</span>),):</span>
<span id="cb32-379">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) Table 12 row lost: the prior </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>g<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> row"</span>,</span>
<span id="cb32-380">                 <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(T12x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T12[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>((T12.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prior"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T12.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> g))])))</span>
<span id="cb32-381"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the Tables 1-11 rows: one alpha that carries a headline, one P, one that sets a span,</span></span>
<span id="cb32-382"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and one row lost (the last row whose reference no other row cites)</span></span>
<span id="cb32-383"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, label, (gp, col, old, new) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb32-384">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TABLE 10 decimal slip: alpha(H2/CO2) 100.9 -&gt; 10.09"</span>,</span>
<span id="cb32-385">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.09</span>)),</span>
<span id="cb32-386">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TABLE 1 decimal slip: P(O2/N2) 18.0 -&gt; 1.80"</span>,</span>
<span id="cb32-387">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_fast_barrer"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">18.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.80</span>)),</span>
<span id="cb32-388">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TABLE 7 glyph 3&lt;-&gt;8: alpha(He/H2) 4.39 -&gt; 4.89"</span>,</span>
<span id="cb32-389">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.39</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.89</span>))]:</span>
<span id="cb32-390">    p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS.copy()</span>
<span id="cb32-391">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (p.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> gp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (p[col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> old)</span>
<span id="cb32-392">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb32-393">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> must hit exactly one cell, hit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb32-394">    p.loc[m, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> new</span>
<span id="cb32-395">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(PTSx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p)))</span>
<span id="cb32-396">_i9 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS[PTS.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>].alpha.idxmax()</span>
<span id="cb32-397">ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(T4) TABLE 9 decimal slip: the largest alpha(N2/CH4) read ten times too large"</span>,</span>
<span id="cb32-398">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(PTSx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PTS.assign(alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PTS.alpha.where(PTS.index <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> _i9, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> PTS.alpha[_i9])))))</span>
<span id="cb32-399">ROWS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(CL) Conclusions misread: H2/CO2 classed 'modest' instead of 'minor'"</span>,</span>
<span id="cb32-400">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(CLMx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLM.assign(shift_class<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CLM.shift_class.where(</span>
<span id="cb32-401">                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>((CLM.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> CLM.shift_class.notna()), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"modest"</span>)))))</span>
<span id="cb32-402">_refs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS.ref_bracket.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)</span>
<span id="cb32-403">_lost <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PTS.index[_refs.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">map</span>(_refs.value_counts()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>][<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb32-404">ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(RP) Tables 1-11 row lost: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>gas_pair[_lost]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>polymer[_lost][:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb32-405">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(PTSx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PTS.drop(index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_lost))))</span>
<span id="cb32-406"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the Table 13 rows: two molecular-weight cells, one product cell, one row lost</span></span>
<span id="cb32-407"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tag, label, (tb, gp, col, new, printed) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb32-408">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TABLE 13a glyph 42&lt;-&gt;24: sqrt(M) H2/N2 3.742 -&gt; 3.724"</span>,</span>
<span id="cb32-409">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sqrt_M_ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.724</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)),</span>
<span id="cb32-410">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"M2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TABLE 13a glyph 90&lt;-&gt;09: sqrt(M) H2/CO2 4.6904 -&gt; 4.6094"</span>,</span>
<span id="cb32-411">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"H2/CO2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sqrt_M_ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6094</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)),</span>
<span id="cb32-412">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TABLE 13a glyph 73&lt;-&gt;37: ks*sqrt(M) O2/N2 1.473 -&gt; 1.437"</span>,</span>
<span id="cb32-413">         (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"O2/N2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ks_D_ratio"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.437</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.437"</span>))]:</span>
<span id="cb32-414">    q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T13.copy()</span>
<span id="cb32-415">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (q.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> tb) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (q.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> gp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (q.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>)</span>
<span id="cb32-416">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(m.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb32-417">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ValueError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> must hit exactly one Table 13 row"</span>)</span>
<span id="cb32-418">    q.loc[m, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> new</span>
<span id="cb32-419">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> printed <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb32-420">        q.loc[m, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ks_D_as_printed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed</span>
<span id="cb32-421">    ROWS.append((<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tag<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(T13x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>q)))</span>
<span id="cb32-422">ROWS.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(R13) Table 13 row lost: 13b N2/CH4"</span>,</span>
<span id="cb32-423">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(T13x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T13[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>((T13.table <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13b"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (T13.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N2/CH4"</span>))])))</span>
<span id="cb32-424"></span>
<span id="cb32-425">BASE, MARGIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rerun_all()</span>
<span id="cb32-426">BROKEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {lab: rerun_all(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS}</span>
<span id="cb32-427">BR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([BASE] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [BROKEN[lab] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS],</span>
<span id="cb32-428">                  index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(clean) - as transcribed"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [lab <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS])</span>
<span id="cb32-429"></span>
<span id="cb32-430">SHOW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_shift_decades"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_identity_max_abs_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_v1_heh2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_v1_h2co2_prior"</span>,</span>
<span id="cb32-431">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_shift_crosscheck_max_abs_decades"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_crossing_alpha"</span>,</span>
<span id="cb32-432">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_decades"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_present_bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_top3_hits"</span>]</span>
<span id="cb32-433">HEAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2 shift"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"V1 max"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"V1 He/H2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"V1 H2/CO2pr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"V2 max"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha*"</span>,</span>
<span id="cb32-434">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"V3 offset"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#above"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top3"</span>]</span>
<span id="cb32-435"></span>
<span id="cb32-436"></span>
<span id="cb32-437"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _fmt(v):</span>
<span id="cb32-438">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb32-439"></span>
<span id="cb32-440"></span>
<span id="cb32-441">_W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(lab) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BR.index)</span>
<span id="cb32-442"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'injected defect'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>{_W}s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>h<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> h <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> HEAD)]</span>
<span id="cb32-443">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> [<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>{_W}s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>.join(_fmt(BR[c][lab]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SHOW) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BR.index]))</span>
<span id="cb32-444"></span>
<span id="cb32-445"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The clean rerun must reproduce the narrative cells, by its own code path.</span></span>
<span id="cb32-446">NARRATIVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(</span>
<span id="cb32-447">    pairs_in_table12<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_PAIRS_TABLE, pairs_comparable<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_PAIRS_COMPARABLE,</span>
<span id="cb32-448">    cells_table12<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_NUM_T12, cells_tables1_11<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_NUM_PTS, cells_table13<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_NUM_T13,</span>
<span id="cb32-449">    cells_total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_NUMERALS,</span>
<span id="cb32-450">    front_factor_share_median<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SHARE_MED, front_factor_share_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SHARE_MIN,</span>
<span id="cb32-451">    front_factor_share_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SHARE_MAX, pairs_near_parallel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PARALLEL_N,</span>
<span id="cb32-452">    heh2_shift_decades<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.shift_gm[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>], heh2_dlogk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.dlogk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>],</span>
<span id="cb32-453">    heh2_spread_over_shift<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SH.spread_over_shift[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/H2"</span>], pairs_alpha1_inside_range<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(IN1),</span>
<span id="cb32-454">    pairs_crossing_inside_range<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_CROSSING_INSIDE, h2co2_crossing_alpha_rootfind_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ALPHA_STAR_AGREE,</span>
<span id="cb32-455">    envelope_dn_positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_DN_POS, o2n2_points_above_present_bound<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_ABOVE_O2N2, h2co2_crossing_alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ALPHA_STAR,</span>
<span id="cb32-456">    h2co2_points_above_crossing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(above),</span>
<span id="cb32-457">    h2co2_present_over_prior_at_alpha_max_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRESENT_BELOW_PRIOR_PCT,</span>
<span id="cb32-458">    dlogA_top3_hits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HITS_A, dlogk_top3_hits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HITS_K, dlogP_top3_hits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HITS_P,</span>
<span id="cb32-459">    dlogA_gap_third_to_fourth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>gap_A, dlogA_top3_hits_min_over_eval_points<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>EVAL_HITS_MIN,</span>
<span id="cb32-460">    dlogA_gap_min_over_eval_points<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>EVAL_GAP_MIN, alpha_gain_hech4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RK.alpha_gain[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CH4"</span>],</span>
<span id="cb32-461">    alpha_gain_co2ch4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RK.alpha_gain[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"CO2/CH4"</span>], points_total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_POINTS,</span>
<span id="cb32-462">    points_above_present_bound<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_ABOVE, frac_above_present_bound<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FRAC_ABOVE,</span>
<span id="cb32-463">    excursion_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R_MAX, excursion_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R_MIN, excursion_geomean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>R_GEOMEAN,</span>
<span id="cb32-464">    points_above_prior_bound<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_ABOVE_PRIOR, t13_mw_column_max_abs_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MW_MAX_REL,</span>
<span id="cb32-465">    t13_mw_column_max_abs_rel_iupac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MW_MAX_REL_IUPAC, t13_product_column_max_abs_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PROD_MAX_REL,</span>
<span id="cb32-466">    t13_identity_max_abs_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T13_MAX_REL, t13_identity_median_abs_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T13_MED_REL,</span>
<span id="cb32-467">    t13_rows_inside_tight_band<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_INSIDE_TIGHT, t13_rows_inside_loose_band<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_INSIDE_LOOSE,</span>
<span id="cb32-468">    t13a_o2n2_alpha_backout_rel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T13A_O2N2_BACKOUT_REL,</span>
<span id="cb32-469">    v2_shift_crosscheck_max_abs_decades<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V2_MAX_ABS, v2_kshare_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V2.k_share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(),</span>
<span id="cb32-470">    v2_kshare_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V2.k_share.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(), envelope_dn_median_abs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3_DN_MED,</span>
<span id="cb32-471">    envelope_dn_max_abs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3_DN_MAX, envelope_offset_median_decades<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3_OFFSET_MED,</span>
<span id="cb32-472">    envelope_offset_max_abs_decades<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3_OFFSET_MAX, envelope_offsets_positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N_OFFSET_POS,</span>
<span id="cb32-473">    envelope_offset_max_abs_wide_span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SECOND_ROUTE_WIDE_MAX,</span>
<span id="cb32-474">    envelope_offset_max_abs_wide_span_max_over_alpha0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SR_WIDE_MAX_OVER_A0,</span>
<span id="cb32-475">    envelope_sign_agree_min_over_alpha0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SR_SIGN_MIN_OVER_A0,</span>
<span id="cb32-476">    envelope_sign_agree_at_alpha_gm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SECOND_ROUTE_SIGN_AGREE,</span>
<span id="cb32-477">    envelope_dn_max_abs_wide_span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3_DN_WIDE, envelope_span_min_decades<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>V3_SPAN_MIN,</span>
<span id="cb32-478">    lever_arm_set_size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>M_LEVER, envelope_implied_share_median<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SHARE_ENV_MED,</span>
<span id="cb32-479">    envelope_implied_share_min<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SR.share_env.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), envelope_implied_share_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SR.share_env.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(),</span>
<span id="cb32-480">    envelope_implied_dlogA_top3_hits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HITS_ENV,</span>
<span id="cb32-481">    envelope_implied_dlogA_top3_hits_min_over_eval_points<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>HITS_ENV_MIN)</span>
<span id="cb32-482">_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: (v, BASE[k]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NARRATIVE.items()</span>
<span id="cb32-483">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(BASE[k]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(v)))}</span>
<span id="cb32-484"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _bad:</span>
<span id="cb32-485">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">AssertionError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rerun_all disagrees with the narrative cells: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_bad<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb32-486"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The clean rerun reproduces all </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(NARRATIVE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> narrative values it shares with the cells "</span></span>
<span id="cb32-487">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"above, to 1e-12 relative."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>injected defect                                                               He/H2 shift      V1 max    V1 He/H2 V1 H2/CO2pr      V2 max      alpha*   V3 offset      #above        top3
(clean) - as transcribed                                                           1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(S) n taken POSITIVE (sign convention flipped)                                     1.7631 3867280.6665      0.9995      1.0000      0.8872      0.0267      9.6294     11.0000      0.0000
(B) prior and present blocks swapped                                              -1.8274     57.1308      0.9828      9.4494      3.5284     37.4654      1.6252     83.0000      0.0000
(L) natural log used in the decomposition                                          4.2076      0.0061      0.0010    2.22e-05      2.2988   4201.6231      0.4663     19.0000      3.0000
(I) excursion inverted: k*alpha^n / P                                              1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     98.0000      3.0000
(N) inverse of the bound written with n instead of 1/n                             1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(X) closed form of the crossing with its sign dropped                              1.8274      0.0061      0.0010    2.22e-05    4.93e-04      0.0267      0.4663     19.0000      3.0000
(C) thousands comma dropped: k(O2/N2, present) 1,396,000 -&gt; 1396                   1.8274      0.9990      0.0010    2.22e-05    4.93e-04     37.4654      3.4663     27.0000      3.0000
(G9) glyph 9&lt;-&gt;0: k(He/H2, present) 59,910 -&gt; 59,010                               1.8208      0.0156      0.0140    2.22e-05      0.0068     37.4654      0.4663     19.0000      3.0000
(G8) glyph 8&lt;-&gt;3: n(He/CH4, present) -0.809 -&gt; -0.309                              1.8274      0.7133      0.0010    2.22e-05    4.93e-04     37.4654      0.8025     15.0000      3.0000
(G0) glyph 8&lt;-&gt;0: n(O2/N2, prior) -5.800 -&gt; -5.000                                 1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(DD) digit dropped: k(He/CH4, present) 19,800 -&gt; 1,980                             1.8274      0.9001      0.0010    2.22e-05    4.93e-04     37.4654      1.0734     26.0000      2.0000
(D1) last digit: n(He/H2, present) -4.864 -&gt; -4.865                                1.8270      0.0061      0.0018    2.22e-05    8.37e-04     37.4654      0.4663     19.0000      3.0000
(D2) last digit: k(H2/CO2, prior) 1200 -&gt; 1201                                     1.8274      0.0061      0.0010    8.56e-04    4.93e-04     37.3801      0.4663     19.0000      3.0000
(DP) digit dropped in the PRIOR block: k(He/H2, prior) 960 -&gt; 96                   2.8274      0.9000      0.0010    2.22e-05      1.0005     37.4654      0.4663     19.0000      3.0000
(G7) glyph 7&lt;-&gt;1: n(N2/CH4, present) -4.507 -&gt; -4.501                              1.8274      0.0124      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(RT) Table 12 row lost: the prior He/CO2 row                                       1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     18.0000      2.0000
(T1) TABLE 10 decimal slip: alpha(H2/CO2) 100.9 -&gt; 10.09                           1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(T2) TABLE 1 decimal slip: P(O2/N2) 18.0 -&gt; 1.80                                   1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.2021     18.0000      3.0000
(T3) TABLE 7 glyph 3&lt;-&gt;8: alpha(He/H2) 4.39 -&gt; 4.89                                1.8277      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     20.0000      3.0000
(T4) TABLE 9 decimal slip: the largest alpha(N2/CH4) read ten times too large      1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     20.0000      3.0000
(CL) Conclusions misread: H2/CO2 classed 'modest' instead of 'minor'               1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(RP) Tables 1-11 row lost: He/CO2 Polyimide (6FDA-durene) (cross                   1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(M1) TABLE 13a glyph 42&lt;-&gt;24: sqrt(M) H2/N2 3.742 -&gt; 3.724                         1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(M2) TABLE 13a glyph 90&lt;-&gt;09: sqrt(M) H2/CO2 4.6904 -&gt; 4.6094                      1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(K) TABLE 13a glyph 73&lt;-&gt;37: ks*sqrt(M) O2/N2 1.473 -&gt; 1.437                       1.8274      0.1435      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000
(R13) Table 13 row lost: 13b N2/CH4                                                1.8274      0.0061      0.0010    2.22e-05    4.93e-04     37.4654      0.4663     19.0000      3.0000

The clean rerun reproduces all 64 narrative values it shares with the cells above, to 1e-12 relative.</code></pre>
</div>
</div>
<div id="fffcbf72" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:42:00.836444Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:42:00.836157Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:42:00.847122Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:42:00.846356Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Reading the table row by row. Looked up by label, never by list index.</span></span>
<span id="cb34-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pick(frag):</span>
<span id="cb34-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The recomputed claims under the one row whose label contains ``frag``."""</span></span>
<span id="cb34-4">    lab, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [lab <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BROKEN <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> frag <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lab]</span>
<span id="cb34-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> BROKEN[lab]</span>
<span id="cb34-6"></span>
<span id="cb34-7"></span>
<span id="cb34-8">o_ld, o_pk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n(He/H2, present) -4.864"</span>), pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k(H2/CO2, prior) 1200"</span>)</span>
<span id="cb34-9">o_g8, o_dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n(He/CH4, present) -0.809"</span>), pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k(He/CH4, present) 19,800"</span>)</span>
<span id="cb34-10">o_t1, o_t2, o_t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha(H2/CO2) 100.9"</span>), pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P(O2/N2) 18.0"</span>), pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"alpha(He/H2) 4.39"</span>)</span>
<span id="cb34-11">o_b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pick(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"blocks swapped"</span>)</span>
<span id="cb34-12">_dd_t12, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [kw[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"T12x"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k(He/CH4, present) 19,800"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lab]</span>
<span id="cb34-13">o_dd_k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_dd_t12[(_dd_t12.dataset <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"present"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (_dd_t12.gas_pair <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"He/CH4"</span>)].k_barrer.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb34-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>.join([</span>
<span id="cb34-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The block swap leaves the crossing selectivity alpha* where it was "</span></span>
<span id="cb34-16">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'h2co2_crossing_alpha'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_b[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'h2co2_crossing_alpha'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): alpha* is symmetric in"</span>,</span>
<span id="cb34-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the two lines, so exchanging them cannot move it. Every Table 12 row corrupts one cell and"</span>,</span>
<span id="cb34-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves only what that cell feeds; the Tables 1-11 rows corrupt one point each."</span>,</span>
<span id="cb34-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>,</span>
<span id="cb34-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The two LAST-DIGIT rows are the resolving-power rows, and V1's GLOBAL max is the wrong column"</span>,</span>
<span id="cb34-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"to read them in (it stays pinned to the unrelated 13a O2/N2 row at "</span></span>
<span id="cb34-22">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t13_identity_max_abs_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). Per row:"</span>,</span>
<span id="cb34-23">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n(He/H2) -4.864 -&gt; -4.865 moves the He/H2 identity residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_heh2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb34-24">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_ld[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_heh2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_ld[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_heh2'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_heh2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x)"</span>,</span>
<span id="cb34-25">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"                            and the V2 cross-check "</span></span>
<span id="cb34-26">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v2_shift_crosscheck_max_abs_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_ld[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v2_shift_crosscheck_max_abs_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb34-27">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_ld[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v2_shift_crosscheck_max_abs_decades'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v2_shift_crosscheck_max_abs_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x)"</span>,</span>
<span id="cb34-28">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  k(H2/CO2,prior) 1200 -&gt; 1201 moves that row's identity residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_h2co2_prior'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb34-29">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_pk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_h2co2_prior'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_pk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_h2co2_prior'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_v1_h2co2_prior'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">x)"</span>,</span>
<span id="cb34-30">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                            and the crossing selectivity </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'h2co2_crossing_alpha'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb34-31">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_pk[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'h2co2_crossing_alpha'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb34-32">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Both residuals move, but the He/H2 rows stay inside their literal printing bands "</span></span>
<span id="cb34-33">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v1_heh2_rows_inside_tight_band'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_ld[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'v1_heh2_rows_inside_tight_band'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of 4 inside),"</span>,</span>
<span id="cb34-34">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"so V1 and V2 do NOT detect a last-digit error in n(He/H2) on their own; the regression check"</span>,</span>
<span id="cb34-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"against the committed values does. The crossing result is sensitive to the final digit of"</span>,</span>
<span id="cb34-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the prior k it depends on."</span>,</span>
<span id="cb34-37">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>,</span>
<span id="cb34-38">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The ranking count is deliberately the coarsest quantity here. It survives both last-digit"</span>,</span>
<span id="cb34-39">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rows, and the 8&lt;-&gt;3 glyph in n(He/CH4) too (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlogA_top3_hits'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_g8[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlogA_top3_hits'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), "</span></span>
<span id="cb34-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"because a shallower slope only"</span>,</span>
<span id="cb34-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pushes He/CH4 further UP the selectivity-gain ranking. What breaks it is a lost digit:"</span>,</span>
<span id="cb34-42">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"k(He/CH4) 19,800 -&gt; 1,980 takes the count </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlogA_top3_hits'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_dd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dlogA_top3_hits'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb34-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"because He/CH4's shift then reverses sign."</span>,</span>
<span id="cb34-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"So the ranking rests on the DECADE of every present k, which V1 pins hard."</span>,</span>
<span id="cb34-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>,</span>
<span id="cb34-46">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A single slip in ONE cell of Tables 1-11:"</span>,</span>
<span id="cb34-47">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (T1) alpha(H2/CO2) 100.9 -&gt; 10.09 takes pairs_crossing_inside_range "</span></span>
<span id="cb34-48">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pairs_crossing_inside_range'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_t1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pairs_crossing_inside_range'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: with that point gone"</span>,</span>
<span id="cb34-49">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"       from the top of Table 10's range, alpha* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'h2co2_crossing_alpha'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is no longer "</span></span>
<span id="cb34-50">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inside it. No Table 12 check can see this."</span>,</span>
<span id="cb34-51">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (T2) P(O2/N2) 18.0 -&gt; 1.80 takes points_above_present_bound </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'points_above_present_bound'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb34-52">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_t2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'points_above_present_bound'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and the envelope"</span>,</span>
<span id="cb34-53">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"       offset </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'envelope_offset_max_abs_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb34-54">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_t2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'envelope_offset_max_abs_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades, because that point pins O2/N2's covering line."</span>,</span>
<span id="cb34-55">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (T3) alpha(He/H2) 4.39 -&gt; 4.89 moves envelope_span_min_decades "</span></span>
<span id="cb34-56">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'envelope_span_min_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_t3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'envelope_span_min_decades'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>,</span>
<span id="cb34-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"       the lever arm behind the whole V3 slope discussion."</span>,</span>
<span id="cb34-58">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>,</span>
<span id="cb34-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(DD) answers the obvious objection to the second route. Tables 1-11 are the points Robeson"</span>,</span>
<span id="cb34-60">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SELECTED as close to his 2008 line, so the baseline residual is an optimistic figure. That"</span>,</span>
<span id="cb34-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"says nothing about the route's DETECTING power: k_env never touches Table 12, so"</span>,</span>
<span id="cb34-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"d(resid)/d(log k_present) = -1 identically. (DD) divides k(He/CH4, present) by ten and moves"</span>,</span>
<span id="cb34-63">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"that pair's two-route residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sr_resid_hech4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_dd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sr_resid_hech4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, by "</span></span>
<span id="cb34-64">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o_dd[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sr_resid_hech4'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> BASE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sr_resid_hech4'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> decades for a"</span>,</span>
<span id="cb34-65">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log10(present.k_barrer[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'He/CH4'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> o_dd_k)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-decade error in the printed line."</span>]))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>The block swap leaves the crossing selectivity alpha* where it was (37.4654 -&gt; 37.4654): alpha* is symmetric in
the two lines, so exchanging them cannot move it. Every Table 12 row corrupts one cell and
moves only what that cell feeds; the Tables 1-11 rows corrupt one point each.

The two LAST-DIGIT rows are the resolving-power rows, and V1's GLOBAL max is the wrong column
to read them in (it stays pinned to the unrelated 13a O2/N2 row at 6.12e-03). Per row:
  n(He/H2) -4.864 -&gt; -4.865 moves the He/H2 identity residual 1.04e-03 -&gt; 1.83e-03 (2x)
                            and the V2 cross-check 4.93e-04 -&gt; 8.37e-04 (1.7x)
  k(H2/CO2,prior) 1200 -&gt; 1201 moves that row's identity residual 2.22e-05 -&gt; 8.56e-04 (39x)
                            and the crossing selectivity 37.4654 -&gt; 37.3801
Both residuals move, but the He/H2 rows stay inside their literal printing bands (4 -&gt; 4 of 4 inside),
so V1 and V2 do NOT detect a last-digit error in n(He/H2) on their own; the regression check
against the committed values does. The crossing result is sensitive to the final digit of
the prior k it depends on.

The ranking count is deliberately the coarsest quantity here. It survives both last-digit
rows, and the 8&lt;-&gt;3 glyph in n(He/CH4) too (3 -&gt; 3), because a shallower slope only
pushes He/CH4 further UP the selectivity-gain ranking. What breaks it is a lost digit:
k(He/CH4) 19,800 -&gt; 1,980 takes the count 3 -&gt; 2, because He/CH4's shift then reverses sign.
So the ranking rests on the DECADE of every present k, which V1 pins hard.

A single slip in ONE cell of Tables 1-11:
  (T1) alpha(H2/CO2) 100.9 -&gt; 10.09 takes pairs_crossing_inside_range 1 -&gt; 0: with that point gone
       from the top of Table 10's range, alpha* = 37.47 is no longer inside it. No Table 12 check can see this.
  (T2) P(O2/N2) 18.0 -&gt; 1.80 takes points_above_present_bound 19 -&gt; 18, and the envelope
       offset 0.4663 -&gt; 0.2021 decades, because that point pins O2/N2's covering line.
  (T3) alpha(He/H2) 4.39 -&gt; 4.89 moves envelope_span_min_decades 0.6172 -&gt; 0.6640,
       the lever arm behind the whole V3 slope discussion.

(DD) answers the obvious objection to the second route. Tables 1-11 are the points Robeson
SELECTED as close to his 2008 line, so the baseline residual is an optimistic figure. That
says nothing about the route's DETECTING power: k_env never touches Table 12, so
d(resid)/d(log k_present) = -1 identically. (DD) divides k(He/CH4, present) by ten and moves
that pair's two-route residual 0.07341 -&gt; 1.07341, by +1.00000 decades for a
1.000-decade error in the printed line.</code></pre>
</div>
</div>
<div id="1faa6f20" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:42:00.848901Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:42:00.848666Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:42:00.857676Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:42:00.857201Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb36-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number the page states, registered once (docs/claims-design.md). Values are</span></span>
<span id="cb36-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arithmetic on printed numbers and reproduce to round-off, so they are held to 1e-6.</span></span>
<span id="cb36-3">VAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span></span>
<span id="cb36-4">EXACT_COUNTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_in_table12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_comparable"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_tables1_11"</span>,</span>
<span id="cb36-5">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table13"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_total"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"references_cited"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_total"</span>,</span>
<span id="cb36-6">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lever_arm_set_size"</span>]</span>
<span id="cb36-7">BOUNDS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb36-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound_roundtrip_max_rel"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P_bound and alpha_bound are algebraic inverses"</span>),</span>
<span id="cb36-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_is_v1_difference_max_abs"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"V2's residual is the difference of two V1 residuals"</span>),</span>
<span id="cb36-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataside_shift_is_decomposition_max_abs"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean(log alpha) is log(alpha_gm)"</span>),</span>
<span id="cb36-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second_route_is_offset_max_abs"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the prior line cancels from the two routes"</span>),</span>
<span id="cb36-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_crossing_alpha_rootfind_rel"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brentq xtol 1e-14 on log10(alpha)"</span>),</span>
<span id="cb36-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_rootfind_max_abs"</span>: (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brentq rtol 8.9e-16 on alpha"</span>),</span>
<span id="cb36-14">}</span>
<span id="cb36-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BASE.items():</span>
<span id="cb36-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>):</span>
<span id="cb36-17">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb36-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BOUNDS:</span>
<span id="cb36-19">        basis, note <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BOUNDS[name]</span>
<span id="cb36-20">        claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>basis, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>note)</span>
<span id="cb36-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MARGIN:</span>
<span id="cb36-22">        claims.exact(name, x, margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>MARGIN[name], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb36-23">                     note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a count decided against a threshold; margin is its distance to it"</span>)</span>
<span id="cb36-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">elif</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> EXACT_COUNTS:</span>
<span id="cb36-25">        claims.exact(name, x)</span>
<span id="cb36-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb36-27">        claims.value(name, x, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>VAL)</span>
<span id="cb36-28"></span>
<span id="cb36-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every row, every claim: the claim's own check decides whether the row catches it</span></span>
<span id="cb36-30"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ROWS:</span>
<span id="cb36-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics:</span>
<span id="cb36-32">        claims.breaks(lab, name, BROKEN[lab][name])</span></code></pre></div></div>
</div>
</section>
<section id="blind-spots-what-this-page-does-not-establish" class="level3">
<h3 class="anchored" data-anchor-id="blind-spots-what-this-page-does-not-establish">Blind spots: what this page does <em>not</em> establish</h3>
<ol type="1">
<li><strong>Nothing here validates the upper bound against measurement.</strong> Every number is Robeson’s: his compiled points, his hand-drawn lines, his derived tables. The page tests <em>internal consistency and the meaning of his claims</em>, and that is all. In the gallery’s vocabulary this is <strong>reproduction, not validation</strong>.</li>
<li><strong>The 117 points are a compilation.</strong> They cite 44 distinct primary references, none of which was consulted. An error made in compiling them is inherited silently.</li>
<li><strong>The prior bounds are a restatement.</strong> The 1991 and 1994 papers are not on disk. If the 2008 paper misquotes its own earlier <img src="https://latex.codecogs.com/png.latex?k"> or <img src="https://latex.codecogs.com/png.latex?n">, every shift on this page is wrong by exactly that amount and nothing here would show it. V1 touches the prior block for only two of the nine pairs.</li>
<li><strong><img src="https://latex.codecogs.com/png.latex?k_s">, and therefore Tables 13a/13b’s first column, is unchecked</strong>, the critical and Lennard-Jones temperatures behind eqs. (4) and (5) are not printed. V1 and V2 take that column as given; had Robeson mis-evaluated eq. (4), they would both still pass.</li>
<li><strong>The reference selectivity is this page’s choice.</strong> The geometric mean of the printed points is defensible and stated, but the front-factor <em>share</em> is not a property of the data alone, and the page says so in three places because it is the single easiest thing to quote out of context. The same applies to Result 3’s evaluation permeability: the ranking survives every reference tried inside the range all nine pairs share, but the <em>gap</em> between third and fourth does not, it is swept and printed above, with both its smallest and its largest value, and neither should be quoted without its reference. <strong>And it applies to the second route’s own headline</strong>: the residual between the two routes carries <img src="https://latex.codecogs.com/png.latex?%5Clog%5Calpha_0"> explicitly, so it is swept over in-data references the same way, and both the residual and the sign agreement are reported at their worst as well as at the reference used. Neither number means anything unattached.</li>
<li><strong>Figure 12’s slope–diameter correlation and Freeman’s eq. (2) are out of scope</strong>, for a stated reason: the inputs are not printed in this paper. The page reports no verdict on either.</li>
<li><strong>The envelope re-fit (V3) is not a competitor to the printed <img src="https://latex.codecogs.com/png.latex?(k,n)"></strong> and must not be quoted as a “corrected” bound. It answers a different question (the tightest covering line), and it is pinned by exactly the extreme points the paper distrusts. It is also fitted to points Robeson <em>selected</em> as close to his 2008 line, so the second route’s small <strong>baseline</strong> residual is an optimistic figure and should not be read as accuracy. That limits the baseline agreement and not the route’s <strong>detecting power</strong>: <img src="https://latex.codecogs.com/png.latex?k_%7B%5Ctext%7Benv%7D%7D"> is untouched by Table 12, so the residual responds to a vertical error in the printed present line exactly one for one, measured under break row (DD) above, not argued.</li>
<li><strong>The excursion count is a count against <em>this</em> paper’s own lines.</strong> It says nothing about whether those 19 polymers really beat the state of the art; it says the hand-drawn line does not enclose every point the author tabulated beside it, which he never claimed it would.</li>
<li><strong>“The paper does not state the crossing” is a searched claim, not an assumption.</strong> The full text was searched for cross / crossing / intersect / “below the prior”; the only hits are the polymer name <em>crosslinked</em>, reference titles containing <em>crosslinking</em>, and nothing else. What the paper <em>does</em> print, and this page quotes, is the slope change and the warning that the low-permeability end may have skewed it.</li>
<li><strong>Result 1’s decomposition has no second arithmetic route, and cannot have one.</strong> Given Table 12 it is a rearrangement, so V2 and the data-side shift both reproduce it to machine precision by construction; the page measures that rather than claiming otherwise. The one genuine second route is V3’s envelope, which replaces the <em>present</em> line with an estimate from Tables 1–11; at each pair’s geometric-mean selectivity it agrees on the sign of the shift for every comparable pair (8 of 9 at the least kind of the four references swept), and on the magnitude to the tolerance printed in V3 wherever the lever arm allows, but it does <strong>not</strong> reproduce the front-factor share at all, which is blind spot 5 arriving from the other side. Its scope is the <strong>present line only</strong>: nothing on this page can give the <em>prior</em> block a second route, because both routes read it from the same restatement, and <img src="https://latex.codecogs.com/png.latex?%5Calpha_0"> is likewise common to both. And its corroboration of Result 3’s ranking is <strong>weaker than the primary route’s</strong>: swept over the same evaluation points the primary route is held to, the substituted route reproduces the ranking at most of them and not at all of them, while the primary route holds at every one. The counts are printed above; the asymmetry is the honest statement and it is the reported one.</li>
<li><strong>The “inside its own tabulated range” half of Result 2 rests on a single tabulated point</strong>, named and quantified in Result 2 and removed by break row (T1) above. The crossing itself does not (it is a property of the printed <img src="https://latex.codecogs.com/png.latex?(k,n)">), but the claim that it lands where the paper has data does.</li>
</ol>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Nothing.</strong> This page calls no pymrm function, and the honest statement is that the Robeson upper bound is not a pymrm problem: there is no field to discretise, no operator to assemble, no Jacobian to build. The bootstrap installs pymrm only because every gallery page pins it. The <code>structures</code> field is empty and <code>pymrm_api</code> is empty because that is true, not because they were not filled in.</p>
<p>What the <em>page</em> adds, over reading Table 12:</p>
<ul>
<li>It separates the <strong>nine</strong> comparable pairs from the thirteen listed, and shows that Robeson’s own Conclusions do the same, so a reader who compares thirteen is departing from the source, not following it.</li>
<li>It makes “primarily the front factor” <strong>quantitative and reference-explicit</strong>. On the four references <em>Robeson’s own Table 13</em> supplies, the front-factor share of the same two shifts runs from <strong>0.56 to 1.03</strong>; across the nine pairs at this page’s stated reference (the geometric-mean selectivity of each pair’s own points, which the paper does not supply) it runs <strong>0.59 to 1.39</strong>. Both ranges are printed above; the distinction between them is the point, and quoting either as “the paper’s” without saying which is exactly the error the page exists to warn against. Robeson’s own reference, <img src="https://latex.codecogs.com/png.latex?%5Calpha%20=%201">, is not outside the data either: it lies inside the tabulated range of 5 of the nine pairs.</li>
<li>It shows that <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k">, the quantity the abstract highlights, does <strong>not</strong> reproduce the paper’s own ranking of which bounds moved most, and that the selectivity gain at fixed permeability does, exactly, at every evaluation point inside the range all nine pairs share, while the <em>margin</em> between third and fourth is itself reference-dependent and runs from 0.011 to 0.111 decades across those points. Both of the paper’s statements survive; they are statements about different things.</li>
<li>It finds the one pair whose bounds <strong>cross inside its own data range</strong>, and says how thin that is: the crossing is a property of four printed numbers, but “inside its own range” rests on a single tabulated point.</li>
<li>It measures what <em>“by eye”</em> costs: 19 of 117 points above the line. At each pair’s <img src="https://latex.codecogs.com/png.latex?%5Calpha_%7Bgm%7D"> the tightest covering line through the same points sits above the printed one for 7 pairs and below it for 4; that count moves with the reference, while the slope does not: the covering line is shallower than the printed one for 10 pairs and steeper for only 1.</li>
<li>It says which of its own checks is a <strong>second route</strong> and which is an identity. V2 looks like independent corroboration and is arithmetically incapable of failing unless V1 does; the real second route is the envelope of <em>Validation V3</em>, the only computation here that does not read the present bound out of Table 12. That route corroborates the size of the shift, at a stated reference and by an amount that itself depends on that reference (which is why the residual is swept and not quoted at one point), and refuses to corroborate its front-factor split, which is the page’s own central claim arriving from a direction the page did not choose. It also corroborates Result 3’s ranking <strong>less strongly than the primary route does</strong>, under the identical evaluation-point sweep, and the page reports that gap rather than the flattering half of it.</li>
<li>It leaves every printed defect in place and quoted: the doubled <code>He/CO2</code> in the Conclusions, the <code>Polypyrrole</code>/<code>Polypyrrolone</code> inconsistency between Tables 2 and 5/6, the one Table 13a row outside even a generous printing band, and the paper’s own “the one data point above the present upper bound” where its Table 1 has 2.</li>
</ul>
<p>For the transport model that produces a <img src="https://latex.codecogs.com/png.latex?(P,%5Calpha)"> pair in the first place, go to <a href="../H1.7-solution-diffusion/"><code>H1.7</code></a>; that page <em>is</em> a pymrm page.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>Use the bound as a sanity ceiling, and quote it correctly.</strong> Given a claimed <img src="https://latex.codecogs.com/png.latex?(P_i,%5Calpha_%7Bij%7D)"> for a homogeneous polymer film, <code>excursion(P, alpha, k, n)</code> in <code>model.py</code> returns <img src="https://latex.codecogs.com/png.latex?r">; <img src="https://latex.codecogs.com/png.latex?r%3E1"> means the claim is above the 2008 bound. Take the <img src="https://latex.codecogs.com/png.latex?(k,n)"> from the <code>present</code> block of the Table 12 dataset, and note that only eleven pairs have one.</p>
<p><strong>Four cautions, in order of how often they bite.</strong></p>
<ol type="1">
<li><strong>Nine, not thirteen.</strong> If you are comparing 1991 with 2008, H2/O2 and He/O2 have no 2008 bound and CO2/N2 and N2/CH4 have no 1991 one. Comparing them is comparing against <code>NA</code>.</li>
<li><strong>Never quote a front-factor share without its reference selectivity.</strong> <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Clog%20k"> is the shift at <img src="https://latex.codecogs.com/png.latex?%5Calpha=1">, a selectivity with no special standing in the data. On this page’s own numbers the share of the He/H2 shift carried by <img src="https://latex.codecogs.com/png.latex?k"> is 0.98 at the geometric-mean selectivity of its points and 1.02 and 1.03 at the two selectivities Robeson’s own Tables 13a/13b use. For H2/CO2 it is <strong>0.56 and 0.70 at the two references Table 13 supplies</strong>, <strong>1.39 at this page’s geometric-mean reference</strong>, and undefined at <img src="https://latex.codecogs.com/png.latex?%5Calpha%5Capprox%2037"> where the two lines cross. Name the reference or the number means nothing: the same pair, the same two bounds, and a share running from 0.56 to 1.39.</li>
<li><strong>Rank pairs by selectivity gain, not by <img src="https://latex.codecogs.com/png.latex?k">.</strong> <img src="https://latex.codecogs.com/png.latex?%7Cn%7C"> runs from 0.79 (He/CH4) to 5.8 (O2/N2) in Table 12, so equal moves in <img src="https://latex.codecogs.com/png.latex?%5Clog%20k"> buy wildly unequal separation. This is the page’s sharpest practical result and the easiest thing to get wrong.</li>
<li><strong>The bound applies to homogeneous polymer films only.</strong> The paper excludes heterogeneous, surface-modified, mixed-matrix, carbon molecular-sieve and thermally-rearranged membranes explicitly, and shows TR polymers above the CO2/CH4 bound as a deliberate comparison rather than as a refutation. A Pd membrane (<a href="../H1.1-sieverts-permeation/"><code>H1.1</code></a>) or a zeolite membrane (<a href="../H1.9-zeolite-membrane-maxwell-stefan-mixture/"><code>H1.9</code></a>) exceeding it is not news.</li>
</ol>
<p><strong>If you extend this page</strong>, the highest-value additions are, in order: (i) the 1991 paper itself, which would let the prior block be checked rather than restated and would make every shift on this page a validated number instead of a reproduced one; (ii) Breck’s kinetic diameters, which would open Fig. 12’s <img src="https://latex.codecogs.com/png.latex?-1/n"> correlation; (iii) solubility constants, which would open Freeman’s eq. (2). None of the three is reachable from this file, and the page claims nothing about any of them.</p>
<p><strong>Datasets</strong> are reusable as they stand: <code>robeson-2008-table12-upper-bounds</code> is the canonical <img src="https://latex.codecogs.com/png.latex?(k,n)"> table, and <code>robeson-2008-near-bound-points</code> is 117 literature points with the compiler’s citation on every row. Both carry the caveats above in their sidecars; read them before loading, per the gallery’s cross-page rule.</p>
<div id="db0f7433" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:42:00.859214Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:42:00.859083Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:42:00.866848Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:42:00.866099Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb37-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number in the prose above, in README.md and in meta.yaml, checked against its claim.</span></span>
<span id="cb37-2"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [</span>
<span id="cb37-3">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"382"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_total"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table12"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"234"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_tables1_11"</span>),   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Background</span></span>
<span id="cb37-4">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"104"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cells_table13"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"26"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows"</span>),</span>
<span id="cb37-5">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_in_table12"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"44"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"references_cited"</span>),                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The data</span></span>
<span id="cb37-6">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"more than 7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_ratio"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.79"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_min"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_abs_max"</span>),   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># intro, model, Reuse</span></span>
<span id="cb37-7">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"37"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_crossing_alpha"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"37.47"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_crossing_alpha"</span>),</span>
<span id="cb37-8">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"19"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_above_present_bound"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"117"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"points_total"</span>),</span>
<span id="cb37-9">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"excursion_max"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.49"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"excursion_max"</span>),</span>
<span id="cb37-10">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_alpha1_inside_range"</span>),        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># model, assumptions</span></span>
<span id="cb37-11">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.742"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_mw_h2n2_printed"</span>),</span>
<span id="cb37-12">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.56"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_min"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.03"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_max"</span>),                            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># What pymrm adds</span></span>
<span id="cb37-13">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5647"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_min"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.0334"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_max"</span>),</span>
<span id="cb37-14">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.59"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"front_factor_share_min"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.39"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"front_factor_share_max"</span>),</span>
<span id="cb37-15">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.98"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"front_factor_share_median"</span>),</span>
<span id="cb37-16">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.011"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_gap_min_over_eval_points"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.111"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_gap_third_to_fourth"</span>),</span>
<span id="cb37-17">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_positive"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offsets_negative"</span>),</span>
<span id="cb37-18">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o2n2_points_above_present_bound"</span>),</span>
<span id="cb37-19">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.98"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_share_gm"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.02"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_heh2_13a"</span>),                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Reuse</span></span>
<span id="cb37-20">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.03"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_heh2_13b"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.56"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_h2co2_13a"</span>),</span>
<span id="cb37-21">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.70"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_kshare_h2co2_13b"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.39"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_share_gm"</span>),</span>
<span id="cb37-22">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_near_parallel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_comparable"</span>),                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># README, meta.yaml</span></span>
<span id="cb37-23">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.34"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2n2_spread_over_shift"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.93"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2ch4_spread_over_shift"</span>),</span>
<span id="cb37-24">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_spread_over_shift"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.0 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_spread_over_shift"</span>),</span>
<span id="cb37-25">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.83"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_shift_decades"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.1 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heh2_slope_term_max_frac"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogA_top3_hits"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogk_top3_hits"</span>),</span>
<span id="cb37-26">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dlogP_top3_hits"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-30.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_present_over_prior_at_alpha_max_pct"</span>),</span>
<span id="cb37-27">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"30.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_present_below_prior_at_alpha_max_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"30"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_present_below_prior_at_alpha_max_pct"</span>),</span>
<span id="cb37-28">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"100.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_alpha_max"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"16.2 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"frac_above_present_bound"</span>),</span>
<span id="cb37-29">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.478"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"excursion_geomean"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.017 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_identity_median_abs_rel"</span>),</span>
<span id="cb37-30">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"25"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows_inside_loose_band"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"24"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_rows_inside_tight_band"</span>),</span>
<span id="cb37-31">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.612 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.279 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_band_loose"</span>),</span>
<span id="cb37-32">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.4714"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_needed"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.473"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_o2n2_alpha_printed"</span>),</span>
<span id="cb37-33">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.027 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13b_o2n2_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.5e-4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_mw_column_max_abs_rel"</span>),</span>
<span id="cb37-34">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.9e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_mw_column_max_abs_rel_iupac"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.6e-3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13_product_column_max_abs_rel"</span>),</span>
<span id="cb37-35">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.9e-4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_shift_crosscheck_max_abs_decades"</span>),</span>
<span id="cb37-36">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v2_is_v1_difference_max_abs"</span>),</span>
<span id="cb37-37">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dataside_shift_is_decomposition_max_abs"</span>),</span>
<span id="cb37-38">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.086"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_wide_span"</span>),</span>
<span id="cb37-39">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.543"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_wide_span_max_over_alpha0"</span>),</span>
<span id="cb37-40">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_sign_agree_at_alpha_gm"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_sign_agree_min_over_alpha0"</span>),</span>
<span id="cb37-41">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.466"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_offset_max_abs_decades"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.62"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_span_min_decades"</span>),</span>
<span id="cb37-42">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.278"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_max_abs_wide_span"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lever_arm_set_size"</span>),</span>
<span id="cb37-43">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_dlogA_top3_hits"</span>),</span>
<span id="cb37-44">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_dlogA_top3_hits_min_over_eval_points"</span>),</span>
<span id="cb37-45">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_eval_points_with_3_hits"</span>),</span>
<span id="cb37-46">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.43"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_share_median"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.03"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_share_min"</span>),</span>
<span id="cb37-47">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.55"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_implied_share_max"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.0092"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_hen2_dlogk"</span>),</span>
<span id="cb37-48">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.299"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_hen2_shift"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_hen2_cross_alpha"</span>),</span>
<span id="cb37-49">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_crossing_inside_range"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"h2co2_points_above_crossing"</span>),</span>
<span id="cb37-50">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_classified_modest"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_classified_minor"</span>),            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Result 3</span></span>
<span id="cb37-51">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_classified_significant"</span>),</span>
<span id="cb37-52">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_positive"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"envelope_dn_negative"</span>),                <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># What pymrm adds</span></span>
<span id="cb37-53">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs_span_over_1p5_decades"</span>),                                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># meta.yaml</span></span>
<span id="cb37-54">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.92 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_n2ch4_band_tight"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.43 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t13a_n2ch4_band_tight_float_read"</span>),  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># README</span></span>
<span id="cb37-55">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v1_heh2_rows_inside_tight_band"</span>)]:</span>
<span id="cb37-56">    claims.says(lit, name)</span></code></pre></div></div>
</div>
<div id="d574af18" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-31T00:42:00.868375Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-31T00:42:00.868199Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-31T00:42:00.876716Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-31T00:42:00.876174Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb38-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb38-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row.</span></span>
<span id="cb38-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for H1.8:
  pairs_classified_modest                               = 5                value  rtol 1e-06
  pairs_classified_minor                                = 1                value  rtol 1e-06
  pairs_classified_significant                          = 3                value  rtol 1e-06
  pairs_in_table12                                      = 13               exact  exact
  pairs_comparable                                      = 9                exact  exact
  cells_table12                                         = 44               exact  exact
  cells_tables1_11                                      = 234              exact  exact
  cells_table13                                         = 104              exact  exact
  t13_rows                                              = 26               exact  exact
  cells_total                                           = 382              exact  exact
  references_cited                                      = 44               exact  exact
  n_abs_min                                             = 0.7857           value  rtol 1e-06
  n_abs_max                                             = 5.8              value  rtol 1e-06
  n_abs_ratio                                           = 7.382            value  rtol 1e-06
  front_factor_share_median                             = 0.98242          value  rtol 1e-06
  front_factor_share_min                                = 0.58675          value  rtol 1e-06
  front_factor_share_max                                = 1.3938           value  rtol 1e-06
  pairs_near_parallel                                   = 6                exact  exact, margin 0.183
  heh2_shift_decades                                    = 1.8274           value  rtol 1e-06
  heh2_dlogk                                            = 1.7952           value  rtol 1e-06
  heh2_slope_change_frac                                = 0.018068         value  rtol 1e-06
  heh2_spread_over_shift                                = 0.030227         value  rtol 1e-06
  heh2_share_gm                                         = 0.98242          value  rtol 1e-06
  heh2_slope_term_max_frac                              = 0.031467         value  rtol 1e-06
  h2n2_spread_over_shift                                = 0.33528          value  rtol 1e-06
  h2ch4_spread_over_shift                               = 0.92506          value  rtol 1e-06
  h2co2_spread_over_shift                               = 2.0501           value  rtol 1e-06
  h2co2_share_gm                                        = 1.3938           value  rtol 1e-06
  pairs_alpha1_inside_range                             = 5                exact  exact, margin 0.0132
  pairs_crossing_inside_range                           = 1                exact  exact, margin 0.43
  h2co2_crossing_alpha                                  = 37.465           value  rtol 1e-06
  h2co2_crossing_alpha_rootfind_rel                     = (here 1.1e-15)   bound  bound &lt;= 1e-12 [tolerance]
  h2co2_alpha_max                                       = 100.9            value  rtol 1e-06
  h2co2_points_above_crossing                           = 1                exact  exact, margin 0.21
  h2co2_present_over_prior_at_alpha_max_pct             = -30.393          value  rtol 1e-06
  h2co2_present_below_prior_at_alpha_max_pct            = 30.393           value  rtol 1e-06
  dlogA_top3_hits                                       = 3                exact  exact, margin 0.111
  dlogk_top3_hits                                       = 2                exact  exact, margin 0.102
  dlogP_top3_hits                                       = 2                exact  exact, margin 0.0103
  dlogA_gap_third_to_fourth                             = 0.11122          value  rtol 1e-06
  dlogA_rootfind_max_abs                                = (here 6.7e-16)   bound  bound &lt;= 1e-12 [tolerance]
  alpha_gain_hech4                                      = 5.024            value  rtol 1e-06
  alpha_gain_co2ch4                                     = 1.8202           value  rtol 1e-06
  dlogA_top3_hits_min_over_eval_points                  = 3                exact  exact, margin 0.0113
  dlogA_gap_min_over_eval_points                        = 0.011276         value  rtol 1e-06
  points_total                                          = 117              exact  exact
  points_above_present_bound                            = 19               exact  exact, margin 0.00285
  frac_above_present_bound                              = 0.16239          value  rtol 1e-06
  o2n2_points_above_present_bound                       = 2                exact  exact, margin 0.24
  excursion_max                                         = 3.4924           value  rtol 1e-06
  excursion_min                                         = 0.021863         value  rtol 1e-06
  excursion_geomean                                     = 0.4778           value  rtol 1e-06
  points_above_prior_bound                              = 83               exact  exact, margin 0.037
  t13_mw_column_max_abs_rel                             = 0.00015103       value  rtol 1e-06
  t13_mw_column_max_abs_rel_iupac                       = 0.003871         value  rtol 1e-06
  t13_mw_h2n2_printed                                   = 3.742            value  rtol 1e-06
  t13_product_column_max_abs_rel                        = 0.0016229        value  rtol 1e-06
  t13_identity_max_abs_rel                              = 0.0061192        value  rtol 1e-06
  t13_identity_median_abs_rel                           = 0.00016615       value  rtol 1e-06
  t13_rows_inside_tight_band                            = 24               exact  exact, margin 0.00197
  t13_rows_inside_loose_band                            = 25               exact  exact, margin 0.481
  t13a_o2n2_rel                                         = -0.0061192       value  rtol 1e-06
  t13b_h2n2_tight_excess                                = 0.0019661        value  rtol 1e-06
  t13a_n2ch4_band_tight                                 = 0.009196         value  rtol 1e-06
  t13a_n2ch4_band_tight_float_read                      = 0.084313         value  rtol 1e-06
  v1_heh2_rows_inside_tight_band                        = 4                exact  exact, margin 0.684
  t13a_o2n2_band_loose                                  = 0.0027946        value  rtol 1e-06
  t13b_o2n2_rel                                         = -0.00026543      value  rtol 1e-06
  t13a_o2n2_alpha_printed                               = 1.473            value  rtol 1e-06
  t13a_o2n2_alpha_needed                                = 1.4714           value  rtol 1e-06
  t13a_o2n2_alpha_backout_rel                           = -0.0010827       value  rtol 1e-06
  v2_shift_crosscheck_max_abs_decades                   = 0.0004933        value  rtol 1e-06
  v2_kshare_min                                         = 0.5647           value  rtol 1e-06
  v2_kshare_max                                         = 1.0334           value  rtol 1e-06
  v2_kshare_heh2_13a                                    = 1.0174           value  rtol 1e-06
  v2_kshare_h2co2_13a                                   = 0.5647           value  rtol 1e-06
  v2_kshare_heh2_13b                                    = 1.0334           value  rtol 1e-06
  v2_kshare_h2co2_13b                                   = 0.69908          value  rtol 1e-06
  v2_is_v1_difference_max_abs                           = (here 4.1e-16)   bound  bound &lt;= 1e-12 [identity]
  dataside_shift_is_decomposition_max_abs               = (here 4.4e-16)   bound  bound &lt;= 1e-12 [identity]
  envelope_dn_median_abs                                = 0.18922          value  rtol 1e-06
  envelope_dn_max_abs                                   = 2.6857           value  rtol 1e-06
  envelope_offset_median_decades                        = 0.02762          value  rtol 1e-06
  envelope_offset_max_abs_decades                       = 0.46632          value  rtol 1e-06
  envelope_offsets_positive                             = 7                exact  exact, margin 0.00436
  envelope_offsets_negative                             = 4                exact  exact, margin 0.00436
  envelope_dn_max_abs_wide_span                         = 0.27784          value  rtol 1e-06
  envelope_span_min_decades                             = 0.61716          value  rtol 1e-06
  envelope_dn_positive                                  = 10               exact  exact, margin 0.0148
  envelope_dn_negative                                  = 1                exact  exact, margin 0.0148
  pairs_span_over_1p5_decades                           = 7                exact  exact, margin 0.442
  lever_arm_set_size                                    = 4                exact  exact
  second_route_is_offset_max_abs                        = (here 4.4e-16)   bound  bound &lt;= 1e-12 [identity]
  envelope_offset_max_abs_wide_span                     = 0.085699         value  rtol 1e-06
  sr_resid_hech4                                        = 0.073409         value  rtol 1e-06
  envelope_implied_share_median                         = 0.43404          value  rtol 1e-06
  h2co2_share_env                                       = 1.5494           value  rtol 1e-06
  heco2_share_env                                       = 0.9097           value  rtol 1e-06
  h2ch4_share_env                                       = 0.35039          value  rtol 1e-06
  heco2_share_gm                                        = 0.98289          value  rtol 1e-06
  h2ch4_share_gm                                        = 0.58675          value  rtol 1e-06
  envelope_implied_share_min                            = -0.030629        value  rtol 1e-06
  envelope_implied_share_max                            = 1.5494           value  rtol 1e-06
  envelope_hen2_dlogk                                   = -0.0091509       value  rtol 1e-06
  envelope_hen2_shift                                   = 0.29877          value  rtol 1e-06
  envelope_hen2_cross_alpha                             = 1.1138           value  rtol 1e-06
  envelope_offset_max_abs_wide_span_max_over_alpha0     = 0.54312          value  rtol 1e-06
  envelope_sign_agree_min_over_alpha0                   = 8                exact  exact, margin 0.0117
  envelope_sign_agree_at_alpha_gm                       = 9                exact  exact, margin 0.213
  envelope_implied_dlogA_top3_hits                      = 3                exact  exact, margin 0.0864
  envelope_implied_dlogA_top3_hits_min_over_eval_points = 2                exact  exact, margin 0.0195
  envelope_eval_points_with_3_hits                      = 5                exact  exact, margin 0.0195
  bound_roundtrip_max_rel                               = (here 5.6e-16)   bound  bound &lt;= 1e-12 [identity]</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:H</category>
  <category>tier:T0</category>
  <category>data:tier2</category>
  <category>phase:gas</category>
  <category>kind:correlation</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/H1.8-robeson-upper-bound/</guid>
  <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>IAST 1965: mixture adsorption from pure-component isotherms alone — and a paper that prints no numbers</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.4-iast-mixed-gas-adsorption/</link>
  <description><![CDATA[ 




<section id="iast-1965-mixture-adsorption-from-pure-component-isotherms-alone-and-a-paper-that-prints-no-numbers" class="level1">
<h1>IAST 1965: mixture adsorption from pure-component isotherms alone — and a paper that prints no numbers</h1>
<p><strong>Catalog ID:</strong> <code>J1.4</code> · <strong>Structures:</strong> <code>S1</code> (pointwise algebra), <code>S10</code> (constrained algebraic system) · <strong>Tier:</strong> T0</p>
<p>The ideal adsorbed solution theory is the <code>A2.1</code> of adsorption: the default mixture model everyone reaches for, sixty years on. Its content is one sentence — the paper’s own abstract sentence: <em>the partial pressure of an adsorbed component is given by the product of its mole fraction in the adsorbed phase and the pressure which it would exert as a pure adsorbed component at the same temperature and <strong>spreading pressure</strong> as those of the mixture</em>,</p>
<p><img src="https://latex.codecogs.com/png.latex?P%20y_i%20%5C;=%5C;%20P_i%5E%7B%5Ccirc%7D(%5Cpi)%5C,x_i%20%5Cqquad%20%5Ctext%7B(eq.%2022)%7D,"></p>
<p>Raoult’s law with the pure-component reference taken at matched spreading pressure instead of matched temperature alone. Everything else follows from classical surface thermodynamics, and mixture equilibria follow from pure-component isotherms with <strong>no mixture data and no mixture parameters</strong>.</p>
<p><strong>What this page can and cannot check, decided before any code.</strong> The paper validates IAST against four systems — methane–ethane and ethylene–carbon dioxide on activated carbon, carbon monoxide–oxygen and propane–propylene on silica gel. <strong>Every one of those comparisons is a figure</strong> (Figs. 3–10), the experimental points in them belong to four <em>other</em> papers, and even the pure-component isotherms that feed the theory are never tabulated — Fig. 2’s own legend box says its curves are <em>calculated from</em> the isotherms of Szepesy and Illés. There is not one table in the paper. So the experimental case is out of scope here (§4 gives the search and the reasoning), and the page validates what the paper actually prints:</p>
<ol type="1">
<li><strong>The derivation chain, symbolically.</strong> Eqs. (9)–(35) and (45)–(46) are re-derived with <code>sympy</code>; eleven identities close to exactly zero. Doing this surfaces <strong>two printed equation defects</strong>: eq. (11) is missing the <code>+</code> between its two <img src="https://latex.codecogs.com/png.latex?RT%5Cln"> terms — as printed it does not yield eq. (13), the equilibrium relation the whole theory rests on — and the sentence introducing eq. (21) cites eq. (21) itself where the derivation needs eq. (20). Both are reported, neither repaired silently.</li>
<li><strong>The solver, against closed forms it never touches.</strong> The page derives symbolically that for two Langmuir isotherms of <strong>equal capacity</strong> the IAST solution <em>is</em> the extended Langmuir rule, and the numerical solver reproduces that closed form to 7.6e-16; in the Henry-law limit — the one case the paper itself proves IAST rigorous (eqs. 30–35) — the solver converges to the closed-form selectivity at first order in <img src="https://latex.codecogs.com/png.latex?P">, as it must.</li>
<li><strong>The thermodynamic consistency the paper’s rivals lack, made quantitative.</strong> The paper reports (p.&nbsp;125) that the Langmuir mixture model is “not thermodynamically consistent”. This page turns that sentence into a number: integrating the Gibbs adsorption isotherm (eq. 15) around a closed loop in <img src="https://latex.codecogs.com/png.latex?(P,%20y_1)"> leaves a spreading-pressure mismatch of <strong>12 % of the loop’s own scale</strong> for extended Langmuir with unequal capacities — computed twice, by line integral and by a symbolically derived curl, two routes that agree to 2.7e-15 — while IAST closes the same loop to 7.8e-16. With equal capacities the curl is symbolically zero, which is exactly the case where extended Langmuir <em>is</em> an IAST.</li>
<li><strong>One structural result the paper stops short of.</strong> Under IAST, the selectivity coefficient is <em>exactly</em> constant whenever the two pure isotherms are the same curve shifted in <img src="https://latex.codecogs.com/png.latex?%5Clog%20P"> — the Henry limit of eqs. (30)–(35) is the linear special case — so the composition dependence the paper predicts in Fig. 10 is a measure of the two isotherms’ difference in <strong>shape</strong>, not in scale. Verified to 4.7e-14 on a dual-site pair the closed forms never see.</li>
</ol>
<p>Nothing on this page is a fit — there is no data to fit — and nothing on it is experimental. <strong>This page establishes that the theory is what the paper says it is, not that it is empirically right.</strong> The empirical case lives in figures this page does not touch.</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<section id="the-problem-in-1965" class="level3">
<h3 class="anchored" data-anchor-id="the-problem-in-1965">The problem in 1965</h3>
<p>Adsorption equilibria of gas <em>mixtures</em> are what separation design actually needs, and measuring them is far more work than measuring pure-component isotherms. The obvious programme — write the mixture isotherm’s parameters as functions of the pure-component parameters — had, in the paper’s words, “not been very successful; the predictions have not been in quantitative agreement with the experimental data (<img src="https://latex.codecogs.com/png.latex?2">) and often not even in qualitative agreement (<img src="https://latex.codecogs.com/png.latex?1">)”. The one alternative on the table, Arnold’s liquid entropy model, the paper dismisses on two grounds it states plainly: “it is thermodynamically inconsistent and … separate numerical integrations are required for each vapor composition.”</p>
<p>Myers and Prausnitz instead import the machinery that had organised vapour–liquid equilibria for decades: <strong>treat the adsorbed phase as a solution, define activity coefficients for it, and let ideality be an empirical question.</strong> The move that makes this possible is recognising the <strong>spreading pressure</strong> <img src="https://latex.codecogs.com/png.latex?%5Cpi"> — the two-dimensional analogue of pressure, the intensive variable conjugate to adsorbent area <img src="https://latex.codecogs.com/png.latex?A"> — as a full thermodynamic variable. There is “no experimental technique for measuring the spreading pressure directly”, the paper concedes, but it is computable from any measured isotherm through the Gibbs adsorption isotherm, and that is all the theory needs.</p>
<p>Three assumptions carry the thermodynamics (p.&nbsp;121): the adsorbent is inert; it “possesses a temperature-invariant area which is the same for all adsorbates” — explicitly <em>not</em> valid for molecular sieves, where accessible area depends on the adsorbate; and adsorption is what the Gibbs definition says it is. On top of these the derivation assumes a perfect gas phase, which the paper defends for pressures “usually less than 1 atm.”</p>
</section>
<section id="what-the-paper-found-and-why-it-was-surprising" class="level3">
<h3 class="anchored" data-anchor-id="what-the-paper-found-and-why-it-was-surprising">What the paper found, and why it was surprising</h3>
<p>The original plan, the paper says, was to <em>measure</em> activity coefficients from mixture data and then interpret them. “Surprisingly, the calculated activity coefficients were found to be equal to unity within the experimental error” — so the ideal adsorbed solution, the <img src="https://latex.codecogs.com/png.latex?%5Cgamma_i%20=%201"> case, predicts the mixture equilibria outright, from pure-component isotherms alone. The conclusions call it “very surprising” a second time and are careful about why: the adsorbents in question are highly heterogeneous, no statistical model of them existed to compare against, and the paper explicitly declines to claim the result must generalise — mixtures of “highly dissimilar components … may show appreciable nonideality”.</p>
</section>
<section id="where-this-pages-siblings-sit" class="level3">
<h3 class="anchored" data-anchor-id="where-this-pages-siblings-sit">Where this page’s siblings sit</h3>
<p>The pure-component isotherms IAST consumes are the subject of <code>J1.1</code> (Langmuir 1918) and <code>J1.3</code> (BET 1938); either drops into this page’s <img src="https://latex.codecogs.com/png.latex?F_i(P_i%5E%7B%5Ccirc%7D)"> slot. Adsorption <em>dynamics</em> — breakthrough, the linear-driving-force law — is <code>J1.5</code>, and an IAST equilibrium can serve as that page’s mixture isotherm. This page is equilibrium only.</p>
</section>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>All equation numbers are the paper’s, read from a 300 ppi native render.</p>
<section id="thermodynamics-of-the-adsorbed-phase-eqs.-118" class="level3">
<h3 class="anchored" data-anchor-id="thermodynamics-of-the-adsorbed-phase-eqs.-118">Thermodynamics of the adsorbed phase (eqs. 1–18)</h3>
<p>Substituting <img src="https://latex.codecogs.com/png.latex?-%5Cpi%5C,dA"> for <img src="https://latex.codecogs.com/png.latex?-P%5C,dV"> work makes the adsorbed phase a two-dimensional fluid:</p>
<p><img src="https://latex.codecogs.com/png.latex?dU%20=%20T%5C,dS%20-%20%5Cpi%5C,dA%20+%20%5CSigma%20%5Cmu_i%5C,dn_i%20%5Ctag%7B1%7D"> <img src="https://latex.codecogs.com/png.latex?dG%20=%20-S%5C,dT%20+%20A%5C,d%5Cpi%20+%20%5CSigma%20%5Cmu_i%5C,dn_i%20%5Ctag%7B2%7D"></p>
<p>so <img src="https://latex.codecogs.com/png.latex?G%20=%20G(T,%20%5Cpi,%20n_i)"> and, by Euler’s theorem, <img src="https://latex.codecogs.com/png.latex?G%20=%20%5CSigma%20n_i%20%5Cmu_i"> (3). Activity coefficients are then <em>defined</em> exactly as for a liquid mixture, at constant <img src="https://latex.codecogs.com/png.latex?T"> <strong>and <img src="https://latex.codecogs.com/png.latex?%5Cpi"></strong> (5)–(8), giving the chemical potential</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu_i(T,%5Cpi,x_1%5Cldots)%20=%20g_i%5E%7B%5Ccirc%7D(T,%5Cpi)%20+%20RT%20%5Cln%20%5Cgamma_i%20x_i,%20%5Ctag%7B9%7D"></p>
<p>and, writing the pure-adsorbate reference through its equilibrium pressure <img src="https://latex.codecogs.com/png.latex?P_i%5E%7B%5Ccirc%7D(%5Cpi)"> at the same spreading pressure (10), then equating with the perfect-gas chemical potential (12), the <strong>equation of equilibrium for mixed-gas adsorption</strong>:</p>
<p><img src="https://latex.codecogs.com/png.latex?P%20y_i%20=%20P_i%5E%7B%5Ccirc%7D(%5Cpi)%5C,%5Cgamma_i%20x_i%20%5Cquad%20(%5Ctext%7Bconstant%20%7D%20T).%20%5Ctag%7B13%7D"></p>
<p>Eq. (14) restates (13) with fugacities for high pressure. The Gibbs adsorption isotherm <img src="https://latex.codecogs.com/png.latex?-A%5C,d%5Cpi%20+%20%5CSigma%20n_i%5C,d%5Cmu_i%20=%200"> (15) yields the Gibbs–Duhem relation <img src="https://latex.codecogs.com/png.latex?%5CSigma%20x_i%5C,d%5Cln%5Cgamma_i%20=%200"> at constant <img src="https://latex.codecogs.com/png.latex?T"> and <img src="https://latex.codecogs.com/png.latex?%5Cpi"> (17), so the activity coefficients are thermodynamically consistent by construction — the failure the paper charges Arnold’s model with cannot occur here. The phase rule for adsorption (18) gives binary adsorption <strong>3</strong> degrees of freedom, one more than binary VLE, because area is an extra variable; the adsorbent itself is not counted (“The absorbent is not counted as a component in Equation (18) since it is assumed to be thermodynamically inert.” — <em>sic</em>, “absorbent”, p.&nbsp;122; the paper spells “adsorbent” correctly everywhere else).</p>
</section>
<section id="two-printed-equation-defects-reported-and-not-repaired" class="level3">
<h3 class="anchored" data-anchor-id="two-printed-equation-defects-reported-and-not-repaired">Two printed equation defects, reported and not repaired</h3>
<p><strong>Eq. (11) is missing its <code>+</code>.</strong> As printed (p.&nbsp;122, verified on a crop of the 300 ppi native render):</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmu_i(T,%5Cpi,x_1%5Cldots)%20=%20g_i%5E%7B%5Ccirc%7D(T)%20+%20RT%20%5Cln%20P_i%5E%7B%5Ccirc%7D(%5Cpi)%5C;RT%5Cln%5Cgamma_i%20x_i%0A%5Cqquad%20%5Bsic%5D%20%5Ctag%7B11%7D"></p>
<p>— no operator between the two <img src="https://latex.codecogs.com/png.latex?RT%5Cln"> terms. The product form is dimensionally incoherent (energy²) and §2.1 shows symbolically that equating it with eq. (12) does <strong>not</strong> produce eq. (13), while the sum form produces it exactly. Since (11) is by construction “Substituting Equation (10) into Equation (9)”, and both (10) and (9) are printed correctly, the defect is proved from the paper’s own equations; the repair (a lost <code>+</code>) is an inference, labelled as one.</p>
<p><strong>The sentence introducing eq. (21) cites eq. (21).</strong> P. 123, verbatim: “With the pressure <img src="https://latex.codecogs.com/png.latex?P"> of the mixture held constant, Equation (21) becomes” — and what follows <em>is</em> eq. (21). The derivation requires “Equation (20) becomes”: at constant <img src="https://latex.codecogs.com/png.latex?P">, <img src="https://latex.codecogs.com/png.latex?d%5Cln%20P%20y_i%20=%20d%5Cln%20y_i"> turns (20) into (21), which §2.1 also verifies. Again the repair is an inference; the defect is not.</p>
</section>
<section id="the-ideal-adsorbed-solution-eqs.-1929" class="level3">
<h3 class="anchored" data-anchor-id="the-ideal-adsorbed-solution-eqs.-1929">The ideal adsorbed solution (eqs. 19–29)</h3>
<p>For <img src="https://latex.codecogs.com/png.latex?%5Cgamma_i%20=%201">, eq. (13) is the Raoult analogue (22) quoted in the title cell. The spreading pressure of a pure component comes from integrating (15):</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cpi(P_i%5E%7B%5Ccirc%7D)%20=%20%5Cfrac%7BRT%7D%7BA%7D%5Cint_%7Bt=0%7D%5E%7BP_i%5E%7B%5Ccirc%7D%7D%20n_i%5E%7B%5Ccirc%7D(t)%5C,d%5Cln%20t%0A%5Cquad%20(%5Ctext%7Bconstant%20%7D%20T),%20%5Ctag%7B19%7D"></p>
<p>well defined at the lower limit because <img src="https://latex.codecogs.com/png.latex?n_i%5E%7B%5Ccirc%7D%20%5Cpropto%20P_i%5E%7B%5Ccirc%7D"> at low coverage. Mixing at constant <img src="https://latex.codecogs.com/png.latex?T,%5Cpi"> has no enthalpy and no area change ((23), (24)), and the area balance gives the <strong>total amount adsorbed</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7B1%7D%7Bn_t%7D%20=%20%5Cfrac%7Bx_1%7D%7Bn_1%5E%7B%5Ccirc%7D%7D%20+%20%5Cfrac%7Bx_2%7D%7Bn_2%5E%7B%5Ccirc%7D%7D%0A%5Cquad%20(%5Ctext%7Bconstant%20%7D%20T%20%5Ctext%7B%20and%20%7D%20%5Cpi)%20%5Ctag%7B26%7D"></p>
<p>— a harmonic mix, not an arithmetic one; §7.5 shows the arithmetic version fails the Gibbs isotherm. Relative volatility and selectivity are defined by (27), (28) with <img src="https://latex.codecogs.com/png.latex?s_%7B1,2%7D%20=%201/%5Calpha_%7B1,2%7D%20=%20P_2%5E%7B%5Ccirc%7D/P_1%5E%7B%5Ccirc%7D">, and (22) + (41) give the Raoult total-pressure line <img src="https://latex.codecogs.com/png.latex?P%20=%20P_1%5E%7B%5Ccirc%7Dx_1%20+%20P_2%5E%7B%5Ccirc%7Dx_2"> (29).</p>
</section>
<section id="the-calculation-scheme-eqs.-3646-and-the-special-case-that-anchors-it" class="level3">
<h3 class="anchored" data-anchor-id="the-calculation-scheme-eqs.-3646-and-the-special-case-that-anchors-it">The calculation scheme (eqs. 36–46) and the special case that anchors it</h3>
<p>The p.&nbsp;124 scheme is a nine-unknown, seven-equation algebraic system — <img src="https://latex.codecogs.com/png.latex?%5Cpi_1%5E%7B%5Ccirc%7D%20=%20%5Cpi_2%5E%7B%5Ccirc%7D"> (40) is the matching condition — closed by specifying two quantities, e.g.&nbsp;<img src="https://latex.codecogs.com/png.latex?P"> and <img src="https://latex.codecogs.com/png.latex?y_1">; the paper’s own count (9 − 7 = 2) agrees with its phase rule (3 degrees of freedom, one spent on <img src="https://latex.codecogs.com/png.latex?T">), which §4 checks from the transcribed counts. When the pure isotherms are analytic, (44) is one equation in one unknown; in general the paper gives the graphical construction of Fig. 1, whose lever rules (45), (46) §2.1 proves and §6.2 draws. At very low coverage — Henry’s law, <img src="https://latex.codecogs.com/png.latex?n_i%5E%7B%5Ccirc%7D%20=%0AK_i%20P_i%5E%7B%5Ccirc%7D"> (30) — the paper proves IAST <strong>rigorous</strong>: eqs. (32)–(35) reproduce the statistical-mechanical mixture result <img src="https://latex.codecogs.com/png.latex?n_i%20=%20K_i%20P%20y_i"> (31) exactly, with <img src="https://latex.codecogs.com/png.latex?%5Cpi%20A/RT%20=%20K_i%20P_i%5E%7B%5Ccirc%7D%20=%20n_1%5E%7B%5Ccirc%7D%20=%20n_2%5E%7B%5Ccirc%7D"> (32) and constant selectivity <img src="https://latex.codecogs.com/png.latex?K_1/K_2"> (34). §7.3 uses this as a solver test.</p>
<div id="54bb2cb9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:41.137836Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:41.137666Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:41.546462Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:41.545780Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb1-2">    <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pymrm</span>
<span id="cb1-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">ImportError</span>:</span>
<span id="cb1-4">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%</span>pip install <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>q pymrm pyyaml</span></code></pre></div></div>
</div>
<div id="b4672447" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:41.548748Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:41.548538Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:42.079435Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:42.078665Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sys, urllib.request</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">any</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> p <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> sys.path):</span>
<span id="cb2-5">    local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Path.cwd()</span>
<span id="cb2-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>):</span>
<span id="cb2-7">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>).is_file():</span>
<span id="cb2-8">            sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">break</span></span>
<span id="cb2-9">        local <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> local.parent</span>
<span id="cb2-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb2-11">        url <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb2-12">               <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery/main/shared/gallery_utils.py"</span>)</span>
<span id="cb2-13">        urllib.request.urlretrieve(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_utils.py"</span>)</span>
<span id="cb2-14">        sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)</span>
<span id="cb2-15"></span>
<span id="cb2-16"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-17"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-18"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> sympy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> sp</span>
<span id="cb2-19"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-20"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> numpy.polynomial.legendre <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> leggauss</span>
<span id="cb2-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> minimize_scalar</span>
<span id="cb2-22"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> newton, NumJac</span>
<span id="cb2-23"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, report_agreement</span>
<span id="cb2-24"></span>
<span id="cb2-25">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J1.4-iast-mixed-gas-adsorption"</span></span>
<span id="cb2-26">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-27">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.width"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">130</span>)</span>
<span id="cb2-28"></span>
<span id="cb2-29">np.random.seed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nothing on this page is stochastic; seeded so it stays that way</span></span></code></pre></div></div>
</div>
</section>
<section id="the-derivation-chain-verified-symbolically" class="level3">
<h3 class="anchored" data-anchor-id="the-derivation-chain-verified-symbolically">2.1 The derivation chain, verified symbolically</h3>
<p>Eleven identities, every one an equation the paper prints (or, for the last three, a closed form this page derives and then leans on). Each <code>assert</code> would fail the notebook if the algebra did not close. These are <strong>structural</strong> checks — they verify the paper’s algebra and this page’s closed forms, and they cannot detect a numerical defect; the numerical machinery gets its own, breakable tests in §7.</p>
<div id="042bf396" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:42.081736Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:42.081543Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:42.282811Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:42.281990Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Symbols. All positive reals; gamma_i carried where the paper carries it.</span></span>
<span id="cb3-2">RT, g0, P, y1, y2, x1, x2, P1o, P2o, gam, K1, K2, m, b, t, Pv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(</span>
<span id="cb3-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RT g0 P y1 y2 x1 x2 P1o P2o gamma K1 K2 m b t Pv"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb3-4">ZERO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb3-5"></span>
<span id="cb3-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (11)+(12) -&gt; (13): the equilibrium relation, with eq. (11) read as a SUM</span></span>
<span id="cb3-7">mu_ads <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> RT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(P1o) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> RT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(gam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x1)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (11), '+' restored</span></span>
<span id="cb3-8">mu_gas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> RT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1)                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (12)</span></span>
<span id="cb3-9">res13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.exp((mu_gas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.exp((mu_ads <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RT))</span>
<span id="cb3-10">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(11)+(12) -&gt; (13):  P y1 - P1o gamma x1"</span>, sp.simplify(res13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P1o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>gam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x1))))</span>
<span id="cb3-11"></span>
<span id="cb3-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- and AS PRINTED (no operator: a product) it does NOT give (13)</span></span>
<span id="cb3-13">mu_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> g0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> RT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(P1o)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>RT<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(gam<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x1)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (11) verbatim [sic]</span></span>
<span id="cb3-14">Py_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.exp((mu_printed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> g0)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>RT))</span>
<span id="cb3-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (11) as printed (product) would give  P y1 ="</span>, Py_printed)</span>
<span id="cb3-16"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  -&gt; not eq. (13), and dimensionally incoherent (the product term is energy^2).</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb3-17"></span>
<span id="cb3-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (22)+(41)+(42) -&gt; (29): the Raoult total-pressure line</span></span>
<span id="cb3-19">sol29 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.solve([sp.Eq(P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1, P1o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x1), sp.Eq(P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y2, P2o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x2),</span>
<span id="cb3-20">                  sp.Eq(y1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y2, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), sp.Eq(x1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> x2, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)], [P, y1, y2, x2], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb3-21">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(22)+(41)+(42) -&gt; (29):  P = P1o x1 + P2o x2"</span>,</span>
<span id="cb3-22">             sp.simplify(sol29[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>][P] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (P1o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P2o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x1)))))</span>
<span id="cb3-23"></span>
<span id="cb3-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (20) -&gt; (21) at constant P:  d ln(P y_i) = d ln y_i  (the misprinted cross-reference)</span></span>
<span id="cb3-25">lnPy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.log(P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1)</span>
<span id="cb3-26">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(20) -&gt; (21):  d ln(P y1)/d y1 = d ln(y1)/d y1 at constant P"</span>,</span>
<span id="cb3-27">             sp.simplify(sp.diff(lnPy, y1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.diff(sp.log(y1), y1))))</span>
<span id="cb3-28"></span>
<span id="cb3-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (19) on a Langmuir isotherm:  z = pi A/RT = m ln(1 + b P)</span></span>
<span id="cb3-30">z_langmuir_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.integrate(m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t), (t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Pv))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># integrand n(t)/t * t = n(t) d ln t</span></span>
<span id="cb3-31">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(19) on Langmuir:  z = m ln(1+bP)"</span>, sp.simplify(z_langmuir_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>sp.log(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pv))))</span>
<span id="cb3-32"></span>
<span id="cb3-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (30) into (19) -&gt; (32):  z = K_i P_i^o  in the Henry limit</span></span>
<span id="cb3-34">z_henry_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.integrate(K1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>t, (t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Pv))</span>
<span id="cb3-35">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(30) into (19) -&gt; (32):  z = K P"</span>, sp.simplify(z_henry_sym <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pv)))</span>
<span id="cb3-36"></span>
<span id="cb3-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (32)-(35) -&gt; (31):  the Henry-limit IAST recovers n_i = K_i P y_i exactly</span></span>
<span id="cb3-38">z_mix <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(y1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K2)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from x1+x2=1 with x_i = P y_i K_i / z</span></span>
<span id="cb3-39">x1_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>K1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>z_mix</span>
<span id="cb3-40">n1_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> x1_h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>z_mix                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># n_t = z in this limit (eq. 32 + eq. 26)</span></span>
<span id="cb3-41">ZERO.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(32)-(35) -&gt; (31):  n1 = K1 P y1"</span>, sp.simplify(n1_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> K1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1)))</span>
<span id="cb3-42"></span>
<span id="cb3-43"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ZERO:</span>
<span id="cb3-44">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  0 == </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span>)</span>
<span id="cb3-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, name</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (11) as printed (product) would give  P y1 = (gamma*x1)**log(P1o**RT)
  -&gt; not eq. (13), and dimensionally incoherent (the product term is energy^2).

  0 == 0   [(11)+(12) -&gt; (13):  P y1 - P1o gamma x1]
  0 == 0   [(22)+(41)+(42) -&gt; (29):  P = P1o x1 + P2o x2]
  0 == 0   [(20) -&gt; (21):  d ln(P y1)/d y1 = d ln(y1)/d y1 at constant P]
  0 == 0   [(19) on Langmuir:  z = m ln(1+bP)]
  0 == 0   [(30) into (19) -&gt; (32):  z = K P]
  0 == 0   [(32)-(35) -&gt; (31):  n1 = K1 P y1]</code></pre>
</div>
</div>
<div id="68c3b5d8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:42.284749Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:42.284568Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:42.536754Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:42.535969Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb5-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- (45), (46): the lever rules of Fig. 1, from (22), (26), (29) alone.</span></span>
<span id="cb5-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A = (0, z*), B = (P1o, z*), C = (P2o, z*) on the two pure curves at matched z*;</span></span>
<span id="cb5-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># D = (P, z*); F and E are the intersections of the vertical through D with the</span></span>
<span id="cb5-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># chords OB and OC.</span></span>
<span id="cb5-5">zst, Ps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zst Ps"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-6">x1_lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P2o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ps)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(P2o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P1o)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (29) solved for x1</span></span>
<span id="cb5-7">y1_lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P1o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>x1_lr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Ps                           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (22)</span></span>
<span id="cb5-8">DE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zst <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P2o                          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># D to E (E on chord OC)</span></span>
<span id="cb5-9">FE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P1o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Ps<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P2o                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># F to E (F on chord OB)</span></span>
<span id="cb5-10">lever <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb5-11">lever.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(45):  y1 = DE/FE"</span>, sp.simplify(DE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>FE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1_lr)))</span>
<span id="cb5-12">lever.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(46):  x1 = DC/BC"</span>, sp.simplify((P2o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Ps)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(P2o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P1o) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> x1_lr)))</span>
<span id="cb5-13"></span>
<span id="cb5-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- equal-capacity Langmuir: the IAST solution IS extended Langmuir (this</span></span>
<span id="cb5-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     page's closed form; not stated in the paper). Matching m ln(1+b1 P1o) =</span></span>
<span id="cb5-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     m ln(1+b2 P2o) forces b1 P1o = b2 P2o = u, and x1+x2 = 1 gives</span></span>
<span id="cb5-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     u = b1 P y1 + b2 P y2; then eq. (26) collapses:</span></span>
<span id="cb5-18">b1s, b2s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b1 b2"</span>, positive<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-19">u <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1)</span>
<span id="cb5-20">x1_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>u                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># x1 = P y1/P1o with P1o = u/b1</span></span>
<span id="cb5-21">nt_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>u<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> u)                             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># n_i^o(P_i^o) = m u/(1+u), both components</span></span>
<span id="cb5-22">n1_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(x1_eq<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>nt_eq)</span>
<span id="cb5-23">extL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1))</span>
<span id="cb5-24">lever.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal-m IAST == extended Langmuir (n1)"</span>, sp.simplify(n1_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> extL)))</span>
<span id="cb5-25"></span>
<span id="cb5-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the curl of the extended-Langmuir Gibbs one-form, unequal capacities.</span></span>
<span id="cb5-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     A d(pi)/RT = n_t d lnP + [n1/y1 - n2/y2] d y1 must be EXACT for pi to be</span></span>
<span id="cb5-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     a state function. sympy derives the curl in closed form:</span></span>
<span id="cb5-29">m1s, m2s, lnP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.symbols(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m1 m2 lnP"</span>, real<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb5-30">Pe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.exp(lnP)</span>
<span id="cb5-31">u1, u2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pe<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1, b2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pe<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1)</span>
<span id="cb5-32">D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> u1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> u2</span>
<span id="cb5-33">M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>u1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> m2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>u2)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D                         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># coefficient of d lnP  (= n_t)</span></span>
<span id="cb5-34">N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pe)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># coefficient of d y1   (= n1/y1 - n2/y2)</span></span>
<span id="cb5-35">curl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.simplify(sp.diff(N, lnP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sp.diff(M, y1))</span>
<span id="cb5-36">curl_closed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m2s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m1s)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pe<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb5-37">lever.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extended-Langmuir curl == (m2-m1) b1 b2 P^2 / D^2"</span>, sp.simplify(curl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> curl_closed)))</span>
<span id="cb5-38">lever.append((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"... and == 0 at m1 = m2 (the consistent case)"</span>, sp.simplify(curl.subs(m2s, m1s))))</span>
<span id="cb5-39"></span>
<span id="cb5-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lever:</span>
<span id="cb5-41">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  0 == </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]"</span>)</span>
<span id="cb5-42">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, name</span>
<span id="cb5-43">ZERO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> lever</span>
<span id="cb5-44">SYM_ZERO_COUNT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ZERO)</span>
<span id="cb5-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SYM_ZERO_COUNT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> symbolic identities, all exactly zero. The curl closed form is the"</span>)</span>
<span id="cb5-46"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"engine of §7.6: it vanishes iff m1 = m2, so the Langmuir mixture rule is"</span>)</span>
<span id="cb5-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thermodynamically consistent exactly when it happens to BE an ideal adsorbed solution."</span>)</span>
<span id="cb5-48">curl_fn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sp.lambdify((lnP, y1, m1s, b1s, m2s, b2s), curl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"numpy"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>  0 == 0   [(45):  y1 = DE/FE]
  0 == 0   [(46):  x1 = DC/BC]
  0 == 0   [equal-m IAST == extended Langmuir (n1)]
  0 == 0   [extended-Langmuir curl == (m2-m1) b1 b2 P^2 / D^2]
  0 == 0   [... and == 0 at m1 = m2 (the consistent case)]

11 symbolic identities, all exactly zero. The curl closed form is the
engine of §7.6: it vanishes iff m1 = m2, so the Langmuir mixture rule is
thermodynamically consistent exactly when it happens to BE an ideal adsorbed solution.</code></pre>
</div>
</div>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>The paper’s assumptions, inherited unchanged:</strong> inert adsorbent; temperature-invariant area equal for all adsorbates; Gibbs definition of adsorption; perfect gas phase (<img src="https://latex.codecogs.com/png.latex?%5Cgamma_i"> in eq. (13) set to 1 — the ideal adsorbed solution; eq. (14)’s fugacity form is transcribed in §2 and <strong>not exercised</strong>, because the paper prints no real-gas model to put in it).</p>
<p><strong>Illustrative parameters, and what they are not.</strong> The paper tabulates no isotherm — not even the pure-component inputs of its own Fig. 2 — so every number this page computes with is an <strong>illustrative parameter set, chosen for no physical system, in arbitrary pressure and amount units</strong>. No conclusion about any real gas pair is drawn from them anywhere on this page; they exist so that the theory’s printed structure can be exercised and broken.</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>set</th>
<th>component 1</th>
<th>component 2</th>
<th>used for</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><strong>pair L</strong> (equal capacities)</td>
<td><img src="https://latex.codecogs.com/png.latex?m%7B=%7D1">, <img src="https://latex.codecogs.com/png.latex?b_1%7B=%7D10"></td>
<td><img src="https://latex.codecogs.com/png.latex?m%7B=%7D1">, <img src="https://latex.codecogs.com/png.latex?b_2%7B=%7D1"></td>
<td>the closed-form solver test (§7.1); constant-selectivity demonstration</td>
</tr>
<tr class="even">
<td><strong>pair U</strong> (unequal capacities)</td>
<td><img src="https://latex.codecogs.com/png.latex?m_1%7B=%7D1">, <img src="https://latex.codecogs.com/png.latex?b_1%7B=%7D10"></td>
<td><img src="https://latex.codecogs.com/png.latex?m_2%7B=%7D0.5">, <img src="https://latex.codecogs.com/png.latex?b_2%7B=%7D2"></td>
<td>everything else: Results, consistency loop, Henry limit</td>
</tr>
<tr class="odd">
<td><strong>pair S</strong> (dual-site, shape-shifted)</td>
<td>two-site Langmuir</td>
<td>the <em>same curve</em> at <img src="https://latex.codecogs.com/png.latex?%5Ckappa%20P">, <img src="https://latex.codecogs.com/png.latex?%5Ckappa%20=%201/4"></td>
<td>the shape-translation result (§7.8)</td>
</tr>
</tbody>
</table>
<p>with pure isotherms <img src="https://latex.codecogs.com/png.latex?n%5E%7B%5Ccirc%7D(P)%20=%20m%5C,bP/(1+bP)"> (single site), for which eq. (19) integrates to <img src="https://latex.codecogs.com/png.latex?z%20%5Cequiv%20%5Cpi%20A/RT%20=%20m%5Cln(1+bP)"> — the closed form §2.1 verified — and analytic inverses <img src="https://latex.codecogs.com/png.latex?P%5E%7B%5Ccirc%7D(z)%20=%20(e%5E%7Bz/m%7D-1)/b">. All solver tolerances are <img src="https://latex.codecogs.com/png.latex?10%5E%7B-13%7D"> on the spreading-pressure match.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p><strong>There is none, and that is this page’s central scope fact.</strong> Stated precisely, with the search that backs each claim (all seven pages were read on 300 ppi native renders; the text layer was used only as a search index, never for a digit):</p>
<ul>
<li><strong>The paper contains no tables.</strong> The only tabular matter in its seven pages is the NOTATION list and LITERATURE CITED (p.&nbsp;126–127). No numerical result of the theory — no predicted composition, amount, or selectivity — is printed anywhere in the text.</li>
<li><strong>All four experimental comparisons are figures</strong>: Figs. 3–4 (methane–ethane, activated carbon, 20 °C, 1 atm), Figs. 5–6 (CO–O₂, silica, 100 °C and 0 °C, 1 atm), Fig. 7 (propane–propylene, silica gel, 25 °C, 1 atm), Figs. 8–10 (ethylene–CO₂, activated carbon, 25.4 °C, 50–250 mm Hg). The experimental points belong to Szepesy &amp; Illés (1963), Markham &amp; Benton (1931), Lewis et al.&nbsp;(1950) and Bering &amp; Serpenskii (1952) respectively — none of which is on disk here.</li>
<li><strong>Even the pure-component inputs are not tabulated.</strong> Fig. 2’s legend box reads “(CALCULATED FROM EXPERIMENTAL ADSORPTION ISOTHERMS OF SZEPESY &amp; ILLES (1963))”: the paper’s own inputs exist in it only as already-integrated <img src="https://latex.codecogs.com/png.latex?%5Cpi%20A/RT"> curves. Reproducing Fig. 3 would therefore mean <strong>differentiating a digitised integral</strong> of data from a paper that is not on disk — figure-derived inputs feeding figure-derived targets. That double dependence, plus the repository rule that figure content needs a human review gate, is why the experimental case is scoped out rather than digitised. If the Szepesy &amp; Illés tables (Acta Chim. Hung. <strong>35</strong>, 37, 53,
<ol start="245" type="1">
<li>are ever acquired, the four comparisons become a natural companion page.</li>
</ol></li>
</ul>
<p>What the paper <em>does</em> print as numbers — conditions, the text’s own counting, and the reference list — is transcribed in <code>myers-1965-printed-claims.csv</code> (34 scalars, each read off a digit-scale crop of the native render), and the page’s computed IAST solutions are written to <code>iast-illustrative-reference.csv</code> so an independent implementation can regression-test against them. <strong>No other page’s dataset is loaded</strong>, so none of the cross-page reconciliation obligations apply.</p>
<div id="76386c08" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:42.538755Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:42.538485Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:42.548761Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:42.548080Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"myers-1965-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb7-2">C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(claims.key, pd.to_numeric(claims.printed)))</span>
<span id="cb7-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"myers-1965-printed-claims.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)))</span>
<span id="cb7-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed scalars transcribed.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb7-5"></span>
<span id="cb7-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the paper's own counting, checked against itself (all numbers from the CSV)</span></span>
<span id="cb7-7">dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (18): components - phases + 3, binary, two phases</span></span>
<span id="cb7-8"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text_dof_binary"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phase-rule count"</span></span>
<span id="cb7-9">free_after_T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text_dof_binary"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># T is fixed in the p.124 scheme</span></span>
<span id="cb7-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text_unknowns"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text_equations"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"text_specified"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> free_after_T</span>
<span id="cb7-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (18) for a binary: 2 - 2 + 3 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>dof<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> degrees of freedom (printed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_dof_binary'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb7-12"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"p. 124 scheme: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_unknowns'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> unknowns - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_equations'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> equations = "</span></span>
<span id="cb7-13">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_unknowns'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_equations'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to specify = printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_specified'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-14">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" = DOF </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'text_dof_binary'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with T already fixed.  Internally consistent."</span>)</span>
<span id="cb7-15"></span>
<span id="cb7-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- two bibliographic defects, proved from the reference list's own numbers</span></span>
<span id="cb7-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 6 legend attributes its points to 'MARKHAM &amp; BENTON (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'fig6_legend_year'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)' [sic],"</span>)</span>
<span id="cb7-18"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"but the paper's ONLY Markham &amp; Benton reference (ref. 8) is J. Am. Chem. Soc. "</span></span>
<span id="cb7-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref8_volume'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 497 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref8_year'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">),"</span>)</span>
<span id="cb7-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"and the p. 125 text credits the 0 C data to '(8)'. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref7_year'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is ref. 7, Lewis et al."</span>)</span>
<span id="cb7-21">vol_rate <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref5_volume"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref4_volume"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref5_year"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ref4_year"</span>])</span>
<span id="cb7-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Ref. 5 reads 'Ibid, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref5_volume'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, 456 (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref5_year'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)' where Ibid = "</span></span>
<span id="cb7-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"J. Chem. Phys. (ref. 4: vol. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref4_volume'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>C[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'ref4_year'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb7-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"That requires </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>vol_rate<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> volumes/year from the same journal, and J. Chem. Phys. was at "</span></span>
<span id="cb7-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"vol. 37 in 1962;"</span>)</span>
<span id="cb7-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J. Phys. Chem.'s vol. 63 IS 1959. That ref. 5 points at the wrong journal is an inference;"</span>)</span>
<span id="cb7-27"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the arithmetic tension is not. Ref. 5 is also cited nowhere in the running text: every '(5)'"</span>)</span>
<span id="cb7-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"in the text layer (searched as an index, then verified on crops) is equation (5)."</span>)</span>
<span id="cb7-29">REF5_VOL_RATE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> vol_rate</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Myers, A. L.; Prausnitz, J. M. (1965) — AIChE Journal 11(1) 121-127 (January 1965) — doi:10.1002/aic.690110125 — text
34 printed scalars transcribed.

eq. (18) for a binary: 2 - 2 + 3 = 3 degrees of freedom (printed: 3)
p. 124 scheme: 9 unknowns - 7 equations = 2 to specify = printed 2 = DOF 3 with T already fixed.  Internally consistent.

Fig. 6 legend attributes its points to 'MARKHAM &amp; BENTON (1950)' [sic],
but the paper's ONLY Markham &amp; Benton reference (ref. 8) is J. Am. Chem. Soc. 53, 497 (1931),
and the p. 125 text credits the 0 C data to '(8)'. 1950 is ref. 7, Lewis et al.

Ref. 5 reads 'Ibid, 63, 456 (1959)' where Ibid = J. Chem. Phys. (ref. 4: vol. 17 in 1949).
That requires 4.6 volumes/year from the same journal, and J. Chem. Phys. was at vol. 37 in 1962;
J. Phys. Chem.'s vol. 63 IS 1959. That ref. 5 points at the wrong journal is an inference;
the arithmetic tension is not. Ref. 5 is also cited nowhere in the running text: every '(5)'
in the text layer (searched as an index, then verified on crops) is equation (5).</code></pre>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>The p.&nbsp;124 scheme, eqs. (36)–(42), reduced the way the paper’s own eq. (44) reduces it: one unknown per state point, the reduced spreading pressure <img src="https://latex.codecogs.com/png.latex?z%20=%20%5Cpi%20A/RT">, with the matching condition and mole-fraction closure</p>
<p><img src="https://latex.codecogs.com/png.latex?R(z)%20%5C;=%5C;%20%5Cfrac%7BP%20y_1%7D%7BP_1%5E%7B%5Ccirc%7D(z)%7D%20+%20%5Cfrac%7BP%20y_2%7D%7BP_2%5E%7B%5Ccirc%7D(z)%7D%20-%201%20%5C;=%5C;%200,"></p>
<p>solved simultaneously for a whole grid of <img src="https://latex.codecogs.com/png.latex?(P,%20y_1)"> states as a <strong>block of independent scalar Newton problems</strong>: <code>NumJac((K, 1))</code> — the shape is <code>(K, 1)</code>, never <code>(K,)</code>, per the house rule; a bare 1-D shape would declare all <img src="https://latex.codecogs.com/png.latex?K"> states coupled and build a dense Jacobian — and pymrm’s <code>newton</code> on <img src="https://latex.codecogs.com/png.latex?w%20=%20%5Cln%20z">, which keeps the iterate positive (a plain-<img src="https://latex.codecogs.com/png.latex?z"> Newton overshoots to <img src="https://latex.codecogs.com/png.latex?z%20%5Cle%200"> and divides by <img src="https://latex.codecogs.com/png.latex?P%5E%7B%5Ccirc%7D(0)%20=%200">). Everything downstream is the paper’s algebra: <img src="https://latex.codecogs.com/png.latex?x_1"> from (22), <img src="https://latex.codecogs.com/png.latex?n_t"> from (26), <img src="https://latex.codecogs.com/png.latex?s_%7B1,2%7D"> from (28).</p>
<p>Two routes to <img src="https://latex.codecogs.com/png.latex?z(P%5E%7B%5Ccirc%7D)"> exist and both are used: the <strong>analytic</strong> one for Langmuir forms (<img src="https://latex.codecogs.com/png.latex?z%20=%20m%5Cln(1+bP%5E%7B%5Ccirc%7D)">, verified symbolically in §2.1), and the <strong>general quadrature</strong> of eq. (19) for isotherms known only pointwise — trapezoid on a logarithmic grid with the Henry-law segment <img src="https://latex.codecogs.com/png.latex?%5B0,%20t_0%5D"> integrated analytically as <img src="https://latex.codecogs.com/png.latex?K%20t_0">, exactly the low-coverage care the paper’s conclusions ask for (“the integration for spreading pressure is sensitive to this portion of the … isotherm”). §7.4 refines it and breaks it.</p>
<div id="9fc60aa2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:42.550493Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:42.550328Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:43.774797Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:43.773961Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- pure-component isotherm objects ------------------------------------</span></span>
<span id="cb9-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> langmuir_pure(m_, b_):</span>
<span id="cb9-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Single-site Langmuir: n, z = pi A/RT (analytic, verified in 2.1), inverse."""</span></span>
<span id="cb9-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pp: m_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp),</span>
<span id="cb9-5">                z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pp: m_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log1p(b_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp),</span>
<span id="cb9-6">                Pinv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> zz: np.expm1(zz<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>m_)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b_,</span>
<span id="cb9-7">                K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>m_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b_)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Henry constant, eq. (30)</span></span>
<span id="cb9-8"></span>
<span id="cb9-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> henry_pure(K_):</span>
<span id="cb9-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Pure Henry isotherm: the eq. (30) special case, everything linear."""</span></span>
<span id="cb9-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pp: K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp, z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pp: K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp, Pinv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> zz: zz<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_, K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>K_)</span>
<span id="cb9-12"></span>
<span id="cb9-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> dualsite_pure(ma, ba, mb, bb, scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb9-14">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Two-site Langmuir evaluated at (scale*P): pair S and its shape-shifted twin.</span></span>
<span id="cb9-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    z is analytic; the INVERSE is numerical (newton on ln P), which is the</span></span>
<span id="cb9-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    general-isotherm machinery pair L never needs."""</span></span>
<span id="cb9-17">    zf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pp: ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log1p(ba<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> mb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.log1p(bb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp)</span>
<span id="cb9-18">    nf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pp: (ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ba<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>ba<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> mb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>bb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>bb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp))</span>
<span id="cb9-19">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> Pinv(zz):</span>
<span id="cb9-20">        zz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.atleast_1d(np.asarray(zz, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>))</span>
<span id="cb9-21">        jacd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((zz.size, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb9-22">        res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> wc: (zf(np.exp(wc[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zz)[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb9-23">        w0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log(np.maximum(np.expm1(zz<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(ma <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> mb))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(ba<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>))</span>
<span id="cb9-24">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> wc: jacd(res, wc), w0.reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb9-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> s.success</span>
<span id="cb9-26">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(s.x[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb9-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nf, z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zf, Pinv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Pinv, K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(ma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ba <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> mb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>bb)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>scale)</span>
<span id="cb9-28"></span>
<span id="cb9-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the IAST solver -----------------------------------------------------</span></span>
<span id="cb9-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> iast(Pt, y1v, pure1, pure2, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>):</span>
<span id="cb9-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Solve eqs. (36)-(42) for a vector of binary states.  Returns z, x1, nt, n1, n2, s12."""</span></span>
<span id="cb9-32">    Pt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.broadcast_to(np.asarray(Pt, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), np.shape(y1v)).ravel().copy()</span>
<span id="cb9-33">    y1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(y1v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).ravel()</span>
<span id="cb9-34">    jac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((y1v.size, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># K independent scalar equations: (K,1), NOT (K,)</span></span>
<span id="cb9-35">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(wc):                              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># R(z) = P y1/P1o(z) + P y2/P2o(z) - 1</span></span>
<span id="cb9-36">        zz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(wc[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb9-37">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pure1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zz) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>y1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pure2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zz) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb9-38">    z0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(pure1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pt), pure2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pt))       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># upper start: R(z0) &lt;= 0, monotone</span></span>
<span id="cb9-39">    sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> wc: jac(res, wc), np.log(z0).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tol, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb9-40">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> sol.success, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"IAST Newton did not converge"</span></span>
<span id="cb9-41">    zz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(sol.x[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb9-42">    P1v, P2v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pure1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zz), pure2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zz)</span>
<span id="cb9-43">    x1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P1v                                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (22)</span></span>
<span id="cb9-44">    ntv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(x1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pure1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](P1v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pure2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](P2v))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (26), harmonic</span></span>
<span id="cb9-45">    s12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (x1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.where(y1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, y1v, np.nan)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.where(y1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>y1v, np.nan))</span>
<span id="cb9-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zz, P1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P1v, P2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P2v, x1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x1v, nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ntv, n1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ntv, n2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ntv, s12<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>s12)</span>
<span id="cb9-47"></span>
<span id="cb9-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the rival: extended Langmuir (the mixture model of Bering &amp; Serpenskii's</span></span>
<span id="cb9-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     fit, p. 125), closed form, sharing NOTHING with the solver above -------</span></span>
<span id="cb9-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ext_langmuir(Pt, y1v, m1_, b1_, m2_, b2_):</span>
<span id="cb9-51">    Dd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>y1v)</span>
<span id="cb9-52">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> m1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dd, m2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>y1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Dd</span>
<span id="cb9-53"></span>
<span id="cb9-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the three illustrative pairs ---------------------------------------</span></span>
<span id="cb9-55">mL, b1L, b2L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb9-56">m1U, b1U, m2U, b2U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb9-57">pL1, pL2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> langmuir_pure(mL, b1L), langmuir_pure(mL, b2L)</span>
<span id="cb9-58">pU1, pU2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> langmuir_pure(m1U, b1U), langmuir_pure(m2U, b2U)</span>
<span id="cb9-59">KAPPA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span></span>
<span id="cb9-60">pS1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dualsite_pure(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb9-61">pS2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dualsite_pure(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, KAPPA)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the SAME curve, shifted in log P</span></span>
<span id="cb9-62"></span>
<span id="cb9-63">demo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>]), pU1, pU2)</span>
<span id="cb9-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair U at P = 1, y1 = 0.5:"</span>)</span>
<span id="cb9-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>demo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'z'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   x1 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>demo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'x1'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>demo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nt'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb9-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   s12 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>demo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'s12'</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pair U at P = 1, y1 = 0.5:
  z = 1.814834   x1 = 0.972752   n_t = 0.821030   s12 = 35.7003</code></pre>
</div>
</div>
<div id="4c7650a2" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:43.776893Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:43.776720Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:44.262227Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:44.261567Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The construction the paper computes its Fig. 2 with: n(P) and z(P) for pair U.</span></span>
<span id="cb11-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (Same CONSTRUCTION as the paper's figure; the curves are this page's</span></span>
<span id="cb11-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#  illustrative isotherms, not the paper's systems.)</span></span>
<span id="cb11-4">Pplot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb11-5">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.8</span>))</span>
<span id="cb11-6">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].semilogx(Pplot, pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](Pplot), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>,  color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"component 1  ($m_1{=}1,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> b_1{=}10$)"</span>)</span>
<span id="cb11-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].semilogx(Pplot, pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](Pplot), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"component 2  ($m_2{=}0.5,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> b_2{=}2$)"</span>)</span>
<span id="cb11-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$P$ (arbitrary units)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$n^{</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">circ}(P)$ (arbitrary units)"</span>,</span>
<span id="cb11-9">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pure isotherms, pair U (illustrative)"</span>)</span>
<span id="cb11-10">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb11-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].semilogx(Pplot, pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pplot), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>,  color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"component 1"</span>)</span>
<span id="cb11-12">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].semilogx(Pplot, pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pplot), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"component 2"</span>)</span>
<span id="cb11-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$P$ (arbitrary units)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$z = </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pi A/RT$ (amount units)"</span>,</span>
<span id="cb11-14">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Reduced spreading pressure, eq. (19)"</span>)</span>
<span id="cb11-15">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb11-16">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.4-iast-mixed-gas-adsorption/index_files/figure-html/cell-8-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-mixture-equilibria-the-construction-of-figs.-3-4-illustrative" class="level3">
<h3 class="anchored" data-anchor-id="the-mixture-equilibria-the-construction-of-figs.-3-4-illustrative">6.1 The mixture equilibria (the construction of Figs. 3, 4 — illustrative)</h3>
<p>The <img src="https://latex.codecogs.com/png.latex?(y%7B-%7Dx)"> diagram and the total amount adsorbed for pair U, at three total pressures. These have the <em>structure</em> of the paper’s Figs. 3 and 4 — an azeotrope-free <img src="https://latex.codecogs.com/png.latex?y%7B-%7Dx"> curve bowed toward the strongly adsorbed component, <img src="https://latex.codecogs.com/png.latex?n_t"> falling as the weakly adsorbed component takes over the gas — but they are computed from the illustrative parameters and <strong>reproduce nothing in the paper</strong>; the paper’s own curves would need the Szepesy &amp; Illés isotherms this page does not have.</p>
<div id="5acee4da" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:44.264465Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:44.264331Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:44.531058Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:44.530308Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">yfine <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">399</span>)</span>
<span id="cb12-2">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.9</span>))</span>
<span id="cb12-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Pt, ls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)]:</span>
<span id="cb12-4">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(Pt, yfine, pU1, pU2)</span>
<span id="cb12-5">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x1"</span>], yfine, ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>)</span>
<span id="cb12-6">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(yfine, s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>], ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"$P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>)</span>
<span id="cb12-7">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5"</span>)</span>
<span id="cb12-8">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$x_1$ (adsorbed phase)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$y_1$ (gas phase)"</span>,</span>
<span id="cb12-9">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$y{-}x$ diagram, pair U (illustrative)"</span>)</span>
<span id="cb12-10">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb12-11">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$y_1$ (gas phase)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$n_t$ (amount units)"</span>,</span>
<span id="cb12-12">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total amount adsorbed, eq. (26)"</span>)</span>
<span id="cb12-13">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb12-14">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb12-15">S_RESULTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {Pt: iast(Pt, yfine, pU1, pU2) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Pt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)}</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.4-iast-mixed-gas-adsorption/index_files/figure-html/cell-9-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-papers-graphical-procedure-drawn-and-checked-fig.-1s-construction" class="level3">
<h3 class="anchored" data-anchor-id="the-papers-graphical-procedure-drawn-and-checked-fig.-1s-construction">6.2 The paper’s graphical procedure, drawn and checked (Fig. 1’s construction)</h3>
<p>The paper’s general algorithm is geometric: at a chosen spreading pressure the horizontal line <img src="https://latex.codecogs.com/png.latex?ABC"> cuts the two pure <img src="https://latex.codecogs.com/png.latex?z(P)"> curves at <img src="https://latex.codecogs.com/png.latex?B%20=%20(P_1%5E%7B%5Ccirc%7D,%20z%5E%7B*%7D)"> and <img src="https://latex.codecogs.com/png.latex?C%20=%20(P_2%5E%7B%5Ccirc%7D,%20z%5E%7B*%7D)">; a point <img src="https://latex.codecogs.com/png.latex?D"> on <img src="https://latex.codecogs.com/png.latex?BC"> picks the mixture pressure; the chords <img src="https://latex.codecogs.com/png.latex?OB">, <img src="https://latex.codecogs.com/png.latex?OC"> and the vertical through <img src="https://latex.codecogs.com/png.latex?D"> give <img src="https://latex.codecogs.com/png.latex?E"> and <img src="https://latex.codecogs.com/png.latex?F">; and eqs. (45), (46) read the equilibrium off the ruler: <img src="https://latex.codecogs.com/png.latex?y_1%20=%20%5Cmathrm%7BDE%7D/%5Cmathrm%7BFE%7D">, <img src="https://latex.codecogs.com/png.latex?x_1%20=%20%5Cmathrm%7BDC%7D/%5Cmathrm%7BBC%7D">. §2.1 proved both symbolically; here the construction is drawn for pair U and the lever rules evaluated numerically — the same numbers the Newton solver returns, which is eq. (44) and the ruler agreeing about eq. (40).</p>
<div id="a04c7249" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:44.533184Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:44.533056Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:44.693285Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:44.692457Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">ZSTAR, X1STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span></span>
<span id="cb13-2">P1s, P2s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](ZSTAR)), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](ZSTAR))</span>
<span id="cb13-3">Pd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X1STAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X1STAR)                    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (29): D chosen via x1</span></span>
<span id="cb13-4">Fh, Eh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ZSTAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P1s, ZSTAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P2s                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># chords OB, OC at abscissa Pd</span></span>
<span id="cb13-5">y1_lever <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (ZSTAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Eh)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Fh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Eh)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (45)</span></span>
<span id="cb13-6">x1_lever <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P2s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Pd)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(P2s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P1s)                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (46)</span></span>
<span id="cb13-7">y1_direct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P1s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>X1STAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Pd                             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (22)</span></span>
<span id="cb13-8">LEVER_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(y1_lever <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1_direct), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(x1_lever <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X1STAR))</span>
<span id="cb13-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the defect that shows the check has power: swap the chords</span></span>
<span id="cb13-10">Fs, Es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ZSTAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P2s, ZSTAR<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P1s</span>
<span id="cb13-11">LEVER_SWAPPED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((ZSTAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Es)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(Fs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Es) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> y1_direct)</span>
<span id="cb13-12"></span>
<span id="cb13-13">Pc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, P2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.08</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">300</span>)</span>
<span id="cb13-14">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6</span>))</span>
<span id="cb13-15">ax.plot(Pc, pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pc), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pure component 1"</span>)</span>
<span id="cb13-16">ax.plot(Pc, pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pc), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C1"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pure component 2"</span>)</span>
<span id="cb13-17">ax.plot([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, P2s], [ZSTAR, ZSTAR], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb13-18">ax.plot([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Pd], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Fh], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k:"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># chord OB extended to F</span></span>
<span id="cb13-19">ax.plot([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, P2s], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, ZSTAR], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k:"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># chord OC</span></span>
<span id="cb13-20">ax.plot([Pd, Pd], [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Fh], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb13-21"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x_, z_, nm, off <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, ZSTAR, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>, (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)), (P1s, ZSTAR, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>, (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)),</span>
<span id="cb13-22">                        (P2s, ZSTAR, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)), (Pd, ZSTAR, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)),</span>
<span id="cb13-23">                        (Pd, Eh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)), (Pd, Fh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))]:</span>
<span id="cb13-24">    ax.plot(x_, z_, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ko"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb13-25">    ax.annotate(nm, (x_, z_), textcoords<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"offset points"</span>, xytext<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>off, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb13-26">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$P$ (arbitrary units)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$z = </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pi A/RT$"</span>,</span>
<span id="cb13-27">       title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Fig. 1's construction, computed: $y_1 = $ DE/FE $ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>y1_lever<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$,"</span></span>
<span id="cb13-28">             <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  $x_1 = $ DC/BC $ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>x1_lever<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>,</span>
<span id="cb13-29">       xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, P2s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.08</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, Fh<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.12</span>))</span>
<span id="cb13-30">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"center right"</span>)</span>
<span id="cb13-31">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb13-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"lever rules vs eqs. (22)/(29) directly: max deviation </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEVER_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb13-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"with the chords deliberately swapped:   </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEVER_SWAPPED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (the check can fail)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.4-iast-mixed-gas-adsorption/index_files/figure-html/cell-10-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>lever rules vs eqs. (22)/(29) directly: max deviation 1.1e-16
with the chords deliberately swapped:   0.5844  (the check can fail)</code></pre>
</div>
</div>
</section>
<section id="selectivity-what-varies-what-cannot-the-structure-of-fig.-10s-claim" class="level3">
<h3 class="anchored" data-anchor-id="selectivity-what-varies-what-cannot-the-structure-of-fig.-10s-claim">6.3 Selectivity: what varies, what cannot (the structure of Fig. 10’s claim)</h3>
<p>The paper’s Fig. 10 discussion is the one place it exhibits IAST predicting a <em>composition-dependent</em> selectivity — “a small composition dependence” the data of Bering and Serpenskii could not resolve. For pair U the dependence is anything but small, and both infinite-dilution ends have <strong>closed forms</strong> (the dilute-1 limit is <img src="https://latex.codecogs.com/png.latex?s%20%5Cto%20P/P_1%5E%7B%5Ccirc%7D(z_2(P))">, the dilute-2 limit <img src="https://latex.codecogs.com/png.latex?s%20%5Cto%20P_2%5E%7B%5Ccirc%7D(z_1(P))/P">; at <img src="https://latex.codecogs.com/png.latex?P%20=%201"> these evaluate to <img src="https://latex.codecogs.com/png.latex?5(1+%5Csqrt3)%20=%0A13.660254"> and exactly <img src="https://latex.codecogs.com/png.latex?60">), so the page reports limits, not sampled extrema. For pair L the selectivity is <img src="https://latex.codecogs.com/png.latex?b_1/b_2%20=%2010"> <strong>identically</strong> — under IAST, any two pure isotherms that are the same curve shifted in <img src="https://latex.codecogs.com/png.latex?%5Clog%20P"> give exactly constant selectivity (§7.8 proves and breaks this) — so composition dependence of <img src="https://latex.codecogs.com/png.latex?s"> under IAST measures the two isotherms’ difference in <em>shape</em>, not in scale. The paper does not state this; its Henry-limit section (eqs. 30–35, constant <img src="https://latex.codecogs.com/png.latex?s%20=%20K_1/K_2">) is the linear special case of it.</p>
<div id="28e6b959" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:44.695452Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:44.695188Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:44.930242Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:44.929458Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># closed-form dilution limits at P = 1 (pair U)</span></span>
<span id="cb15-2">P_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb15-3">S_DIL1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(P_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](P_)))          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># y1 -&gt; 0</span></span>
<span id="cb15-4">S_DIL2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](P_))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P_)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># y1 -&gt; 1</span></span>
<span id="cb15-5">S_DIL_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_DIL2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_DIL1</span>
<span id="cb15-6">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span>))</span>
<span id="cb15-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Pt, ls <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>)]:</span>
<span id="cb15-8">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S_RESULTS[Pt]</span>
<span id="cb15-9">    ax.plot(yfine, s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>], ls, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C0"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pair U, $P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Pt<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$"</span>)</span>
<span id="cb15-10">ax.plot(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, S_DIL1, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb15-11">ax.plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, S_DIL2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C3"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, zorder<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>,</span>
<span id="cb15-12">        label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed-form dilution limits, $P{=}1$"</span>)</span>
<span id="cb15-13">sL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, yfine, pL1, pL2)</span>
<span id="cb15-14">ax.plot(yfine, sL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C2"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2</span>,</span>
<span id="cb15-15">        label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair L (equal shape): $s </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">equiv b_1/b_2 = 10$"</span>)</span>
<span id="cb15-16">ax.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$y_1$ (gas phase)"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"selectivity $s_{1,2}$, eq. (28)"</span>, yscale<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>,</span>
<span id="cb15-17">       title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Selectivity under IAST: shape difference, not scale, drives the variation"</span>)</span>
<span id="cb15-18">ax.legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb15-19">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb15-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pair U at P = 1: dilute-in-1 limit s = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_DIL1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 5(1+sqrt(3)) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span>np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                 dilute-in-2 limit s = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_DIL2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (exactly 60: e^(2 ln 11) = 121, (121-1)/2)"</span>)</span>
<span id="cb15-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                 composition-dependence factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_DIL_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-23">SEL_EQUAL_M_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.ptp(sL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][np.isfinite(sL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>])])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.nanmean(sL[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>]))</span>
<span id="cb15-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pair L: relative spread of s over the whole composition range </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SEL_EQUAL_M_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.4-iast-mixed-gas-adsorption/index_files/figure-html/cell-11-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>pair U at P = 1: dilute-in-1 limit s = 13.660254 = 5(1+sqrt(3)) = 13.660254
                 dilute-in-2 limit s = 60.000000 (exactly 60: e^(2 ln 11) = 121, (121-1)/2)
                 composition-dependence factor 4.392305
pair L: relative spread of s over the whole composition range 3.16e-12</code></pre>
</div>
</div>
<div id="e430ef2f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:44.932649Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:44.932466Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:44.957606Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:44.956903Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The page's computed reference table, written for reuse (see the data sidecar:</span></span>
<span id="cb17-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># COMPUTED output, not data from any paper). Deterministic across runs.</span></span>
<span id="cb17-3">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb17-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> pair, (q1, q2) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L"</span>, (pL1, pL2)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"U"</span>, (pU1, pU2))]:</span>
<span id="cb17-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Pt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>):</span>
<span id="cb17-6">        yv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(np.arange(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.91</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)</span>
<span id="cb17-7">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(Pt, yv, q1, q2)</span>
<span id="cb17-8">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, yy <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(yv):</span>
<span id="cb17-9">            rows.append((pair, Pt, yy, s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>][i], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x1"</span>][i], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>][i],</span>
<span id="cb17-10">                         s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>][i], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2"</span>][i], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][i]))</span>
<span id="cb17-11">ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_t"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>])</span>
<span id="cb17-12">Path(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data"</span>).mkdir(exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb17-13">hdr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"# IAST reference solutions COMPUTED BY PAGE J1.4 on two illustrative Langmuir pairs.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-14">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"# NOT experimental data and NOT from Myers &amp; Prausnitz (1965); see the .meta.yaml sidecar.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb17-15">       <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"# pair L: m=1, b1=10, b2=1.  pair U: m1=1, b1=10, m2=0.5, b2=2.  Arbitrary units.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">open</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/iast-illustrative-reference.csv"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"w"</span>, encoding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utf-8"</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> fh:</span>
<span id="cb17-17">    fh.write(hdr)</span>
<span id="cb17-18">    ref.to_csv(fh, index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, float_format<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%.12g</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb17-19"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"wrote data/iast-illustrative-reference.csv  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ref)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows)"</span>)</span>
<span id="cb17-20">ref.head(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>wrote data/iast-illustrative-reference.csv  (54 rows)</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="11">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">pair</th>
<th data-quarto-table-cell-role="th">P</th>
<th data-quarto-table-cell-role="th">y1</th>
<th data-quarto-table-cell-role="th">z</th>
<th data-quarto-table-cell-role="th">x1</th>
<th data-quarto-table-cell-role="th">n_t</th>
<th data-quarto-table-cell-role="th">n_1</th>
<th data-quarto-table-cell-role="th">n_2</th>
<th data-quarto-table-cell-role="th">s12</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>L</td>
<td>0.2</td>
<td>0.1</td>
<td>0.322083</td>
<td>0.526316</td>
<td>0.275362</td>
<td>0.144928</td>
<td>0.130435</td>
<td>10.0</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>L</td>
<td>0.2</td>
<td>0.2</td>
<td>0.444686</td>
<td>0.714286</td>
<td>0.358974</td>
<td>0.256410</td>
<td>0.102564</td>
<td>10.0</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>L</td>
<td>0.2</td>
<td>0.3</td>
<td>0.553885</td>
<td>0.810811</td>
<td>0.425287</td>
<td>0.344828</td>
<td>0.080460</td>
<td>10.0</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>L</td>
<td>0.2</td>
<td>0.4</td>
<td>0.652325</td>
<td>0.869565</td>
<td>0.479167</td>
<td>0.416667</td>
<td>0.062500</td>
<td>10.0</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>L</td>
<td>0.2</td>
<td>0.5</td>
<td>0.741937</td>
<td>0.909091</td>
<td>0.523810</td>
<td>0.476190</td>
<td>0.047619</td>
<td>10.0</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>L</td>
<td>0.2</td>
<td>0.6</td>
<td>0.824175</td>
<td>0.937500</td>
<td>0.561404</td>
<td>0.526316</td>
<td>0.035088</td>
<td>10.0</td>
</tr>
</tbody>
</table>

</div>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<p>Eight numerical sections. Every reported metric appears in §7.9’s defect-injection table with a row that moves it, or is explicitly labelled structural/below-floor there with an above-floor companion named. Since nothing here is experimental, <strong>every check below is a consistency test of the theory’s printed structure and of this page’s solver — none is evidence that IAST describes any real system.</strong></p>
<section id="the-solver-against-a-closed-form-it-never-touches-equal-capacities" class="level3">
<h3 class="anchored" data-anchor-id="the-solver-against-a-closed-form-it-never-touches-equal-capacities">7.1 The solver against a closed form it never touches (equal capacities)</h3>
<p>§2.1 derived symbolically that for equal-capacity Langmuir pairs the IAST solution <em>is</em> the extended Langmuir rule. The Newton solver knows nothing of that closed form — it solves the spreading-pressure match by iteration — so agreement is a real test of the whole chain (matching, eq. (22), eq. (26)).</p>
<div id="53329f7d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:44.959172Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:44.959048Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:44.981943Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:44.981242Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1">Pgrid, ygrid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.meshgrid(np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>), np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>))</span>
<span id="cb19-2">GP, GY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pgrid.ravel(), ygrid.ravel()</span>
<span id="cb19-3"></span>
<span id="cb19-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eqm_dev(p1_, p2_, m1_, b1_, m2_, b2_, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>):</span>
<span id="cb19-5">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(GP, GY, p1_, p2_, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tol)</span>
<span id="cb19-6">    n1e, n2e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ext_langmuir(GP, GY, m1_, b1_, m2_, b2_)</span>
<span id="cb19-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.array([s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n1e, s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n2e]))</span>
<span id="cb19-8">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.maximum(n1e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n2e, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)))</span>
<span id="cb19-9"></span>
<span id="cb19-10">EQM_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eqm_dev(pL1, pL2, mL, b1L, mL, b2L)</span>
<span id="cb19-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"IAST solver vs extended-Langmuir closed form, pair L, 900 states: "</span></span>
<span id="cb19-12">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"max rel dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQM_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-13"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(solver-tolerance level; below the CI floor of 1e-12 -- named as such in 7.9,"</span>)</span>
<span id="cb19-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" with the three break rows below as its above-floor companions)"</span>)</span>
<span id="cb19-15"></span>
<span id="cb19-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break rows -- the same comparison must MOVE when the premise is broken</span></span>
<span id="cb19-17">BRK_EQM_M2   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eqm_dev(pL1, langmuir_pure(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, b2L), mL, b1L, mL, b2L)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># unequal capacity</span></span>
<span id="cb19-18">BRK_EQM_B1   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eqm_dev(langmuir_pure(mL, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1L), pL2, mL, b1L, mL, b2L)  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1 % wrong b1</span></span>
<span id="cb19-19">BRK_EQM_TOL  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eqm_dev(pL1, pL2, mL, b1L, mL, b2L, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>)             <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># loose Newton</span></span>
<span id="cb19-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">breaks:  m2 = 0.6            -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_EQM_M2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"         b1 off by 1 %       -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_EQM_B1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb19-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"         Newton tol 1e-3     -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_EQM_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>IAST solver vs extended-Langmuir closed form, pair L, 900 states: max rel dev 7.635e-16
(solver-tolerance level; below the CI floor of 1e-12 -- named as such in 7.9,
 with the three break rows below as its above-floor companions)

breaks:  m2 = 0.6            -&gt; 0.424
         b1 off by 1 %       -&gt; 9.081e-03
         Newton tol 1e-3     -&gt; 2.441e-10</code></pre>
</div>
</div>
</section>
<section id="where-extended-langmuir-stops-being-an-iast-unequal-capacities" class="level3">
<h3 class="anchored" data-anchor-id="where-extended-langmuir-stops-being-an-iast-unequal-capacities">7.2 Where extended Langmuir stops being an IAST (unequal capacities)</h3>
<p>With <img src="https://latex.codecogs.com/png.latex?m_1%20%5Cne%20m_2"> the two models genuinely differ, and the size of the difference is this page’s first physical statement. Both extrema are computed honestly: the deviation grows monotonically with <img src="https://latex.codecogs.com/png.latex?P"> across the window (asserted below), so its supremum sits on the window’s <img src="https://latex.codecogs.com/png.latex?P%20=%2010"> edge and is a <strong>window supremum by definition, not a sampled maximum</strong>; the interior maximum over <img src="https://latex.codecogs.com/png.latex?y_1"> at that edge is root-found (a 30-point grid read would have been 0.7 % low — printed beside it); and the dilute-component deviation has a <strong>closed form</strong> at <img src="https://latex.codecogs.com/png.latex?y_1%20%5Cto%200">, where both models are linear in <img src="https://latex.codecogs.com/png.latex?y_1"> and the ratio of slopes is <img src="https://latex.codecogs.com/png.latex?%5Cbigl%5Bm_1%20b_1%20P/(1%7B+%7Db_2%20P)%5Cbigr%5D%20%5Cbig/%20%5Cbigl%5B(P/P_1%5E%7B%5Ccirc%7D(z_2(P)))%5C,n_2%5E%7B%5Ccirc%7D(P)%5Cbigr%5D">.</p>
<div id="a15fc5ec" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:44.984070Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:44.983809Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.152750Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.152193Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb21-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> nt_dev_U(y, Pt):</span>
<span id="cb21-2">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(np.array([Pt]), np.array([y]), pU1, pU2)</span>
<span id="cb21-3">    n1e, n2e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ext_langmuir(np.array([Pt]), np.array([y]), m1U, b1U, m2U, b2U)</span>
<span id="cb21-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((n1e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n2e) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>])[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb21-5"></span>
<span id="cb21-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># monotone in P at the (P-wise) optimal y -- so the window sup is at P = 10</span></span>
<span id="cb21-7">Pchecks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>])</span>
<span id="cb21-8">maxdev_at_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb21-9"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> Pt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> Pchecks:</span>
<span id="cb21-10">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> y: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>nt_dev_U(y, Pt), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>),</span>
<span id="cb21-11">                        method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>))</span>
<span id="cb21-12">    maxdev_at_P.append(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r.fun)</span>
<span id="cb21-13"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(np.diff(maxdev_at_P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"monotone growth with P across the window"</span></span>
<span id="cb21-14"></span>
<span id="cb21-15">r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> y: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>nt_dev_U(y, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>),</span>
<span id="cb21-16">                    method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>, options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(xatol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>))</span>
<span id="cb21-17">NT_DEV_SUP, NT_DEV_Y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r.fun, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.x)</span>
<span id="cb21-18">sU <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(GP, GY, pU1, pU2)</span>
<span id="cb21-19">n1e, n2e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ext_langmuir(GP, GY, m1U, b1U, m2U, b2U)</span>
<span id="cb21-20">NT_DEV_GRID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((n1e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n2e) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sU[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>]))</span>
<span id="cb21-21"></span>
<span id="cb21-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dilute-component deviation, closed form at y1 -&gt; 0, P = 10</span></span>
<span id="cb21-23">Pt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span></span>
<span id="cb21-24">slope_EL   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b2U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt)</span>
<span id="cb21-25">slope_IAST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pt)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](Pt)</span>
<span id="cb21-26">N1_DILUTE_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(slope_EL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>slope_IAST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb21-27"></span>
<span id="cb21-28"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"n_t deviation, window sup (P = 10 edge, y1 root-found): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_DEV_SUP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at y1* = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_DEV_Y<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the 30 x 30 grid read of the same quantity: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_DEV_GRID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  "</span></span>
<span id="cb21-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT_DEV_GRID<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NT_DEV_SUP)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % low -- why extrema are root-found here)"</span>)</span>
<span id="cb21-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dilute-component-1 deviation at P = 10, closed form: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N1_DILUTE_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb21-32"></span>
<span id="cb21-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break: restore m2 = m1 and both must collapse</span></span>
<span id="cb21-34">sB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(GP, GY, pU1, langmuir_pure(m1U, b2U))</span>
<span id="cb21-35">n1b, n2b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ext_langmuir(GP, GY, m1U, b1U, m1U, b2U)</span>
<span id="cb21-36">BRK_NT_EQUALM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((n1b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n2b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> sB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>sB[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nt"</span>]))</span>
<span id="cb21-37">slope_IAST_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](langmuir_pure(m1U, b2U)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pt)))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>langmuir_pure(m1U, b2U)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](Pt)</span>
<span id="cb21-38">BRK_N1_EQUALM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b2U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pt)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>slope_IAST_eq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb21-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">break (m2 -&gt; m1): window measure collapses to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_NT_EQUALM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb21-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"dilute closed form to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_N1_EQUALM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>n_t deviation, window sup (P = 10 edge, y1 root-found): 0.215079 at y1* = 0.099555
  the 30 x 30 grid read of the same quantity: 0.213643  (0.67 % low -- why extrema are root-found here)
dilute-component-1 deviation at P = 10, closed form: 0.641742

break (m2 -&gt; m1): window measure collapses to 6.52e-16, dilute closed form to 0.00e+00</code></pre>
</div>
</div>
</section>
<section id="the-henry-law-limit-the-one-case-the-paper-proves-rigorous" class="level3">
<h3 class="anchored" data-anchor-id="the-henry-law-limit-the-one-case-the-paper-proves-rigorous">7.3 The Henry-law limit — the one case the paper proves rigorous</h3>
<p>Eqs. (30)–(35): at vanishing coverage IAST must reproduce <img src="https://latex.codecogs.com/png.latex?n_i%20=%20K_i%20P%20y_i"> and the constant selectivity <img src="https://latex.codecogs.com/png.latex?K_1/K_2">. Two tests. <strong>(a)</strong> On <em>pure Henry isotherms</em> the solver must be exact at any pressure — it is, to solver tolerance. <strong>(b)</strong> On pair U the selectivity must converge to <img src="https://latex.codecogs.com/png.latex?K_1/K_2%20=%20m_1%20b_1%20/%20m_2%20b_2%20=%2010"> as <img src="https://latex.codecogs.com/png.latex?P%20%5Cto%200">, at first order in <img src="https://latex.codecogs.com/png.latex?P"> (the leading correction to both isotherms is <img src="https://latex.codecogs.com/png.latex?O(P)">); the observed order over six decades is printed.</p>
<div id="60eac276" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.155180Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.155006Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.180597Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.179862Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb23-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) pure Henry isotherms: closed case of eqs. (30)-(35)</span></span>
<span id="cb23-2">KH1, KH2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span></span>
<span id="cb23-3">yv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>)</span>
<span id="cb23-4">sH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>, yv, henry_pure(KH1), henry_pure(KH2))</span>
<span id="cb23-5">HENRY_EXACT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KH1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>yv)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KH1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>yv)))</span>
<span id="cb23-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(a) solver on pure Henry isotherms vs n1 = K1 P y1 (eq. 31): max rel </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HENRY_EXACT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"    (below the CI floor; its above-floor companion is the no-matching break below)"</span>)</span>
<span id="cb23-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break: skip the spreading-pressure matching entirely (x_i = y_i)</span></span>
<span id="cb23-9">n1_nomatch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(yv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KH1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yv)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KH2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span>))</span>
<span id="cb23-10">BRK_HENRY_NOMATCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(n1_nomatch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> KH1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>yv)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(KH1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.37</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>yv)))</span>
<span id="cb23-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    break (matching skipped, x_i = y_i): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_HENRY_NOMATCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb23-12"></span>
<span id="cb23-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) pair U selectivity -&gt; K1/K2 at first order</span></span>
<span id="cb23-14">S_INF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (m1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b1U)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(m2U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>b2U)</span>
<span id="cb23-15">Psweep <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>np.arange(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb23-16">hdev <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(p, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_INF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb23-17">                 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> Psweep])</span>
<span id="cb23-18">orders <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.log10(hdev[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>hdev[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:])</span>
<span id="cb23-19">HENRY_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(hdev[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> HENRY_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(orders[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb23-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(b) |s/ (K1/K2) - 1| at P = 1e-3 ... 1e-8: "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb23-21">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> hdev))</span>
<span id="cb23-22"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    observed order in P: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HENRY_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (first order, as the O(P) isotherm "</span></span>
<span id="cb23-23">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"correction requires)"</span>)</span>
<span id="cb23-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># breaks</span></span>
<span id="cb23-25">BRK_HENRY_P01 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_INF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb23-26">BRK_HENRY_WRONGK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((b1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b2U)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_INF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb23-27">hdev_wrong <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(p, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> Psweep])</span>
<span id="cb23-28">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(b1U<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>b2U) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb23-29">BRK_HENRY_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log10(hdev_wrong[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>hdev_wrong[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb23-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    breaks: read at P = 0.1 instead -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_HENRY_P01<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  K = b (capacity "</span></span>
<span id="cb23-31">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"forgotten) -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_HENRY_WRONGK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;"</span>)</span>
<span id="cb23-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"            order against that wrong limit -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_HENRY_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (convergence gone)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>(a) solver on pure Henry isotherms vs n1 = K1 P y1 (eq. 31): max rel 2.17e-16
    (below the CI floor; its above-floor companion is the no-matching break below)
    break (matching skipped, x_i = y_i): 0.757

(b) |s/ (K1/K2) - 1| at P = 1e-3 ... 1e-8: 2.75e-03  2.75e-04  2.75e-05  2.75e-06  2.75e-07  2.75e-08
    observed order in P: 1.0000  (first order, as the O(P) isotherm correction requires)
    breaks: read at P = 0.1 instead -&gt; 0.2697;  K = b (capacity forgotten) -&gt; 0.50;
            order against that wrong limit -&gt; 0.0000 (convergence gone)</code></pre>
</div>
</div>
</section>
<section id="the-general-spreading-pressure-quadrature-refined-and-broken" class="level3">
<h3 class="anchored" data-anchor-id="the-general-spreading-pressure-quadrature-refined-and-broken">7.4 The general spreading-pressure quadrature, refined and broken</h3>
<p>Eq. (19) for isotherms known only pointwise: log-grid trapezoid with the Henry segment <img src="https://latex.codecogs.com/png.latex?%5B0,%20t_0%5D"> added analytically as <img src="https://latex.codecogs.com/png.latex?K%20t_0"> — the low-coverage care the paper’s conclusions single out. Tested against the analytic <img src="https://latex.codecogs.com/png.latex?z%20=%20m%5Cln(1+bP)"> on pair U’s component 1; the error must fall at second order in the node count, and the two design choices (log grid, Henry anchor) each get a break row.</p>
<div id="ea001889" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.182230Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.182108Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.188426Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.187787Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> z_quad(Pp, nfun, K_, n_nodes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>, t0_frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>):</span>
<span id="cb25-2">    t0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t0_frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Pp</span>
<span id="cb25-3">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(t0, Pp, n_nodes)</span>
<span id="cb25-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> K_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.trapezoid(nfun(tg), np.log(tg))     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># eq. (19): n d ln t</span></span>
<span id="cb25-5"></span>
<span id="cb25-6">ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb25-7">qerr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {nn: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(z_quad(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>], pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K"</span>], nn)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nn <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">513</span>)}</span>
<span id="cb25-8">QUAD_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(qerr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>])</span>
<span id="cb25-9">QUAD_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(qerr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>qerr[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">513</span>]))</span>
<span id="cb25-10"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nodes -&gt; rel err: "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> qerr.items()))</span>
<span id="cb25-11"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reported: rel err at 257 nodes </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QUAD_ERR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>QUAD_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-12"></span>
<span id="cb25-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># breaks</span></span>
<span id="cb25-14">BRK_QUAD_LIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.trapezoid(pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>))</span>
<span id="cb25-15">                                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>), np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb25-16"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> z_quad_noanchor(nn, t0_frac<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>):</span>
<span id="cb25-17">    tg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(t0_frac, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nn)</span>
<span id="cb25-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.trapezoid(pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](tg), np.log(tg))</span>
<span id="cb25-19">BRK_QUAD_NOANCHOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(z_quad_noanchor(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb25-20">BRK_QUAD_NOANCHOR_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(z_quad_noanchor(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb25-21">                                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(z_quad_noanchor(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">513</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb25-22">WITH_ANCHOR_SAME_T0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> z_quad_noanchor(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">257</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>ZA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb25-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"breaks: linear grid, same 257 nodes      -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_QUAD_LIN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb25-24"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        Henry anchor dropped (t0 = 1e-3) -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_QUAD_NOANCHOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb25-25">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_QUAD_NOANCHOR_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (truncation-dominated, convergence gone;"</span>)</span>
<span id="cb25-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        restoring the anchor at the same t0 recovers </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WITH_ANCHOR_SAME_T0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>nodes -&gt; rel err: 65: 2.378e-04   129: 5.947e-05   257: 1.487e-05   513: 3.718e-06
reported: rel err at 257 nodes 1.487e-05, observed order 2.0000
breaks: linear grid, same 257 nodes      -&gt; 5.254e-05
        Henry anchor dropped (t0 = 1e-3) -&gt; 4.148e-03, observed order -0.000 (truncation-dominated, convergence gone;
        restoring the anchor at the same t0 recovers 2.256e-05)</code></pre>
</div>
</div>
</section>
<section id="the-gibbs-adsorption-isotherm-along-a-path-eq.-21-as-a-solver-test" class="level3">
<h3 class="anchored" data-anchor-id="the-gibbs-adsorption-isotherm-along-a-path-eq.-21-as-a-solver-test">7.5 The Gibbs adsorption isotherm along a path — eq. (21) as a solver test</h3>
<p>At constant <img src="https://latex.codecogs.com/png.latex?T"> and <img src="https://latex.codecogs.com/png.latex?P">, eq. (21) says <img src="https://latex.codecogs.com/png.latex?%5C;(A/RT)%5C,d%5Cpi%20=%20n_1%5C,d%5Cln%20y_1%20+%20n_2%5C,d%5Cln%20y_2">. The left side comes from the solver’s <img src="https://latex.codecogs.com/png.latex?z(y_1)"> — the <em>pure-component</em> route, eq. (19) at the matched <img src="https://latex.codecogs.com/png.latex?P_i%5E%7B%5Ccirc%7D"> — while the right side integrates the <em>mixture</em> amounts along the composition path. The two routes share the solve but not the thermodynamics: if the solver returned self-consistent but wrong states (mismatched spreading pressures, or a wrong <img src="https://latex.codecogs.com/png.latex?n_t"> rule), the identity fails, and the break rows show exactly that — the <strong>arithmetic-mean</strong> <img src="https://latex.codecogs.com/png.latex?n_t"> (the plausible wrong reading of eq. (26)) misses by 1.5 %, and a 1 % mismatch between the two components’ spreading pressures by 0.16 %.</p>
<div id="0161a106" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.190176Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.190001Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.245700Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.245068Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb27-1">YA, YB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span></span>
<span id="cb27-2">zA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([YA]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb27-3">zB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([YB]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb27-4">DZ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> zB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> zA</span>
<span id="cb27-5"></span>
<span id="cb27-6"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> path_rhs_gauss(ng):</span>
<span id="cb27-7">    xg, wg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> leggauss(ng)</span>
<span id="cb27-8">    yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(YB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> YA)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(YA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> YB)</span>
<span id="cb27-9">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, yv_, pU1, pU2)</span>
<span id="cb27-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(YB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> YA)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(wg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yv_))))</span>
<span id="cb27-11"></span>
<span id="cb27-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> iast_defect(Pt, y1v, zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nt_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"harmonic"</span>):</span>
<span id="cb27-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The pair-U IAST solve with an injectable defect: the two components'</span></span>
<span id="cb27-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    spreading pressures mismatched by zfac2 (a broken eq. 40), and/or eq. (26)</span></span>
<span id="cb27-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    read as an ARITHMETIC mean (the plausible wrong reading)."""</span></span>
<span id="cb27-16">    Pt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.broadcast_to(np.asarray(Pt, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), np.shape(y1v)).ravel().copy()</span>
<span id="cb27-17">    y1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(y1v, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>).ravel()</span>
<span id="cb27-18">    jacd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NumJac((y1v.size, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb27-19">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> res(wc):</span>
<span id="cb27-20">        zz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(wc[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb27-21">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zz) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>y1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>zz) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[:, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>]</span>
<span id="cb27-22">    z0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pt), pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](Pt))</span>
<span id="cb27-23">    so <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> newton(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> wc: jacd(res, wc), np.log(z0).reshape(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>, maxfev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb27-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> so.success</span>
<span id="cb27-25">    zz <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(so.x[:, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb27-26">    P1v, P2v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zz), pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>zz)</span>
<span id="cb27-27">    x1v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Pt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>y1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>P1v</span>
<span id="cb27-28">    n1o, n2o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](P1v), pU2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n"</span>](P2v)</span>
<span id="cb27-29">    ntv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (x1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>n1o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>n2o) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nt_mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arith"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(x1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n1o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n2o)</span>
<span id="cb27-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(z<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zz, x1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x1v, nt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ntv, n1<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x1v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ntv, n2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x1v)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>ntv)</span>
<span id="cb27-31"></span>
<span id="cb27-32"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> path_rhs_trap(nn, nt_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"harmonic"</span>, zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>):</span>
<span id="cb27-33">    yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(YA, YB, nn)</span>
<span id="cb27-34">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, yv_, pU1, pU2) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> nt_mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"harmonic"</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> zfac2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb27-35">         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> iast_defect(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, yv_, zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>zfac2, nt_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nt_mode))</span>
<span id="cb27-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.trapezoid(s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2"</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yv_), yv_))</span>
<span id="cb27-37"></span>
<span id="cb27-38">PATH_GAUSS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_gauss(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ)</span>
<span id="cb27-39">t65, t129 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_trap(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_trap(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ)</span>
<span id="cb27-40">PATH_TRAP65, PATH_TRAP_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(t65), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(t65<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>t129))</span>
<span id="cb27-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pure-route Delta z = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DZ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (P = 1, y1: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>YA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>YB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb27-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mixture-route integral: Gauss-64 residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PATH_GAUSS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (below CI floor -- named in 7.9;"</span>)</span>
<span id="cb27-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                        trapezoid-65 residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PATH_TRAP65<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is the CI-active metric,"</span>)</span>
<span id="cb27-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                        observed order </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PATH_TRAP_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb27-45"></span>
<span id="cb27-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># breaks</span></span>
<span id="cb27-47">DZ_MM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast_defect(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([YB]), zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb27-48">         <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast_defect(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([YA]), zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb27-49">BRK_PATH_ARITH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_trap(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>, nt_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arith"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ)</span>
<span id="cb27-50">BRK_PATH_MISMATCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_trap(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4001</span>, zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ_MM)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ_MM)</span>
<span id="cb27-51">a65 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_trap(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span>, nt_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arith"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ)</span>
<span id="cb27-52">a129 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(path_rhs_trap(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">129</span>, nt_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arith"</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DZ)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DZ)</span>
<span id="cb27-53">BRK_PATH_ARITH_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.log2(a65<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>a129))</span>
<span id="cb27-54"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">breaks (both on 4001-node trapezoids, so quadrature error is negligible):"</span>)</span>
<span id="cb27-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n_t read as the ARITHMETIC mean of eq. (26)     -&gt; residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_PATH_ARITH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  spreading pressures mismatched by 1 % (eq. 40)  -&gt; residual </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_PATH_MISMATCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb27-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and the order under the arithmetic defect: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_PATH_ARITH_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb27-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(saturates -- refinement cannot fix a wrong identity)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pure-route Delta z = 1.6051451807   (P = 1, y1: 0.05 -&gt; 0.95)
mixture-route integral: Gauss-64 residual 4.15e-16 (below CI floor -- named in 7.9;
                        trapezoid-65 residual 8.776e-05 is the CI-active metric,
                        observed order 1.9999)

breaks (both on 4001-node trapezoids, so quadrature error is negligible):
  n_t read as the ARITHMETIC mean of eq. (26)     -&gt; residual 1.520e-02
  spreading pressures mismatched by 1 % (eq. 40)  -&gt; residual 1.597e-03
  and the order under the arithmetic defect: 0.006 (saturates -- refinement cannot fix a wrong identity)</code></pre>
</div>
</div>
</section>
<section id="the-closed-loop-the-papers-consistency-charge-quantified" class="level3">
<h3 class="anchored" data-anchor-id="the-closed-loop-the-papers-consistency-charge-quantified">7.6 The closed loop: the paper’s consistency charge, quantified</h3>
<p>The paper reports (p.&nbsp;125) that Bering and Serpenskii “noted that the Langmuir equation for mixture adsorption was not thermodynamically consistent”. Here is that sentence as a number. If a mixture model <img src="https://latex.codecogs.com/png.latex?n_i(P,%20y_1)"> respects the Gibbs adsorption isotherm, the one-form <img src="https://latex.codecogs.com/png.latex?n_t%5C,d%5Cln%20P%20+%20(n_1/y_1%20-%20n_2/y_2)%5C,dy_1"> is exact and its integral around any closed loop vanishes — <img src="https://latex.codecogs.com/png.latex?%5Cpi"> is a state function. Around the rectangle <img src="https://latex.codecogs.com/png.latex?P%20%5Cin%20%5B0.2,%201%5D">, <img src="https://latex.codecogs.com/png.latex?y_1%20%5Cin%20%5B0.2,%200.8%5D">:</p>
<ul>
<li><strong>IAST</strong> closes the loop to machine precision, as its construction from a single <img src="https://latex.codecogs.com/png.latex?%5Cpi"> guarantees <em>in exact arithmetic</em> — but not in code: the same loop with the two components’ spreading pressures mismatched by 1 % (a solver bug this test would catch) fails at <img src="https://latex.codecogs.com/png.latex?2%5Ctimes10%5E%7B-3%7D">.</li>
<li><strong>Extended Langmuir with unequal capacities does not close</strong>: the deficit is 12 % of the loop’s own spreading-pressure scale. Computed <strong>twice, by routes sharing no assembly</strong> — the boundary line integral of the model’s <img src="https://latex.codecogs.com/png.latex?n_i">, and the area integral of the curl that §2.1 derived symbolically (<img src="https://latex.codecogs.com/png.latex?(m_2%7B-%7Dm_1)%20b_1%20b_2%20P%5E2/D%5E2">) — agreeing to 2.7e-15. The curl’s closed form makes the deficit <strong>exactly linear in <img src="https://latex.codecogs.com/png.latex?m_2%20-%20m_1"></strong> (its denominator contains no <img src="https://latex.codecogs.com/png.latex?m">), and doubling <img src="https://latex.codecogs.com/png.latex?m_1%20-%20m_2"> doubles the measured loop deficit to machine precision, a third route to the same structure. At <img src="https://latex.codecogs.com/png.latex?m_2%20=%20m_1"> everything vanishes identically — the consistent case is exactly the case where extended Langmuir <em>is</em> an IAST (§2.1, §7.1).</li>
</ul>
<div id="5ffac8b8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.247662Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.247537Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.276661Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.275945Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb29-1">LOOP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(Pa<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, Pb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, ya<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, yb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb29-2"></span>
<span id="cb29-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> circulation(model, ngauss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>, skip_edge4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>loop):</span>
<span id="cb29-4">    Pa, Pb, ya, yb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> loop.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pa"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), loop.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pb"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>), loop.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ya"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>), loop.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yb"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb29-5">    xg, wg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> leggauss(ngauss)</span>
<span id="cb29-6">    lnv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(Pb) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(Pa))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(Pa) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.log(Pb))</span>
<span id="cb29-7">    yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(yb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ya)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(ya <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> yb)</span>
<span id="cb29-8">    tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb29-9">    n1_, n2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model(np.exp(lnv), np.full_like(lnv, ya))</span>
<span id="cb29-10">    tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(Pb) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(Pa))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(wg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(n1_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n2_))          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># bottom, -&gt;</span></span>
<span id="cb29-11">    n1_, n2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model(np.full_like(yv_, Pb), yv_)</span>
<span id="cb29-12">    tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(yb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ya)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(wg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(n1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yv_)))            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># right, ^</span></span>
<span id="cb29-13">    n1_, n2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model(np.exp(lnv), np.full_like(lnv, yb))</span>
<span id="cb29-14">    tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(Pb) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(Pa))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(wg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(n1_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n2_))          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># top, &lt;-</span></span>
<span id="cb29-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> skip_edge4:</span>
<span id="cb29-16">        n1_, n2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> model(np.full_like(yv_, Pa), yv_)</span>
<span id="cb29-17">        tot <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(yb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ya)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(wg<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(n1_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> yv_)))        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># left, v</span></span>
<span id="cb29-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(tot)</span>
<span id="cb29-19"></span>
<span id="cb29-20">model_iast_U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pt, yv_: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: (s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2"</span>]))(iast(Pt, yv_, pU1, pU2))</span>
<span id="cb29-21">model_extL_U <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pt, yv_: ext_langmuir(Pt, yv_, m1U, b1U, m2U, b2U)</span>
<span id="cb29-22"></span>
<span id="cb29-23">CIRC_IAST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> circulation(model_iast_U)</span>
<span id="cb29-24">CIRC_EXTL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> circulation(model_extL_U)</span>
<span id="cb29-25">Z_SCALE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](LOOP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pb"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pU1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](LOOP[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pa"</span>]))    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the loop's own z scale</span></span>
<span id="cb29-26">CIRC_REL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CIRC_EXTL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Z_SCALE</span>
<span id="cb29-27"></span>
<span id="cb29-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route 2: Green's theorem with the symbolically derived curl</span></span>
<span id="cb29-29">xg, wg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> leggauss(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>)</span>
<span id="cb29-30">lnv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb29-31">yv_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb29-32">LN, YV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.meshgrid(lnv, yv_)</span>
<span id="cb29-33">W2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.outer(wg, wg)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>)</span>
<span id="cb29-34">CIRC_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(W2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>curl_fn(LN, YV, m1U, b1U, m2U, b2U)))</span>
<span id="cb29-35">ROUTE_AGREE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CIRC_EXTL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CIRC_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb29-36"></span>
<span id="cb29-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># route 3: exact linearity in (m2 - m1)</span></span>
<span id="cb29-38">CIRC_DOUBLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> circulation(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pt, yv2: ext_langmuir(Pt, yv2, m1U, b1U, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, b2U))</span>
<span id="cb29-39">LINEARITY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> CIRC_DOUBLE<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CIRC_EXTL          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (0 - 1)/(0.5 - 1) = 2 exactly</span></span>
<span id="cb29-40">LINEARITY_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(LINEARITY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb29-41"></span>
<span id="cb29-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"loop deficit, IAST:               </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CIRC_IAST)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   (closes; below CI floor, named in 7.9)"</span>)</span>
<span id="cb29-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"loop deficit, extended Langmuir:  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CIRC_EXTL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  =  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>CIRC_REL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the "</span></span>
<span id="cb29-44">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"loop's z-scale </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>Z_SCALE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-45"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"same deficit via the symbolic curl (Green route): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>CIRC_GREEN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb29-46">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"routes agree to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ROUTE_AGREE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"doubling m1 - m2 multiplies the deficit by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LINEARITY<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.15f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (exactly 2 in exact arithmetic)"</span>)</span>
<span id="cb29-48"></span>
<span id="cb29-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># breaks</span></span>
<span id="cb29-50">model_mismatch <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pt, yv2: (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s: (s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n1"</span>], s[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n2"</span>]))(iast_defect(Pt, yv2, zfac2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.01</span>))</span>
<span id="cb29-51">BRK_CIRC_MISMATCH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(circulation(model_mismatch))</span>
<span id="cb29-52">BRK_CIRC_EQUALM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(circulation(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pt, yv2: ext_langmuir(Pt, yv2, m1U, b1U, m1U, b2U)))</span>
<span id="cb29-53">BRK_ROUTE_G2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(circulation(model_extL_U, ngauss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>CIRC_GREEN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb29-54">BRK_LIN_EDGE4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(circulation(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pt, yv2: ext_langmuir(Pt, yv2, m1U, b1U, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, b2U),</span>
<span id="cb29-55">                                skip_edge4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb29-56">                    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> circulation(model_extL_U, skip_edge4<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb29-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">breaks: 1 % spreading-pressure mismatch injected into IAST -&gt; loop deficit "</span></span>
<span id="cb29-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_CIRC_MISMATCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        m2 -&gt; m1 in extended Langmuir -&gt; deficit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_CIRC_EQUALM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (collapses)"</span>)</span>
<span id="cb29-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        line-integral route on 2-point Gauss -&gt; route agreement degrades to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_ROUTE_G2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb29-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"        edge 4 of the loop dropped -&gt; linearity factor off by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_LIN_EDGE4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>loop deficit, IAST:               7.77e-16   (closes; below CI floor, named in 7.9)
loop deficit, extended Langmuir:  -0.154834  =  -11.92 % of the loop's z-scale 1.299283
same deficit via the symbolic curl (Green route): -0.154834   routes agree to 2.66e-15
doubling m1 - m2 multiplies the deficit by 2.000000000000002  (exactly 2 in exact arithmetic)

breaks: 1 % spreading-pressure mismatch injected into IAST -&gt; loop deficit 1.97e-03
        m2 -&gt; m1 in extended Langmuir -&gt; deficit 5.00e-16 (collapses)
        line-integral route on 2-point Gauss -&gt; route agreement degrades to 6.10e-03
        edge 4 of the loop dropped -&gt; linearity factor off by 1.289</code></pre>
</div>
</div>
</section>
<section id="the-lever-rules-numerically-their-symbolic-proof-is-2.1" class="level3">
<h3 class="anchored" data-anchor-id="the-lever-rules-numerically-their-symbolic-proof-is-2.1">7.7 The lever rules, numerically (their symbolic proof is §2.1)</h3>
<p>An identity in exact arithmetic — the numeric check is kept because it is what §6.2’s drawing rests on, and because its <em>break</em> (chords swapped, the plausible mis-drawing of Fig. 1) moves the answer by order one.</p>
<div id="59188962" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.278366Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.278193Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.281239Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.280614Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb31-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"lever rules vs eqs. (22)/(29): max deviation </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEVER_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb31-2">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(identically zero here; below CI floor, named in 7.9)"</span>)</span>
<span id="cb31-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break -- chords OB and OC swapped: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEVER_SWAPPED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>lever rules vs eqs. (22)/(29): max deviation 1.11e-16 (identically zero here; below CI floor, named in 7.9)
break -- chords OB and OC swapped: 0.5844</code></pre>
</div>
</div>
</section>
<section id="the-shape-translation-result-when-iast-selectivity-cannot-vary" class="level3">
<h3 class="anchored" data-anchor-id="the-shape-translation-result-when-iast-selectivity-cannot-vary">7.8 The shape-translation result: when IAST selectivity cannot vary</h3>
<p><strong>Claim (this page’s, not the paper’s):</strong> if the two pure isotherms are the same curve shifted in <img src="https://latex.codecogs.com/png.latex?%5Clog%20P"> — <img src="https://latex.codecogs.com/png.latex?n_2%5E%7B%5Ccirc%7D(P)%20=%20n_1%5E%7B%5Ccirc%7D(%5Ckappa%20P)"> — then eq. (19) gives <img src="https://latex.codecogs.com/png.latex?%5Cpi_2(P%5E%7B%5Ccirc%7D)%20=%20%5Cpi_1(%5Ckappa%20P%5E%7B%5Ccirc%7D)">, the match (40) forces <img src="https://latex.codecogs.com/png.latex?P_1%5E%7B%5Ccirc%7D%20=%20%5Ckappa%20P_2%5E%7B%5Ccirc%7D">, and the selectivity (28) is <strong>exactly</strong> <img src="https://latex.codecogs.com/png.latex?1/%5Ckappa">, independent of <img src="https://latex.codecogs.com/png.latex?P"> and composition. The Henry-limit constancy of eqs. (30)–(35) is the linear special case (any two lines are shape-identical, <img src="https://latex.codecogs.com/png.latex?%5Ckappa%20=%20K_2/K_1">); §6.3’s pair L is the equal-capacity Langmuir case (<img src="https://latex.codecogs.com/png.latex?%5Ckappa%20=%20b_2/b_1">). Searched for in the paper and not found there: the Fig. 10 discussion (pp.&nbsp;125–126) treats the composition dependence as a prediction to compare with data, and the conclusions do not connect selectivity constancy to isotherm shape; the closest printed statement is the Henry-limit special case itself. Verified here on pair S — dual-site isotherms the closed forms of §7.1 never see, inverted numerically — and broken by perturbing one site’s affinity so the shapes genuinely differ.</p>
<div id="fa686ba4" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.282819Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.282702Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.372009Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.371284Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb33-1">Pg2, yg2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.meshgrid(np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>), np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>))</span>
<span id="cb33-2">sS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(Pg2.ravel(), yg2.ravel(), pS1, pS2)</span>
<span id="cb33-3">selS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>]</span>
<span id="cb33-4">SHAPE_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.ptp(selS)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.mean(selS))</span>
<span id="cb33-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pair S (same shape, kappa = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KAPPA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): selectivity mean </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean(selS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb33-6">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"vs 1/kappa = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>KAPPA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-7"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  relative spread over 144 states spanning 100x in P: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHAPE_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb33-8">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(below CI floor, named in 7.9)"</span>)</span>
<span id="cb33-9"></span>
<span id="cb33-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># break: perturb ONE site of component 2 by 5 % -- shapes now differ</span></span>
<span id="cb33-11">pS2_pert <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dualsite_pure(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>, KAPPA)</span>
<span id="cb33-12">sSp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> iast(Pg2.ravel(), yg2.ravel(), pS1, pS2_pert)</span>
<span id="cb33-13">SHAPE_PERT_SPREAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.ptp(sSp[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>np.mean(sSp[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>]))</span>
<span id="cb33-14"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break -- one site's b perturbed 5 %: spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SHAPE_PERT_SPREAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb33-15">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(the constancy is the shape identity, not the solver)"</span>)</span>
<span id="cb33-16"></span>
<span id="cb33-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dilution-limit second route for 6.3's closed forms: solver at y1 = 1e-8</span></span>
<span id="cb33-18">S_DIL1_SOLVER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb33-19">DIL1_ROUTE_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S_DIL1_SOLVER<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_DIL1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb33-20">BRK_DIL1_Y01 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>]), pU1, pU2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>S_DIL1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb33-21"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">6.3's dilute-in-1 closed form checked by the solver at y1 = 1e-8: "</span></span>
<span id="cb33-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"rel dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DIL1_ROUTE_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-23"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"break -- read at y1 = 0.1 instead of the limit: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_DIL1_Y01<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb33-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and the ratio's break: equal-shape pair has ratio exactly 1</span></span>
<span id="cb33-25">S_DIL_RATIO_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((pL2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](pL1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>pL1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pinv"</span>](pL2[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"z"</span>](<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))))</span>
<span id="cb33-26"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"composition-dependence factor, pair U: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_DIL_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">;  pair L (equal shape): "</span></span>
<span id="cb33-27">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S_DIL_RATIO_L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (collapses to 1)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>pair S (same shape, kappa = 0.25): selectivity mean 4.000000000000 vs 1/kappa = 4.0
  relative spread over 144 states spanning 100x in P: 4.65e-14 (below CI floor, named in 7.9)
break -- one site's b perturbed 5 %: spread 1.067e-02 (the constancy is the shape identity, not the solver)

6.3's dilute-in-1 closed form checked by the solver at y1 = 1e-8: rel dev 2.68e-08
break -- read at y1 = 0.1 instead of the limit: 0.286
composition-dependence factor, pair U: 4.392305;  pair L (equal shape): 1.000000 (collapses to 1)</code></pre>
</div>
</div>
</section>
<section id="the-defect-injection-table-and-the-coverage-map-that-builds-itself" class="level3">
<h3 class="anchored" data-anchor-id="the-defect-injection-table-and-the-coverage-map-that-builds-itself">7.9 The defect-injection table, and the coverage map that builds itself</h3>
<p>Every metric reported to <code>agreement.json</code> must have a row here that moves it, or be named below with its reason and an above-floor companion. The coverage map is <strong>assembled from the table itself</strong> (a metric cannot claim a row that is not in the table), and the assert fails the notebook on any mismatch in either direction.</p>
<div id="fb4a8e94" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.373640Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.373519Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.384417Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.383851Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb35-1">BREAKS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb35-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metric, defect injected, baseline, broken value</span></span>
<span id="cb35-3">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal_m_closed_form_max_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2 = 0.6 (capacities made unequal)"</span>, EQM_DEV, BRK_EQM_M2),</span>
<span id="cb35-4">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal_m_closed_form_max_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"b1 wrong by 1 %"</span>, EQM_DEV, BRK_EQM_B1),</span>
<span id="cb35-5">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal_m_closed_form_max_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Newton tol loosened to 1e-3"</span>, EQM_DEV, BRK_EQM_TOL),</span>
<span id="cb35-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unequal_m_nt_dev_windowsup"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2 -&gt; m1 (models coincide again)"</span>, NT_DEV_SUP, BRK_NT_EQUALM),</span>
<span id="cb35-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unequal_m_n1_dilute_limit_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2 -&gt; m1, closed form"</span>, N1_DILUTE_DEV, BRK_N1_EQUALM),</span>
<span id="cb35-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_model_solver_max_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spreading-pressure matching skipped (x_i = y_i)"</span>,</span>
<span id="cb35-9">     HENRY_EXACT, BRK_HENRY_NOMATCH),</span>
<span id="cb35-10">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_selectivity_dev_P1em8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read at P = 0.1 instead of the limit"</span>, HENRY_DEV, BRK_HENRY_P01),</span>
<span id="cb35-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_selectivity_dev_P1em8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Henry constant taken as b (capacity forgotten)"</span>,</span>
<span id="cb35-12">     HENRY_DEV, BRK_HENRY_WRONGK),</span>
<span id="cb35-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_convergence_order"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"order measured against that wrong limit"</span>, HENRY_ORDER, BRK_HENRY_ORDER),</span>
<span id="cb35-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pi_quadrature_rel_err_257"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"linear grid instead of logarithmic"</span>, QUAD_ERR, BRK_QUAD_LIN),</span>
<span id="cb35-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pi_quadrature_rel_err_257"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Henry anchor dropped (t0 = 1e-3)"</span>, QUAD_ERR, BRK_QUAD_NOANCHOR),</span>
<span id="cb35-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pi_quadrature_observed_order"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Henry anchor dropped: order collapses"</span>,</span>
<span id="cb35-17">     QUAD_ORDER, BRK_QUAD_NOANCHOR_ORDER),</span>
<span id="cb35-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_trap65_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n_t read as the arithmetic mean of eq. (26)"</span>,</span>
<span id="cb35-19">     PATH_TRAP65, BRK_PATH_ARITH),</span>
<span id="cb35-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_trap65_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spreading pressures mismatched by 1 % (eq. 40)"</span>,</span>
<span id="cb35-21">     PATH_TRAP65, BRK_PATH_MISMATCH),</span>
<span id="cb35-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_trap_order"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arithmetic-mean defect: order saturates"</span>,</span>
<span id="cb35-23">     PATH_TRAP_ORDER, BRK_PATH_ARITH_ORDER),</span>
<span id="cb35-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_gauss64_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"arithmetic-mean defect (same rows as trap-65)"</span>,</span>
<span id="cb35-25">     PATH_GAUSS, BRK_PATH_ARITH),</span>
<span id="cb35-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_iast_abs"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% s</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">preading-pressure mismatch injected"</span>,</span>
<span id="cb35-27">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CIRC_IAST), BRK_CIRC_MISMATCH),</span>
<span id="cb35-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_ext_langmuir"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2 -&gt; m1: deficit collapses"</span>, CIRC_EXTL, BRK_CIRC_EQUALM),</span>
<span id="cb35-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_ext_langmuir"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"m2 -&gt; 0: deficit exactly doubles"</span>, CIRC_EXTL, CIRC_DOUBLE),</span>
<span id="cb35-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_over_scale"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"same two rows (derived metric: deficit / z-scale)"</span>,</span>
<span id="cb35-31">     CIRC_REL, BRK_CIRC_EQUALM<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>Z_SCALE),</span>
<span id="cb35-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circulation_route_rel_agreement"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"line-integral route degraded to 2-point Gauss"</span>,</span>
<span id="cb35-33">     ROUTE_AGREE, BRK_ROUTE_G2),</span>
<span id="cb35-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circulation_linearity_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"edge 4 of the loop dropped"</span>, LINEARITY_DEV, BRK_LIN_EDGE4),</span>
<span id="cb35-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lever_rule_max_dev"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chords OB and OC swapped"</span>, LEVER_DEV, LEVER_SWAPPED),</span>
<span id="cb35-36">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape_translation_selectivity_rel_spread"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one site's affinity perturbed 5 %"</span>,</span>
<span id="cb35-37">     SHAPE_SPREAD, SHAPE_PERT_SPREAD),</span>
<span id="cb35-38">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape_perturbed_selectivity_rel_spread"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"perturbation removed (collapses back)"</span>,</span>
<span id="cb35-39">     SHAPE_PERT_SPREAD, SHAPE_SPREAD),</span>
<span id="cb35-40">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"selectivity_dilute_ratio_P1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal-shape pair: factor collapses to 1"</span>,</span>
<span id="cb35-41">     S_DIL_RATIO, S_DIL_RATIO_L),</span>
<span id="cb35-42">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"selectivity_dilute1_solver_vs_closed_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"read at y1 = 0.1 instead of the limit"</span>,</span>
<span id="cb35-43">     DIL1_ROUTE_DEV, BRK_DIL1_Y01),</span>
<span id="cb35-44">]</span>
<span id="cb35-45">bt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAKS, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect injected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"broken"</span>])</span>
<span id="cb35-46"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">with</span> pd.option_context(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.float_format"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> v: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>):</span>
<span id="cb35-47">    display(bt)</span>
<span id="cb35-48"></span>
<span id="cb35-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- structural / below-floor declarations, each with its companion --------</span></span>
<span id="cb35-50">STRUCTURAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb35-51">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_zero_identity_count"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a count of sympy identities; it verifies algebra, not numerics, "</span></span>
<span id="cb35-52">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and no runtime defect can move it -- cited as evidence for nothing numerical"</span>,</span>
<span id="cb35-53">}</span>
<span id="cb35-54">BELOW_FLOOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># metric -&gt; its above-floor companion (all companions are CI-active or in BREAKS)</span></span>
<span id="cb35-55">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal_m_closed_form_max_rel"</span>:</span>
<span id="cb35-56">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"its three break rows (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_EQM_M2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_EQM_B1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_EQM_TOL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb35-57">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_model_solver_max_rel"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the no-matching break (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_HENRY_NOMATCH<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb35-58">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_gauss64_rel"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_trap65_rel (CI-active) and the arithmetic-mean break"</span>,</span>
<span id="cb35-59">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_iast_abs"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_ext_langmuir (CI-active) and the mismatch break"</span>,</span>
<span id="cb35-60">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circulation_route_rel_agreement"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the 2-point-Gauss break (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_ROUTE_G2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb35-61">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circulation_linearity_dev"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the dropped-edge break (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>BRK_LIN_EDGE4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>,</span>
<span id="cb35-62">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lever_rule_max_dev"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the swapped-chords break (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>LEVER_SWAPPED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) and the symbolic proof in 2.1"</span>,</span>
<span id="cb35-63">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape_translation_selectivity_rel_spread"</span>: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape_perturbed_selectivity_rel_spread (CI-active)"</span>,</span>
<span id="cb35-64">}</span>
<span id="cb35-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Below the CI comparison floor (1e-12) while healthy -- protected by their companions, "</span></span>
<span id="cb35-66">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"not by CI:"</span>)</span>
<span id="cb35-67"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> BELOW_FLOOR.items():</span>
<span id="cb35-68">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: companion = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb35-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Structural (no break row can exist):"</span>)</span>
<span id="cb35-70"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> STRUCTURAL.items():</span>
<span id="cb35-71">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">metric</th>
<th data-quarto-table-cell-role="th">defect injected</th>
<th data-quarto-table-cell-role="th">baseline</th>
<th data-quarto-table-cell-role="th">broken</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>equal_m_closed_form_max_rel</td>
<td>m2 = 0.6 (capacities made unequal)</td>
<td>7.635e-16</td>
<td>4.240e-01</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>equal_m_closed_form_max_rel</td>
<td>b1 wrong by 1 %</td>
<td>7.635e-16</td>
<td>9.081e-03</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>equal_m_closed_form_max_rel</td>
<td>Newton tol loosened to 1e-3</td>
<td>7.635e-16</td>
<td>2.441e-10</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>unequal_m_nt_dev_windowsup</td>
<td>m2 -&gt; m1 (models coincide again)</td>
<td>2.151e-01</td>
<td>6.517e-16</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>unequal_m_n1_dilute_limit_dev</td>
<td>m2 -&gt; m1, closed form</td>
<td>6.417e-01</td>
<td>0.000e+00</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>henry_model_solver_max_rel</td>
<td>spreading-pressure matching skipped (x_i = y_i)</td>
<td>2.174e-16</td>
<td>7.574e-01</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>henry_selectivity_dev_P1em8</td>
<td>read at P = 0.1 instead of the limit</td>
<td>2.750e-08</td>
<td>2.697e-01</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">7</th>
<td>henry_selectivity_dev_P1em8</td>
<td>Henry constant taken as b (capacity forgotten)</td>
<td>2.750e-08</td>
<td>5.000e-01</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">8</th>
<td>henry_convergence_order</td>
<td>order measured against that wrong limit</td>
<td>1.000e+00</td>
<td>2.150e-07</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">9</th>
<td>pi_quadrature_rel_err_257</td>
<td>linear grid instead of logarithmic</td>
<td>1.487e-05</td>
<td>5.254e-05</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">10</th>
<td>pi_quadrature_rel_err_257</td>
<td>Henry anchor dropped (t0 = 1e-3)</td>
<td>1.487e-05</td>
<td>4.148e-03</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">11</th>
<td>pi_quadrature_observed_order</td>
<td>Henry anchor dropped: order collapses</td>
<td>2.000e+00</td>
<td>-4.807e-04</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">12</th>
<td>gibbs_path_trap65_rel</td>
<td>n_t read as the arithmetic mean of eq. (26)</td>
<td>8.776e-05</td>
<td>1.520e-02</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">13</th>
<td>gibbs_path_trap65_rel</td>
<td>spreading pressures mismatched by 1 % (eq. 40)</td>
<td>8.776e-05</td>
<td>1.597e-03</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">14</th>
<td>gibbs_path_trap_order</td>
<td>arithmetic-mean defect: order saturates</td>
<td>2.000e+00</td>
<td>5.743e-03</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">15</th>
<td>gibbs_path_gauss64_rel</td>
<td>arithmetic-mean defect (same rows as trap-65)</td>
<td>4.150e-16</td>
<td>1.520e-02</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">16</th>
<td>loop_circulation_iast_abs</td>
<td>1 % spreading-pressure mismatch injected</td>
<td>7.772e-16</td>
<td>1.969e-03</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">17</th>
<td>loop_circulation_ext_langmuir</td>
<td>m2 -&gt; m1: deficit collapses</td>
<td>-1.548e-01</td>
<td>4.996e-16</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">18</th>
<td>loop_circulation_ext_langmuir</td>
<td>m2 -&gt; 0: deficit exactly doubles</td>
<td>-1.548e-01</td>
<td>-3.097e-01</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">19</th>
<td>loop_circulation_over_scale</td>
<td>same two rows (derived metric: deficit / z-scale)</td>
<td>-1.192e-01</td>
<td>3.845e-16</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">20</th>
<td>circulation_route_rel_agreement</td>
<td>line-integral route degraded to 2-point Gauss</td>
<td>2.665e-15</td>
<td>6.097e-03</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">21</th>
<td>circulation_linearity_dev</td>
<td>edge 4 of the loop dropped</td>
<td>2.220e-15</td>
<td>1.289e+00</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">22</th>
<td>lever_rule_max_dev</td>
<td>chords OB and OC swapped</td>
<td>1.110e-16</td>
<td>5.844e-01</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">23</th>
<td>shape_translation_selectivity_rel_spread</td>
<td>one site's affinity perturbed 5 %</td>
<td>4.652e-14</td>
<td>1.067e-02</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">24</th>
<td>shape_perturbed_selectivity_rel_spread</td>
<td>perturbation removed (collapses back)</td>
<td>1.067e-02</td>
<td>4.652e-14</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">25</th>
<td>selectivity_dilute_ratio_P1</td>
<td>equal-shape pair: factor collapses to 1</td>
<td>4.392e+00</td>
<td>1.000e+00</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">26</th>
<td>selectivity_dilute1_solver_vs_closed_rel</td>
<td>read at y1 = 0.1 instead of the limit</td>
<td>2.675e-08</td>
<td>2.857e-01</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Below the CI comparison floor (1e-12) while healthy -- protected by their companions, not by CI:
  equal_m_closed_form_max_rel: companion = its three break rows (0.42, 9.1e-03, 2.4e-10)
  henry_model_solver_max_rel: companion = the no-matching break (0.76)
  gibbs_path_gauss64_rel: companion = gibbs_path_trap65_rel (CI-active) and the arithmetic-mean break
  loop_circulation_iast_abs: companion = loop_circulation_ext_langmuir (CI-active) and the mismatch break
  circulation_route_rel_agreement: companion = the 2-point-Gauss break (6.1e-03)
  circulation_linearity_dev: companion = the dropped-edge break (1.29)
  lever_rule_max_dev: companion = the swapped-chords break (0.58) and the symbolic proof in 2.1
  shape_translation_selectivity_rel_spread: companion = shape_perturbed_selectivity_rel_spread (CI-active)
Structural (no break row can exist):
  sym_zero_identity_count: a count of sympy identities; it verifies algebra, not numerics, and no runtime defect can move it -- cited as evidence for nothing numerical</code></pre>
</div>
</div>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p>Nothing to the theory, and the page says so plainly: IAST is algebra plus one scalar root-find per state, and most of this notebook would run with pymrm uninstalled — exactly as on <code>J1.1</code>, <code>J1.3</code> and <code>A1.6</code>. What <code>newton</code> and <code>NumJac</code> do here is narrow and real:</p>
<ol type="1">
<li><strong>The whole <img src="https://latex.codecogs.com/png.latex?(P,%20y_1)"> grid as one Newton problem.</strong> The spreading-pressure match is solved for hundreds of states simultaneously with <code>NumJac((K, 1))</code> — independent scalars, a diagonal Jacobian by construction. The shape is <code>(K, 1)</code> and never <code>(K,)</code>: the bare 1-D shape would couple every state to every other and build a dense <img src="https://latex.codecogs.com/png.latex?K%20%5Ctimes%20K"> Jacobian for no change in the answer (the house rule, measured on <code>B1.1</code>). The iteration runs in <img src="https://latex.codecogs.com/png.latex?%5Cln%20z">, which is what keeps Newton on the feasible side of <img src="https://latex.codecogs.com/png.latex?P%5E%7B%5Ccirc%7D(0)%20=%200">.</li>
<li><strong>The general-isotherm inverse.</strong> For pair S the pure isotherms have no analytic inverse; <img src="https://latex.codecogs.com/png.latex?P%5E%7B%5Ccirc%7D(z)"> is itself a vectorised <code>newton</code> solve nested inside the IAST solve. That is the machinery a user with tabulated isotherms (eq. 43) actually needs.</li>
<li><strong>Root-finds and closed forms where a sweep would have been wrong.</strong> The §7.2 supremum is root-found (the grid read is 0.7 % low — printed), the dilution limits are closed forms rather than end-of-grid reads, and the quadrature and path integrals carry observed orders, not single numbers.</li>
</ol>
<p>The one thing on this page that is genuinely useful beyond reproduction is not pymrm at all: the <strong>closed-loop consistency test of §7.6</strong> (with its symbolically derived curl) as a portable diagnostic. It applies to <em>any</em> proposed mixture-adsorption model <img src="https://latex.codecogs.com/png.latex?n_i(P,%20y)">, needs no IAST solve, and returns a single number that is zero iff the model carries a consistent spreading pressure. The extended-Langmuir deficit — 12 % of scale on an ordinary parameter set — is what it reports on the most widely used shortcut model in the field, and the <img src="https://latex.codecogs.com/png.latex?m_2%20=%20m_1"> collapse identifies <em>why</em> the shortcut is safe exactly when capacities match.</p>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>Use this page for</strong> a working, tested IAST solver (<code>iast</code> + <code>langmuir_pure</code>/<code>dualsite_pure</code>/<code>henry_pure</code>), the consistency-loop diagnostic (<code>circulation</code>), and the reference solutions in <code>data/iast-illustrative-reference.csv</code> for regression-testing your own implementation (parameters in the file header; equal-capacity pair L also has the closed form to check against).</p>
<p><strong>Four things to carry away:</strong></p>
<ol type="1">
<li><strong>Extended Langmuir is safe exactly when capacities match.</strong> Then it <em>is</em> the ideal adsorbed solution (§2.1, symbolically). With unequal capacities it is thermodynamically inconsistent — a 12 %-of-scale loop deficit on an unremarkable parameter set (§7.6) and a 21.5 % total-amount error against IAST at the illustrative window’s edge (§7.2) — and the dilute component is where it is worst (64 % there). If you must use it, check the capacity ratio first.</li>
<li><strong>Eq. (26) is a harmonic mix.</strong> The arithmetic reading is the natural slip and it <em>fails the Gibbs isotherm</em> by 1.5 % on this page’s mild example (§7.5) — a thermodynamic error, not a numerical one, so no grid refinement will ever surface it (§7.5’s order break shows the residual saturating).</li>
<li><strong>The low-pressure tail of the pure isotherms is load-bearing.</strong> The paper’s own conclusions say so; §7.4 quantifies it — dropping the Henry anchor at <img src="https://latex.codecogs.com/png.latex?t_0%20=%2010%5E%7B-3%7D"> costs 4e-3 in <img src="https://latex.codecogs.com/png.latex?z"> <em>and</em> kills the convergence order, so refinement looks converged while being wrong. Measure the Henry constant, or extrapolate to it explicitly, before integrating eq. (19).</li>
<li><strong>Composition-dependent selectivity is a shape signal.</strong> Under IAST, isotherms differing only by a <img src="https://latex.codecogs.com/png.latex?%5Clog%20P"> shift give exactly constant <img src="https://latex.codecogs.com/png.latex?s_%7B1,2%7D"> (§7.8). If your IAST calculation shows strong composition dependence, your two pure isotherms differ in shape — and if your <em>data</em> show it where the fitted pure isotherms do not, IAST with those fits cannot represent the system, whatever the parameters.</li>
</ol>
<p><strong>Do not use this page as evidence that IAST works.</strong> It contains no experimental comparison — the paper’s four validation systems are figures of external data, out of scope here — and every agreement on it is structural. The empirical literature on IAST is enormous; this page is about what the 1965 paper actually established on its own printed content. <strong>Do not use it for dynamics</strong> — breakthrough is <code>J1.5</code>, and this page’s <code>iast</code> can serve as that page’s mixture-equilibrium closure. <strong>Do not read pairs L, U, S as any physical system</strong>; they are illustrative parameter sets and nothing more.</p>
<div id="5d04e13d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.386662Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.386540Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.393225Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.392506Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb37-1">metrics <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {</span>
<span id="cb37-2">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sym_zero_identity_count"</span>: SYM_ZERO_COUNT,</span>
<span id="cb37-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"equal_m_closed_form_max_rel"</span>: EQM_DEV,</span>
<span id="cb37-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unequal_m_nt_dev_windowsup"</span>: NT_DEV_SUP,</span>
<span id="cb37-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unequal_m_n1_dilute_limit_dev"</span>: N1_DILUTE_DEV,</span>
<span id="cb37-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_model_solver_max_rel"</span>: HENRY_EXACT,</span>
<span id="cb37-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_selectivity_dev_P1em8"</span>: HENRY_DEV,</span>
<span id="cb37-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"henry_convergence_order"</span>: HENRY_ORDER,</span>
<span id="cb37-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pi_quadrature_rel_err_257"</span>: QUAD_ERR,</span>
<span id="cb37-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pi_quadrature_observed_order"</span>: QUAD_ORDER,</span>
<span id="cb37-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_trap65_rel"</span>: PATH_TRAP65,</span>
<span id="cb37-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_trap_order"</span>: PATH_TRAP_ORDER,</span>
<span id="cb37-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gibbs_path_gauss64_rel"</span>: PATH_GAUSS,</span>
<span id="cb37-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_iast_abs"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CIRC_IAST),</span>
<span id="cb37-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_ext_langmuir"</span>: CIRC_EXTL,</span>
<span id="cb37-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"loop_circulation_over_scale"</span>: CIRC_REL,</span>
<span id="cb37-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circulation_route_rel_agreement"</span>: ROUTE_AGREE,</span>
<span id="cb37-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"circulation_linearity_dev"</span>: LINEARITY_DEV,</span>
<span id="cb37-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lever_rule_max_dev"</span>: LEVER_DEV,</span>
<span id="cb37-20">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape_translation_selectivity_rel_spread"</span>: SHAPE_SPREAD,</span>
<span id="cb37-21">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shape_perturbed_selectivity_rel_spread"</span>: SHAPE_PERT_SPREAD,</span>
<span id="cb37-22">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"selectivity_dilute_ratio_P1"</span>: S_DIL_RATIO,</span>
<span id="cb37-23">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"selectivity_dilute1_solver_vs_closed_rel"</span>: DIL1_ROUTE_DEV,</span>
<span id="cb37-24">}</span>
<span id="cb37-25"></span>
<span id="cb37-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the coverage map builds itself from the break table -------------------</span></span>
<span id="cb37-27">covered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(bt[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>])</span>
<span id="cb37-28">declared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> covered <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(STRUCTURAL)</span>
<span id="cb37-29"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(metrics) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> declared, (</span>
<span id="cb37-30">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"coverage mismatch: unclaimed=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(metrics)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>declared<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, phantom=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>declared<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-31">moved <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bt[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bt.broken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bt.baseline) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb37-32"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(moved[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> covered, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a break row failed to move its metric"</span></span>
<span id="cb37-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"coverage: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> metrics = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(covered)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with moving break rows "</span></span>
<span id="cb37-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"+ </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(STRUCTURAL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> structural.  Assert passed in both directions.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb37-35"></span>
<span id="cb37-36">report_agreement(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"J1.4"</span>, metrics)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>coverage: 22 metrics = 21 with moving break rows + 1 structural.  Assert passed in both directions.

Agreement metrics for J1.4:
  sym_zero_identity_count                  = 11
  equal_m_closed_form_max_rel              = 7.6355e-16
  unequal_m_nt_dev_windowsup               = 0.21508
  unequal_m_n1_dilute_limit_dev            = 0.64174
  henry_model_solver_max_rel               = 2.1743e-16
  henry_selectivity_dev_P1em8              = 2.75e-08
  henry_convergence_order                  = 1
  pi_quadrature_rel_err_257                = 1.487e-05
  pi_quadrature_observed_order             = 2
  gibbs_path_trap65_rel                    = 8.776e-05
  gibbs_path_trap_order                    = 1.9999
  gibbs_path_gauss64_rel                   = 4.15e-16
  loop_circulation_iast_abs                = 7.7716e-16
  loop_circulation_ext_langmuir            = -0.15483
  loop_circulation_over_scale              = -0.11917
  circulation_route_rel_agreement          = 2.6645e-15
  circulation_linearity_dev                = 2.2204e-15
  lever_rule_max_dev                       = 1.1102e-16
  shape_translation_selectivity_rel_spread = 4.6518e-14
  shape_perturbed_selectivity_rel_spread   = 0.010665
  selectivity_dilute_ratio_P1              = 4.3923
  selectivity_dilute1_solver_vs_closed_rel = 2.6754e-08</code></pre>
</div>
<div class="cell-output cell-output-display" data-execution_count="21">
<pre><code>{'page': 'J1.4',
 'metrics': {'sym_zero_identity_count': 11.0,
  'equal_m_closed_form_max_rel': 7.635453975501703e-16,
  'unequal_m_nt_dev_windowsup': 0.21507876398405296,
  'unequal_m_n1_dilute_limit_dev': 0.6417424305044159,
  'henry_model_solver_max_rel': 2.174349832795058e-16,
  'henry_selectivity_dev_P1em8': 2.7500014487813473e-08,
  'henry_convergence_order': 0.9999997499762475,
  'pi_quadrature_rel_err_257': 1.4870143879130993e-05,
  'pi_quadrature_observed_order': 1.9999529168647325,
  'gibbs_path_trap65_rel': 8.775985910945557e-05,
  'gibbs_path_trap_order': 1.9999495810931398,
  'gibbs_path_gauss64_rel': 4.1499910585415586e-16,
  'loop_circulation_iast_abs': 7.771561172376096e-16,
  'loop_circulation_ext_langmuir': -0.15483360141013042,
  'loop_circulation_over_scale': -0.11916849778016288,
  'circulation_route_rel_agreement': 2.6645352591003757e-15,
  'circulation_linearity_dev': 2.220446049250313e-15,
  'lever_rule_max_dev': 1.1102230246251565e-16,
  'shape_translation_selectivity_rel_spread': 4.651834473179406e-14,
  'shape_perturbed_selectivity_rel_spread': 0.010665083545773094,
  'selectivity_dilute_ratio_P1': 4.392304845413265,
  'selectivity_dilute1_solver_vs_closed_rel': 2.675426480358567e-08}}</code></pre>
</div>
</div>
<div id="ab675577" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-08-08T00:26:45.394763Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-08-08T00:26:45.394639Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-08-08T00:26:45.403638Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-08-08T00:26:45.403103Z&quot;}}" data-execution_count="22">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb40-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every number quoted in this page's MARKDOWN is re-derived here and compared</span></span>
<span id="cb40-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># against the live computation; any mismatch raises and fails the notebook.</span></span>
<span id="cb40-3"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> close(a, b, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>, atol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>):</span>
<span id="cb40-4">    ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> atol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b)</span>
<span id="cb40-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> ok:</span>
<span id="cb40-6">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">AssertionError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prose drift: typed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> vs computed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>b<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!r}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb40-7">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span></span>
<span id="cb40-8"></span>
<span id="cb40-9">AUDIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb40-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (typed in prose, computed live, rtol; rtol 0 means exact)</span></span>
<span id="cb40-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.6e-16 solver vs closed form (title, 7.1)"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.6e-16</span>, EQM_DEV, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb40-12">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.7e-15 two routes (title, 7.6)"</span>,            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.7e-15</span>, ROUTE_AGREE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8e-2</span>),</span>
<span id="cb40-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.8e-16 IAST closes the loop (title, 7.6)"</span>,  <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.8e-16</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CIRC_IAST), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-1</span>),</span>
<span id="cb40-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"12 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% o</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">f scale (title, 7.6, Reuse)"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.12</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CIRC_REL), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-2</span>),</span>
<span id="cb40-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.7e-14 shape spread (title, 7.8)"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.7e-14</span>, SHAPE_SPREAD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-1</span>),</span>
<span id="cb40-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eleven identities (title, 2.1)"</span>,             <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, SYM_ZERO_COUNT, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb40-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3 DOF, eq. (18) (model, data)"</span>,              <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb40-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.6 volumes/year, ref. 5 (data)"</span>,            <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6</span>, REF5_VOL_RATE, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>),</span>
<span id="cb40-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13.660254 dilute-1 limit (6.3)"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.660254</span>, S_DIL1, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>),</span>
<span id="cb40-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"... equals 5(1+sqrt(3))"</span>,                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">13.660254</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>),</span>
<span id="cb40-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"60 dilute-2 limit (6.3)"</span>,                    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>, S_DIL2, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>),</span>
<span id="cb40-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pair L selectivity = 10 (6.3)"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>,</span>
<span id="cb40-23">     <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.nanmean(iast(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, yfine, pL1, pL2)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s12"</span>])), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>),</span>
<span id="cb40-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"21.5 % window sup (7.2, Reuse)"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.215079</span>, NT_DEV_SUP, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>),</span>
<span id="cb40-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y1* of the sup (7.2 print)"</span>,                 <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.099555</span>, NT_DEV_Y, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>),</span>
<span id="cb40-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.7 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% lo</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">w grid read (7.2, 8)"</span>,               <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.007</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> NT_DEV_GRID<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>NT_DEV_SUP, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb40-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"64 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% d</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">ilute closed form (7.2, Reuse)"</span>,       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.641742</span>, N1_DILUTE_DEV, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>),</span>
<span id="cb40-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.75e-8 Henry deviation (7.3)"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.75e-8</span>, HENRY_DEV, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>),</span>
<span id="cb40-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order in P (7.3)"</span>,                     <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, HENRY_ORDER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-3</span>),</span>
<span id="cb40-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.49e-5 quadrature error (7.4)"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.49e-5</span>, QUAD_ERR, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb40-31">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order (7.4)"</span>,                         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, QUAD_ORDER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-2</span>),</span>
<span id="cb40-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4e-3 anchor dropped (7.4, Reuse)"</span>,           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4e-3</span>, BRK_QUAD_NOANCHOR, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb40-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8.78e-5 path residual (7.5)"</span>,                <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.78e-5</span>, PATH_TRAP65, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-3</span>),</span>
<span id="cb40-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order (7.5)"</span>,                         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, PATH_TRAP_ORDER, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e-2</span>),</span>
<span id="cb40-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.5 % arithmetic mean (7.5, Reuse)"</span>,         <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.015</span>, BRK_PATH_ARITH, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb40-36">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.16 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% f</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">rom 1 % mismatch (7.5)"</span>,             <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6e-3</span>, BRK_PATH_MISMATCH, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb40-37">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2e-3-level loop failure (7.6)"</span>,              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-3</span>, BRK_CIRC_MISMATCH, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-2</span>),</span>
<span id="cb40-38">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact doubling (7.6)"</span>,                       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, LINEARITY, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>),</span>
<span id="cb40-39">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.1e-2 perturbed-shape spread (7.8)"</span>,        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0107</span>, SHAPE_PERT_SPREAD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-2</span>),</span>
<span id="cb40-40">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.392305 composition factor (6.3)"</span>,          <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.392305</span>, S_DIL_RATIO, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>),</span>
<span id="cb40-41">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"collapses to 1 (7.8)"</span>,                       <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, S_DIL_RATIO_L, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>),</span>
<span id="cb40-42">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"34 scalars transcribed (data)"</span>,              <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">34</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb40-43">]</span>
<span id="cb40-44"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> label, typed, computed, rt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> AUDIT:</span>
<span id="cb40-45">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> rt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb40-46">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> typed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> computed, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prose drift [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">]: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>typed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> != </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>computed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb40-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb40-48">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb40-49">            close(typed, computed, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rt)</span>
<span id="cb40-50">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">AssertionError</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> e:</span>
<span id="cb40-51">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">AssertionError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>) <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb40-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"prose audit: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(AUDIT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> numbers re-derived and matched. "</span></span>
<span id="cb40-53">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Any drift raises and fails the notebook."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>prose audit: 31 numbers re-derived and matched. Any drift raises and fails the notebook.</code></pre>
</div>
</div>
</section>
<section id="references" class="level2">
<h2 class="anchored" data-anchor-id="references">References</h2>
<p>Myers, A. L. and Prausnitz, J. M. (1965). Thermodynamics of mixed-gas adsorption. <em>AIChE Journal</em> <strong>11</strong>(1), 121–127. <a href="https://doi.org/10.1002/aic.690110125">doi:10.1002/aic.690110125</a> — <strong>the paper, and the only document read for content.</strong> Identity confirmed from its own first page on a native-resolution render: the title, the by-line “A. L. MYERS and J. M. PRAUSNITZ / University of California, Berkeley, California”, the footnote “A. L. Myers is at the University of Pennsylvania, Philadelphia, Pennsylvania”, the running feet “Vol. 11, No.&nbsp;1 / A.I.Ch.E. Journal / Page 121”, and the Wiley PDF margin naming the same DOI; the Wiley Subject metadata independently gives “AIChE Journal 1965.11:121-127”. Manuscript received April 24, 1964; revision received August 14, 1964; accepted August 19, 1964. <code>pdfimages -list</code> reports all seven pages as CCITT-G4 bilevel at <strong>300 ppi native</strong>, so every numeric was read from a crop of a 300 ppi render at digit scale; the text layer was used only as a search index. (The seventh PDF page carries the start of the <em>next</em> article — Gabor, “Lateral Transport in a Fluidized-Packed Bed” — below Myers &amp; Prausnitz’s reference list; nothing was read from it.)</p>
<p><strong>Cited by the paper, not consulted, and no number here derives from them</strong> — these four are the sources of every experimental point in Figs. 3–10, which is exactly why the experimental case is out of this page’s scope:</p>
<p>Szepesy, L. and Illés, V. (1963). <em>Acta Chim. Hung.</em> <strong>35</strong>, 37; <em>ibid.</em> p.&nbsp;53; <em>ibid.</em> p.&nbsp;245 (refs. 9–11) — the methane, ethane and mixture isotherms behind Figs. 2–4. Markham, E. C. and Benton, A. F. (1931). <em>J. Am. Chem. Soc.</em> <strong>53</strong>, 497 (ref. 8) — the CO–O₂/silica data of Figs. 5–6 (the Fig. 6 legend’s “(1950)” contradicts this, the paper’s only Markham &amp; Benton reference; see §4). Lewis, W. K., Gilliland, E. R., Chertow, B. and Hoffman, W. H. (1950). <em>J. Am. Chem. Soc.</em> <strong>72</strong>, 1153 (ref. 7) — the propane–propylene/silica-gel data of Fig. 7. Bering, B. P. and Serpenskii, V. V. (1952). <em>Zhur. Fiz. Khim.</em> <strong>26</strong>, 253 (ref. 2) — the ethylene–CO₂ equilibrium surface behind Figs. 8–10 (the reference and text spell “Serpenskii”; the three figure legends spell “SERPINSKII” — one surname, two transliterations, reported as an observation).</p>
<p>Also cited, not consulted: Arnold (1949), <em>J. Am. Chem. Soc.</em> <strong>71</strong>, 104 — the liquid entropy model the paper supersedes; de Boer (1953); Hill (1949), <em>J. Chem. Phys.</em> <strong>17</strong>, 520, and Hill (1960), <em>Introduction to Statistical Mechanics</em> — the adsorption thermodynamics and the low-coverage statistical mechanics behind eqs. (4), (30), (31); Young &amp; Crowell (1962) — the mixed-gas-adsorption review. <strong>Ref. 5</strong> (“Ibid, 63, 456 (1959)”) is cited nowhere in the paper’s running text and its “Ibid.” (= <em>J. Chem. Phys.</em>) cannot carry volume 63 in 1959 (ref. 4’s own pair puts that journal at vol.&nbsp;17 in 1949, and it was at vol.&nbsp;37 in 1962); <em>J. Phys. Chem.</em> <strong>63</strong> (1959) exists and carries Hill’s adsorption-definitions paper at p.&nbsp;456 — that ref. 5 intends it is an inference, stated as one.</p>
<p><code>J1.1</code> (Langmuir 1918) and <code>J1.3</code> (BET 1938) are the pure-isotherm siblings; both were read for this page and neither is loaded — no dataset of either page is used and no number of theirs is retyped here.</p>


</section>
</section>

 ]]></description>
  <category>sec:J</category>
  <category>struct:S1</category>
  <category>struct:S10</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:gas-solid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/J1.4-iast-mixed-gas-adsorption/</guid>
  <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Tanks in series: what two moments of an RTD do and do not buy you</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A2.4-tanks-in-series/</link>
  <description><![CDATA[ 




<section id="tanks-in-series-what-two-moments-of-an-rtd-do-and-do-not-buy-you" class="level1">
<h1>Tanks in series: what two moments of an RTD do and do not buy you</h1>
<p><strong>Catalog ID:</strong> <code>A2.4</code> · <strong>Structures:</strong> <code>S1</code> (pointwise / staged algebra), <code>S3</code> (1-D steady BVP), <code>S5</code> (convection-dominated) · <strong>Tier:</strong> T0</p>
<p>The tanks-in-series model has one adjustable number. You measure a residence-time distribution, you take its mean and its variance, you divide, and you get <img src="https://latex.codecogs.com/png.latex?N">. Levenspiel’s Chapter 14 does exactly that three times, in worked examples E14.1, E14.2 and E14.4, and it is the reason the model is in every course: it is the cheapest possible description of a vessel that is neither plug flow nor a stirred tank.</p>
<p>Fitting <img src="https://latex.codecogs.com/png.latex?N"> to an RTD and then reporting that the RTD is reproduced would be a goodness of fit and nothing more. This page does not do that. It fits <img src="https://latex.codecogs.com/png.latex?N"> where the book fits it — from <strong>two moments</strong> — and then asks what the fit is worth on quantities that were held out of it: the <em>shape</em> of the exit curve, the <em>conversion</em>, and the <em>additivity</em> property the model must satisfy exactly.</p>
<p>The answer is sharper than expected, and it is a limit rather than an agreement. Levenspiel’s E14.4 reads <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bt%7D%20=%2060"> s and <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2%20=%20900"> s² off a pair of tracer curves and concludes “4 tanks”. A chain of <strong>five unequal</strong> tanks of 9, 9, 9, 9 and 24 s has exactly the same mean and exactly the same variance — the two numbers the method uses — and leaves the <strong>outlet concentration</strong> open by 23.2 % at the far end of the range swept. That chain is only an example, not the extreme: over <em>every</em> chain matching the same two moments the outlet concentration is open by a factor that is computed in closed form below. Two moments do not determine a conversion, and this page measures by how much.</p>
<div id="559e2045" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:50.420725Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:50.420563Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:50.429960Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:50.429218Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.3.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A2.4-tanks-in-series"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="a60b3ff8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:50.432239Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:50.432065Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.193603Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.192884Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> textwrap</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> warnings</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> IPython.display <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Markdown, display</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> brentq, minimize_scalar</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.special <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> gammaln</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, Claims</span>
<span id="cb2-10"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Cascade, dispersion_exit, dispersion_exit_deferred   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># this page's model.py</span></span>
<span id="cb2-11"></span>
<span id="cb2-12">warnings.filterwarnings(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ignore"</span>, category<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">UserWarning</span>)</span>
<span id="cb2-13">rng <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.random.default_rng(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20260807</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nothing here is stochastic; seeded anyway</span></span>
<span id="cb2-14">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"font.size"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.5</span>})</span>
<span id="cb2-15">np.set_printoptions(legacy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.25"</span>)</span>
<span id="cb2-16">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span></code></pre></div></div>
</div>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>Four gallery pages already end at a residence-time distribution. <a href="../A2.1-danckwerts-boundary-conditions/"><code>A2.1</code></a> settles what boundary conditions the axial-dispersion model needs, <a href="../A2.3-taylor-aris-dispersion/"><code>A2.3</code></a> derives a dispersion coefficient, <a href="../A2.5-edwards-richardson-dispersion/"><code>A2.5</code></a> measures one and <a href="../A2.6-gunn-dispersion-correlations/"><code>A2.6</code></a> correlates it. <a href="../A2.8-zwietering-segregation/"><code>A2.8</code></a> asks what an RTD still leaves undetermined once you have it, and answers with Zwietering’s micromixing bounds.</p>
<p>This page is the <em>other</em> one-parameter flow model — the one Levenspiel opens Chapter 14 by putting side by side with the dispersion model:</p>
<blockquote class="blockquote">
<p>“This model can be used whenever the dispersion model is used; and for not too large a deviation from plug flow both models give identical results, for all practical purposes. Which model you use depends on your mood and taste.”</p>
</blockquote>
<p>The tanks-in-series model replaces a partial differential equation by a chain of <img src="https://latex.codecogs.com/png.latex?N"> equal, perfectly mixed tanks. It has three properties that make it worth a page of its own:</p>
<ol type="1">
<li><strong>It is closed-form in <img src="https://latex.codecogs.com/png.latex?N"></strong> — RTD, <img src="https://latex.codecogs.com/png.latex?F"> curve, first-order conversion, second-order conversion and the macrofluid conversion are all printed in Chapter 14 as explicit formulae.</li>
<li><strong>It is additive.</strong> <img src="https://latex.codecogs.com/png.latex?M"> tanks followed by <img src="https://latex.codecogs.com/png.latex?N"> more tanks <em>is</em> <img src="https://latex.codecogs.com/png.latex?M+N"> tanks — Levenspiel’s Eq. 4 — which is what lets E14.4 subtract a sloppy input signal from a sloppy output signal instead of deconvolving them.</li>
<li><strong>It is a discretisation.</strong> <img src="https://latex.codecogs.com/png.latex?N"> equal stirred tanks in series are algebraically identical to the first-order upwind finite-volume scheme for plug flow on <img src="https://latex.codecogs.com/png.latex?N"> cells. That identity is not in the chapter, it is derived below, and it is what makes the chapter’s opening claim quantitative: the model’s numerical diffusion is <img src="https://latex.codecogs.com/png.latex?u%20L/(2N)">, so the equivalent Péclet number is <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%202N">. The chapter <em>does</em> print a conversion rule of its own — inside the axes box of Fig. 14.7, book p.&nbsp;327 — and it is inverted. The derivation below de-inverts it, and the book’s own Chapter 13 settles which way round it goes.</li>
</ol>
<p><strong>What was read, and from where.</strong> Everything on this page comes from Levenspiel, <em>Chemical Reaction Engineering</em>, 3rd edition (John Wiley &amp; Sons, 1999), ISBN 0-471-25424-X, <strong>Chapter 14 “The Tanks-In-Series Model”, sections 14.1 (Pulse Response Experiments and the RTD) and 14.2 (Chemical Conversion)</strong>, book pp.&nbsp;321–338, plus <strong>book p.&nbsp;303 in Chapter 13</strong>, which Fig. 14.7’s own annotation sends the reader to by name and which supplies the two printed values that settle the inversion. The book <strong>attributes</strong> the RTD, its means and variances, and the <img src="https://latex.codecogs.com/png.latex?F"> curve of Fig. 14.7 to <em>MacMullin, R. B. and Weber, M., Jr., Trans. AIChE <strong>31</strong>, 409 (1935)</em>. That paper is <strong>not on disk and was not consulted</strong>; it is recorded as the origin and this monograph as the text actually read. No equation on this page was written from memory.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p>Levenspiel defines two dimensionless times, on p.&nbsp;321:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctheta_i%20=%20%5Cfrac%7Bt%7D%7B%5Cbar%7Bt%7D_i%7D%5C%20%5Ctext%7B(per%20tank)%7D,%5Cqquad%0A%20%20%5Ctheta%20=%20%5Cfrac%7Bt%7D%7B%5Cbar%7Bt%7D%7D%5C%20%5Ctext%7B(all%20$N$%20tanks)%7D,%5Cqquad%0A%20%20%5Ctheta_i%20=%20N%5Ctheta%20."></p>
<section id="the-rtd-his-eq.-3" class="level3">
<h3 class="anchored" data-anchor-id="the-rtd-his-eq.-3">The RTD — his Eq. 3</h3>
<p>Four equivalent forms, all boxed together as <strong>Eq. 3</strong> on book p.&nbsp;323, with the means and variances alongside:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bt%7D%5C,%5Cmathbf%7BE%7D%20=%20%5Cleft(%5Cfrac%7Bt%7D%7B%5Cbar%20t%7D%5Cright)%5E%7BN-1%7D%5Cfrac%7BN%5EN%7D%7B(N-1)!%7D%5C,e%5E%7B-tN/%5Cbar%20t%7D%0A%20%20%5Cquad%5Ccdots%5Cquad%20%5Cbar%20t%20=%20N%20%5Cbar%20t_i%20%5Cquad%5Ccdots%5Cquad%20%5Csigma%5E2%20=%20%5Cfrac%7B%5Cbar%20t%5E%7B%5C,2%7D%7D%7BN%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bt%7D_i%5C,%5Cmathbf%7BE%7D%20=%20%5Cleft(%5Cfrac%7Bt%7D%7B%5Cbar%20t_i%7D%5Cright)%5E%7BN-1%7D%5Cfrac%7B1%7D%7B(N-1)!%7D%5C,e%5E%7B-t/%5Cbar%20t_i%7D%0A%20%20%5Cquad%5Ccdots%5Cquad%20%5Cbar%20t_i%20=%20%5Cfrac%7B%5Cbar%20t%7D%7BN%7D%20%5Cquad%5Ccdots%5Cquad%20%5Csigma%5E2%20=%20N%20%5Cbar%20t_i%5E%7B%5C,2%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BE%7D_%7B%5Ctheta_i%7D%20=%20%5Cbar%20t_i%20%5Cmathbf%7BE%7D%20=%20%5Cfrac%7B%5Ctheta_i%5E%7B%5C,N-1%7D%7D%7B(N-1)!%7De%5E%7B-%5Ctheta_i%7D%0A%20%20%5Cquad%5Ccdots%5Cquad%20%5Csigma%5E2_%7B%5Ctheta_i%7D%20=%20N"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BE%7D_%7B%5Ctheta%7D%20=%20(N%5Cbar%20t_i)%5Cmathbf%7BE%7D%20=%20N%5Cfrac%7B(N%5Ctheta)%5E%7BN-1%7D%7D%7B(N-1)!%7De%5E%7B-N%5Ctheta%7D%0A%20%20%5Cquad%5Ccdots%5Cquad%20%5Csigma%5E2_%7B%5Ctheta%7D%20=%20%5Cfrac%7B1%7D%7BN%7D"></p>
<p>The chapter’s own text says these “were first derived by MacMullin and Weber (1935)”.</p>
</section>
<section id="the-properties-of-the-curve-his-fig.-14.3" class="level3">
<h3 class="anchored" data-anchor-id="the-properties-of-the-curve-his-fig.-14.3">The properties of the curve — his Fig. 14.3</h3>
<p>Figure 14.3 is a sketch, but it is annotated with five <em>algebraic</em> statements and two numbers, and all seven are testable:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BE%7D_%7B%5Ctheta,%5Cmax%7D%20=%20%5Cfrac%7BN(N-1)%5E%7BN-1%7D%7D%7B(N-1)!%7De%5E%7B-(N-1)%7D%0A%20%20%5C;%5Ccong%5C;%20%5Cfrac%7BN%7D%7B%5Csqrt%7B2%5Cpi(N-1)%7D%7D,%5C%20%5Ctext%7B%22error%7D%20%3C%202%5C%25%20%5Ctext%7B%20for%20%7D%20N%20%3E%205%5Ctext%7B%22%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctheta_%7B%5Cmax%7D%20=%20%5Cfrac%7BN-1%7D%7BN%7D,%5Cqquad%0A%20%20%5Cfrac%7B%5CDelta%5Ctheta%7D%7B%5Ctheta_%7B%5Cmax%7D%7D%20=%20%5Cfrac%7B2%7D%7B%5Csqrt%7BN-1%7D%7D,%5Cqquad%0A%20%20%5Ctext%7BArea%7D%20=%201,%5Cqquad%20%5Csigma%5E2_%5Ctheta%20=%20%5Ctfrac1N,"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BE%7D_%7B%5Ctheta,%5Cmathrm%7Binf%7D%7D%20%5Ccong%200.55%5C,%5Cmathbf%7BE%7D_%7B%5Ctheta,%5Cmax%7D%5C%20(N=4),%0A%20%20%5Cqquad%20%5Ccong%200.61%5C,%5Cmathbf%7BE%7D_%7B%5Ctheta,%5Cmax%7D%5C%20(N%5Cge%2010)."></p>
<p><img src="https://latex.codecogs.com/png.latex?%5CDelta%5Ctheta"> is the separation of the two inflection points.</p>
</section>
<section id="independence-his-eq.-4" class="level3">
<h3 class="anchored" data-anchor-id="independence-his-eq.-4">Independence — his Eq. 4</h3>
<blockquote class="blockquote">
<p>“If <img src="https://latex.codecogs.com/png.latex?M"> tanks are connected to <img src="https://latex.codecogs.com/png.latex?N"> more tanks (all of the same size) then the individual means and variances (in ordinary time units) are additive”</p>
</blockquote>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbar%20t_%7BM+N%7D%20=%20%5Cbar%20t_M%20+%20%5Cbar%20t_N%20%5Cquad%5Ctext%7Band%7D%5Cquad%0A%20%20%5Csigma%5E2_%7BM+N%7D%20=%20%5Csigma%5E2_M%20+%20%5Csigma%5E2_N%20%5Ctag%7B4%7D"></p>
<p>with a footnote defining independence as “the fluid loses its memory as it passes from vessel to vessel”, and warning that laminar flow often does not satisfy it.</p>
</section>
<section id="the-one-shot-tracer-relation-his-eq.-5" class="level3">
<h3 class="anchored" data-anchor-id="the-one-shot-tracer-relation-his-eq.-5">The one-shot tracer relation — his Eq. 5</h3>
<p>Under the heading <em>One-shot Tracer Input</em>, on book p.&nbsp;324, Eq. 4 is turned into the relation E14.4 actually uses:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5CDelta%5Csigma%5E2%20=%20%5Csigma%5E2_%7B%5Ctext%7Bout%7D%7D%20-%20%5Csigma%5E2_%7B%5Ctext%7Bin%7D%7D%0A%20%20=%20%5Cfrac%7B(%5CDelta%5Cbar%20t)%5E%7B%5C,2%7D%7D%7BN%7D%20%5Ctag%7B5%7D"></p>
<p>This is the most heavily exercised relation on the page: running it backwards is the whole of E14.4’s fit, and the headline in section 8 is a statement about it. Eqs. 6a–c and 7a–c on p.&nbsp;325, which superpose passes through a <strong>closed recirculation</strong> loop, are printed but are not exercised anywhere here; nor is Fig. 14.8’s graphical construction for arbitrary kinetics (p.&nbsp;328).</p>
</section>
<section id="the-f-curve-his-eq.-8" class="level3">
<h3 class="anchored" data-anchor-id="the-f-curve-his-eq.-8">The <img src="https://latex.codecogs.com/png.latex?F"> curve — his Eq. 8</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BF%7D%20=%201%20-%20e%5E%7B-N%5Ctheta%7D%5Cleft%5B1%20+%20N%5Ctheta%20+%20%5Cfrac%7B(N%5Ctheta)%5E2%7D%7B2!%7D%20+%20%5Ccdots%0A%20%20+%20%5Cfrac%7B(N%5Ctheta)%5E%7BN-1%7D%7D%7B(N-1)!%7D%5Cright%5D%20%5Ctag%7B8%7D"></p>
<p>with a brace under the terms reading “For one tank use the first term / For <img src="https://latex.codecogs.com/png.latex?N%20=%202"> …”. Figure 14.7, which plots it, is captioned “from MacMullin and Weber (1935)” — and inside its axes box it carries the chapter’s <strong>only</strong> rule for turning <img src="https://latex.codecogs.com/png.latex?N"> into a dispersion number:</p>
<blockquote class="blockquote">
<p>“When <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> the curve becomes symmetrical in which case use fig.&nbsp;13-11 with <img src="https://latex.codecogs.com/png.latex?N%20=%20%5Ctfrac12%5Cleft(%5Cdfrac%7B%5Cmathbf%7BD%7D%7D%7BuL%7D%5Cright)">”</p>
</blockquote>
<p>The ratio in that parenthesis is upside down. The book’s own Chapter 13 proves it, section 9 shows what the printed form costs, and it is reported as the most consequential of the printed defects rather than repaired.</p>
</section>
<section id="conversion-section-14.2" class="level3">
<h3 class="anchored" data-anchor-id="conversion-section-14.2">Conversion — section 14.2</h3>
<p>First order, one tank and then <img src="https://latex.codecogs.com/png.latex?N"> tanks (<strong>Eq. 9</strong>):</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BC_A%7D%7BC_%7BA0%7D%7D%20=%20%5Cfrac%7B1%7D%7B1+k%5Cbar%20t_i%7D%20=%20%5Cfrac%7B1%7D%7B1+k%5Cbar%20t%7D%0A%20%20%5Cqquad%5Clongrightarrow%5Cqquad%0A%20%20%5Cfrac%7BC_A%7D%7BC_%7BA0%7D%7D%20=%20%5Cfrac%7B1%7D%7B(1+k%5Cbar%20t_i)%5EN%7D%20=%20%5Cfrac%7B1%7D%7B%5Cleft(1+%5Cfrac%7Bk%5Cbar%20t%7D%7BN%7D%5Cright)%5EN%7D"></p>
<p>and, “for small deviations from plug flow (large <img src="https://latex.codecogs.com/png.latex?N">)”,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Ctext%7Bfor%20same%20%7D%20C_%7BA,%5Ctext%7Bfinal%7D%7D:%5C%20%5Cfrac%7BV_%7BN%5C,%5Ctext%7Btanks%7D%7D%7D%7BV_p%7D%20=%201%20+%20k%5Cbar%20t_i%0A%20%20=%201%20+%20%5Cfrac%7Bk%5Cbar%20t%7D%7B2N%7D,%0A%5Cqquad%0A%5Ctext%7Bfor%20same%20volume%20%7D%20V:%5C%20%5Cfrac%7BC_%7BA,N%5Ctext%7Btanks%7D%7D%7D%7BC_%7BAp%7D%7D%20=%201%20+%20%5Cfrac%7B(k%5Cbar%20t)%5E2%7D%7B2N%7D."></p>
<p><strong>The first of those two is printed inconsistently</strong> — the middle and right-hand expressions differ by a factor of two — and the page proves which one is wrong from the book’s own Eq. 9 rather than from anywhere else.</p>
<p>Second order for a microfluid, <img src="https://latex.codecogs.com/png.latex?A%5Cto%20R"> or <img src="https://latex.codecogs.com/png.latex?A+B%5Cto%20R"> with <img src="https://latex.codecogs.com/png.latex?C_%7BA0%7D=C_%7BB0%7D">, “Eq. 6.8 gives” (<strong>Eq. 10</strong>) a nest of <img src="https://latex.codecogs.com/png.latex?N"> radicals:</p>
<p><img src="https://latex.codecogs.com/png.latex?C_N%20=%20%5Cfrac%7B1%7D%7B4k%5Ctau_i%7D%5Cleft(-2%20+%202%5Csqrt%7B-1%5Ccdots+2%5Csqrt%7B-1+2%5Csqrt%7B1+4C_0k%5Ctau_i%7D%7D%7D%5Cright)"></p>
<p>and for a macrofluid, “combine Eq. 11.3 with Eq. 3” (<strong>Eq. 11</strong>):</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cfrac%7BC_A%7D%7BC_%7BA0%7D%7D%20=%20%5Cfrac%7BN%5EN%7D%7B(N-1)!%5C,%5Cbar%20t%5E%7B%5C,N%7D%7D%0A%20%20%5Cint_0%5E%7B%5Cinfty%7D%5Cleft(%5Cfrac%7BC_A%7D%7BC_%7BA0%7D%7D%5Cright)_%7B%5Ctext%7Bbatch%7D%7D%20t%5E%7BN-1%7De%5E%7B-tN/%5Cbar%20t%7D%5C,dt"></p>
<p>The book sets that denominator as <img src="https://latex.codecogs.com/png.latex?(N-1)!%5C,%5Cbar%20t_N">, with <img src="https://latex.codecogs.com/png.latex?N"> <strong>lowered</strong> as a subscript. Only <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%5E%7B%5C,N%7D"> makes the expression dimensionless and normalised, and the book prints the raised form itself two pages later in E14.4, so the subscript is a typesetting slip. It is reported below, not silently repaired.</p>
</section>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p>There is <strong>one parameter</strong>, <img src="https://latex.codecogs.com/png.latex?N">, and it is an integer count of equal tanks. Two groups set everything else: <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t"> for a first-order reaction and <img src="https://latex.codecogs.com/png.latex?kC_0%5Cbar%20t"> for a second-order one. Nothing on this page is calibrated to anything: every <img src="https://latex.codecogs.com/png.latex?N"> is either an integer chosen to sweep, or the value the book itself computes from its own printed moments.</p>
<p>Assumptions the model makes, in the order they bite:</p>
<ul>
<li><strong>Each tank is perfectly mixed</strong>, so its exit stream carries the tank’s own concentration. This is not a boundary-condition choice; it is the model, and it is why the outflow below is <em>not</em> the second-order face reconstruction that pymrm’s zero-gradient boundary condition would give. The difference is measured.</li>
<li><strong>All tanks are equal in size.</strong> Levenspiel says so explicitly in Eq. 4’s sentence. The page’s headline result is what goes wrong when this is assumed rather than checked.</li>
<li><strong>Stages are independent</strong> — no memory carried from tank to tank. Levenspiel’s own footnote flags laminar flow as a case where this fails. Nothing on this page tests it; it is an assumption inherited whole.</li>
<li><strong>Constant density and constant volumetric flow</strong>, so <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%20V/v"> and <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t_i%20=%20%5Cbar%20t/N">.</li>
</ul>
<p><strong>Fit or test.</strong> Every number this page compares against is a <strong>held-out</strong> one. <img src="https://latex.codecogs.com/png.latex?N%20=%204"> in E14.4 is fitted — to two moments, by the book — and then the RTD shape, the <img src="https://latex.codecogs.com/png.latex?F"> curve, the first- and second-order conversions and the macrofluid conversion are all <em>consequences</em> of that fit that were not used to make it. E14.1 and E14.2 fit nothing at all: they are pure arithmetic on printed inputs. The Fig. 14.3 properties are fitted to nothing anywhere. There is <strong>no experiment in Chapter 14 at all</strong>, so nothing here is experimental validation, and the page says so wherever it matters.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Chapter 14 contains <strong>no measurement</strong>. Its numbers are (a) the inputs and intermediates of three worked examples, (b) the algebraic annotations of Fig. 14.3, (c) two approximate ratios on that same figure, and (d) the threshold and the coefficient of Fig. 14.7’s dispersion-conversion annotation. Two further rows come from <strong>Chapter 13, book p.&nbsp;303</strong> — Fig. 13.12’s printed <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%202(%5Cmathbf%7BD%7D/uL)"> and the printed validity limit <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3C%200.01"> of Fig. 13.11 — because Fig. 14.7’s annotation names that figure and those are the two numbers that settle whether its ratio is the right way up. All of them are in the CSV below, transcribed from 600 dpi renders — the scan’s <em>native</em> resolution, checked with <code>pdfimages -list</code>, so anything higher would be interpolation.</p>
<p>The text layer of this book is a specific kind of trap. The <strong>prose</strong> is excellent and fully searchable; it is what located the chapter and its two sections in the first place. The <strong>equations and subscripts are destroyed</strong>: <code>pdftotext</code> returns Eq. 3 as <code>7. = (-&amp;) NN e-tNli</code> and Eq. 4 as <code>%+, = tM+ t,</code>. Not one numeric cell below came off the text layer.</p>
<p>Five of the printed items are <strong>defective as printed</strong>. They are carried in the CSV exactly as they appear, with the defect named in the <code>printed_as</code> and <code>note</code> columns, and each is proved from the book’s own arithmetic in the <em>Printed defects</em> section rather than quietly corrected.</p>
<p><strong>No other gallery page’s dataset is loaded here</strong>, so no cross-page reconciliation applies. The one sibling page whose findings bear on this one is <a href="../A2.8-zwietering-segregation/"><code>A2.8</code></a>, which uses Erlang RTDs of <img src="https://latex.codecogs.com/png.latex?N"> equal tanks and states in its own caveats that “<code>A2.4</code> is not built, so the RTDs used here have no page of their own to cross-check against”. It publishes no RTD dataset, so there is nothing to borrow; what it establishes about these RTDs — that each integrates to one and has mean one, and that for a reaction order other than one the RTD alone does not fix the conversion — is re-established independently below and is consistent.</p>
<div id="ff1d7427" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.196209Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.195943Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.214269Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.213470Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-1999-ch14-printed.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-2">META <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"levenspiel-1999-ch14-printed.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)</span>
<span id="cb3-3"></span>
<span id="cb3-4"></span>
<span id="cb3-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> P(item, quantity):</span>
<span id="cb3-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One printed value, by (worked example, quantity). Never retype a number."""</span></span>
<span id="cb3-7">    row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PRINTED[(PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> item) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> quantity)]</span>
<span id="cb3-8">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(row) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb3-9">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">KeyError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>item<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>quantity<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(row)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows"</span>)</span>
<span id="cb3-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb3-11"></span>
<span id="cb3-12"></span>
<span id="cb3-13">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"**Source:** </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>cite_data(META)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>))</span>
<span id="cb3-14">display(PRINTED[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"units"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"book_page"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed_as"</span>]])</span>
<span id="cb3-15">display(Markdown(</span>
<span id="cb3-16">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PRINTED)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed values, from book pp. "</span></span>
<span id="cb3-17">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb3-18">    <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(PDF pp. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRINTED[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'book_page'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">). "</span></span>
<span id="cb3-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nothing is digitised: the page traces no curve anywhere."</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Source:</strong> Levenspiel, O. (1999) — John Wiley &amp; Sons, ISBN 0-471-25424-X — table</p>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">item</th>
<th data-quarto-table-cell-role="th">quantity</th>
<th data-quarto-table-cell-role="th">value</th>
<th data-quarto-table-cell-role="th">units</th>
<th data-quarto-table-cell-role="th">book_page</th>
<th data-quarto-table-cell-role="th">printed_as</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>E14.1</td>
<td>L_1</td>
<td>32.000000</td>
<td>m</td>
<td>329</td>
<td>32 m</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>E14.1</td>
<td>sigma_1</td>
<td>8.000000</td>
<td>bottles</td>
<td>329</td>
<td>8</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>E14.1</td>
<td>sigma_1_squared</td>
<td>64.000000</td>
<td>bottles^2</td>
<td>329</td>
<td>64</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>E14.1</td>
<td>L_2</td>
<td>50.000000</td>
<td>m</td>
<td>329</td>
<td>50 m</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>E14.1</td>
<td>sigma_2_squared</td>
<td>100.000000</td>
<td>bottles^2</td>
<td>330</td>
<td>100</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>E14.1</td>
<td>sigma_2</td>
<td>10.000000</td>
<td>bottles</td>
<td>330</td>
<td>10</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>E14.2</td>
<td>x_Portsmouth_to_Cincinnati</td>
<td>119.000000</td>
<td>miles</td>
<td>330</td>
<td>119</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">7</th>
<td>E14.2</td>
<td>spread_Portsmouth</td>
<td>10.500000</td>
<td>h</td>
<td>330</td>
<td>10.5</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">8</th>
<td>E14.2</td>
<td>spread_Cincinnati</td>
<td>14.000000</td>
<td>h</td>
<td>330</td>
<td>14</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">9</th>
<td>E14.2</td>
<td>L</td>
<td>272.000000</td>
<td>miles</td>
<td>331</td>
<td>272 moles</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">10</th>
<td>E14.4</td>
<td>tbar_in</td>
<td>220.000000</td>
<td>s</td>
<td>334</td>
<td>220s</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">11</th>
<td>E14.4</td>
<td>var_in</td>
<td>100.000000</td>
<td>s^2</td>
<td>334</td>
<td>100s^2</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">12</th>
<td>E14.4</td>
<td>tbar_out</td>
<td>280.000000</td>
<td>s</td>
<td>334</td>
<td>280s</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">13</th>
<td>E14.4</td>
<td>var_out</td>
<td>1000.000000</td>
<td>s^2</td>
<td>334</td>
<td>1000s^2</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">14</th>
<td>E14.4</td>
<td>delta_tbar</td>
<td>60.000000</td>
<td>s</td>
<td>333</td>
<td>280 - 220 = 60 s</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">15</th>
<td>E14.4</td>
<td>delta_var</td>
<td>900.000000</td>
<td>s^2</td>
<td>333</td>
<td>1000 - 100 = 900 s</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">16</th>
<td>E14.4</td>
<td>N</td>
<td>4.000000</td>
<td>tanks</td>
<td>334</td>
<td>4 tanks</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">17</th>
<td>E14.4</td>
<td>E_prefactor</td>
<td>0.000003</td>
<td>s^-4</td>
<td>334</td>
<td>3.2922 x 10^-6</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">18</th>
<td>E14.4</td>
<td>E_exponent</td>
<td>0.066700</td>
<td>s^-1</td>
<td>334</td>
<td>0.0667</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">19</th>
<td>E14.4</td>
<td>E_axis_top_tick</td>
<td>0.105000</td>
<td>s^-1</td>
<td>334</td>
<td>0.105</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">20</th>
<td>Fig14.3</td>
<td>Einf_over_Emax_N4</td>
<td>0.550000</td>
<td>-</td>
<td>324</td>
<td>0.55</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">21</th>
<td>Fig14.3</td>
<td>Einf_over_Emax_Nge10</td>
<td>0.610000</td>
<td>-</td>
<td>324</td>
<td>0.61</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">22</th>
<td>Fig14.3</td>
<td>stirling_error_bound</td>
<td>0.020000</td>
<td>-</td>
<td>324</td>
<td>error &lt; 2% for N &gt; 5</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">23</th>
<td>Fig14.7</td>
<td>N_symmetric_threshold</td>
<td>50.000000</td>
<td>tanks</td>
<td>327</td>
<td>When N &gt; 50 the curve becomes symmetrical in w...</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">24</th>
<td>Fig14.7</td>
<td>dispersion_rule_half</td>
<td>0.500000</td>
<td>-</td>
<td>327</td>
<td>with N = 1/2 (D/uL)</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">25</th>
<td>Fig13.12</td>
<td>sigma2_theta_over_DuL</td>
<td>2.000000</td>
<td>-</td>
<td>303</td>
<td>From sigma_theta^2 = 2(D/uL) we find</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">26</th>
<td>Fig13.11</td>
<td>DuL_small_deviation_limit</td>
<td>0.010000</td>
<td>-</td>
<td>303</td>
<td>Small Deviation from Plug Flow, D/uL &lt; 0.01</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>27 printed values, from book pp.&nbsp;303-334 (PDF pp.&nbsp;319-350). Nothing is digitised: the page traces no curve anywhere.</p>
</div>
</div>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<section id="the-cascade-is-the-first-order-upwind-scheme" class="level3">
<h3 class="anchored" data-anchor-id="the-cascade-is-the-first-order-upwind-scheme">The cascade is the first-order upwind scheme</h3>
<p>A tracer balance on tank <img src="https://latex.codecogs.com/png.latex?i"> of volume <img src="https://latex.codecogs.com/png.latex?V_i%20=%20V/N"> with volumetric flow <img src="https://latex.codecogs.com/png.latex?v"> is</p>
<p><img src="https://latex.codecogs.com/png.latex?V_i%5Cfrac%7BdC_i%7D%7Bdt%7D%20=%20v%5C,C_%7Bi-1%7D%20-%20v%5C,C_i%0A%20%20%5Cqquad%5CLongleftrightarrow%5Cqquad%0A%20%20%5Cfrac%7BdC_i%7D%7Bdt%7D%20=%20%5Cfrac%7BC_%7Bi-1%7D-C_i%7D%7B%5Cbar%20t_i%7D,%5Cquad%20%5Cbar%20t_i%20=%20%5Cfrac%7BV_i%7D%7Bv%7D."></p>
<p>Put the chain on a line <img src="https://latex.codecogs.com/png.latex?0%5Cle%20z%5Cle%201"> with <img src="https://latex.codecogs.com/png.latex?N"> uniform cells, superficial velocity <img src="https://latex.codecogs.com/png.latex?u%20=%201/%5Cbar%20t"> (so the transit time of the whole line is <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t">) and <img src="https://latex.codecogs.com/png.latex?%5CDelta%20z%20=%201/N">. The first-order <strong>upwind</strong> convective flux on an interior face is <img src="https://latex.codecogs.com/png.latex?u%5C,C_%7Bi-1%7D">, and the divergence operator divides by the cell size, so</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cleft%5B%5Cnabla%5C!%5Ccdot(uC)%5Cright%5D_i%20=%20%5Cfrac%7Bu%5C,C_i%20-%20u%5C,C_%7Bi-1%7D%7D%7B%5CDelta%20z%7D%0A=%20%5Cfrac%7BC_i%20-%20C_%7Bi-1%7D%7D%7B%5Cbar%20t_i%7D."></p>
<p>The two are the same equation. <code>construct_convflux_upwind</code> plus <code>construct_div</code> with <code>nu=0</code> <strong>is</strong> the tanks-in-series model — not an approximation to it — and <img src="https://latex.codecogs.com/png.latex?N"> is a <em>physical parameter</em>, not a mesh resolution. That has a consequence the rest of this page keeps running into: <strong>there is no grid-refinement axis here.</strong> Refining the grid changes the model. The axes that do carry numerical error are the time step, the quadrature panel count and (in the dispersion comparison at the end) a genuine grid.</p>
</section>
<section id="the-one-place-the-standard-boundary-condition-is-wrong" class="level3">
<h3 class="anchored" data-anchor-id="the-one-place-the-standard-boundary-condition-is-wrong">The one place the standard boundary condition is wrong</h3>
<p>A perfectly mixed tank discharges its own contents, so the flux leaving tank <img src="https://latex.codecogs.com/png.latex?N"> is exactly <img src="https://latex.codecogs.com/png.latex?v%5C,C_N">. The usual PDE outflow condition, a zero-gradient <img src="https://latex.codecogs.com/png.latex?%5C%7Ba%7B=%7D1,%20b%7B=%7D0,%20d%7B=%7D0%5C%7D">, makes the operator reconstruct the exit-face value to second order as <img src="https://latex.codecogs.com/png.latex?%5Ctfrac98%20C_N%20-%20%5Ctfrac18%20C_%7BN-1%7D">. For a <em>discretised PDE</em> that is the right thing to do and buys an order of accuracy. Here it is a <strong>modelling error</strong>, because <img src="https://latex.codecogs.com/png.latex?N"> is not a mesh: it changes the last tank’s balance and breaks the identity with Levenspiel’s Eq. 9. It is measured against <img src="https://latex.codecogs.com/png.latex?N"> in <em>Validation</em>, and it decays like an ordinary first-order discretisation error, which is exactly why it is easy to dismiss, and why it is in the break table.</p>
<p>pymrm has a boundary for this case: <code>{"outflow": True}</code> sets the exit-face value to the adjacent cell value, which is what a stirred tank discharges (pymrm pitfall P6). <code>Cascade</code> in this page’s <code>model.py</code> uses it. The same thing can be built by hand: no operator flux on the exit face (<code>b=1, d=0</code>) and the outflow as a sink <img src="https://latex.codecogs.com/png.latex?v%20C_N%20/%20V_N"> on the last tank, built with <code>construct_coefficient_matrix</code>. That construction is <code>outlet="stirred"</code>, and the cell below shows that the library’s boundary and the hand construction give the same operator, entry for entry. The matrix, scaled by <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t_i">, is exactly the lower-bidiagonal cascade.</p>
<div id="2497f13a" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.215914Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.215769Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.235346Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.234666Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">_demo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>)</span>
<span id="cb4-2"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"jac_const * t_i  for N = 4  (should be the lower-bidiagonal cascade):"</span>)</span>
<span id="cb4-3"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(_demo.jac_const.toarray() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _demo.t_i[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb4-4"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tank residence times t_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_demo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>t_i<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s, sum = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_demo<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>t_i<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s"</span>)</span>
<span id="cb4-5"></span>
<span id="cb4-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The library's pure-outflow boundary against the page's own sink construction,</span></span>
<span id="cb4-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># on equal and on graded tanks: operator and boundary vector, entry for entry.</span></span>
<span id="cb4-8">_graded <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.cumsum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> np.arange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> np.arange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))])</span>
<span id="cb4-9">OUTFLOW_VS_SINK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb4-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, faces<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_graded)]:</span>
<span id="cb4-11">    _lib, _own <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>_kw), Cascade(c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirred"</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>_kw)</span>
<span id="cb4-12">    OUTFLOW_VS_SINK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(OUTFLOW_VS_SINK,</span>
<span id="cb4-13">                          <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_lib.jac_const <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _own.jac_const).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb4-14">                          <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_lib.g_const <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _own.g_const))))</span>
<span id="cb4-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow": True</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the sink construction: largest entry difference '</span></span>
<span id="cb4-16">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"below 1e-14 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_VS_SINK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb4-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> OUTFLOW_VS_SINK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>jac_const * t_i  for N = 4  (should be the lower-bidiagonal cascade):
[[ 1.  0.  0.  0.]
 [-1.  1.  0.  0.]
 [ 0. -1.  1.  0.]
 [ 0.  0. -1.  1.]]

tank residence times t_i = [15. 15. 15. 15.] s, sum = 60 s
{"outflow": True} against the sink construction: largest entry difference below 1e-14 (here 0.0e+00)</code></pre>
</div>
</div>
</section>
<section id="levenspiels-own-formulae-written-once" class="level3">
<h3 class="anchored" data-anchor-id="levenspiels-own-formulae-written-once">Levenspiel’s own formulae, written once</h3>
<p>Every closed form below is transcribed from a 600 dpi crop of the boxed equation it is named after. They are kept as free functions so that the pymrm solve and the algebra never share a line of code — that separation is what makes the comparisons in <em>Validation</em> mean anything.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BE%7D"> is evaluated through <code>gammaln</code>, not by forming <img src="https://latex.codecogs.com/png.latex?N%5EN"> and <img src="https://latex.codecogs.com/png.latex?(N-1)!">, because both overflow before <img src="https://latex.codecogs.com/png.latex?N%20=%20200"> and the plug-flow sweep below goes to <img src="https://latex.codecogs.com/png.latex?N%20=%20400">. Eq. 8’s <img src="https://latex.codecogs.com/png.latex?F"> is summed term by term exactly as the book writes it, so that the truncation the book’s brace prescribes is the one that is tested.</p>
<div id="97d1a974" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.237691Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.237542Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.244848Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.244251Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> E_time(t, N, tbar):</span>
<span id="cb6-2">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel Eq. 3, second form: E(t) for N equal tanks of total mean tbar."""</span></span>
<span id="cb6-3">    ti <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> tbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N</span>
<span id="cb6-4">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(np.asarray(t, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb6-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp((N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ti) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ti <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> gammaln(N)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ti</span>
<span id="cb6-6"></span>
<span id="cb6-7"></span>
<span id="cb6-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> E_theta(th, N):</span>
<span id="cb6-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel Eq. 3, fourth form: E_theta = N (N theta)^(N-1) e^(-N theta)/(N-1)!."""</span></span>
<span id="cb6-10">    th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(np.asarray(th, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb6-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(np.log(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> gammaln(N))</span>
<span id="cb6-12"></span>
<span id="cb6-13"></span>
<span id="cb6-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> F_eq8(th, N):</span>
<span id="cb6-15">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel Eq. 8, summed exactly as printed: 1 + Ntheta + ... + (Ntheta)^(N-1)/(N-1)!."""</span></span>
<span id="cb6-16">    th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(th, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb6-17">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th</span>
<span id="cb6-18">    term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.ones_like(x)</span>
<span id="cb6-19">    total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> term.copy()</span>
<span id="cb6-20">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, N):</span>
<span id="cb6-21">        term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> j</span>
<span id="cb6-22">        total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> term</span>
<span id="cb6-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> total</span>
<span id="cb6-24"></span>
<span id="cb6-25"></span>
<span id="cb6-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq9(N, ktbar):</span>
<span id="cb6-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel Eq. 9: first order, N tanks."""</span></span>
<span id="cb6-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> N</span>
<span id="cb6-29"></span>
<span id="cb6-30"></span>
<span id="cb6-31"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq10(N, k, tau_i, C0):</span>
<span id="cb6-32">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel Eq. 10: second-order microfluid, as the printed nest of N radicals."""</span></span>
<span id="cb6-33">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> C0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau_i)</span>
<span id="cb6-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb6-35">        x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> x)</span>
<span id="cb6-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tau_i)</span>
<span id="cb6-37"></span>
<span id="cb6-38"></span>
<span id="cb6-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq11(N, tbar, batch, npanel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40000</span>, span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">80.0</span>):</span>
<span id="cb6-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel Eq. 11: macrofluid conversion, by composite Simpson on [0, span*tbar].</span></span>
<span id="cb6-41"></span>
<span id="cb6-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    The printed denominator is (N-1)! * tbar_N with a LOWERED N.  Only tbar**N</span></span>
<span id="cb6-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    normalises, and E14.4 prints the raised form, so tbar**N is used and the</span></span>
<span id="cb6-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    subscript reading is reported as a defect, and exercised in the break table.</span></span>
<span id="cb6-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb6-46">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, span <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tbar, npanel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb6-47">    y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(batch(t), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E_time(t, N, tbar)</span>
<span id="cb6-48">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb6-49">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb6-50"></span>
<span id="cb6-51"></span>
<span id="cb6-52"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> max_brent(f, lo, hi, nscan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>):</span>
<span id="cb6-53">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""max of a smooth scalar f on [lo, hi], BRACKETED by a coarse scan and then</span></span>
<span id="cb6-54"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    refined with Brent's method.  Every curve maximum on this page goes through</span></span>
<span id="cb6-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    here rather than through `.max()` of a sampled array: section 2's own</span></span>
<span id="cb6-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    sweep-versus-root-find margin is the reason."""</span></span>
<span id="cb6-57">    xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(lo, hi, nscan)</span>
<span id="cb6-58">    ys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([f(x) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> xs])</span>
<span id="cb6-59">    j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(ys))</span>
<span id="cb6-60">    a, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> xs[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)], xs[<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(j <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, nscan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]</span>
<span id="cb6-61">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> x: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>f(x), bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(a, b), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb6-62">                        options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>})</span>
<span id="cb6-63">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>r.fun, ys[j]))</span>
<span id="cb6-64"></span>
<span id="cb6-65"></span>
<span id="cb6-66"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> Emax_printed(N):</span>
<span id="cb6-67">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The closed form printed in Fig. 14.3 for E_theta,max."""</span></span>
<span id="cb6-68">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(np.log(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> gammaln(N))</span>
<span id="cb6-69"></span>
<span id="cb6-70"></span>
<span id="cb6-71"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> Emax_stirling(N):</span>
<span id="cb6-72">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Fig. 14.3's approximation: N / sqrt(2 pi (N-1))."""</span></span>
<span id="cb6-73">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb6-74"></span>
<span id="cb6-75"></span>
<span id="cb6-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sanity: eq9(4, 2) ="</span>, eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>),</span>
<span id="cb6-77">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" eq10(1, 2, 1, 1) ="</span>, eq10(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>),</span>
<span id="cb6-78">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" F_eq8(1e9, 3) ="</span>, F_eq8(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>sanity: eq9(4, 2) = 0.19753086419753085  eq10(1, 2, 1, 1) = 0.5  F_eq8(1e9, 3) = 1.0</code></pre>
</div>
</div>
</section>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="the-three-worked-examples-reproduced-from-their-printed-inputs" class="level3">
<h3 class="anchored" data-anchor-id="the-three-worked-examples-reproduced-from-their-printed-inputs">1. The three worked examples, reproduced from their printed inputs</h3>
<p>E14.1 (<em>Modifications to a winery</em>) and E14.2 (<em>A fable on river pollution</em>) fit nothing: they apply <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2%20%5Cpropto%20N%20%5Cpropto%20L"> — Levenspiel’s own sentence, “for small deviations from plug flow, from Eq. 3 <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2%20%5Cpropto%20N"> or <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2%20%5Cpropto%20L">” — to printed inputs and produce printed answers. They are reproduced here because they are the only place in the chapter where the model’s <em>scaling with length</em> is exercised, and because getting the square wrong is the single most likely way to misuse it.</p>
<p>E14.2’s answer is obtained by <strong>root-finding</strong> the printed ratio <img src="https://latex.codecogs.com/png.latex?14/10.5%20=%20%5Csqrt%7BL/(L-119)%7D"> rather than by evaluating a rearrangement, and checked against the closed form <img src="https://latex.codecogs.com/png.latex?L%20=%20119/(1-(10.5/14)%5E2)"> — two routes that share no algebra.</p>
<div id="30bfc7d7" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.246798Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.246672Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.258022Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.257441Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- E14.1: the winery -------------------------------------------------</span></span>
<span id="cb8-2">L1, S1, S1SQ, L2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L_1"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_1"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_1_squared"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L_2"</span>)</span>
<span id="cb8-3">E141_S2SQ_P, E141_S2_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_2_squared"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma_2"</span>)</span>
<span id="cb8-4"></span>
<span id="cb8-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> S1SQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> S1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the book's own sigma_1^2 must be sigma_1 squared"</span></span>
<span id="cb8-6">E141_S2SQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S1SQ            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sigma^2 proportional to L</span></span>
<span id="cb8-7">E141_S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(E141_S2SQ)</span>
<span id="cb8-8">E141_S2SQ_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E141_S2SQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E141_S2SQ_P)</span>
<span id="cb8-9">E141_S2_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E141_S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E141_S2_P)</span>
<span id="cb8-10">E141_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> S1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> L2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L1       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what scaling sigma (not sigma^2) would give</span></span>
<span id="cb8-11"></span>
<span id="cb8-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- E14.2: the Ohio river --------------------------------------------</span></span>
<span id="cb8-13">X, SP, SC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x_Portsmouth_to_Cincinnati"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread_Portsmouth"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread_Cincinnati"</span>)</span>
<span id="cb8-14">E142_L_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"L"</span>)</span>
<span id="cb8-15">E142_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> L: SC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X)), X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>,</span>
<span id="cb8-16">                xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb8-17">E142_L_CLOSED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (SP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SC) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second, independent route</span></span>
<span id="cb8-18">E142_L_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E142_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E142_L_P)</span>
<span id="cb8-19">E142_TWO_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E142_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E142_L_CLOSED)</span>
<span id="cb8-20">E142_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SC)              <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># spread ~ distance, not spread^2</span></span>
<span id="cb8-21"></span>
<span id="cb8-22">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb8-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**E14.1** — pipeline </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m &amp;rarr; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> m, spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bottles.</span></span>
<span id="cb8-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma_2^2 = (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>L1<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>S1SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2SQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ against the printed</span></span>
<span id="cb8-25"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2SQ_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2SQ_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), so</span></span>
<span id="cb8-26"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma_2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ against the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span></span>
<span id="cb8-27"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) &amp;mdash; **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_S2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bottles of vin rose**.</span></span>
<span id="cb8-28"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Scaling $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma$ instead of $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2$ would give </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E141_WRONG_POWER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> bottles,</span></span>
<span id="cb8-29"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E141_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E141_S2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E141_S2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % high.</span></span>
<span id="cb8-30"></span>
<span id="cb8-31"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**E14.2** — root-finding the printed ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sqrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">L/(L-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb8-32"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gives $L = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_L<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ miles against the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_L_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span></span>
<span id="cb8-33"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_L_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); the closed form $L = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>X<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/(1-(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SC<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)^2)$ gives</span></span>
<span id="cb8-34"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_L_CLOSED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the two routes agreeing to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. Using the</span></span>
<span id="cb8-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">spread rather than its square would put the source at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_WRONG_POWER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> miles</span></span>
<span id="cb8-36"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">&amp;mdash; past Marietta and Parkersburg, and a different answer to the question asked.</span></span>
<span id="cb8-37"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>E14.1</strong> — pipeline 32 m → 50 m, spread 8 bottles. <img src="https://latex.codecogs.com/png.latex?%5Csigma_2%5E2%20=%20(50/32)(64)%20=%20100"> against the printed 100 (dev 0.0e+00), so <img src="https://latex.codecogs.com/png.latex?%5Csigma_2%20=%2010"> against the printed 10 (dev 0.0e+00) — <strong>10 bottles of vin rose</strong>. Scaling <img src="https://latex.codecogs.com/png.latex?%5Csigma"> instead of <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2"> would give 12.5 bottles, 25 % high.</p>
<p><strong>E14.2</strong> — root-finding the printed ratio 14/10.5 = <img src="https://latex.codecogs.com/png.latex?%5Csqrt%7BL/(L-119)%7D"> gives <img src="https://latex.codecogs.com/png.latex?L%20=%20272.000000"> miles against the printed 272 (dev 0.0e+00); the closed form <img src="https://latex.codecogs.com/png.latex?L%20=%20119/(1-(10.5/14)%5E2)"> gives 272.000000, the two routes agreeing to 0.0e+00. Using the spread rather than its square would put the source at 476 miles — past Marietta and Parkersburg, and a different answer to the question asked.</p>
</div>
</div>
</section>
<section id="e14.4-the-fit-and-everything-it-was-not-fitted-to" class="level3">
<h3 class="anchored" data-anchor-id="e14.4-the-fit-and-everything-it-was-not-fitted-to">2. E14.4: the fit, and everything it was not fitted to</h3>
<p>E14.4 is the one place in the chapter where <img src="https://latex.codecogs.com/png.latex?N"> is obtained from data rather than assumed, and it is the reason Eq. 4 exists. A sloppy tracer input with <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%20220"> s, <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2%20=%20100"> s² produces an output with <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%20280"> s, <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2%20=%201000"> s². Rather than deconvolve, Levenspiel <em>subtracts moments</em>:</p>
<p><img src="https://latex.codecogs.com/png.latex?%5CDelta%20%5Cbar%20t%20=%20280-220%20=%2060%5C%20%5Ctext%7Bs%7D,%5Cqquad%0A%20%20%5CDelta(%5Csigma%5E2)%20=%201000-100%20=%20900%5C%20%5Ctext%7Bs%7D%5E2,%5Cqquad%0A%20%20N%20=%20%5Cfrac%7B(%5CDelta%5Cbar%20t)%5E2%7D%7B%5CDelta(%5Csigma%5E2)%7D%20=%204%5C%20%5Ctext%7Btanks%7D."></p>
<p>That is <strong>two numbers in, one number out.</strong> Everything else in this section is a consequence of those two numbers that was not used to produce them.</p>
<p>The prefactor of the resulting <img src="https://latex.codecogs.com/png.latex?E"> curve is computed two independent ways: from <img src="https://latex.codecogs.com/png.latex?N%5EN/((N-1)!%5C,%5Cbar%20t%5E%7B%5C,N%7D)">, and by normalising <img src="https://latex.codecogs.com/png.latex?t%5E%7B3%7De%5E%7B-4t/60%7D"> to unit area with an independent quadrature. Neither route uses the other’s algebra.</p>
<div id="f87bc1b9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.260231Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.260093Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.285548Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.284720Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb9-1">TB_IN, V_IN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tbar_in"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"var_in"</span>)</span>
<span id="cb9-2">TB_OUT, V_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tbar_out"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"var_out"</span>)</span>
<span id="cb9-3">DTB_P, DV_P, N4_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_tbar"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"delta_var"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N"</span>)</span>
<span id="cb9-4">PRE_P, EXP_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_prefactor"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_exponent"</span>)</span>
<span id="cb9-5">TICK_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E_axis_top_tick"</span>)</span>
<span id="cb9-6"></span>
<span id="cb9-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the fit: Eq. 4 run backwards -----------------------------------------</span></span>
<span id="cb9-8">DTB, DV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TB_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TB_IN, V_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> V_IN</span>
<span id="cb9-9">E144_DTB_DEV, E144_DV_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DTB_P), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DV_P)</span>
<span id="cb9-10">E144_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DV</span>
<span id="cb9-11">E144_N_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E144_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N4_P)</span>
<span id="cb9-12">N4, TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(E144_N)), DTB</span>
<span id="cb9-13"></span>
<span id="cb9-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the E curve: two independent routes to the prefactor -----------------</span></span>
<span id="cb9-15">E144_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.exp(gammaln(N4)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> N4)</span>
<span id="cb9-16">_span, _npan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">200.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400000</span></span>
<span id="cb9-17">_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, _span, _npan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb9-18">_y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB4)</span>
<span id="cb9-19">_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb9-20">_area <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (_y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _y[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb9-21">E144_PRE_QUAD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _area                     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second route: normalise numerically</span></span>
<span id="cb9-22">E144_PRE_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E144_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> PRE_P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PRE_P</span>
<span id="cb9-23">E144_PRE_TWO_ROUTES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E144_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E144_PRE_QUAD) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_PRE</span>
<span id="cb9-24">E144_EXP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB4</span>
<span id="cb9-25">E144_EXP_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E144_EXP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> EXP_P)</span>
<span id="cb9-26"></span>
<span id="cb9-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the peak: root-found, never sampled ----------------------------------</span></span>
<span id="cb9-28">E144_TMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB4, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb9-29">E144_EMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E144_PRE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E144_TMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E144_TMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB4)</span>
<span id="cb9-30">_grid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1001</span>)           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what a sampled max would have given</span></span>
<span id="cb9-31">E144_EMAX_SAMPLED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(_grid, N4, TB4).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb9-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The SAME peak computed from the coefficients as the book ROUNDS AND PRINTS them</span></span>
<span id="cb9-33"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (3.2922e-6 and 0.0667, both from the CSV), which is the curve the axis tick of</span></span>
<span id="cb9-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Fig. E14.4b belongs to.  It is not the same number as E144_EMAX above, and the</span></span>
<span id="cb9-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defect section must use this one.</span></span>
<span id="cb9-36">E144_TMAX_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> EXP_P, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-13</span>)</span>
<span id="cb9-37">E144_EMAX_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> PRE_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E144_TMAX_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>EXP_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E144_TMAX_PRINTED)</span>
<span id="cb9-38">E144_TICK_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TICK_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E144_EMAX_PRINTED) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX_PRINTED</span>
<span id="cb9-39"></span>
<span id="cb9-40">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb9-41"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| step | this page | Levenspiel |</span></span>
<span id="cb9-42"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">|---|---|---|</span></span>
<span id="cb9-43"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DTB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DTB_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s (dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_DTB_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) |</span></span>
<span id="cb9-44"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2)$ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s² | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DV_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s² (dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_DV_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) |</span></span>
<span id="cb9-45"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| $N=(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t)^2/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2)$ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N4_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tanks (dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_N_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) |</span></span>
<span id="cb9-46"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| prefactor $N^N/((N-1)!</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)$ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_PRE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻⁴ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRE_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (rel dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_PRE_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) |</span></span>
<span id="cb9-47"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| the same by normalising $t^3e^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-4t/60</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_PRE_QUAD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻⁴ | two routes agree to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_PRE_TWO_ROUTES<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> |</span></span>
<span id="cb9-48"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">| exponent $N/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EXP<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻¹ | </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EXP_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (dev </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EXP_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, the book's rounding) |</span></span>
<span id="cb9-49"></span>
<span id="cb9-50"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The fitted $N$ is **exactly** </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: not rounded to it, equal to it, because</span></span>
<span id="cb9-51"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$60^2 = 3600$ and $4</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">times 900 = 3600$.</span></span>
<span id="cb9-52"></span>
<span id="cb9-53"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The curve peaks at $t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_TMAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s with</span></span>
<span id="cb9-54"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$E = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s⁻¹, root-found from $dE/dt = 0$. Sampling the same curve on</span></span>
<span id="cb9-55"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">a 1001-point grid over $[0, 4</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t]$ returns </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX_SAMPLED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻¹ instead</span></span>
<span id="cb9-56"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">&amp;mdash; close, and still a grid maximum. Evaluated instead with the coefficients</span></span>
<span id="cb9-57"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">as the book *rounds and prints* them (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRE_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EXP_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), the same curve</span></span>
<span id="cb9-58"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">peaks at $t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_TMAX_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s with</span></span>
<span id="cb9-59"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$E = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s⁻¹ &amp;mdash; a different number in the fifth digit, and</span></span>
<span id="cb9-60"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the one Fig. E14.4b's axis belongs to. Its top tick is printed</span></span>
<span id="cb9-61"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TICK_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** s⁻¹, which is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_TICK_ERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % away from that maximum;</span></span>
<span id="cb9-62"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">see *Printed defects*.</span></span>
<span id="cb9-63"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>step</th>
<th>this page</th>
<th>Levenspiel</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?%5CDelta%5Cbar%20t"></td>
<td>60 s</td>
<td>60 s (dev 0e+00)</td>
</tr>
<tr class="even">
<td><img src="https://latex.codecogs.com/png.latex?%5CDelta(%5Csigma%5E2)"></td>
<td>900 s²</td>
<td>900 s² (dev 0e+00)</td>
</tr>
<tr class="odd">
<td><img src="https://latex.codecogs.com/png.latex?N=(%5CDelta%5Cbar%20t)%5E2/%5CDelta(%5Csigma%5E2)"></td>
<td>4</td>
<td>4 tanks (dev 0e+00)</td>
</tr>
<tr class="even">
<td>prefactor <img src="https://latex.codecogs.com/png.latex?N%5EN/((N-1)!%5C,%5Cbar%20t%5E%7B%5C,N%7D)"></td>
<td>3.292181e-06 s⁻⁴</td>
<td>3.2922e-06 (rel dev 5.7e-06)</td>
</tr>
<tr class="odd">
<td>the same by normalising <img src="https://latex.codecogs.com/png.latex?t%5E3e%5E%7B-4t/60%7D"></td>
<td>3.292181e-06 s⁻⁴</td>
<td>two routes agree to 8.9e-14</td>
</tr>
<tr class="even">
<td>exponent <img src="https://latex.codecogs.com/png.latex?N/%5Cbar%20t"></td>
<td>0.0666667 s⁻¹</td>
<td>0.0667 (dev 3.3e-05, the book’s rounding)</td>
</tr>
</tbody>
</table>
<p>The fitted <img src="https://latex.codecogs.com/png.latex?N"> is <strong>exactly</strong> 4: not rounded to it, equal to it, because <img src="https://latex.codecogs.com/png.latex?60%5E2%20=%203600"> and <img src="https://latex.codecogs.com/png.latex?4%5Ctimes%20900%20=%203600">.</p>
<p>The curve peaks at <img src="https://latex.codecogs.com/png.latex?t%20=%2045"> s with <img src="https://latex.codecogs.com/png.latex?E%20=%200.0149361"> s⁻¹, root-found from <img src="https://latex.codecogs.com/png.latex?dE/dt%20=%200">. Sampling the same curve on a 1001-point grid over <img src="https://latex.codecogs.com/png.latex?%5B0,%204%5Cbar%20t%5D"> returns 0.014936 s⁻¹ instead — close, and still a grid maximum. Evaluated instead with the coefficients as the book <em>rounds and prints</em> them (3.2922e-06 and 0.0667), the same curve peaks at <img src="https://latex.codecogs.com/png.latex?t%20=%2044.9775"> s with <img src="https://latex.codecogs.com/png.latex?E%20=%200.0149138"> s⁻¹ — a different number in the fifth digit, and the one Fig. E14.4b’s axis belongs to. Its top tick is printed <strong>0.105</strong> s⁻¹, which is 604 % away from that maximum; see <em>Printed defects</em>.</p>
</div>
</div>
</section>
<section id="fig.-14.3s-seven-annotations" class="level3">
<h3 class="anchored" data-anchor-id="fig.-14.3s-seven-annotations">3. Fig. 14.3’s seven annotations</h3>
<p>Figure 14.3 is drawn, not computed, but everything written on it is exact algebra. Each statement below is obtained by <strong>root-finding on Eq. 3</strong> — <img src="https://latex.codecogs.com/png.latex?dE_%5Ctheta/d%5Ctheta%20=%200"> for the maximum, <img src="https://latex.codecogs.com/png.latex?d%5E2E_%5Ctheta/d%5Ctheta%5E2%20=%200"> for the two inflection points — never by scanning a grid, and then compared with the printed expression.</p>
<p>The Stirling annotation is the sharpest of them. “error <img src="https://latex.codecogs.com/png.latex?%3C%202%5C%25"> for <img src="https://latex.codecogs.com/png.latex?N%20%3E%205">” is a <em>threshold</em> claim, so it is tested by root-finding the <img src="https://latex.codecogs.com/png.latex?N"> at which the relative error of <img src="https://latex.codecogs.com/png.latex?N/%5Csqrt%7B2%5Cpi(N-1)%7D"> crosses 2 %, not by checking a few integers and declaring victory.</p>
<div id="16e1b3ae" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.287771Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.287592Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:51.699742Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:51.699011Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1">NS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>])</span>
<span id="cb10-2"></span>
<span id="cb10-3"></span>
<span id="cb10-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> theta_max_root(N):</span>
<span id="cb10-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th: (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>)</span>
<span id="cb10-6"></span>
<span id="cb10-7"></span>
<span id="cb10-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> inflections(N):</span>
<span id="cb10-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The two inflection points of Eq. 3, found by BRACKETING A SIGN CHANGE.</span></span>
<span id="cb10-10"></span>
<span id="cb10-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    d2E/dtheta2 = 0 is (N-1)(N-2)/u^2 - 2(N-1)/u + 1 = 0 with u = N theta.  The</span></span>
<span id="cb10-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    brackets come from a coarse scan, never from the analytic roots, so this is a</span></span>
<span id="cb10-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    root-find and not an evaluation.  At N = 2 the lower inflection sits exactly</span></span>
<span id="cb10-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    at theta = 0 (the density leaves the origin with zero curvature there), the</span></span>
<span id="cb10-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    scan finds only one interior sign change, and 0 is returned for the lower one.</span></span>
<span id="cb10-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    """</span></span>
<span id="cb10-17">    g <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th: (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb10-18">    scan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.geomspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20001</span>)</span>
<span id="cb10-19">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([g(s) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> s <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> scan])</span>
<span id="cb10-20">    idx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.nonzero(np.sign(vals[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sign(vals[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb10-21">    roots <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [brentq(g, scan[i], scan[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> idx]</span>
<span id="cb10-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(roots) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:</span>
<span id="cb10-23">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, roots[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb10-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(roots) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:</span>
<span id="cb10-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">raise</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">RuntimeError</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"N=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: found </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(roots)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> inflection points, expected 2"</span>)</span>
<span id="cb10-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> roots[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], roots[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb10-27"></span>
<span id="cb10-28"></span>
<span id="cb10-29">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb10-30"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NS:</span>
<span id="cb10-31">    tm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> theta_max_root(N)</span>
<span id="cb10-32">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> inflections(N)</span>
<span id="cb10-33">    em_root <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_theta(tm, N)</span>
<span id="cb10-34">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N,</span>
<span id="cb10-35">                     theta_max<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tm, theta_max_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N,</span>
<span id="cb10-36">                     width_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tm, width_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb10-37">                     Emax_root<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>em_root, Emax_printed<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>Emax_printed(N),</span>
<span id="cb10-38">                     stirling_rel_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Emax_stirling(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Emax_printed(N)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Emax_printed(N),</span>
<span id="cb10-39">                     Einf_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>E_theta(lo, N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> em_root, Einf_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>E_theta(hi, N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> em_root))</span>
<span id="cb10-40">FIG143 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb10-41">FIG143[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_max_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (FIG143.theta_max <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FIG143.theta_max_printed).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb10-42">FIG143[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"width_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (FIG143.width_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FIG143.width_printed).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb10-43">FIG143[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Emax_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((FIG143.Emax_root <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FIG143.Emax_printed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> FIG143.Emax_printed).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb10-44"></span>
<span id="cb10-45">THETA_MAX_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.theta_max_dev.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-46">WIDTH_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.width_dev.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-47">EMAX_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.Emax_dev.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb10-48"></span>
<span id="cb10-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Area = 1 and sigma^2_theta = 1/N, by quadrature on Eq. 3 (independent of the algebra)</span></span>
<span id="cb10-50">_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600001</span>)</span>
<span id="cb10-51">_hh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _th[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb10-52"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _simp(y):</span>
<span id="cb10-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> _hh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb10-54">AREA_DEV, MEAN_DEV, VAR_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb10-55"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>]:</span>
<span id="cb10-56">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_theta(_th, N)</span>
<span id="cb10-57">    a, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _simp(e), _simp(_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e)</span>
<span id="cb10-58">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _simp((_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> e)</span>
<span id="cb10-59">    AREA_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(AREA_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb10-60">    MEAN_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(MEAN_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb10-61">    VAR_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(VAR_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N))</span>
<span id="cb10-62"></span>
<span id="cb10-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two printed sigma^2 forms of Eq. 3 are the same number: tbar^2/N == N tbar_i^2</span></span>
<span id="cb10-64">_tb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span></span>
<span id="cb10-65">EQ3_VAR_IDENTITY <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_tb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (_tb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>])</span>
<span id="cb10-66"></span>
<span id="cb10-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the threshold, root-found</span></span>
<span id="cb10-68">STIRLING_NCRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(</span>
<span id="cb10-69">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> N: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Emax_stirling(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Emax_printed(N)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Emax_printed(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig14.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirling_error_bound"</span>),</span>
<span id="cb10-70">    <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb10-71">STIRLING_ERR_N5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirling_rel_err"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-72">STIRLING_ERR_N6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirling_rel_err"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-73"></span>
<span id="cb10-74">EINF_LO_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Einf_lo"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-75">EINF_HI_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Einf_hi"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-76">EINF_LO_N10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Einf_lo"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-77">EINF_HI_N10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Einf_hi"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb10-78">EINF_ASYMPTOTE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb10-79">EINF_P4, EINF_P10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig14.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Einf_over_Emax_N4"</span>), P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig14.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Einf_over_Emax_Nge10"</span>)</span>
<span id="cb10-80"></span>
<span id="cb10-81">display(FIG143[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_max"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theta_max_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"width_ratio"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"width_printed"</span>,</span>
<span id="cb10-82">                <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Emax_root"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Emax_printed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirling_rel_err"</span>]].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span>
<span id="cb10-83">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb10-84"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Over $N$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ root-found against the printed</span></span>
<span id="cb10-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$(N-1)/N$ to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>THETA_MAX_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ against the</span></span>
<span id="cb10-86"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed $2/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sqrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">N-1</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>WIDTH_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, and $E_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ evaluated at</span></span>
<span id="cb10-87"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the root against the printed closed form to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EMAX_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** relative. By</span></span>
<span id="cb10-88"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quadrature, area $-1$ is at most **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AREA_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, mean $-1$ at most</span></span>
<span id="cb10-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, and $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta - 1/N$ at most **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VAR_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**.</span></span>
<span id="cb10-90"></span>
<span id="cb10-91"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**The 2 % claim.** The relative error of $N/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sqrt</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pi(N-1)</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ crosses 2 % at</span></span>
<span id="cb10-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STIRLING_NCRIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$: it is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STIRLING_ERR_N5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at $N=5$ and</span></span>
<span id="cb10-93"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>STIRLING_ERR_N6 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at $N=6$. The printed "error &amp;lt; 2 % for $N &gt; 5$" is</span></span>
<span id="cb10-94"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">therefore correct, and correct at the tightest integer &amp;mdash; one lower and it</span></span>
<span id="cb10-95"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">would be false. (It is Stirling's series: the approximation is high by</span></span>
<span id="cb10-96"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$1/(12(N-1))$, which is 2 % at $N-1 = 4.17$.)</span></span>
<span id="cb10-97"></span>
<span id="cb10-98"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**The one annotation this page cannot settle.** Fig. 14.3 draws a single level</span></span>
<span id="cb10-99"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$E_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">text</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ and labels it $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cong </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_P4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,E_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ for</span></span>
<span id="cb10-100"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N=4$ and $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cong </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_P10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,E_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">max</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ for $N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ge 10$. The two inflection</span></span>
<span id="cb10-101"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">points do **not** sit at the same height: at $N=4$ they are at</span></span>
<span id="cb10-102"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_LO_N4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_HI_N4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of the maximum, and at $N=10$ at</span></span>
<span id="cb10-103"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_LO_N10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_HI_N10<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The printed value lies between them in both</span></span>
<span id="cb10-104"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cases (their geometric mean is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(EINF_LO_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> EINF_HI_N4)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $N=4$,</span></span>
<span id="cb10-105"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(EINF_LO_N10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> EINF_HI_N10)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $N=10$), and the $N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ge 10$ figure is the</span></span>
<span id="cb10-106"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Gaussian limit $e^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-1/2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EINF_ASYMPTOTE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. Which convention the figure</span></span>
<span id="cb10-107"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">intends is not recoverable from the page, so **both heights are reported and</span></span>
<span id="cb10-108"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">neither is scored as an agreement.**</span></span>
<span id="cb10-109"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">N</th>
<th data-quarto-table-cell-role="th">theta_max</th>
<th data-quarto-table-cell-role="th">theta_max_printed</th>
<th data-quarto-table-cell-role="th">width_ratio</th>
<th data-quarto-table-cell-role="th">width_printed</th>
<th data-quarto-table-cell-role="th">Emax_root</th>
<th data-quarto-table-cell-role="th">Emax_printed</th>
<th data-quarto-table-cell-role="th">stirling_rel_err</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>2</td>
<td>0.500000</td>
<td>0.500000</td>
<td>2.000000</td>
<td>2.000000</td>
<td>0.735759</td>
<td>0.735759</td>
<td>0.084438</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>3</td>
<td>0.666667</td>
<td>0.666667</td>
<td>1.414214</td>
<td>1.414214</td>
<td>0.812012</td>
<td>0.812012</td>
<td>0.042207</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>4</td>
<td>0.750000</td>
<td>0.750000</td>
<td>1.154701</td>
<td>1.154701</td>
<td>0.896167</td>
<td>0.896167</td>
<td>0.028065</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>5</td>
<td>0.800000</td>
<td>0.800000</td>
<td>1.000000</td>
<td>1.000000</td>
<td>0.976834</td>
<td>0.976834</td>
<td>0.021008</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>6</td>
<td>0.833333</td>
<td>0.833333</td>
<td>0.894427</td>
<td>0.894427</td>
<td>1.052804</td>
<td>1.052804</td>
<td>0.016784</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>8</td>
<td>0.875000</td>
<td>0.875000</td>
<td>0.755929</td>
<td>0.755929</td>
<td>1.192022</td>
<td>1.192022</td>
<td>0.011968</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>10</td>
<td>0.900000</td>
<td>0.900000</td>
<td>0.666667</td>
<td>0.666667</td>
<td>1.317556</td>
<td>1.317556</td>
<td>0.009298</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">7</th>
<td>16</td>
<td>0.937500</td>
<td>0.937500</td>
<td>0.516398</td>
<td>0.516398</td>
<td>1.638974</td>
<td>1.638974</td>
<td>0.005570</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">8</th>
<td>25</td>
<td>0.960000</td>
<td>0.960000</td>
<td>0.408248</td>
<td>0.408248</td>
<td>2.028788</td>
<td>2.028788</td>
<td>0.003478</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">9</th>
<td>50</td>
<td>0.980000</td>
<td>0.980000</td>
<td>0.285714</td>
<td>0.285714</td>
<td>2.844746</td>
<td>2.844746</td>
<td>0.001702</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">10</th>
<td>100</td>
<td>0.990000</td>
<td>0.990000</td>
<td>0.201008</td>
<td>0.201008</td>
<td>4.006147</td>
<td>4.006147</td>
<td>0.000842</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">11</th>
<td>200</td>
<td>0.995000</td>
<td>0.995000</td>
<td>0.141776</td>
<td>0.141776</td>
<td>5.653686</td>
<td>5.653686</td>
<td>0.000419</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">12</th>
<td>400</td>
<td>0.997500</td>
<td>0.997500</td>
<td>0.100125</td>
<td>0.100125</td>
<td>7.987170</td>
<td>7.987170</td>
<td>0.000209</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Over <img src="https://latex.codecogs.com/png.latex?N"> = 2 to 400: <img src="https://latex.codecogs.com/png.latex?%5Ctheta_%7B%5Cmax%7D"> root-found against the printed <img src="https://latex.codecogs.com/png.latex?(N-1)/N"> to <strong>2.2e-16</strong>, <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Ctheta/%5Ctheta_%7B%5Cmax%7D"> against the printed <img src="https://latex.codecogs.com/png.latex?2/%5Csqrt%7BN-1%7D"> to <strong>2.7e-15</strong>, and <img src="https://latex.codecogs.com/png.latex?E_%7B%5Ctheta,%5Cmax%7D"> evaluated at the root against the printed closed form to <strong>0.0e+00</strong> relative. By quadrature, area <img src="https://latex.codecogs.com/png.latex?-1"> is at most <strong>2.6e-14</strong>, mean <img src="https://latex.codecogs.com/png.latex?-1"> at most <strong>2.6e-14</strong>, and <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20-%201/N"> at most <strong>5.3e-16</strong>.</p>
<p><strong>The 2 % claim.</strong> The relative error of <img src="https://latex.codecogs.com/png.latex?N/%5Csqrt%7B2%5Cpi(N-1)%7D"> crosses 2 % at <img src="https://latex.codecogs.com/png.latex?N%20=%205.2004">: it is 2.10 % at <img src="https://latex.codecogs.com/png.latex?N=5"> and 1.68 % at <img src="https://latex.codecogs.com/png.latex?N=6">. The printed “error &lt; 2 % for <img src="https://latex.codecogs.com/png.latex?N%20%3E%205">” is therefore correct, and correct at the tightest integer — one lower and it would be false. (It is Stirling’s series: the approximation is high by <img src="https://latex.codecogs.com/png.latex?1/(12(N-1))">, which is 2 % at <img src="https://latex.codecogs.com/png.latex?N-1%20=%204.17">.)</p>
<p><strong>The one annotation this page cannot settle.</strong> Fig. 14.3 draws a single level <img src="https://latex.codecogs.com/png.latex?E_%7B%5Ctheta,%5Ctext%7Binf%7D%7D"> and labels it <img src="https://latex.codecogs.com/png.latex?%5Ccong%200.55%5C,E_%7B%5Ctheta,%5Cmax%7D"> for <img src="https://latex.codecogs.com/png.latex?N=4"> and <img src="https://latex.codecogs.com/png.latex?%5Ccong%200.61%5C,E_%7B%5Ctheta,%5Cmax%7D"> for <img src="https://latex.codecogs.com/png.latex?N%5Cge%2010">. The two inflection points do <strong>not</strong> sit at the same height: at <img src="https://latex.codecogs.com/png.latex?N=4"> they are at 0.4267 and 0.6943 of the maximum, and at <img src="https://latex.codecogs.com/png.latex?N=10"> at 0.5225 and 0.6631. The printed value lies between them in both cases (their geometric mean is 0.5443 at <img src="https://latex.codecogs.com/png.latex?N=4">, 0.5886 at <img src="https://latex.codecogs.com/png.latex?N=10">), and the <img src="https://latex.codecogs.com/png.latex?N%5Cge%2010"> figure is the Gaussian limit <img src="https://latex.codecogs.com/png.latex?e%5E%7B-1/2%7D%20=%200.6065">. Which convention the figure intends is not recoverable from the page, so <strong>both heights are reported and neither is scored as an agreement.</strong></p>
</div>
</div>
</section>
<section id="the-rtd-three-ways" class="level3">
<h3 class="anchored" data-anchor-id="the-rtd-three-ways">4. The RTD, three ways</h3>
<p>The exit curve is computed by</p>
<ol type="1">
<li><strong>pymrm</strong> — a pulse into tank 1 of the <img src="https://latex.codecogs.com/png.latex?N">-cell cascade, marched with Crank–Nicolson;</li>
<li><strong>Eq. 3</strong> — the closed form, in the second of its four printed shapes;</li>
<li><strong>explicit convolution</strong> — <img src="https://latex.codecogs.com/png.latex?E_M%20%5Cstar%20E_N"> evaluated by Simpson quadrature, which is the <em>definition</em> of two vessels in series and shares no assembly with either of the others.</li>
</ol>
<p>Route 3 is what makes Eq. 4 testable rather than assumed, and it is the one used in the additivity section below. Route 1 carries a genuine time-step error, and it is refined.</p>
<div id="abb7df5f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:51.701829Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:51.701568Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:52.276703Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:52.276077Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb11-1">NT_PROD, TMAX_PROD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4000</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">300.0</span></span>
<span id="cb11-2"></span>
<span id="cb11-3"></span>
<span id="cb11-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rtd_error(N, tbar, nt, theta):</span>
<span id="cb11-5">    ts, es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tbar).pulse_response(TMAX_PROD, nt, theta<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>theta)</span>
<span id="cb11-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E_time(ts, N, tbar)))), ts, es</span>
<span id="cb11-7"></span>
<span id="cb11-8"></span>
<span id="cb11-9">NTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4000</span>])</span>
<span id="cb11-10">ERR_CN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([rtd_error(N4, TB4, nt, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NTS])</span>
<span id="cb11-11">ERR_IE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([rtd_error(N4, TB4, nt, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NTS])</span>
<span id="cb11-12">ORDER_CN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> NTS), np.log(ERR_CN), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb11-13">ORDER_IE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> NTS), np.log(ERR_IE), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb11-14">RTD_MAX_DEV, TS_P, ES_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rtd_error(N4, TB4, NT_PROD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)</span>
<span id="cb11-15"></span>
<span id="cb11-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># area under the pymrm curve: 1 by physics, not by normalisation.  The window stops</span></span>
<span id="cb11-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at TMAX_PROD, so the analytic tail of Eq. 3 beyond it is computed and reported</span></span>
<span id="cb11-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># separately - otherwise the truncation would be mistaken for solver error.</span></span>
<span id="cb11-19">_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TS_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> TS_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb11-20">RTD_AREA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ES_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ES_P[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ES_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()</span>
<span id="cb11-21">                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ES_P[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()))</span>
<span id="cb11-22">RTD_AREA_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(RTD_AREA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb11-23">_tail <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(TMAX_PROD, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200001</span>)</span>
<span id="cb11-24">_ht <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _tail[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _tail[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb11-25">_yt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_time(_tail, N4, TB4)</span>
<span id="cb11-26">RTD_TAIL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_ht <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (_yt[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _yt[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _yt[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _yt[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()))</span>
<span id="cb11-27">RTD_AREA_RESIDUAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(RTD_AREA_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RTD_TAIL)</span>
<span id="cb11-28"></span>
<span id="cb11-29"></span>
<span id="cb11-30"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> convolve_E(t, M, N, tiM, tiN, npan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span>):</span>
<span id="cb11-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(E_M * E_N)(t) by composite Simpson on [0, t].  No cascade, no gamma identity."""</span></span>
<span id="cb11-32">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.empty_like(t)</span>
<span id="cb11-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j, tt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(t):</span>
<span id="cb11-34">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb11-35">            out[j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb11-36">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb11-37">        s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, tt, npan <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-38">        y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_time(s, M, M <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tiM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E_time(tt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s, N, N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tiN)</span>
<span id="cb11-39">        h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> s[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb11-40">        out[j] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb11-41">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb11-42"></span>
<span id="cb11-43"></span>
<span id="cb11-44">_tc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, TMAX_PROD, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">121</span>)</span>
<span id="cb11-45">CONV_EQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> convolve_E(_tc, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4, TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4)</span>
<span id="cb11-46">RTD_CONV_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CONV_EQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E_time(_tc, N4, TB4))))</span>
<span id="cb11-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and the same thing on 1/100 of the panels.  For EQUAL tank sizes the</span></span>
<span id="cb11-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># integrand E_M(s) E_N(t-s) collapses to s^(M-1)(t-s)^(N-1)e^(-t/t_i), a</span></span>
<span id="cb11-49"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># polynomial of degree M+N-2 = 2 times a constant-in-s exponential, and Simpson</span></span>
<span id="cb11-50"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is EXACT on cubics.  If the two numbers below agree, the check is an identity</span></span>
<span id="cb11-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and bounds nothing about the quadrature.</span></span>
<span id="cb11-52">RTD_CONV_DEV_COARSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(convolve_E(_tc, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4, TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4, npan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb11-53">                                          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E_time(_tc, N4, TB4))))</span>
<span id="cb11-54"></span>
<span id="cb11-55">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6</span>))</span>
<span id="cb11-56"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>]:</span>
<span id="cb11-57">    th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>)</span>
<span id="cb11-58">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(th, E_theta(th, N), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-59">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta = t/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">E_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\t</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">heta</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-60">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3, dimensionless"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylim(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.4</span>)</span>
<span id="cb11-61"></span>
<span id="cb11-62">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(TS_P, E_time(TS_P, N4, TB4), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3 (closed form)"</span>)</span>
<span id="cb11-63">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(TS_P[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>], ES_P[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm cascade (Crank-Nicolson)"</span>)</span>
<span id="cb11-64">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(_tc[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], CONV_EQ[::<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">E_2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">tar E_2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Simpson</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-65">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axvline(E144_TMAX, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>)</span>
<span id="cb11-66">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t, s"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"E, s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb11-67">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"E14.4: N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TB4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>)</span>
<span id="cb11-68">plt.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb11-69"></span>
<span id="cb11-70">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb11-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">At the production time step ($n_t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NT_PROD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TMAX_PROD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s) the pymrm</span></span>
<span id="cb11-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cascade reproduces Eq. 3 to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_MAX_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** s⁻¹, against a peak of</span></span>
<span id="cb11-73"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻¹. Refining the step: Crank-Nicolson at observed order</span></span>
<span id="cb11-74"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORDER_CN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, implicit Euler at **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ORDER_IE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** &amp;mdash; both the expected</span></span>
<span id="cb11-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">values, and the check is on the step because the *cell* count is the model.</span></span>
<span id="cb11-76"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The area under the pymrm curve falls **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_AREA_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** short of 1 with no</span></span>
<span id="cb11-77"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">normalisation applied anywhere - the injected amount is one mole into $V_1$ and</span></span>
<span id="cb11-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$E = uC_N$ throughout - and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_TAIL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of that is the analytic tail of Eq. 3</span></span>
<span id="cb11-79"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">beyond $t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TMAX_PROD<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s, leaving **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_AREA_RESIDUAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** that the march is</span></span>
<span id="cb11-80"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">responsible for.</span></span>
<span id="cb11-81"></span>
<span id="cb11-82"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The convolution route $E_2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">star E_2$ lands on the same curve to</span></span>
<span id="cb11-83"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_CONV_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** &amp;mdash; and it does so on 2000 panels and on</span></span>
<span id="cb11-84"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> panels alike (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_CONV_DEV_COARSE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), which is the tell. For *equal*</span></span>
<span id="cb11-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tank sizes the integrand is a cubic in $s$ times a constant, Simpson integrates</span></span>
<span id="cb11-86"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cubics exactly, and this number is therefore a **structural identity**, not an</span></span>
<span id="cb11-87"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">independent measurement: it checks the transcription of Eq. 3 and the plumbing</span></span>
<span id="cb11-88"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of `convolve_E`, and it bounds nothing about the quadrature error on the</span></span>
<span id="cb11-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">*unequal* chains that the next two sections actually integrate. It is labelled</span></span>
<span id="cb11-90"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">structural in the coverage map for that reason, and the page's independent route</span></span>
<span id="cb11-91"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">to the RTD is the Crank-Nicolson march against Eq. 3 above (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RTD_MAX_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">).</span></span>
<span id="cb11-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A2.4-tanks-in-series/index_files/figure-html/cell-10-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>At the production time step (<img src="https://latex.codecogs.com/png.latex?n_t%20=%204000"> over 300 s) the pymrm cascade reproduces Eq. 3 to <strong>3.65e-08</strong> s⁻¹, against a peak of 0.01494 s⁻¹. Refining the step: Crank-Nicolson at observed order <strong>2.000</strong>, implicit Euler at <strong>0.988</strong> — both the expected values, and the check is on the step because the <em>cell</em> count is the model. The area under the pymrm curve falls <strong>3.20e-06</strong> short of 1 with no normalisation applied anywhere - the injected amount is one mole into <img src="https://latex.codecogs.com/png.latex?V_1"> and <img src="https://latex.codecogs.com/png.latex?E%20=%20uC_N"> throughout - and 3.20e-06 of that is the analytic tail of Eq. 3 beyond <img src="https://latex.codecogs.com/png.latex?t%20=%20300"> s, leaving <strong>8.7e-11</strong> that the march is responsible for.</p>
<p>The convolution route <img src="https://latex.codecogs.com/png.latex?E_2%5Cstar%20E_2"> lands on the same curve to <strong>6.9e-18</strong> — and it does so on 2000 panels and on 20 panels alike (8.7e-18), which is the tell. For <em>equal</em> tank sizes the integrand is a cubic in <img src="https://latex.codecogs.com/png.latex?s"> times a constant, Simpson integrates cubics exactly, and this number is therefore a <strong>structural identity</strong>, not an independent measurement: it checks the transcription of Eq. 3 and the plumbing of <code>convolve_E</code>, and it bounds nothing about the quadrature error on the <em>unequal</em> chains that the next two sections actually integrate. It is labelled structural in the coverage map for that reason, and the page’s independent route to the RTD is the Crank-Nicolson march against Eq. 3 above (3.65e-08).</p>
</div>
</div>
</section>
<section id="additivity-and-the-assumption-it-hides" class="level3">
<h3 class="anchored" data-anchor-id="additivity-and-the-assumption-it-hides">5. Additivity, and the assumption it hides</h3>
<p>Eq. 4 is a <em>structural</em> claim: for equal tanks it is the statement that a Gamma distribution convolved with a Gamma distribution of the same scale is a Gamma distribution, and the check below closes to round-off because it must. Reporting that as evidence would be exactly the “check that cannot fail”.</p>
<p>What the check <em>can</em> do is show what Eq. 4’s parenthesis — “(all of the same size)” — is worth. The means and variances of two <strong>unequal</strong> blocks still add: that is true of any two independent stages and has nothing to do with tanks in series. The <em>shape</em> does not follow. Below, two blocks with different tank sizes are convolved, and the result is compared with the tanks-in-series curve carrying the same mean and the same variance.</p>
<div id="95efc4eb" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:52.279349Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:52.279216Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:52.669580Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:52.668775Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1">TI <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4</span>
<span id="cb12-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The window has to hold essentially the whole composite before the moment</span></span>
<span id="cb12-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># integrals below mean anything: the composite has tbar = 80 s, and a 340 s</span></span>
<span id="cb12-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># window truncates enough tail to dominate them (measured in the table below).</span></span>
<span id="cb12-5">EQ4_WINDOW, EQ4_NPTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">800.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">331</span></span>
<span id="cb12-6">_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, EQ4_WINDOW, EQ4_NPTS)</span>
<span id="cb12-7"></span>
<span id="cb12-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (a) equal tanks: structural, closes to round-off</span></span>
<span id="cb12-9">EQ4_EQUAL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(convolve_E(_t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, TI, TI) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E_time(_t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TI))))</span>
<span id="cb12-10"></span>
<span id="cb12-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (b) unequal blocks: 2 tanks of 10 s followed by 3 tanks of 20 s</span></span>
<span id="cb12-12">tA, tB, MA, MB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb12-13">CONV_UNEQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> convolve_E(_t, MA, MB, tA, tB)</span>
<span id="cb12-14">MEAN_UNEQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> MB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tB</span>
<span id="cb12-15">VAR_UNEQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> MB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> tB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb12-16">N_MOMENT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MEAN_UNEQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> VAR_UNEQ</span>
<span id="cb12-17"></span>
<span id="cb12-18"></span>
<span id="cb12-19"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> eq4_moment_devs(window, npts):</span>
<span id="cb12-20">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The two moment integrals on a given outer limit of the quadrature."""</span></span>
<span id="cb12-21">    t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, window, npts)</span>
<span id="cb12-22">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> convolve_E(t, MA, MB, tA, tB)</span>
<span id="cb12-23">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> t[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb12-24">    sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> y: h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> y[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb12-25">    m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sq(t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sq(c)</span>
<span id="cb12-26">    v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sq((t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sq(c)</span>
<span id="cb12-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> MEAN_UNEQ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> MEAN_UNEQ, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> VAR_UNEQ) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> VAR_UNEQ</span>
<span id="cb12-28"></span>
<span id="cb12-29"></span>
<span id="cb12-30">EQ4_WIN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(</span>
<span id="cb12-31">    [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(window_s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>w, npts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, mean_reldev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>eq4_moment_devs(w, n)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>],</span>
<span id="cb12-32">          var_reldev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>eq4_moment_devs(w, n)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb12-33">     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">340.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">141</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">500.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">207</span>), (EQ4_WINDOW, EQ4_NPTS), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">495</span>)]])</span>
<span id="cb12-34">EQ4_MEAN_DEV, EQ4_VAR_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq4_moment_devs(EQ4_WINDOW, EQ4_NPTS)</span>
<span id="cb12-35">EQ4_MEAN_DEV_SHORT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EQ4_WIN.mean_reldev.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb12-36">EQ4_VAR_DEV_SHORT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(EQ4_WIN.var_reldev.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb12-37"></span>
<span id="cb12-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The shape gap is an EXTREMUM, so it is bracketed and refined, not sampled.</span></span>
<span id="cb12-39">_gap_fn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(convolve_E(np.array([t]), MA, MB, tA, tB)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb12-40">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(t, N_MOMENT, MEAN_UNEQ)))</span>
<span id="cb12-41">CONV_UNEQ_PEAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_brent(</span>
<span id="cb12-42">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(convolve_E(np.array([t]), MA, MB, tA, tB)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, EQ4_WINDOW)</span>
<span id="cb12-43">EQ4_UNEQUAL_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_brent(_gap_fn, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, EQ4_WINDOW) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CONV_UNEQ_PEAK</span>
<span id="cb12-44">EQ4_UNEQUAL_GAP_SAMPLED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(CONV_UNEQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E_time(_t, N_MOMENT, MEAN_UNEQ)))</span>
<span id="cb12-45">                                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CONV_UNEQ.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb12-46"></span>
<span id="cb12-47">display(EQ4_WIN.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span>
<span id="cb12-48">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb12-49"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**Equal tanks.** $E_2</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">star E_3$ against $E_5$ with the same $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t_i$:</span></span>
<span id="cb12-50"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_EQUAL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** s⁻¹. This is an identity and is labelled as one; it cannot</span></span>
<span id="cb12-51"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">fail and it is not evidence for anything physical. It does not protect the</span></span>
<span id="cb12-52"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quadrature either: for equal tank sizes the integrand is a cubic and Simpson is</span></span>
<span id="cb12-53"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">exact on cubics, which is why the same number comes back on 20 panels. The</span></span>
<span id="cb12-54"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quadrature is instead pinned by refining it directly, on the *unequal* integrand</span></span>
<span id="cb12-55"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">where it is not exact.</span></span>
<span id="cb12-56"></span>
<span id="cb12-57"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**Unequal blocks.** </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tanks of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tA<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s followed by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> tanks of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s.</span></span>
<span id="cb12-58"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The first two moments of the composite are $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sum t_i = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_UNEQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s and</span></span>
<span id="cb12-59"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sum t_i^2 = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>VAR_UNEQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s², and they add for *any* independent stages, exactly,</span></span>
<span id="cb12-60"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by a one-line argument &amp;mdash; so the two deviations in the table above measure</span></span>
<span id="cb12-61"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**the outer limit of the quadrature and nothing else**. That is worth showing</span></span>
<span id="cb12-62"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rather than hiding: on the 340 s window a reader would see </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_MEAN_DEV_SHORT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span></span>
<span id="cb12-63"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_VAR_DEV_SHORT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and might take them for a test of additivity, whereas</span></span>
<span id="cb12-64"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">they are the truncated tail of a distribution with $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_UNEQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s. On</span></span>
<span id="cb12-65"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_WINDOW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s window used here they fall to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_MEAN_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> and</span></span>
<span id="cb12-66"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_VAR_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, and they stay there.</span></span>
<span id="cb12-67"></span>
<span id="cb12-68"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The *shape* is the part that can fail. The moment-matched tanks-in-series curve</span></span>
<span id="cb12-69"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">($N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_MOMENT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MEAN_UNEQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s) misses the true composite by</span></span>
<span id="cb12-70"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_UNEQUAL_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** of its peak &amp;mdash; bracketed and refined with</span></span>
<span id="cb12-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Brent's method rather than read off the plotting grid, which would have given</span></span>
<span id="cb12-72"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ4_UNEQUAL_GAP_SAMPLED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. Eq. 4's parenthesis is doing work.</span></span>
<span id="cb12-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">window_s</th>
<th data-quarto-table-cell-role="th">npts</th>
<th data-quarto-table-cell-role="th">mean_reldev</th>
<th data-quarto-table-cell-role="th">var_reldev</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>340.0</td>
<td>141</td>
<td>7.569460e-05</td>
<td>1.210169e-03</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>500.0</td>
<td>207</td>
<td>2.110000e-08</td>
<td>2.526700e-06</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>800.0</td>
<td>331</td>
<td>6.720000e-08</td>
<td>2.939000e-07</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>1200.0</td>
<td>495</td>
<td>6.810000e-08</td>
<td>2.974000e-07</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Equal tanks.</strong> <img src="https://latex.codecogs.com/png.latex?E_2%5Cstar%20E_3"> against <img src="https://latex.codecogs.com/png.latex?E_5"> with the same <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t_i">: <strong>6.94e-18</strong> s⁻¹. This is an identity and is labelled as one; it cannot fail and it is not evidence for anything physical. It does not protect the quadrature either: for equal tank sizes the integrand is a cubic and Simpson is exact on cubics, which is why the same number comes back on 20 panels. The quadrature is instead pinned by refining it directly, on the <em>unequal</em> integrand where it is not exact.</p>
<p><strong>Unequal blocks.</strong> 2 tanks of 10 s followed by 3 tanks of 20 s. The first two moments of the composite are <img src="https://latex.codecogs.com/png.latex?%5Csum%20t_i%20=%2080"> s and <img src="https://latex.codecogs.com/png.latex?%5Csum%20t_i%5E2%20=%201400"> s², and they add for <em>any</em> independent stages, exactly, by a one-line argument — so the two deviations in the table above measure <strong>the outer limit of the quadrature and nothing else</strong>. That is worth showing rather than hiding: on the 340 s window a reader would see 7.6e-05 and 1.2e-03 and might take them for a test of additivity, whereas they are the truncated tail of a distribution with <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%2080"> s. On the 800 s window used here they fall to 6.7e-08 and 2.9e-07, and they stay there.</p>
<p>The <em>shape</em> is the part that can fail. The moment-matched tanks-in-series curve (<img src="https://latex.codecogs.com/png.latex?N%20=%204.5714">, <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%2080"> s) misses the true composite by <strong>1.8483 %</strong> of its peak — bracketed and refined with Brent’s method rather than read off the plotting grid, which would have given 1.8479 %. Eq. 4’s parenthesis is doing work.</p>
</div>
</div>
</section>
<section id="conversion-what-the-fitted-n-predicts" class="level3">
<h3 class="anchored" data-anchor-id="conversion-what-the-fitted-n-predicts">6. Conversion: what the fitted <img src="https://latex.codecogs.com/png.latex?N"> predicts</h3>
<p>Everything in this section is held out of the E14.4 fit, which used two moments and nothing else. Three routes to the first-order exit concentration, sharing no code:</p>
<ul>
<li><strong>pymrm</strong> — one sparse factorisation of the cascade with a linear sink;</li>
<li><strong>Eq. 9</strong> — <img src="https://latex.codecogs.com/png.latex?%5Cleft(1+k%5Cbar%20t/N%5Cright)%5E%7B-N%7D">;</li>
<li><strong>Eq. 11</strong> — the macrofluid integral <img src="https://latex.codecogs.com/png.latex?%5Cint_0%5E%5Cinfty%20e%5E%7B-kt%7DE(t)%5C,dt"> by Simpson quadrature, which is the Laplace transform of Eq. 3 computed numerically.</li>
</ul>
<p>For a first-order reaction the last two <em>must</em> agree, because Levenspiel writes “These equations apply to both micro- and macrofluids” — micromixing cannot matter when the rate is linear — so route 3 is a real test of Eq. 11’s transcription, of the assumed <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%5E%7B%5C,N%7D"> denominator, and of the quadrature, against an algebraic answer none of them can see.</p>
<p>Second order splits the two: Eq. 10’s nest of radicals is the microfluid, Eq. 11 with the batch solution <img src="https://latex.codecogs.com/png.latex?C_0/(1+kC_0t)"> is the macrofluid, and they are different numbers.</p>
<div id="763bb986" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:52.671673Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:52.671491Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:54.005353Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:54.004203Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb13-1">KTS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>])</span>
<span id="cb13-2">NN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>]</span>
<span id="cb13-3"></span>
<span id="cb13-4">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb13-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NN:</span>
<span id="cb13-6">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KTS:</span>
<span id="cb13-7">        pym, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).first_order(kt)</span>
<span id="cb13-8">        alg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq9(N, kt)</span>
<span id="cb13-9">        mac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq11(N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, kk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt: np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb13-10">        rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N, ktbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, pymrm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pym, eq9<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alg, eq11<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mac))</span>
<span id="cb13-11">FO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb13-12">FO[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (FO.pymrm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FO.eq9).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb13-13">FO[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (FO.eq11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> FO.eq9).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb13-14">PYMRM_EQ9_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FO.pymrm_dev.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb13-15">EQ11_EQ9_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FO.eq11_dev.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb13-16">EQ11_NORM_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eq11(N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: np.ones_like(t)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NN)</span>
<span id="cb13-17"></span>
<span id="cb13-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Simpson refinement of Eq. 11 - the quadrature IS the refinable axis here</span></span>
<span id="cb13-19">_pans <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2500</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20000</span>])</span>
<span id="cb13-20">_qerr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eq11(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t), npanel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb13-21">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _pans])</span>
<span id="cb13-22">EQ11_QUAD_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _pans), np.log(_qerr), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb13-23"></span>
<span id="cb13-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># second order: pymrm Newton vs Eq. 10, and macro vs micro</span></span>
<span id="cb13-25">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb13-26"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NN:</span>
<span id="cb13-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> KTS:</span>
<span id="cb13-28">        pym, _, sol <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).order_n(kt, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb13-29">        alg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq10(N, kt, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb13-30">        mac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq11(N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t, kk<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t))</span>
<span id="cb13-31">        rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N, kC0tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, pymrm<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pym, eq10<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>alg, eq11_macro<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>mac,</span>
<span id="cb13-32">                         nit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sol.nit))</span>
<span id="cb13-33">SO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb13-34">SO[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_dev"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (SO.pymrm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SO.eq10).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb13-35">SO[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"macro_micro_gap"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((SO.eq11_macro <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SO.eq10) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SO.eq10).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()</span>
<span id="cb13-36">PYMRM_EQ10_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SO.pymrm_dev.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb13-37">MACRO_MICRO_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(SO.macro_micro_gap.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb13-38">MACRO_MICRO_ROW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SO.loc[SO.macro_micro_gap.idxmax()]</span>
<span id="cb13-39">NEWTON_MAX_IT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(SO.nit.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb13-40"></span>
<span id="cb13-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed small-deviation asymptote, for equal volume</span></span>
<span id="cb13-42">ASYM_NS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">320</span>])</span>
<span id="cb13-43">_kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb13-44">_asym_err <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((eq9(n, _kt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_kt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (_kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> n)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb13-45">                      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ASYM_NS])</span>
<span id="cb13-46">ASYM_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(ASYM_NS), np.log(_asym_err), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb13-47">ASYM_DEV_N320 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_asym_err[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb13-48"></span>
<span id="cb13-49">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb13-50"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**First order, three routes.** Over </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(NN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values of $N$ and</span></span>
<span id="cb13-51"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(KTS)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> values of $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ (to $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>KTS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$):</span></span>
<span id="cb13-52"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pymrm against Eq. 9 to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PYMRM_EQ9_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, and the Eq. 11 macrofluid</span></span>
<span id="cb13-53"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quadrature against Eq. 9 to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ11_EQ9_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**. Eq. 11 with a batch solution</span></span>
<span id="cb13-54"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of 1 integrates to 1 to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ11_NORM_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, which is the check that fixes the</span></span>
<span id="cb13-55"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ reading of its denominator. The Simpson error falls at observed</span></span>
<span id="cb13-56"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">order **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EQ11_QUAD_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**.</span></span>
<span id="cb13-57"></span>
<span id="cb13-58"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**Second order.** pymrm's Newton solve (pointwise `NumJac`, at most</span></span>
<span id="cb13-59"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NEWTON_MAX_IT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> iterations) against Eq. 10's nest of $N$ radicals to</span></span>
<span id="cb13-60"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PYMRM_EQ10_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**. Micro- and macrofluid are *not* the same here: the gap</span></span>
<span id="cb13-61"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reaches **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MACRO_MICRO_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(MACRO_MICRO_ROW.N)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$,</span></span>
<span id="cb13-62"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$kC_0</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MACRO_MICRO_ROW<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>kC0tbar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, and it is the macrofluid that converts</span></span>
<span id="cb13-63"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">further. This is the same statement [`A2.8`](../A2.8-zwietering-segregation/)</span></span>
<span id="cb13-64"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">makes with bounds; here it is the two specific states Levenspiel prints.</span></span>
<span id="cb13-65"></span>
<span id="cb13-66"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**The printed asymptote.** $C_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">A,N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/C_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Ap</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 1 + (k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t)^2/(2N)$ for the same</span></span>
<span id="cb13-67"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">volume: the relative error of that expression falls at observed order</span></span>
<span id="cb13-68"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASYM_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** in $N$ and is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASYM_DEV_N320<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASYM_NS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, so the</span></span>
<span id="cb13-69"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed formula is the correct first term. Its printed companion for the same</span></span>
<span id="cb13-70"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">final conversion is *not*; see the next section.</span></span>
<span id="cb13-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>First order, three routes.</strong> Over 8 values of <img src="https://latex.codecogs.com/png.latex?N"> and 6 values of <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t"> (to <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010">): pymrm against Eq. 9 to <strong>2.4e-15</strong>, and the Eq. 11 macrofluid quadrature against Eq. 9 to <strong>1.5e-10</strong>. Eq. 11 with a batch solution of 1 integrates to 1 to <strong>2.3e-11</strong>, which is the check that fixes the <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%5E%7B%5C,N%7D"> reading of its denominator. The Simpson error falls at observed order <strong>3.98</strong>.</p>
<p><strong>Second order.</strong> pymrm’s Newton solve (pointwise <code>NumJac</code>, at most 8 iterations) against Eq. 10’s nest of <img src="https://latex.codecogs.com/png.latex?N"> radicals to <strong>3.2e-14</strong>. Micro- and macrofluid are <em>not</em> the same here: the gap reaches <strong>25.43 %</strong> at <img src="https://latex.codecogs.com/png.latex?N%20=%201">, <img src="https://latex.codecogs.com/png.latex?kC_0%5Cbar%20t%20=%2010">, and it is the macrofluid that converts further. This is the same statement <a href="../A2.8-zwietering-segregation/"><code>A2.8</code></a> makes with bounds; here it is the two specific states Levenspiel prints.</p>
<p><strong>The printed asymptote.</strong> <img src="https://latex.codecogs.com/png.latex?C_%7BA,N%7D/C_%7BAp%7D%20=%201%20+%20(k%5Cbar%20t)%5E2/(2N)"> for the same volume: the relative error of that expression falls at observed order <strong>0.99</strong> in <img src="https://latex.codecogs.com/png.latex?N"> and is 1.30e-03 at <img src="https://latex.codecogs.com/png.latex?N%20=%20320">, so the printed formula is the correct first term. Its printed companion for the same final conversion is <em>not</em>; see the next section.</p>
</div>
</div>
</section>
<section id="printed-defects" class="level3">
<h3 class="anchored" data-anchor-id="printed-defects">7. Printed defects</h3>
<p>Six items are wrong or ambiguous as printed — five defects and one typesetting ambiguity. Each is established from the book’s own numbers, and none is repaired in the transcription: the CSV carries the glyphs as they appear and this section says what they should be.</p>
<p>The first of them is the most consequential, because it is a <strong>modelling rule</strong> and not a unit or a tick label: a reader who applies it gets a different reactor.</p>
<div id="4ba2c425" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:54.007592Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:54.007304Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:54.023110Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:54.022335Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (0) Fig. 14.7's dispersion-conversion rule, inverted.  Everything here is</span></span>
<span id="cb14-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arithmetic on printed values; the COST of the inversion is measured in</span></span>
<span id="cb14-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># section 9, where a dispersion solve exists.</span></span>
<span id="cb14-4">HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig14.7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion_rule_half"</span>)</span>
<span id="cb14-5">N_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig14.7"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_symmetric_threshold"</span>)</span>
<span id="cb14-6">SIG_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig13.12"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sigma2_theta_over_DuL"</span>)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># sigma^2_theta = 2 (D/uL)</span></span>
<span id="cb14-7">DUL_LIMIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig13.11"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DuL_small_deviation_limit"</span>)</span>
<span id="cb14-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Ch. 13's variance with Ch. 14's 1/N: 1/N = SIG_COEF (D/uL) -&gt; N = (1/SIG_COEF)(uL/D)</span></span>
<span id="cb14-9">DEFECT_FIG147_FROM_CH13 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SIG_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> HALF)</span>
<span id="cb14-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the annotation's own threshold, pushed through the CORRECT rule</span></span>
<span id="cb14-11">DEFECT_FIG147_THRESHOLD_DUL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N_SYM</span>
<span id="cb14-12">DEFECT_FIG147_THRESHOLD_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DEFECT_FIG147_THRESHOLD_DUL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DUL_LIMIT)</span>
<span id="cb14-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and through the rule AS PRINTED</span></span>
<span id="cb14-14">DEFECT_FIG147_THRESHOLD_DUL_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N_SYM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> HALF</span>
<span id="cb14-15"></span>
<span id="cb14-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (1) the factor of two in "for same C_A,final".</span></span>
<span id="cb14-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The quantity is a LIMIT, x -&gt; 0, of (V_N/V_p - 1)/x with x = k tbar_i, so it is</span></span>
<span id="cb14-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># extrapolated rather than fitted over an arbitrary window: a polyfit on a finite</span></span>
<span id="cb14-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># window returns 2.0003 or 2.03 depending only on how wide the window is, and the</span></span>
<span id="cb14-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># trailing digits would then be pinned in CI while meaning nothing.</span></span>
<span id="cb14-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _vslope(x):</span>
<span id="cb14-22">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""(V_N/V_p - 1)/x from the book's own Eq. 9 against plug flow."""</span></span>
<span id="cb14-23">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log1p(x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> x</span>
<span id="cb14-24"></span>
<span id="cb14-25"></span>
<span id="cb14-26">DEFECT_SLOPE_TABLE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(</span>
<span id="cb14-27">    [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>x, raw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_vslope(x), richardson<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _vslope(x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _vslope(x),</span>
<span id="cb14-28">          polyfit_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>),</span>
<span id="cb14-29">                                               np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb14-30">                                               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.log1p(np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb14-31">                                               <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb14-32">     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> x <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4e-1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4e-2</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4e-4</span>]])</span>
<span id="cb14-33">DEFECT_EXACT_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _vslope(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5e-5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _vslope(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>))   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -&gt; 1/2 - x^2/48</span></span>
<span id="cb14-34">DEFECT_MID_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>                        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "1 + k tbar_i"       -&gt; slope 1</span></span>
<span id="cb14-35">DEFECT_RIGHT_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "1 + k tbar/(2N)"    -&gt; slope 1/2</span></span>
<span id="cb14-36">DEFECT_FACTOR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DEFECT_MID_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DEFECT_EXACT_SLOPE</span>
<span id="cb14-37">DEFECT_RIGHT_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DEFECT_RIGHT_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DEFECT_EXACT_SLOPE</span>
<span id="cb14-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># direct numerical confirmation at a finite N: what volume ratio does Eq. 9 need?</span></span>
<span id="cb14-39">_N, _ktb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb14-40">_target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_ktb)                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># plug-flow conversion at k tbar = 1</span></span>
<span id="cb14-41">_ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: eq9(_N, _ktb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _target, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb14-42">DEFECT_RATIO_TRUE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _ratio</span>
<span id="cb14-43">DEFECT_RATIO_MID <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _ktb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _N</span>
<span id="cb14-44">DEFECT_RATIO_RIGHT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _ktb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _N)</span>
<span id="cb14-45"></span>
<span id="cb14-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (2) Eq. 11's denominator: tbar_N (subscript) against tbar**N (superscript)</span></span>
<span id="cb14-47">_N11, _tb11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span></span>
<span id="cb14-48">NORM_SUPER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq11(_N11, _tb11, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: np.ones_like(t))</span>
<span id="cb14-49">NORM_SUB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NORM_SUPER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _tb11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> _N11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _tb11          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># what the subscript reading gives</span></span>
<span id="cb14-50">DEFECT_EQ11_NORM_SUB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> NORM_SUB</span>
<span id="cb14-51"></span>
<span id="cb14-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (3) Fig. E14.4b's axis tick, against the peak of the curve AS PRINTED</span></span>
<span id="cb14-53">DEFECT_TICK_RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TICK_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX_PRINTED</span>
<span id="cb14-54"></span>
<span id="cb14-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (4) E14.2's "moles";  (5) E14.4's "900 s"</span></span>
<span id="cb14-56">DEFECT_VAR_UNIT_VALUE_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DV_P)     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the VALUE is right; the unit is not</span></span>
<span id="cb14-57"></span>
<span id="cb14-58">display(DEFECT_SLOPE_TABLE.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>))</span>
<span id="cb14-59">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb14-60"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**(a) Fig. 14.7, book p. 327 — the dispersion-conversion rule is inverted.**</span></span>
<span id="cb14-61"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Inside the axes box: *"When $N &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SYM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ the curve becomes symmetrical in which</span></span>
<span id="cb14-62"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">case use fig. 13-11 with $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL)$"*. The ratio is upside</span></span>
<span id="cb14-63"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">down, and the book supplies the proof twice over.</span></span>
<span id="cb14-64"></span>
<span id="cb14-65"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">*From its own variance.* Chapter 13 prints</span></span>
<span id="cb14-66"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SIG_COEF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL)$ (Fig. 13.12, book p. 303) and</span></span>
<span id="cb14-67"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Chapter 14 prints $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta = 1/N$ (Eq. 3). Together they give</span></span>
<span id="cb14-68"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N = (1/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SIG_COEF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)(uL/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)$, whose coefficient matches the printed</span></span>
<span id="cb14-69"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_FROM_CH13<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** &amp;mdash; on the *reciprocal* ratio.</span></span>
<span id="cb14-70"></span>
<span id="cb14-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">*From its own threshold.* Pushed through the corrected rule, the annotation's</span></span>
<span id="cb14-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SYM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ is $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL &lt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_THRESHOLD_DUL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, and</span></span>
<span id="cb14-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"Small Deviation from Plug Flow, $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL &lt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DUL_LIMIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$" is the printed</span></span>
<span id="cb14-74"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">heading of the section that owns Fig. 13.11: the two agree to</span></span>
<span id="cb14-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_THRESHOLD_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**. As printed, the same threshold would send</span></span>
<span id="cb14-76"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the reader to $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_THRESHOLD_DUL_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, off a</span></span>
<span id="cb14-77"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">figure drawn between 0.00005 and 0.0128 and at the opposite end of the flow</span></span>
<span id="cb14-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">regime. Section 9 measures what that costs in conversion.</span></span>
<span id="cb14-79"></span>
<span id="cb14-80"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**(b) Section 14.2, book p. 328 — a factor of two.** The line reads</span></span>
<span id="cb14-81"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$V_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">text</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tanks</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/V_p = 1 + k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t_i = 1 + k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t/(2N)$. With the book's own</span></span>
<span id="cb14-82"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t_i$ those two right-hand sides differ by exactly two. Expanding the</span></span>
<span id="cb14-83"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">book's own Eq. 9 against plug flow gives $V_N/V_p = x/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ln(1+x)$ with</span></span>
<span id="cb14-84"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$x = k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t_i$, whose leading correction has slope</span></span>
<span id="cb14-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_EXACT_SLOPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** &amp;mdash; the table above extrapolates it to $x = 0$</span></span>
<span id="cb14-86"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">instead of fitting it, because the `raw` and `polyfit_ratio` columns show that a</span></span>
<span id="cb14-87"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">finite window puts spurious digits on an exactly rational number. Against that,</span></span>
<span id="cb14-88"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the middle expression has slope </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_MID_SLOPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (a factor</span></span>
<span id="cb14-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FACTOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** too large, i.e. exactly two) and the right-hand one</span></span>
<span id="cb14-90"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_RIGHT_SLOPE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_RIGHT_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.9f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, i.e. exactly one). At</span></span>
<span id="cb14-91"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_ktb<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ the volume ratio that Eq. 9 actually needs is</span></span>
<span id="cb14-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_RATIO_TRUE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_RATIO_MID<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the middle form</span></span>
<span id="cb14-93"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_RATIO_RIGHT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> from the right-hand one. **The middle expression is</span></span>
<span id="cb14-94"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">missing a factor of $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tfrac12$**; the right-hand form, and the companion</span></span>
<span id="cb14-95"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">equal-volume formula $1+(k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t)^2/(2N)$, are correct as printed. Reported, not</span></span>
<span id="cb14-96"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">repaired.</span></span>
<span id="cb14-97"></span>
<span id="cb14-98"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**(c) Eq. 11, book p. 329 — a subscript where a superscript belongs.** The</span></span>
<span id="cb14-99"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">prefactor denominator is set as $(N-1)!</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t_N$ with $N$ lowered. With</span></span>
<span id="cb14-100"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ the kernel integrates to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NORM_SUPER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; with the printed</span></span>
<span id="cb14-101"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t_N = </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ it integrates to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_EQ11_NORM_SUB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_N11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$,</span></span>
<span id="cb14-102"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_tb11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s &amp;mdash; not dimensionless, let alone normalised. The book itself</span></span>
<span id="cb14-103"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">prints the raised form two pages later in E14.4</span></span>
<span id="cb14-104"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">($</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">E</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = t^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">N-1</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cdot N^N/(N-1)!</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">cdot e^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-tN/</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$), which</span></span>
<span id="cb14-105"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">settles the reading. A typesetting slip, not a modelling one.</span></span>
<span id="cb14-106"></span>
<span id="cb14-107"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**(d) Fig. E14.4b, book p. 334 — a transposed digit.** The top axis tick is</span></span>
<span id="cb14-108"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">labelled </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TICK_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻¹, on an axis whose other ticks are 0, 0.005 and 0.010 at</span></span>
<span id="cb14-109"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">equal spacing. The book's own printed $E(t) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PRE_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4e}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,t^3e^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EXP_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">t</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span></span>
<span id="cb14-110"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">peaks at $t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_TMAX_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s with $E = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ s⁻¹, so</span></span>
<span id="cb14-111"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the tick is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_TICK_RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">times$ the whole curve. It should read 0.015.</span></span>
<span id="cb14-112"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(Note which curve: with the *unrounded* coefficients the peak is</span></span>
<span id="cb14-113"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.7g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s⁻¹ and the ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TICK_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">. The tick belongs to the</span></span>
<span id="cb14-114"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">printed curve, so the printed coefficients are the ones used here.)</span></span>
<span id="cb14-115"></span>
<span id="cb14-116"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**(e) E14.2, book p. 331 — "$L = 272$ moles".** The quantity is a distance along</span></span>
<span id="cb14-117"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the Ohio River. The Comment two lines below reads "any location where</span></span>
<span id="cb14-118"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$L </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">le 272$ **miles** is suspect", and every input to the calculation is in miles.</span></span>
<span id="cb14-119"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The *value* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E142_L_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is exactly right, as the reproduction above shows; only</span></span>
<span id="cb14-120"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the unit is a slip.</span></span>
<span id="cb14-121"></span>
<span id="cb14-122"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**(f) E14.4, book p. 333 — "$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2) = 1000 - 100 = 900$ s".** The same</span></span>
<span id="cb14-123"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">class of slip as (e), in the same chapter: a variance carrying the unit of a</span></span>
<span id="cb14-124"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">time. The inputs two lines above are read off Fig. E14.4a as </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V_IN<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s² and</span></span>
<span id="cb14-125"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>V_OUT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s², and the very next line divides $(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t)^2$ by this quantity to</span></span>
<span id="cb14-126"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">get a dimensionless tank count, which only works in s². The *value* </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DV_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is</span></span>
<span id="cb14-127"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">right &amp;mdash; the reproduction above matches it to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_VAR_UNIT_VALUE_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span></span>
<span id="cb14-128"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">&amp;mdash; and the CSV's `note` column carries the correction while `printed_as`</span></span>
<span id="cb14-129"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">carries the glyphs.</span></span>
<span id="cb14-130"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">x</th>
<th data-quarto-table-cell-role="th">raw</th>
<th data-quarto-table-cell-role="th">richardson</th>
<th data-quarto-table-cell-role="th">polyfit_ratio</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>0.4000</td>
<td>0.472013</td>
<td>0.497616</td>
<td>2.120493</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>0.0400</td>
<td>0.496732</td>
<td>0.499968</td>
<td>2.013185</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>0.0040</td>
<td>0.499667</td>
<td>0.500000</td>
<td>2.001332</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>0.0004</td>
<td>0.499967</td>
<td>0.500000</td>
<td>2.000134</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>(a) Fig. 14.7, book p.&nbsp;327 — the dispersion-conversion rule is inverted.</strong> Inside the axes box: <em>“When <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> the curve becomes symmetrical in which case use fig.&nbsp;13-11 with <img src="https://latex.codecogs.com/png.latex?N%20=%200.5(%5Cmathbf%7BD%7D/uL)">”</em>. The ratio is upside down, and the book supplies the proof twice over.</p>
<p><em>From its own variance.</em> Chapter 13 prints <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%202(%5Cmathbf%7BD%7D/uL)"> (Fig. 13.12, book p.&nbsp;303) and Chapter 14 prints <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%201/N"> (Eq. 3). Together they give <img src="https://latex.codecogs.com/png.latex?N%20=%20(1/2)(uL/%5Cmathbf%7BD%7D)">, whose coefficient matches the printed 0.5 to <strong>0e+00</strong> — on the <em>reciprocal</em> ratio.</p>
<p><em>From its own threshold.</em> Pushed through the corrected rule, the annotation’s <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> is <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3C%200.01">, and “Small Deviation from Plug Flow, <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3C%200.01">” is the printed heading of the section that owns Fig. 13.11: the two agree to <strong>0e+00</strong>. As printed, the same threshold would send the reader to <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3E%20100">, off a figure drawn between 0.00005 and 0.0128 and at the opposite end of the flow regime. Section 9 measures what that costs in conversion.</p>
<p><strong>(b) Section 14.2, book p.&nbsp;328 — a factor of two.</strong> The line reads <img src="https://latex.codecogs.com/png.latex?V_%7BN%5C,%5Ctext%7Btanks%7D%7D/V_p%20=%201%20+%20k%5Cbar%20t_i%20=%201%20+%20k%5Cbar%20t/(2N)">. With the book’s own <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%20N%5Cbar%20t_i"> those two right-hand sides differ by exactly two. Expanding the book’s own Eq. 9 against plug flow gives <img src="https://latex.codecogs.com/png.latex?V_N/V_p%20=%20x/%5Cln(1+x)"> with <img src="https://latex.codecogs.com/png.latex?x%20=%20k%5Cbar%20t_i">, whose leading correction has slope <strong>0.500000000</strong> — the table above extrapolates it to <img src="https://latex.codecogs.com/png.latex?x%20=%200"> instead of fitting it, because the <code>raw</code> and <code>polyfit_ratio</code> columns show that a finite window puts spurious digits on an exactly rational number. Against that, the middle expression has slope 1 (a factor <strong>2.000000001</strong> too large, i.e.&nbsp;exactly two) and the right-hand one 0.5 (factor 1.000000000, i.e.&nbsp;exactly one). At <img src="https://latex.codecogs.com/png.latex?N%20=%2020">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%201"> the volume ratio that Eq. 9 actually needs is <strong>1.025422</strong>, against 1.050000 from the middle form and 1.025000 from the right-hand one. <strong>The middle expression is missing a factor of <img src="https://latex.codecogs.com/png.latex?%5Ctfrac12"></strong>; the right-hand form, and the companion equal-volume formula <img src="https://latex.codecogs.com/png.latex?1+(k%5Cbar%20t)%5E2/(2N)">, are correct as printed. Reported, not repaired.</p>
<p><strong>(c) Eq. 11, book p.&nbsp;329 — a subscript where a superscript belongs.</strong> The prefactor denominator is set as <img src="https://latex.codecogs.com/png.latex?(N-1)!%5C,%5Cbar%20t_N"> with <img src="https://latex.codecogs.com/png.latex?N"> lowered. With <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%5E%7B%5C,N%7D"> the kernel integrates to 1.0000000000; with the printed <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t_N%20=%20%5Cbar%20t"> it integrates to 2.16e+05 at <img src="https://latex.codecogs.com/png.latex?N%20=%204">, <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%20=%2060"> s — not dimensionless, let alone normalised. The book itself prints the raised form two pages later in E14.4 (<img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BE%7D%20=%20t%5E%7BN-1%7D/%5Cbar%20t%5E%7B%5C,N%7D%5Ccdot%20N%5EN/(N-1)!%5Ccdot%20e%5E%7B-tN/%5Cbar%20t%7D">), which settles the reading. A typesetting slip, not a modelling one.</p>
<p><strong>(d) Fig. E14.4b, book p.&nbsp;334 — a transposed digit.</strong> The top axis tick is labelled 0.105 s⁻¹, on an axis whose other ticks are 0, 0.005 and 0.010 at equal spacing. The book’s own printed <img src="https://latex.codecogs.com/png.latex?E(t)%20=%203.2922e-06%5C,t%5E3e%5E%7B-0.0667t%7D"> peaks at <img src="https://latex.codecogs.com/png.latex?t%20=%2044.9775"> s with <img src="https://latex.codecogs.com/png.latex?E%20=%200.01491382"> s⁻¹, so the tick is 7.04<img src="https://latex.codecogs.com/png.latex?%5Ctimes"> the whole curve. It should read 0.015. (Note which curve: with the <em>unrounded</em> coefficients the peak is 0.01493612 s⁻¹ and the ratio 7.03. The tick belongs to the printed curve, so the printed coefficients are the ones used here.)</p>
<p><strong>(e) E14.2, book p.&nbsp;331 — “<img src="https://latex.codecogs.com/png.latex?L%20=%20272"> moles”.</strong> The quantity is a distance along the Ohio River. The Comment two lines below reads “any location where <img src="https://latex.codecogs.com/png.latex?L%20%5Cle%20272"> <strong>miles</strong> is suspect”, and every input to the calculation is in miles. The <em>value</em> 272 is exactly right, as the reproduction above shows; only the unit is a slip.</p>
<p><strong>(f) E14.4, book p.&nbsp;333 — “<img src="https://latex.codecogs.com/png.latex?%5CDelta(%5Csigma%5E2)%20=%201000%20-%20100%20=%20900"> s”.</strong> The same class of slip as (e), in the same chapter: a variance carrying the unit of a time. The inputs two lines above are read off Fig. E14.4a as 100 s² and 1000 s², and the very next line divides <img src="https://latex.codecogs.com/png.latex?(%5CDelta%5Cbar%20t)%5E2"> by this quantity to get a dimensionless tank count, which only works in s². The <em>value</em> 900 is right — the reproduction above matches it to 0e+00 — and the CSV’s <code>note</code> column carries the correction while <code>printed_as</code> carries the glyphs.</p>
</div>
</div>
</section>
<section id="what-two-moments-cannot-buy-the-headline" class="level3">
<h3 class="anchored" data-anchor-id="what-two-moments-cannot-buy-the-headline">8. What two moments cannot buy: the headline</h3>
<p>E14.4 uses exactly two numbers, <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Cbar%20t"> and <img src="https://latex.codecogs.com/png.latex?%5CDelta(%5Csigma%5E2)">, and returns “4 tanks”. The method assumes the vessel is <img src="https://latex.codecogs.com/png.latex?N"> <strong>equal</strong> tanks; with two moments there is no way to check that assumption, because a chain of unequal tanks has the same two moments as some equal chain by construction.</p>
<p>Here is a specific alternative. A five-stage chain with residence times <img src="https://latex.codecogs.com/png.latex?9,%209,%209,%209,%2024"> s has</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Csum%20t_i%20=%2060%5C%20%5Ctext%7Bs%7D%20=%20%5CDelta%5Cbar%20t,%5Cqquad%0A%20%20%5Csum%20t_i%5E2%20=%204(81)%20+%20576%20=%20900%5C%20%5Ctext%7Bs%7D%5E2%20=%20%5CDelta(%5Csigma%5E2),"></p>
<p><strong>exactly</strong> the two numbers E14.4 measured — the same mean, the same variance, to the last digit. It is therefore indistinguishable from Levenspiel’s four equal tanks by his own method, and every gallery page that reuses a fitted <img src="https://latex.codecogs.com/png.latex?N"> inherits the ambiguity. It is also <em>admissible</em>: E14.3’s own Figs. E14.3b–d (book p.&nbsp;333) work with <img src="https://latex.codecogs.com/png.latex?V_1%20=%20%5Ctfrac13">, <img src="https://latex.codecogs.com/png.latex?V_2%20=%20%5Ctfrac23"> and with <img src="https://latex.codecogs.com/png.latex?N_1%20=%2012">, <img src="https://latex.codecogs.com/png.latex?N_2%20=%2024">, so unequal blocks are not excluded by the chapter. And it is the natural choice — 9, 9, 9, 9, 24 is the second root of <img src="https://latex.codecogs.com/png.latex?a%5E2%20-%2024a%20+%20135%20=%200">, i.e.&nbsp;the <em>only</em> non-equal member of the four-equal-plus-one family.</p>
<p>Three things have to be said carefully about the number that comes out, because each of them is a way of overstating it:</p>
<ul>
<li>it is a gap in <strong>outlet concentration</strong>, which is not the same as a gap in conversion, and both are printed below;</li>
<li>it is the value at the <strong>right-hand edge</strong> of the range swept, and it is monotone in <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t">, so the sweep is extended past that edge rather than stopped at it;</li>
<li>it is <strong>one chain</strong>, so it is a <em>lower</em> bound on what two moments leave open. The upper bound over the whole family is computed in closed form afterwards.</li>
</ul>
<p>Both chains are built with the same <code>Cascade</code> class, differing only in <code>faces</code>.</p>
<div id="a7ca5aac" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:54.025028Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:54.024900Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:54.596474Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:54.595725Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb15-1">T_EQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.full(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">15.0</span>)</span>
<span id="cb15-2">T_UN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">24.0</span>])</span>
<span id="cb15-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> np.isclose(T_UN.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(), DTB) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> np.isclose((T_UN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(), DV), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moments must match exactly"</span></span>
<span id="cb15-4">AMBIG_MEAN_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(T_UN.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_EQ.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb15-5">AMBIG_VAR_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((T_UN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (T_EQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())</span>
<span id="cb15-6"></span>
<span id="cb15-7"></span>
<span id="cb15-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> chain(ts, tbar_total):</span>
<span id="cb15-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""A Cascade whose cells are sized in proportion to the given residence times."""</span></span>
<span id="cb15-10">    faces <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.cumsum(ts) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ts.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()])</span>
<span id="cb15-11">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Cascade(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(ts), tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tbar_total, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, faces<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>faces)</span>
<span id="cb15-12"></span>
<span id="cb15-13"></span>
<span id="cb15-14">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb15-15"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">20.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50.0</span>]:</span>
<span id="cb15-16">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB</span>
<span id="cb15-17">    a1, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_EQ, DTB).first_order(k)</span>
<span id="cb15-18">    b1, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_UN, DTB).first_order(k)</span>
<span id="cb15-19">    a2, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_EQ, DTB).order_n(k, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb15-20">    b2, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_UN, DTB).order_n(k, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb15-21">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ktbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, eq_first<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a1, un_first<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b1,</span>
<span id="cb15-22">                     conc_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a1,</span>
<span id="cb15-23">                     eq_conv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1, un_conv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1,</span>
<span id="cb15-24">                     conv_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1),</span>
<span id="cb15-25">                     eq_second<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>a2, un_second<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>b2, second_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a2))</span>
<span id="cb15-26">AMB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb15-27">AMBIG_KT_HEADLINE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the right-hand edge of the ORIGINAL sweep</span></span>
<span id="cb15-28">_hl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> AMB.loc[AMB.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> AMBIG_KT_HEADLINE].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb15-29">AMBIG_FIRST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_hl.conc_gap)         <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the 5-stage chain AT k tbar = 10</span></span>
<span id="cb15-30">AMBIG_FIRST_MAX_SWEPT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AMB.conc_gap.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ... and at the new edge, 50</span></span>
<span id="cb15-31">AMBIG_CONV_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AMB.conv_gap.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same thing in CONVERSION</span></span>
<span id="cb15-32">AMBIG_CONV_KT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AMB.loc[AMB.conv_gap.idxmax(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ktbar"</span>])</span>
<span id="cb15-33">AMBIG_CONV_HL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_hl.conv_gap)</span>
<span id="cb15-34">AMBIG_SECOND_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AMB.loc[AMB.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> AMBIG_KT_HEADLINE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second_gap"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-35">AMBIG_FIRST_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AMB.loc[AMB.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conc_gap"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the pymrm unequal chain against the product formula it must satisfy</span></span>
<span id="cb15-37">_k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB</span>
<span id="cb15-38">_prod <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.prod(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T_UN)</span>
<span id="cb15-39">AMBIG_PYMRM_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(chain(T_UN, DTB).first_order(_k)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _prod)</span>
<span id="cb15-40"></span>
<span id="cb15-41">_t <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">260.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>)</span>
<span id="cb15-42">E_UN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> convolve_E(_t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">24.0</span>)</span>
<span id="cb15-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the RTD gap is an extremum too: bracketed and refined, and the denominator is</span></span>
<span id="cb15-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the root-found peak of Eq. 3 at N = 4, tbar = 60 s computed in section 2.</span></span>
<span id="cb15-45">AMBIG_RTD_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> max_brent(</span>
<span id="cb15-46">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(convolve_E(np.array([t]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">24.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb15-47">                  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, DTB))), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">260.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX</span>
<span id="cb15-48"></span>
<span id="cb15-49">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.6</span>))</span>
<span id="cb15-50">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(_t, E_time(_t, N4, DTB), lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"4 equal tanks of 15 s </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">Levenspiel</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-51">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(_t, E_UN, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"5 tanks of 9,9,9,9,24 s"</span>)</span>
<span id="cb15-52">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t, s"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"E, s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{-1}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-53">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_title(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"same </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 60 s, same </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$\s</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">igma</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 900 s</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-54">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5</span>)</span>
<span id="cb15-55">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].semilogy(AMB.ktbar, AMB.conc_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o-"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order, exit concentration"</span>)</span>
<span id="cb15-56">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].semilogy(AMB.ktbar, AMB.second_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s--"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order, exit concentration"</span>)</span>
<span id="cb15-57">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].semilogy(AMB.ktbar, AMB.conv_gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^:"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first order, CONVERSION"</span>)</span>
<span id="cb15-58">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">k</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">or </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">kC_0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">\b</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">ar t</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb15-59">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"relative difference, %"</span>)</span>
<span id="cb15-60">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_title(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what the two-moment fit does not fix"</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)</span>
<span id="cb15-61">plt.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb15-62">display(AMB.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb15-63">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb15-64"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The two chains match E14.4's measured mean to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_MEAN_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** s and its</span></span>
<span id="cb15-65"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">measured variance to **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_VAR_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** s² &amp;mdash; that is, exactly. Their exit</span></span>
<span id="cb15-66"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">curves differ by **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_RTD_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** of the peak.</span></span>
<span id="cb15-67"></span>
<span id="cb15-68"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**In exit concentration** the two chains differ by</span></span>
<span id="cb15-69"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FIRST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_KT_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, first order.</span></span>
<span id="cb15-70"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">That is the number this page quotes, and the table shows what it is and is not:</span></span>
<span id="cb15-71"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">it is monotone in $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$, so it is not a maximum over the sweep but the value</span></span>
<span id="cb15-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">at whichever $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ one stops at &amp;mdash; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FIRST_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at</span></span>
<span id="cb15-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 2$, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>conc_gap<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at</span></span>
<span id="cb15-74"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMB<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ktbar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. Second order at</span></span>
<span id="cb15-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_KT_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_SECOND_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %.</span></span>
<span id="cb15-76"></span>
<span id="cb15-77"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**In conversion** it is a far smaller number, and saying "converts 23 %</span></span>
<span id="cb15-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">differently" would be wrong. At $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_KT_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ the two chains</span></span>
<span id="cb15-79"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">convert </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_hl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>eq_conv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_hl<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>un_conv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % &amp;mdash;</span></span>
<span id="cb15-80"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_hl.un_conv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _hl.eq_conv) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> percentage points apart, or</span></span>
<span id="cb15-81"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_CONV_HL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % relative &amp;mdash; and over the whole sweep the relative gap in</span></span>
<span id="cb15-82"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">conversion never exceeds **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_CONV_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %**, at</span></span>
<span id="cb15-83"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_CONV_KT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. The two statements are consistent: at high</span></span>
<span id="cb15-84"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ both chains convert almost everything, so a large relative difference in</span></span>
<span id="cb15-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">what is *left* is a small difference in what is *converted*. Which of the two</span></span>
<span id="cb15-86"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">matters is the reader's question, not the page's &amp;mdash; for a purification duty,</span></span>
<span id="cb15-87"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">or for anything sized on the outlet, it is the first.</span></span>
<span id="cb15-88"></span>
<span id="cb15-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The pymrm unequal chain reproduces the staged product $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">prod (1+kt_i)^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-1</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ to</span></span>
<span id="cb15-90"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_PYMRM_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, so the difference is physics and not a solver artefact.</span></span>
<span id="cb15-91"></span>
<span id="cb15-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">This is not a criticism of E14.4 &amp;mdash; the method is exactly as good as its</span></span>
<span id="cb15-93"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">inputs, and Levenspiel says plainly that the tanks are assumed equal. It is a</span></span>
<span id="cb15-94"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">statement of what a two-moment fit is worth: **it fixes the RTD only within the</span></span>
<span id="cb15-95"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">family it assumes, and the conversion it implies inherits that ambiguity.**</span></span>
<span id="cb15-96"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span> ))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A2.4-tanks-in-series/index_files/figure-html/cell-14-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">ktbar</th>
<th data-quarto-table-cell-role="th">eq_first</th>
<th data-quarto-table-cell-role="th">un_first</th>
<th data-quarto-table-cell-role="th">conc_gap</th>
<th data-quarto-table-cell-role="th">eq_conv</th>
<th data-quarto-table-cell-role="th">un_conv</th>
<th data-quarto-table-cell-role="th">conv_gap</th>
<th data-quarto-table-cell-role="th">eq_second</th>
<th data-quarto-table-cell-role="th">un_second</th>
<th data-quarto-table-cell-role="th">second_gap</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>0.5</td>
<td>0.624295</td>
<td>0.624000</td>
<td>0.000472</td>
<td>0.375705</td>
<td>0.376000</td>
<td>0.000784</td>
<td>0.687166</td>
<td>0.685959</td>
<td>0.001756</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>1.0</td>
<td>0.409600</td>
<td>0.408395</td>
<td>0.002941</td>
<td>0.590400</td>
<td>0.591605</td>
<td>0.002041</td>
<td>0.538538</td>
<td>0.535271</td>
<td>0.006065</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>2.0</td>
<td>0.197531</td>
<td>0.194515</td>
<td>0.015266</td>
<td>0.802469</td>
<td>0.805485</td>
<td>0.003758</td>
<td>0.387588</td>
<td>0.381479</td>
<td>0.015761</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>5.0</td>
<td>0.039018</td>
<td>0.035541</td>
<td>0.089130</td>
<td>0.960982</td>
<td>0.964459</td>
<td>0.003619</td>
<td>0.224132</td>
<td>0.215546</td>
<td>0.038305</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>10.0</td>
<td>0.006664</td>
<td>0.005120</td>
<td>0.231680</td>
<td>0.993336</td>
<td>0.994880</td>
<td>0.001554</td>
<td>0.138903</td>
<td>0.130450</td>
<td>0.060852</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>20.0</td>
<td>0.000772</td>
<td>0.000434</td>
<td>0.437500</td>
<td>0.999228</td>
<td>0.999566</td>
<td>0.000338</td>
<td>0.082833</td>
<td>0.075740</td>
<td>0.085625</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>50.0</td>
<td>0.000030</td>
<td>0.000009</td>
<td>0.697002</td>
<td>0.999970</td>
<td>0.999991</td>
<td>0.000021</td>
<td>0.040156</td>
<td>0.035378</td>
<td>0.118977</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>The two chains match E14.4’s measured mean to <strong>0e+00</strong> s and its measured variance to <strong>0e+00</strong> s² — that is, exactly. Their exit curves differ by <strong>6.9 %</strong> of the peak.</p>
<p><strong>In exit concentration</strong> the two chains differ by <strong>23.2 %</strong> at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010">, first order. That is the number this page quotes, and the table shows what it is and is not: it is monotone in <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t">, so it is not a maximum over the sweep but the value at whichever <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t"> one stops at — 1.53 % at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%202">, 69.7 % at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2050">. Second order at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010">: 6.1 %.</p>
<p><strong>In conversion</strong> it is a far smaller number, and saying “converts 23 % differently” would be wrong. At <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010"> the two chains convert 99.334 % and 99.488 % — 0.15 percentage points apart, or 0.16 % relative — and over the whole sweep the relative gap in conversion never exceeds <strong>0.38 %</strong>, at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%202">. The two statements are consistent: at high <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t"> both chains convert almost everything, so a large relative difference in what is <em>left</em> is a small difference in what is <em>converted</em>. Which of the two matters is the reader’s question, not the page’s — for a purification duty, or for anything sized on the outlet, it is the first.</p>
<p>The pymrm unequal chain reproduces the staged product <img src="https://latex.codecogs.com/png.latex?%5Cprod%20(1+kt_i)%5E%7B-1%7D"> to 8.3e-17, so the difference is physics and not a solver artefact.</p>
<p>This is not a criticism of E14.4 — the method is exactly as good as its inputs, and Levenspiel says plainly that the tanks are assumed equal. It is a statement of what a two-moment fit is worth: <strong>it fixes the RTD only within the family it assumes, and the conversion it implies inherits that ambiguity.</strong></p>
</div>
</div>
</section>
<section id="b.-the-whole-family-in-closed-form" class="level3">
<h3 class="anchored" data-anchor-id="b.-the-whole-family-in-closed-form">8b. The whole family, in closed form</h3>
<p>One chain is an example. The honest question is the <strong>range</strong> of outlet concentrations consistent with <img src="https://latex.codecogs.com/png.latex?%5Csum%20t_i%20=%2060"> s and <img src="https://latex.codecogs.com/png.latex?%5Csum%20t_i%5E2%20=%20900"> s², because that is the set of vessels E14.4’s two numbers cannot tell apart.</p>
<p>The answer is not a search. For a first-order reaction <img src="https://latex.codecogs.com/png.latex?C/C_0%20=%20%5Cprod%20(1+kt_i)%5E%7B-1%7D">, so maximising the ambiguity means extremising <img src="https://latex.codecogs.com/png.latex?%5Csum%20%5Cln(1+kt_i)"> under two linear-and-quadratic constraints. The Lagrange condition is <img src="https://latex.codecogs.com/png.latex?k/(1+kt_i)%20=%20%5Clambda%20+%202%5Cmu%20t_i"> for every <img src="https://latex.codecogs.com/png.latex?i">, and that equation has <strong>at most two roots</strong> in <img src="https://latex.codecogs.com/png.latex?t">: the left side is increasing and concave, the right side is a straight line. So <em>every</em> extremal chain consists of at most two distinct tank sizes, and the extremum can be enumerated over <img src="https://latex.codecogs.com/png.latex?(n,%20m)"> — <img src="https://latex.codecogs.com/png.latex?m"> tanks of one size, <img src="https://latex.codecogs.com/png.latex?n-m"> of another, with the two moments fixing both sizes in closed form.</p>
<p>The supremum itself is closed form. Write <img src="https://latex.codecogs.com/png.latex?T%20=%20%5Csum%20t_i">, <img src="https://latex.codecogs.com/png.latex?S%20=%20%5Csum%20t_i%5E2">, and note that <img src="https://latex.codecogs.com/png.latex?t_i%20%5Cle%20%5Csqrt%20S"> for every <img src="https://latex.codecogs.com/png.latex?i">. With <img src="https://latex.codecogs.com/png.latex?h(t)%20=%20%5Cln(1+kt)%20-%20kt">, the function <img src="https://latex.codecogs.com/png.latex?h(t)/t%5E2"> is increasing on <img src="https://latex.codecogs.com/png.latex?t%3E0"> (its numerator derivative reduces to <img src="https://latex.codecogs.com/png.latex?u%5E2/(1+u)%5E2%20%5Cge%200"> with <img src="https://latex.codecogs.com/png.latex?u%20=%20kt">), so <img src="https://latex.codecogs.com/png.latex?h(t_i)%20%5Cle%20h(%5Csqrt%20S)%5C,t_i%5E2/S"> for every <img src="https://latex.codecogs.com/png.latex?i">, and summing gives</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Csum%20%5Cln(1+kt_i)%5C%20%5Cle%5C%20%5Cln%5C!%5Cleft(1+k%5Csqrt%20S%5Cright)%20+%20k%5Cleft(T%20-%20%5Csqrt%20S%5Cright),"></p>
<p>with equality only when every <img src="https://latex.codecogs.com/png.latex?t_i"> is <img src="https://latex.codecogs.com/png.latex?0"> or <img src="https://latex.codecogs.com/png.latex?%5Csqrt%20S">. The bound is therefore attained only in the limit of <strong>one tank of <img src="https://latex.codecogs.com/png.latex?%5Csqrt%20S%20=%2030"> s followed by plug flow of <img src="https://latex.codecogs.com/png.latex?T%20-%20%5Csqrt%20S%20=%2030"> s</strong> — a chain of infinitely many infinitesimal tanks. That is the most-converting vessel E14.4’s two numbers permit, and no chain reaches it.</p>
<div id="090a451f" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:54.598696Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:54.598555Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:54.950846Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:54.950006Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1">T_MOM, S_MOM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DTB), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DV)          <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the two numbers E14.4 measured</span></span>
<span id="cb16-2">N_FAMILY_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span></span>
<span id="cb16-3"></span>
<span id="cb16-4"></span>
<span id="cb16-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> two_value_chains(n, m, T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_MOM, S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_MOM):</span>
<span id="cb16-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Residence times of a chain of m tanks of one size and n-m of another that</span></span>
<span id="cb16-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    matches BOTH printed moments.  Closed form: the constraints reduce to a</span></span>
<span id="cb16-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    quadratic in the first size."""</span></span>
<span id="cb16-9">    p, q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> m, n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> m</span>
<span id="cb16-10">    A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p</span>
<span id="cb16-11">    B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> p</span>
<span id="cb16-12">    C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S</span>
<span id="cb16-13">    disc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> C</span>
<span id="cb16-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> disc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>:</span>
<span id="cb16-15">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> []</span>
<span id="cb16-16">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb16-17">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sqrt(disc)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> A), (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>B <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(disc)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> A)):</span>
<span id="cb16-18">        b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> q</span>
<span id="cb16-19">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>:</span>
<span id="cb16-20">            out.append(np.concatenate([np.full(p, a), np.full(q, b)]))</span>
<span id="cb16-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb16-22"></span>
<span id="cb16-23"></span>
<span id="cb16-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> conc_of(ts, k):</span>
<span id="cb16-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""prod (1 + k t_i)^-1, in logs so that 400-stage chains do not underflow."""</span></span>
<span id="cb16-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(np.log1p(k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.asarray(ts)))))</span>
<span id="cb16-27"></span>
<span id="cb16-28"></span>
<span id="cb16-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> family_sup(k, T<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_MOM, S<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>S_MOM):</span>
<span id="cb16-30">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The closed-form supremum of the conversion: one sqrt(S) tank + plug flow."""</span></span>
<span id="cb16-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(S))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(S))</span>
<span id="cb16-32"></span>
<span id="cb16-33"></span>
<span id="cb16-34">rows, FAM_CONV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [], {}</span>
<span id="cb16-35"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, AMBIG_KT_HEADLINE]:</span>
<span id="cb16-36">    k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T_MOM</span>
<span id="cb16-37">    base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> conc_of(T_EQ, k)</span>
<span id="cb16-38">    lo, hi, arg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> base, base, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span></span>
<span id="cb16-39">    conv <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb16-40">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, N_FAMILY_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb16-41">        best_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb16-42">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n):</span>
<span id="cb16-43">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ts <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> two_value_chains(n, m):</span>
<span id="cb16-44">                c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> conc_of(ts, k)</span>
<span id="cb16-45">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> lo:</span>
<span id="cb16-46">                    lo, arg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> c, (n, m, ts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], ts[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb16-47">                hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(hi, c)</span>
<span id="cb16-48">                best_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(best_n, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> base)</span>
<span id="cb16-49">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, N_FAMILY_MAX):</span>
<span id="cb16-50">            conv.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(stages<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, max_conc_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>best_n))</span>
<span id="cb16-51">    sup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> family_sup(k)</span>
<span id="cb16-52">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ktbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, equal_chain<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>base,</span>
<span id="cb16-53">                     most_converting<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo, least_converting<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi,</span>
<span id="cb16-54">                     gap_below<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> base, gap_above<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> base,</span>
<span id="cb16-55">                     closed_form_sup<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>sup, sup_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> base) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> base,</span>
<span id="cb16-56">                     best_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>arg[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], best_a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>arg[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], best_b<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>arg[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]))</span>
<span id="cb16-57">    FAM_CONV[kt] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(conv)</span>
<span id="cb16-58">FAM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb16-59"></span>
<span id="cb16-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the closed form must BOUND every enumerated chain - asserted, not assumed</span></span>
<span id="cb16-61"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> rows:</span>
<span id="cb16-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> _r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"most_converting"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> family_sup(_r[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ktbar"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T_MOM) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, _r</span>
<span id="cb16-63"></span>
<span id="cb16-64">AMBIG_FAMILY_SUP_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FAM.loc[FAM.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> AMBIG_KT_HEADLINE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sup_gap"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb16-65">AMBIG_FAMILY_SUP_GAP_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FAM.loc[FAM.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sup_gap"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb16-66">AMBIG_FAMILY_BEST_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FAM.loc[FAM.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> AMBIG_KT_HEADLINE,</span>
<span id="cb16-67">                                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap_below"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb16-68">AMBIG_FAMILY_ABOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FAM.gap_above.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb16-69"></span>
<span id="cb16-70">display(FAM.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>))</span>
<span id="cb16-71">display(FAM_CONV[AMBIG_KT_HEADLINE].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb16-72">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb16-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">At $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_KT_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ the five-stage chain's</span></span>
<span id="cb16-74"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FIRST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % is a **lower bound**. Enumerating every two-value</span></span>
<span id="cb16-75"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">chain up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_FAMILY_MAX<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> stages reaches </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FAMILY_BEST_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, and the</span></span>
<span id="cb16-76"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">closed-form supremum &amp;mdash; one </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(S_MOM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s tank followed by</span></span>
<span id="cb16-77"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_MOM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(S_MOM)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> s of plug flow &amp;mdash; is</span></span>
<span id="cb16-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FAMILY_SUP_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %**. At $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 2$ the same three numbers are</span></span>
<span id="cb16-79"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FIRST_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FAM.loc[FAM.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gap_below"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span></span>
<span id="cb16-80"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FAMILY_SUP_GAP_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. The ambiguity is **one-sided**: the</span></span>
<span id="cb16-81"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">enumeration finds no chain at all that converts *less* than four equal tanks</span></span>
<span id="cb16-82"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(largest gap in that direction, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FAMILY_ABOVE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %). Four equal</span></span>
<span id="cb16-83"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tanks already sit at the smallest $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sum t_i^2$ their stage count allows, so every</span></span>
<span id="cb16-84"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">other admissible chain must put more residence time into one stage and split the</span></span>
<span id="cb16-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rest more finely &amp;mdash; and the enumeration says that always converts further.</span></span>
<span id="cb16-86"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Levenspiel's answer is therefore the *least*-converting vessel consistent with</span></span>
<span id="cb16-87"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">his own two numbers, which is the conservative end and worth knowing.</span></span>
<span id="cb16-88"></span>
<span id="cb16-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So the correct statement of the headline is: E14.4's two numbers pin the outlet</span></span>
<span id="cb16-90"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">concentration only to within a factor of</span></span>
<span id="cb16-91"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> AMBIG_FAMILY_SUP_GAP)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_KT_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$; the</span></span>
<span id="cb16-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">9, 9, 9, 9, 24 s chain realises </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FIRST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of that ambiguity</span></span>
<span id="cb16-93"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">with five tanks and is quoted because it is concrete, not because it is extreme.</span></span>
<span id="cb16-94"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">ktbar</th>
<th data-quarto-table-cell-role="th">equal_chain</th>
<th data-quarto-table-cell-role="th">most_converting</th>
<th data-quarto-table-cell-role="th">least_converting</th>
<th data-quarto-table-cell-role="th">gap_below</th>
<th data-quarto-table-cell-role="th">gap_above</th>
<th data-quarto-table-cell-role="th">closed_form_sup</th>
<th data-quarto-table-cell-role="th">sup_gap</th>
<th data-quarto-table-cell-role="th">best_n</th>
<th data-quarto-table-cell-role="th">best_a</th>
<th data-quarto-table-cell-role="th">best_b</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>2.0</td>
<td>0.197531</td>
<td>0.184055</td>
<td>0.197531</td>
<td>0.068222</td>
<td>0.0</td>
<td>0.183940</td>
<td>0.068805</td>
<td>400</td>
<td>29.962288</td>
<td>0.075282</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>10.0</td>
<td>0.006664</td>
<td>0.001152</td>
<td>0.006664</td>
<td>0.827058</td>
<td>0.0</td>
<td>0.001123</td>
<td>0.831481</td>
<td>400</td>
<td>0.075282</td>
<td>29.962288</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">stages</th>
<th data-quarto-table-cell-role="th">max_conc_gap</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>5</td>
<td>0.231680</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>6</td>
<td>0.368814</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>8</td>
<td>0.518414</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>12</td>
<td>0.644538</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>40</td>
<td>0.784064</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>100</td>
<td>0.813367</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>400</td>
<td>0.827058</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>At <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010"> the five-stage chain’s 23.2 % is a <strong>lower bound</strong>. Enumerating every two-value chain up to 400 stages reaches 82.7 %, and the closed-form supremum — one 30 s tank followed by 30 s of plug flow — is <strong>83.1 %</strong>. At <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%202"> the same three numbers are 1.53 %, 6.82 % and 6.88 %. The ambiguity is <strong>one-sided</strong>: the enumeration finds no chain at all that converts <em>less</em> than four equal tanks (largest gap in that direction, 0.00 %). Four equal tanks already sit at the smallest <img src="https://latex.codecogs.com/png.latex?%5Csum%20t_i%5E2"> their stage count allows, so every other admissible chain must put more residence time into one stage and split the rest more finely — and the enumeration says that always converts further. Levenspiel’s answer is therefore the <em>least</em>-converting vessel consistent with his own two numbers, which is the conservative end and worth knowing.</p>
<p>So the correct statement of the headline is: E14.4’s two numbers pin the outlet concentration only to within a factor of 5.93 at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010">; the 9, 9, 9, 9, 24 s chain realises 23.2 % of that ambiguity with five tanks and is quoted because it is concrete, not because it is extreme.</p>
</div>
</div>
</section>
<section id="both-models-give-identical-results-quantified" class="level3">
<h3 class="anchored" data-anchor-id="both-models-give-identical-results-quantified">9. “Both models give identical results” — quantified</h3>
<p>Chapter 14 opens by asserting that the tanks-in-series and dispersion models agree “for not too large a deviation from plug flow … for all practical purposes”. It also prints a rule for turning <img src="https://latex.codecogs.com/png.latex?N"> into a dispersion number — once, inside the axes box of Fig. 14.7 on book p.&nbsp;327:</p>
<blockquote class="blockquote">
<p>“When <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> the curve becomes symmetrical in which case use fig.&nbsp;13-11 with <img src="https://latex.codecogs.com/png.latex?N%20=%20%5Ctfrac12%5Cleft(%5Cdfrac%7B%5Cmathbf%7BD%7D%7D%7BuL%7D%5Cright)">”</p>
</blockquote>
<p><strong>and it is inverted.</strong> Three of the book’s own printed values settle it, two of them from the very figure the annotation points at:</p>
<ol type="1">
<li>Chapter 13 prints <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%202(%5Cmathbf%7BD%7D/uL)"> for small deviations from plug flow (Fig. 13.12, book p.&nbsp;303) and Chapter 14 prints <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%201/N"> (Eq. 3, book p.&nbsp;323). Equating them gives <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20=%201/(2N)">, i.e.&nbsp;<img src="https://latex.codecogs.com/png.latex?N%20=%20%5Ctfrac12(uL/%5Cmathbf%7BD%7D)"> — the reciprocal of what is printed.</li>
<li>The annotation’s own threshold. Under the correct form, <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> is exactly <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3C%200.01"> — and “Small Deviation from Plug Flow, <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3C%200.01">” is the printed heading of the section that owns Fig. 13.11. The threshold and the limit are the same statement, which they cannot be under the printed form.</li>
<li>Fig. 13.11 is drawn for <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL"> between 0.00005 and 0.0128. As printed, a reader at <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> would enter it at <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3E%20100"> — four orders of magnitude off the axis, and at the mixed-flow end rather than the plug-flow end the annotation is about.</li>
</ol>
<p>The derivation below reaches the same rule from a completely different direction, the truncation error of the upwind scheme, and this section then measures what the printed form costs. This is reported as printed defect (a), not repaired.</p>
<p>First-order upwind differencing of <img src="https://latex.codecogs.com/png.latex?u%5C,%5Cpartial%20C/%5Cpartial%20z"> on cells of width <img src="https://latex.codecogs.com/png.latex?%5CDelta%20z"> has a leading truncation error <img src="https://latex.codecogs.com/png.latex?%5Ctfrac12%20u%5C,%5CDelta%20z%5C,%5Cpartial%5E2C/%5Cpartial%20z%5E2"> — it behaves like a diffusivity <img src="https://latex.codecogs.com/png.latex?D_%7B%5Ctext%7Bnum%7D%7D%20=%20u%5CDelta%20z/2">. With <img src="https://latex.codecogs.com/png.latex?%5CDelta%20z%20=%20L/N"> that is <img src="https://latex.codecogs.com/png.latex?uL/(2N)">, so</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%20%5Cfrac%7BuL%7D%7BD_%7B%5Ctext%7Bnum%7D%7D%7D%20=%202N%20,"></p>
<p>which is <img src="https://latex.codecogs.com/png.latex?N%20=%20%5Ctfrac12(uL/%5Cmathbf%7BD%7D)"> — Fig. 14.7’s annotation the right way up.</p>
<p>The dispersion model at <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%202N"> is solved here with pymrm on a <strong>real</strong> grid: Danckwerts inlet, zero-gradient outlet (the construction published on <a href="../A2.1-danckwerts-boundary-conditions/"><code>A2.1</code></a>) and van Leer TVD convection. So this section, unlike everything above it, does have a grid-refinement axis, and it is measured.</p>
<p><strong>How the limiter is solved.</strong> The TVD face values depend nonlinearly on the state. <code>dispersion_exit</code> in <code>model.py</code> builds the limited fluxes and their exact Jacobian with <code>ConvFluxTVD</code> and solves with <code>newton(..., damping="monotone")</code>, as pymrm pitfall P10 recommends. A second route checks it: <code>dispersion_exit_deferred</code> solves the same discrete equations by <em>deferred correction</em>, the upwind operator factorised once and the limiter correction lagged in the right-hand side, up to 200 sweeps. That is a fixed-point iteration, not Newton, and for steady problems it converges slowly with minmod and can stall with van Leer (P10). On this smooth one-dimensional problem it converges in a few sweeps, and the two routes agree to the round-off floor of the exit value.</p>
<p>Then the question is turned around: rather than trusting <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%202N">, the Péclet number that <em>reproduces</em> the <img src="https://latex.codecogs.com/png.latex?N">-tank conversion is root-found, and its drift away from <img src="https://latex.codecogs.com/png.latex?2N"> is what “for all practical purposes” is worth.</p>
<div id="3e61c086" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:54.952965Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:54.952769Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:57.908547Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:57.907695Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb17-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dispersion_exit (ConvFluxTVD + newton, damping="monotone") comes from model.py.</span></span>
<span id="cb17-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># grid refinement of the dispersion solve (this one IS a discretisation)</span></span>
<span id="cb17-3">_ns <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3200</span>])</span>
<span id="cb17-4">_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([dispersion_exit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ns])</span>
<span id="cb17-5">DISP_GRID_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(_ns[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), np.log(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_ex[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _ex[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-6">_exu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([dispersion_exit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ns])</span>
<span id="cb17-7">DISP_GRID_ORDER_UPWIND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(_ns[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb17-8">                                           np.log(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_exu[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _exu[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-9"></span>
<span id="cb17-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The second route: the same discrete equations by deferred correction against</span></span>
<span id="cb17-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ConvFluxTVD + Newton, on the same grids.</span></span>
<span id="cb17-12">_dc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [dispersion_exit_deferred(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, return_info<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ns]</span>
<span id="cb17-13">_nw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [dispersion_exit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n, return_info<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _ns]</span>
<span id="cb17-14">_exd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v, _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _dc])</span>
<span id="cb17-15">DISP_GRID_ORDER_DEFERRED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(_ns[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]),</span>
<span id="cb17-16">                                             np.log(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_exd[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _exd[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-17">DISP_TVD_VS_DEFERRED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_ex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _exd)))</span>
<span id="cb17-18">DISP_DEFERRED_SWEEPS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _dc)</span>
<span id="cb17-19">DISP_NEWTON_ITS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _nw)</span>
<span id="cb17-20">SOLVER_CHANGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_ns, deferred_correction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_exd, newton_ConvFluxTVD<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_ex))</span>
<span id="cb17-21"></span>
<span id="cb17-22">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb17-23"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">32</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>]:</span>
<span id="cb17-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>]:</span>
<span id="cb17-25">        tis <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq9(N, kt)</span>
<span id="cb17-26">        dis <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> dispersion_exit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N, kt)</span>
<span id="cb17-27">        pe_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pe: dispersion_exit(Pe, kt, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tis,</span>
<span id="cb17-28">                        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>)</span>
<span id="cb17-29">        rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N, ktbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, tis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>tis, disp_Pe2N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>dis,</span>
<span id="cb17-30">                         rel_diff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dis <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> tis) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> tis, Pe_eff<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pe_eff,</span>
<span id="cb17-31">                         Pe_ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pe_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N)))</span>
<span id="cb17-32">DISP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb17-33">DISP_MAX_DIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DISP.rel_diff.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb17-34">DISP_ROW_WORST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DISP.loc[DISP.rel_diff.idxmax()]</span>
<span id="cb17-35">DISP_DIFF_N16_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DISP[(DISP.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)].rel_diff.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-36">DISP_DIFF_N64_KT05 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DISP[(DISP.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)].rel_diff.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-37">_sub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DISP[DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>]</span>
<span id="cb17-38">DISP_DIFF_ORDER_IN_N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(_sub.N), np.log(_sub.rel_diff), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-39">PE_RATIO_N64 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DISP[(DISP.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)].Pe_ratio.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-40">PE_RATIO_N4_KT5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DISP[(DISP.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>)].Pe_ratio.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-41"></span>
<span id="cb17-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- what Fig. 14.7's rule costs AS PRINTED ------------------------------</span></span>
<span id="cb17-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># printed: N = HALF (D/uL)  -&gt;  D/uL = N/HALF  -&gt;  Pe = HALF/N</span></span>
<span id="cb17-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># derived: N = HALF (uL/D)  -&gt;  Pe = uL/D = N/HALF = 2N</span></span>
<span id="cb17-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (HALF and N_SYM come off the CSV in the printed-defects section above.)</span></span>
<span id="cb17-46">_Nd, _ktd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span></span>
<span id="cb17-47">_tis_d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq9(_Nd, _ktd)</span>
<span id="cb17-48">DEFECT_FIG147_PE_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _Nd</span>
<span id="cb17-49">DEFECT_FIG147_PE_DERIVED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _Nd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> HALF</span>
<span id="cb17-50">DEFECT_FIG147_PRINTED_RELDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(DEFECT_FIG147_PE_PRINTED, _ktd)</span>
<span id="cb17-51">                                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _tis_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _tis_d</span>
<span id="cb17-52">DEFECT_FIG147_DERIVED_RELDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(DEFECT_FIG147_PE_DERIVED, _ktd)</span>
<span id="cb17-53">                                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _tis_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _tis_d</span>
<span id="cb17-54"></span>
<span id="cb17-55"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># ---- the third matching rule: variance, on the CLOSED vessel -------------</span></span>
<span id="cb17-56"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> sigma2_theta_closed(Pe):</span>
<span id="cb17-57">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Levenspiel's closed-vessel variance (Ch. 13), used here only to compare</span></span>
<span id="cb17-58"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    matching rules - the small-deviation form 2(D/uL) gives Pe = 2N exactly."""</span></span>
<span id="cb17-59">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Pe <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>Pe))</span>
<span id="cb17-60"></span>
<span id="cb17-61"></span>
<span id="cb17-62">PEVAR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame([</span>
<span id="cb17-63">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N, Pe_var<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: sigma2_theta_closed(p) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>,</span>
<span id="cb17-64">                            xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.9e-16</span>))</span>
<span id="cb17-65">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>]])</span>
<span id="cb17-66">PEVAR[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two_N_minus_Pe"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> PEVAR.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> PEVAR.Pe_var</span>
<span id="cb17-67">PE_VAR_OFFSET_N64 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(PEVAR.two_N_minus_Pe.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb17-68">PE_EFF_OFFSET_N64 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DISP[(DISP.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)].Pe_eff.iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb17-69"></span>
<span id="cb17-70">display(SOLVER_CHANGE.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>))</span>
<span id="cb17-71">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb17-72"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**Two solvers, side by side.** At $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Pe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 8$, $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 2$ on 200 to</span></span>
<span id="cb17-73"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">3200 cells, deferred correction and `ConvFluxTVD` with Newton give exit</span></span>
<span id="cb17-74"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">concentrations that differ by less than $10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-9</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ (here</span></span>
<span id="cb17-75"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_TVD_VS_DEFERRED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), which is the round-off floor of an exit value on</span></span>
<span id="cb17-76"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">these grids. Both converged on every grid (here in at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_DEFERRED_SWEEPS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb17-77"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sweeps and at most </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_NEWTON_ITS<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Newton iterations): van Leer did not stall on</span></span>
<span id="cb17-78"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this smooth profile. The fitted grid order is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_GRID_ORDER_DEFERRED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by deferred</span></span>
<span id="cb17-79"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">correction and </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_GRID_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> by Newton.</span></span>
<span id="cb17-80"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span>
<span id="cb17-81">display(DISP.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb17-82">display(PEVAR.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb17-83">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb17-84"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The dispersion solve converges at observed grid order</span></span>
<span id="cb17-85"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_GRID_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** with van Leer TVD (`ConvFluxTVD`, Newton) and</span></span>
<span id="cb17-86"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_GRID_ORDER_UPWIND<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** with bare upwind; the usual pair, and the</span></span>
<span id="cb17-87"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">only genuine grid axis on this page.</span></span>
<span id="cb17-88"></span>
<span id="cb17-89"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">At $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Pe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 2N$ the two models' first-order exit concentrations differ by</span></span>
<span id="cb17-90"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_DIFF_N64_KT05 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $N = 64$, $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 0.5$, rising to</span></span>
<span id="cb17-91"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_MAX_DIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(DISP_ROW_WORST.N)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$,</span></span>
<span id="cb17-92"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_ROW_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ktbar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. At fixed $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ the gap falls as</span></span>
<span id="cb17-93"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_DIFF_ORDER_IN_N<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. Turned around: the Péclet number that exactly</span></span>
<span id="cb17-94"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reproduces $N$ tanks is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_RATIO_N64<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of $2N$ at $N = 64$, $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 0.5$, but</span></span>
<span id="cb17-95"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">only </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_RATIO_N4_KT5<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of it at $N = 4$, $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 5$.</span></span>
<span id="cb17-96"></span>
<span id="cb17-97"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">So Levenspiel's "identical for all practical purposes" is a claim about the</span></span>
<span id="cb17-98"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">*deviation from plug flow*, and it is a good one: at $N </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ge 16$ and</span></span>
<span id="cb17-99"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">le 2$ the two models are within </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_DIFF_N16_KT2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, which no</span></span>
<span id="cb17-100"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tracer experiment resolves. It is **not** a claim you can carry to a strongly</span></span>
<span id="cb17-101"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">converting reactor with a broad RTD, and the table above says by how much.</span></span>
<span id="cb17-102"></span>
<span id="cb17-103"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**What Fig. 14.7's rule costs as printed.** Read literally, $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span></span>
<span id="cb17-104"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL)$ sends a reader at $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_Nd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ to</span></span>
<span id="cb17-105"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Pe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_PE_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ instead of</span></span>
<span id="cb17-106"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_PE_DERIVED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> &amp;mdash; essentially a single stirred tank. At</span></span>
<span id="cb17-107"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_ktd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ that is **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_PRINTED_RELDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** away from</span></span>
<span id="cb17-108"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>_Nd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-tank conversion, against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_DERIVED_RELDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % for</span></span>
<span id="cb17-109"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the de-inverted form. The de-inversion is not an opinion: the annotation's own</span></span>
<span id="cb17-110"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">threshold $N &gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_SYM<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ maps through it to</span></span>
<span id="cb17-111"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL &lt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_THRESHOLD_DUL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, which matches the printed</span></span>
<span id="cb17-112"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">validity limit of Fig. 13.11 itself to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_THRESHOLD_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; and</span></span>
<span id="cb17-113"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Ch. 13's own printed $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta = 2(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL)$ with Ch. 14's</span></span>
<span id="cb17-114"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta = 1/N$ gives the coefficient </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to</span></span>
<span id="cb17-115"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_FROM_CH13<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, on the *other* ratio.</span></span>
<span id="cb17-116"></span>
<span id="cb17-117"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**Three matching rules, reconciled.** $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Pe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = 2N$ is what the upwind</span></span>
<span id="cb17-118"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">truncation error gives and it is also what Ch. 13's small-deviation variance</span></span>
<span id="cb17-119"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">gives, exactly. Matching the **closed-vessel** variance instead gives the</span></span>
<span id="cb17-120"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`Pe_var` column above, and matching the **conversion** gives the root-found</span></span>
<span id="cb17-121"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`Pe_eff` column. Both sit a little below $2N$ &amp;mdash; at $N = 64$,</span></span>
<span id="cb17-122"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$2N - </span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Pe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_VAR_OFFSET_N64<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the variance rule and</span></span>
<span id="cb17-123"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PE_EFF_OFFSET_N64<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the conversion rule at $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 0.5$ &amp;mdash; that is, the</span></span>
<span id="cb17-124"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">three rules differ by an $O(1)$ offset in $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathrm</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Pe</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ and therefore by</span></span>
<span id="cb17-125"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$O(1/N)$ relatively. They are the same rule to leading order, which is the only</span></span>
<span id="cb17-126"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">order the annotation claims.</span></span>
<span id="cb17-127"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">n</th>
<th data-quarto-table-cell-role="th">deferred_correction</th>
<th data-quarto-table-cell-role="th">newton_ConvFluxTVD</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>200</td>
<td>0.185122</td>
<td>0.185122</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>400</td>
<td>0.185123</td>
<td>0.185123</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>800</td>
<td>0.185123</td>
<td>0.185123</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>1600</td>
<td>0.185123</td>
<td>0.185123</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>3200</td>
<td>0.185123</td>
<td>0.185123</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>Two solvers, side by side.</strong> At <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%208">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%202"> on 200 to 3200 cells, deferred correction and <code>ConvFluxTVD</code> with Newton give exit concentrations that differ by less than <img src="https://latex.codecogs.com/png.latex?10%5E%7B-9%7D"> (here 1.4e-11), which is the round-off floor of an exit value on these grids. Both converged on every grid (here in at most 7 sweeps and at most 3 Newton iterations): van Leer did not stall on this smooth profile. The fitted grid order is 2.07 by deferred correction and 2.07 by Newton.</p>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">N</th>
<th data-quarto-table-cell-role="th">ktbar</th>
<th data-quarto-table-cell-role="th">tis</th>
<th data-quarto-table-cell-role="th">disp_Pe2N</th>
<th data-quarto-table-cell-role="th">rel_diff</th>
<th data-quarto-table-cell-role="th">Pe_eff</th>
<th data-quarto-table-cell-role="th">Pe_ratio</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>2</td>
<td>0.5</td>
<td>0.640000</td>
<td>0.631491</td>
<td>0.013295</td>
<td>2.350406</td>
<td>0.587601</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>2</td>
<td>1.0</td>
<td>0.444444</td>
<td>0.423923</td>
<td>0.046173</td>
<td>2.187001</td>
<td>0.546750</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>2</td>
<td>2.0</td>
<td>0.250000</td>
<td>0.214695</td>
<td>0.141219</td>
<td>1.940939</td>
<td>0.485235</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>2</td>
<td>5.0</td>
<td>0.081633</td>
<td>0.045354</td>
<td>0.444409</td>
<td>1.510337</td>
<td>0.377584</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>4</td>
<td>0.5</td>
<td>0.624295</td>
<td>0.621732</td>
<td>0.004105</td>
<td>6.537507</td>
<td>0.817188</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">5</th>
<td>4</td>
<td>1.0</td>
<td>0.409600</td>
<td>0.402832</td>
<td>0.016524</td>
<td>6.282186</td>
<td>0.785273</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">6</th>
<td>4</td>
<td>2.0</td>
<td>0.197531</td>
<td>0.185123</td>
<td>0.062813</td>
<td>5.854698</td>
<td>0.731837</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">7</th>
<td>4</td>
<td>5.0</td>
<td>0.039018</td>
<td>0.027880</td>
<td>0.285463</td>
<td>4.970478</td>
<td>0.621310</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">8</th>
<td>8</td>
<td>0.5</td>
<td>0.615699</td>
<td>0.614991</td>
<td>0.001151</td>
<td>14.610205</td>
<td>0.913138</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">9</th>
<td>8</td>
<td>1.0</td>
<td>0.389744</td>
<td>0.387755</td>
<td>0.005105</td>
<td>14.314085</td>
<td>0.894630</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">10</th>
<td>8</td>
<td>2.0</td>
<td>0.167772</td>
<td>0.163946</td>
<td>0.022804</td>
<td>13.777601</td>
<td>0.861100</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">11</th>
<td>8</td>
<td>5.0</td>
<td>0.020567</td>
<td>0.017583</td>
<td>0.145092</td>
<td>12.494474</td>
<td>0.780905</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">12</th>
<td>16</td>
<td>0.5</td>
<td>0.611191</td>
<td>0.611004</td>
<td>0.000306</td>
<td>30.639982</td>
<td>0.957499</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">13</th>
<td>16</td>
<td>1.0</td>
<td>0.379085</td>
<td>0.378541</td>
<td>0.001435</td>
<td>30.324988</td>
<td>0.947656</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">14</th>
<td>16</td>
<td>2.0</td>
<td>0.151901</td>
<td>0.150822</td>
<td>0.007101</td>
<td>29.726912</td>
<td>0.928966</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">15</th>
<td>16</td>
<td>5.0</td>
<td>0.012895</td>
<td>0.012146</td>
<td>0.058083</td>
<td>28.147081</td>
<td>0.879596</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">16</th>
<td>32</td>
<td>0.5</td>
<td>0.608880</td>
<td>0.608832</td>
<td>0.000079</td>
<td>62.653351</td>
<td>0.978959</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">17</th>
<td>32</td>
<td>1.0</td>
<td>0.373554</td>
<td>0.373411</td>
<td>0.000382</td>
<td>62.329058</td>
<td>0.973892</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">18</th>
<td>32</td>
<td>2.0</td>
<td>0.143706</td>
<td>0.143418</td>
<td>0.002003</td>
<td>61.697539</td>
<td>0.964024</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">19</th>
<td>32</td>
<td>5.0</td>
<td>0.009602</td>
<td>0.009417</td>
<td>0.019216</td>
<td>59.927417</td>
<td>0.936366</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">20</th>
<td>64</td>
<td>0.5</td>
<td>0.607710</td>
<td>0.607698</td>
<td>0.000020</td>
<td>126.658906</td>
<td>0.989523</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">21</th>
<td>64</td>
<td>1.0</td>
<td>0.370735</td>
<td>0.370698</td>
<td>0.000099</td>
<td>126.329697</td>
<td>0.986951</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">22</th>
<td>64</td>
<td>2.0</td>
<td>0.139542</td>
<td>0.139468</td>
<td>0.000534</td>
<td>125.680129</td>
<td>0.981876</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">23</th>
<td>64</td>
<td>5.0</td>
<td>0.008113</td>
<td>0.008067</td>
<td>0.005609</td>
<td>123.798898</td>
<td>0.967179</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">N</th>
<th data-quarto-table-cell-role="th">Pe_var</th>
<th data-quarto-table-cell-role="th">two_N_minus_Pe</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>2</td>
<td>2.556929</td>
<td>1.443071</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>4</td>
<td>6.829955</td>
<td>1.170045</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>16</td>
<td>30.966630</td>
<td>1.033370</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>64</td>
<td>126.992063</td>
<td>1.007937</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>The dispersion solve converges at observed grid order <strong>2.07</strong> with van Leer TVD (<code>ConvFluxTVD</code>, Newton) and <strong>1.29</strong> with bare upwind; the usual pair, and the only genuine grid axis on this page.</p>
<p>At <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%202N"> the two models’ first-order exit concentrations differ by <strong>0.002 %</strong> at <img src="https://latex.codecogs.com/png.latex?N%20=%2064">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%200.5">, rising to <strong>44.4 %</strong> at <img src="https://latex.codecogs.com/png.latex?N%20=%202">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%205">. At fixed <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t"> the gap falls as <img src="https://latex.codecogs.com/png.latex?N%5E%7B-1.79%7D">. Turned around: the Péclet number that exactly reproduces <img src="https://latex.codecogs.com/png.latex?N"> tanks is 0.9895 of <img src="https://latex.codecogs.com/png.latex?2N"> at <img src="https://latex.codecogs.com/png.latex?N%20=%2064">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%200.5">, but only 0.6213 of it at <img src="https://latex.codecogs.com/png.latex?N%20=%204">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%205">.</p>
<p>So Levenspiel’s “identical for all practical purposes” is a claim about the <em>deviation from plug flow</em>, and it is a good one: at <img src="https://latex.codecogs.com/png.latex?N%20%5Cge%2016"> and <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20%5Cle%202"> the two models are within 0.71 %, which no tracer experiment resolves. It is <strong>not</strong> a claim you can carry to a strongly converting reactor with a broad RTD, and the table above says by how much.</p>
<p><strong>What Fig. 14.7’s rule costs as printed.</strong> Read literally, <img src="https://latex.codecogs.com/png.latex?N%20=%200.5%0A(%5Cmathbf%7BD%7D/uL)"> sends a reader at <img src="https://latex.codecogs.com/png.latex?N%20=%2064"> to <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%200.0078125"> instead of 128 — essentially a single stirred tank. At <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%202"> that is <strong>138 %</strong> away from the 64-tank conversion, against 0.053 % for the de-inverted form. The de-inversion is not an opinion: the annotation’s own threshold <img src="https://latex.codecogs.com/png.latex?N%20%3E%2050"> maps through it to <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BD%7D/uL%20%3C%200.01">, which matches the printed validity limit of Fig. 13.11 itself to 0e+00; and Ch. 13’s own printed <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%202(%5Cmathbf%7BD%7D/uL)"> with Ch. 14’s <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%201/N"> gives the coefficient 0.5 to 0e+00, on the <em>other</em> ratio.</p>
<p><strong>Three matching rules, reconciled.</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%202N"> is what the upwind truncation error gives and it is also what Ch. 13’s small-deviation variance gives, exactly. Matching the <strong>closed-vessel</strong> variance instead gives the <code>Pe_var</code> column above, and matching the <strong>conversion</strong> gives the root-found <code>Pe_eff</code> column. Both sit a little below <img src="https://latex.codecogs.com/png.latex?2N"> — at <img src="https://latex.codecogs.com/png.latex?N%20=%2064">, <img src="https://latex.codecogs.com/png.latex?2N%20-%20%5Cmathrm%7BPe%7D"> is 1.008 on the variance rule and 1.341 on the conversion rule at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%200.5"> — that is, the three rules differ by an <img src="https://latex.codecogs.com/png.latex?O(1)"> offset in <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D"> and therefore by <img src="https://latex.codecogs.com/png.latex?O(1/N)"> relatively. They are the same rule to leading order, which is the only order the annotation claims.</p>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<section id="the-f-curve-and-the-branch-its-brace-prescribes" class="level3">
<h3 class="anchored" data-anchor-id="the-f-curve-and-the-branch-its-brace-prescribes">The <img src="https://latex.codecogs.com/png.latex?F"> curve, and the branch its brace prescribes</h3>
<p>Eq. 8 is checked against a running integral of Eq. 3 — a different object computed a different way — and at both ends of the brace the book draws under it: the “for one tank use the first term” branch, and the general <img src="https://latex.codecogs.com/png.latex?N"> case.</p>
<div id="77123fd3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:57.910905Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:57.910734Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:57.924263Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:57.923474Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Eq. 8: the F curve, against a numerical integral of Eq. 3 - and both branches</span></span>
<span id="cb18-2">_thF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40001</span>)</span>
<span id="cb18-3">_hF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _thF[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _thF[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb18-4">F_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb18-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>]:</span>
<span id="cb18-6">    e <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_theta(_thF, N)</span>
<span id="cb18-7">    cum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.cumsum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (e[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> e[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _hF)])</span>
<span id="cb18-8">    F_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(F_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F_eq8(_thF, N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> cum))))</span>
<span id="cb18-9">F_ENDPOINT_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F_eq8(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span>, N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>])</span>
<span id="cb18-10">F_ONE_TANK_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(F_eq8(_thF, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_thF)))))</span>
<span id="cb18-11">EQ3_VAR_QUAD_DEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> VAR_DEV</span>
<span id="cb18-12">FIG143_EMAX_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(FIG143.loc[FIG143.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N4, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Emax_root"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb18-13"></span>
<span id="cb18-14">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb18-15"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Eq. 8 against the running integral of Eq. 3, for $N$ = 1, 2, 3, 5, 10 and 30:</span></span>
<span id="cb18-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** (trapezoid-limited). $F(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">infty) - 1$ is **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F_ENDPOINT_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**.</span></span>
<span id="cb18-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The "for one tank use the first term" branch reduces to $1-e^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">theta</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ to</span></span>
<span id="cb18-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>F_ONE_TANK_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, so the brace under Eq. 8 is exercised at its own first</span></span>
<span id="cb18-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">term and not only in the general case.</span></span>
<span id="cb18-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p>Eq. 8 against the running integral of Eq. 3, for <img src="https://latex.codecogs.com/png.latex?N"> = 1, 2, 3, 5, 10 and 30: <strong>1.6e-08</strong> (trapezoid-limited). <img src="https://latex.codecogs.com/png.latex?F(%5Cinfty)%20-%201"> is <strong>0.0e+00</strong>. The “for one tank use the first term” branch reduces to <img src="https://latex.codecogs.com/png.latex?1-e%5E%7B-%5Ctheta%7D"> to <strong>0.0e+00</strong>, so the brace under Eq. 8 is exercised at its own first term and not only in the general case.</p>
</div>
</div>
<div id="440b13a3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:57.926374Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:57.926197Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:57.943430Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:57.942627Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb19-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The outflow-boundary-condition penalty, across N: the one modelling error a</span></span>
<span id="cb19-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># reader of this page is most likely to reproduce.</span></span>
<span id="cb19-3">rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb19-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">160</span>]:</span>
<span id="cb19-5">    good, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb19-6">    bad, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zerograd"</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb19-7">    rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(N<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>N, model<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>good, zero_gradient<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>bad, rel_err<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> good) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> good))</span>
<span id="cb19-8">OUTFLOW <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb19-9">OUTFLOW_N2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(OUTFLOW.loc[OUTFLOW.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel_err"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb19-10">OUTFLOW_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(OUTFLOW.loc[OUTFLOW.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rel_err"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb19-11">OUTFLOW_ORDER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(OUTFLOW.N), np.log(OUTFLOW.rel_err), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb19-12"></span>
<span id="cb19-13">_win <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> DISP[(DISP.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (DISP.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)]</span>
<span id="cb19-14">DISP_WINDOW_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_win.rel_diff.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb19-15">EMAX_SWEEP_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E144_EMAX_SAMPLED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E144_EMAX) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX</span>
<span id="cb19-16"></span>
<span id="cb19-17">display(OUTFLOW.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">round</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>))</span>
<span id="cb19-18">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb19-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**The outflow condition, quantified.** Using the zero-gradient outflow instead</span></span>
<span id="cb19-20"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">of the stirred-tank one costs **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_N2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $N=2$ and</span></span>
<span id="cb19-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $N=4$, decaying as $N^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ over</span></span>
<span id="cb19-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N = 2$ to 160 &amp;mdash; close enough to first order to pass for an ordinary</span></span>
<span id="cb19-23"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">discretisation error, which is what makes it easy to dismiss. It is not one:</span></span>
<span id="cb19-24"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N$ is the model, so this error does not go away by refining anything.</span></span>
<span id="cb19-25"></span>
<span id="cb19-26"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**The sweep-versus-root-find margin.** A 1001-point sweep of E14.4's own curve</span></span>
<span id="cb19-27"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">lands within **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>EMAX_SWEEP_RELERR <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** of the true maximum &amp;mdash; close</span></span>
<span id="cb19-28"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">enough to pass for converged, and still a grid value.</span></span>
<span id="cb19-29"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">N</th>
<th data-quarto-table-cell-role="th">model</th>
<th data-quarto-table-cell-role="th">zero_gradient</th>
<th data-quarto-table-cell-role="th">rel_err</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>2</td>
<td>0.250000</td>
<td>0.264706</td>
<td>0.058824</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>4</td>
<td>0.197531</td>
<td>0.205128</td>
<td>0.038462</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>10</td>
<td>0.161506</td>
<td>0.164553</td>
<td>0.018868</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>40</td>
<td>0.142046</td>
<td>0.142801</td>
<td>0.005319</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>160</td>
<td>0.137023</td>
<td>0.137212</td>
<td>0.001374</td>
</tr>
</tbody>
</table>

</div>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>The outflow condition, quantified.</strong> Using the zero-gradient outflow instead of the stirred-tank one costs <strong>5.9 %</strong> at <img src="https://latex.codecogs.com/png.latex?N=2"> and <strong>3.8 %</strong> at <img src="https://latex.codecogs.com/png.latex?N=4">, decaying as <img src="https://latex.codecogs.com/png.latex?N%5E%7B-0.87%7D"> over <img src="https://latex.codecogs.com/png.latex?N%20=%202"> to 160 — close enough to first order to pass for an ordinary discretisation error, which is what makes it easy to dismiss. It is not one: <img src="https://latex.codecogs.com/png.latex?N"> is the model, so this error does not go away by refining anything.</p>
<p><strong>The sweep-versus-root-find margin.</strong> A 1001-point sweep of E14.4’s own curve lands within <strong>0.0011 %</strong> of the true maximum — close enough to pass for converged, and still a grid value.</p>
</div>
</div>
</section>
<section id="claims-what-each-number-is-and-how-it-is-checked" class="level3">
<h3 class="anchored" data-anchor-id="claims-what-each-number-is-and-how-it-is-checked">Claims: what each number is, and how it is checked</h3>
<p>Every number the page stands behind is registered once, in the cell below, with how it is checked (<code>docs/claims-design.md</code> in the gallery repository):</p>
<ul>
<li>a <strong>value</strong> is a result whose size is set by physics, by the book’s printed numbers or by a discretisation. CI holds it to a relative tolerance of the committed baseline, 5 % unless the cell says otherwise;</li>
<li>a <strong>bound</strong> is a quantity whose size is not physics: a residual, a two-route gap at round-off, an identity, a convergence order. It is checked against its stated limits on every run, on every machine, and states its basis (identity, solver or quadrature tolerance, theory, or a stated choice);</li>
<li><strong>structural</strong> marks an identity no break row can move, named as such.</li>
</ul>
<p>The roles are decided by what each quantity is, never by its size. The reproductions of printed values that come out exactly (the deviations of E14.1, E14.2 and E14.4, and the two checks of the Fig. 14.7 rule) are bounds at <img src="https://latex.codecogs.com/png.latex?10%5E%7B-12%7D">: decimal arithmetic on the printed inputs reproduces each printed value in floating point, and a slip anywhere in the chain moves it by at least <img src="https://latex.codecogs.com/png.latex?10%5E%7B-3%7D">. Values whose break row moves them by less than 5 % carry a tighter tolerance; every value on this page is identical to the last digit under three BLAS kernels, so a tight tolerance is admissible.</p>
<div id="09f94709" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:57.945773Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:57.945587Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:57.960718Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:57.959990Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1">PRINTED_NOTE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"decimal arithmetic on printed inputs reproduces the printed value exactly "</span></span>
<span id="cb20-2">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"in floating point; a slip in the chain moves it by at least 1e-3"</span>)</span>
<span id="cb20-3"></span>
<span id="cb20-4"></span>
<span id="cb20-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> value(name, x, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb20-6">    claims.value(name, x, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rtol, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb20-7"></span>
<span id="cb20-8"></span>
<span id="cb20-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> bound(name, x, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, basis, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb20-10">    claims.bound(name, x, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>basis, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>note, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>structural)</span>
<span id="cb20-11"></span>
<span id="cb20-12"></span>
<span id="cb20-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- printed intermediates, E14.1 and E14.2 ---------------------------------</span></span>
<span id="cb20-14">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_1_sigma2_sq_dev"</span>, E141_S2SQ_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-15">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_1_sigma2_dev"</span>, E141_S2_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-16">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_1_wrong_power_gap"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E141_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E141_S2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E141_S2)</span>
<span id="cb20-17">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_2_L_dev"</span>, E142_L_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-18">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brentq on the printed ratio, xtol 1e-12, against the printed 272"</span>)</span>
<span id="cb20-19">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_2_two_routes"</span>, E142_TWO_ROUTES, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-20">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brentq (xtol 1e-12) against the closed form"</span>)</span>
<span id="cb20-21">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_2_wrong_power_gap"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E142_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E142_L) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E142_L)</span>
<span id="cb20-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- E14.4: the fit and its consequences ------------------------------------</span></span>
<span id="cb20-23">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_delta_tbar_dev"</span>, E144_DTB_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-24">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_delta_var_dev"</span>, E144_DV_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-25">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_N_dev"</span>, E144_N_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-26">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_prefactor_reldev"</span>, E144_PRE_DEV,</span>
<span id="cb20-27">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the book's rounding of 4^4/(3! 60^4) to 3.2922e-6"</span>)</span>
<span id="cb20-28">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_prefactor_two_routes"</span>, E144_PRE_TWO_ROUTES, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-29">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"closed form against Simpson normalisation on 400000 panels"</span>)</span>
<span id="cb20-30">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_exponent_dev"</span>, E144_EXP_DEV, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the book's rounding of 4/60 to 0.0667"</span>)</span>
<span id="cb20-31">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_Emax"</span>, E144_EMAX)</span>
<span id="cb20-32">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_Emax_printed"</span>, E144_EMAX_PRINTED, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,</span>
<span id="cb20-33">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"differs from e14_4_Emax in the fifth digit, which is the point; held "</span></span>
<span id="cb20-34">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tighter than that difference"</span>)</span>
<span id="cb20-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Fig. 14.3 -----------------------------------------------------------------</span></span>
<span id="cb20-36">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_theta_max_max_dev"</span>, THETA_MAX_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-37">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"brentq xtol 1e-14 against the printed (N-1)/N"</span>)</span>
<span id="cb20-38">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_width_max_dev"</span>, WIDTH_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-39">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bracketed inflection roots, xtol 1e-15, against 2/sqrt(N-1)"</span>)</span>
<span id="cb20-40">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Emax_max_reldev"</span>, EMAX_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-41">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3 at the root-found maximum against the printed closed form"</span>)</span>
<span id="cb20-42">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_area_max_dev"</span>, AREA_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-43">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simpson on 600001 points over [0, 60]"</span>)</span>
<span id="cb20-44">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_mean_max_dev"</span>, MEAN_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-45">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simpson on 600001 points over [0, 60]"</span>)</span>
<span id="cb20-46">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_stirling_threshold_N"</span>, STIRLING_NCRIT)</span>
<span id="cb20-47">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_stirling_err_N5"</span>, STIRLING_ERR_N5)</span>
<span id="cb20-48">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_stirling_err_N6"</span>, STIRLING_ERR_N6)</span>
<span id="cb20-49">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Einf_lo_N4"</span>, EINF_LO_N4, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reported, not scored"</span>)</span>
<span id="cb20-50">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Einf_hi_N4"</span>, EINF_HI_N4, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reported, not scored"</span>)</span>
<span id="cb20-51">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Emax_at_N4"</span>, FIG143_EMAX_N4)</span>
<span id="cb20-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Eq. 3 and Eq. 8 ----------------------------------------------------------</span></span>
<span id="cb20-53">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_variance_identity"</span>, EQ3_VAR_IDENTITY, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb20-54">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tbar^2/N and N tbar_i^2 are the same number by the definition of tbar_i"</span>)</span>
<span id="cb20-55">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_var_quadrature_dev"</span>, EQ3_VAR_QUAD_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-56">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simpson on 600001 points over [0, 60]"</span>)</span>
<span id="cb20-57">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_F_vs_integral_max_dev"</span>, F_DEV, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the trapezoid error of the running integral"</span>)</span>
<span id="cb20-58">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_F_endpoint_dev"</span>, F_ENDPOINT_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb20-59">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exp(-N theta) underflows to 0 at theta = 1e6, so F = 1 whatever the series"</span>)</span>
<span id="cb20-60">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_one_tank_branch_dev"</span>, F_ONE_TANK_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb20-61">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the one-term series is 1 - exp(-theta) in the same arithmetic"</span>)</span>
<span id="cb20-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Eq. 4, additivity --------------------------------------------------------</span></span>
<span id="cb20-63">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_equal_convolution_dev"</span>, EQ4_EQUAL, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb20-64">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Gamma * Gamma at equal scale is Gamma, and Simpson is exact on the cubic integrand"</span>)</span>
<span id="cb20-65">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_mean_add_reldev"</span>, EQ4_MEAN_DEV, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"set by the 800 s quadrature window"</span>)</span>
<span id="cb20-66">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_var_add_reldev"</span>, EQ4_VAR_DEV, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"set by the 800 s quadrature window"</span>)</span>
<span id="cb20-67">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_unequal_shape_gap"</span>, EQ4_UNEQUAL_GAP)</span>
<span id="cb20-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the pymrm cascade ----------------------------------------------------------</span></span>
<span id="cb20-69">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_vs_sink_construction"</span>, OUTFLOW_VS_SINK, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb20-70">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm {"outflow": True} against the sink construction, operator and '</span></span>
<span id="cb20-71">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"boundary vector entry for entry"</span>)</span>
<span id="cb20-72">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq9_max_dev"</span>, PYMRM_EQ9_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb20-73">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the N-cell upwind cascade is Eq. 9 algebraically; the break rows test the assembly"</span>)</span>
<span id="cb20-74">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq10_max_dev"</span>, PYMRM_EQ10_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-11</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-75">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"newton tol 1e-14 on order-one concentrations against the radical nest"</span>)</span>
<span id="cb20-76">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_max_dev"</span>, RTD_MAX_DEV, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson time-step error at 4000 steps"</span>)</span>
<span id="cb20-77">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_area_dev"</span>, RTD_AREA_DEV, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the analytic tail of Eq. 3 beyond 300 s"</span>)</span>
<span id="cb20-78">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_area_residual"</span>, RTD_AREA_RESIDUAL, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb20-79">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conservation closure of the march: area under the marched curve plus Eq. 3's "</span></span>
<span id="cb20-80">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tail beyond the window; Crank-Nicolson and Simpson errors only"</span>)</span>
<span id="cb20-81">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_order_cn"</span>, ORDER_CN, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb20-82">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Crank-Nicolson is second order"</span>)</span>
<span id="cb20-83">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_order_ie"</span>, ORDER_IE, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb20-84">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"implicit Euler is first order"</span>)</span>
<span id="cb20-85">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_convolution_dev"</span>, RTD_CONV_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb20-86">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same identity as eq4_equal_convolution_dev at M = N = 2"</span>)</span>
<span id="cb20-87"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Eq. 11, the macrofluid branch ----------------------------------------------</span></span>
<span id="cb20-88">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_vs_eq9_max_dev"</span>, EQ11_EQ9_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb20-89">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"two-route gap: Simpson on 40000 panels, observed order 4, against Eq. 9"</span>)</span>
<span id="cb20-90">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_normalisation_dev"</span>, EQ11_NORM_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb20-91">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Simpson on 40000 panels over [0, 80 tbar]"</span>)</span>
<span id="cb20-92">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_quad_order"</span>, EQ11_QUAD_ORDER, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.2</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb20-93">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"composite Simpson is fourth order"</span>)</span>
<span id="cb20-94">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"macro_micro_max_gap"</span>, MACRO_MICRO_MAX)</span>
<span id="cb20-95"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the printed asymptote and the printed defects -------------------------------</span></span>
<span id="cb20-96">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote_order_in_N"</span>, ASYM_ORDER, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.1</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb20-97">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the printed expression is the first term of an expansion in 1/N"</span>)</span>
<span id="cb20-98">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote_reldev_N320"</span>, ASYM_DEV_N320)</span>
<span id="cb20-99">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_volume_ratio_factor"</span>, DEFECT_FACTOR, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb20-100">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly 2 in the limit; extrapolated, not fitted"</span>)</span>
<span id="cb20-101">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_volume_ratio_right_form"</span>, DEFECT_RIGHT_RATIO, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>,</span>
<span id="cb20-102">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exactly 1 in the limit"</span>)</span>
<span id="cb20-103">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_eq11_subscript_norm"</span>, DEFECT_EQ11_NORM_SUB)</span>
<span id="cb20-104">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_e144_tick_ratio"</span>, DEFECT_TICK_RATIO, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>,</span>
<span id="cb20-105">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"against the printed curve; the unrounded curve gives 7.03"</span>)</span>
<span id="cb20-106">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_printed_rule_reldev"</span>, DEFECT_FIG147_PRINTED_RELDEV)</span>
<span id="cb20-107">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_derived_rule_reldev"</span>, DEFECT_FIG147_DERIVED_RELDEV)</span>
<span id="cb20-108">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_threshold_dev"</span>, DEFECT_FIG147_THRESHOLD_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb20-109">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-110">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_from_ch13"</span>, DEFECT_FIG147_FROM_CH13, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb20-111">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PRINTED_NOTE)</span>
<span id="cb20-112"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the headline ---------------------------------------------------------------</span></span>
<span id="cb20-113">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_mean_dev"</span>, AMBIG_MEAN_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb20-114">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the alternative chain is chosen to match the mean, and asserted in code"</span>)</span>
<span id="cb20-115">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_var_dev"</span>, AMBIG_VAR_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb20-116">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the alternative chain is chosen to match the variance, and asserted in code"</span>)</span>
<span id="cb20-117">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_first_order_max_gap"</span>, AMBIG_FIRST_MAX)</span>
<span id="cb20-118">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_conc_gap_kt50"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(AMB.conc_gap.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb20-119">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_conversion_max_gap"</span>, AMBIG_CONV_MAX)</span>
<span id="cb20-120">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_second_order_max_gap"</span>, AMBIG_SECOND_MAX)</span>
<span id="cb20-121">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_rtd_peak_gap"</span>, AMBIG_RTD_GAP)</span>
<span id="cb20-122">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_pymrm_vs_product_dev"</span>, AMBIG_PYMRM_DEV, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb20-123">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the unequal cascade is the staged product algebraically"</span>)</span>
<span id="cb20-124">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_family_sup_gap"</span>, AMBIG_FAMILY_SUP_GAP)</span>
<span id="cb20-125">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_family_sup_gap_kt2"</span>, AMBIG_FAMILY_SUP_GAP_KT2)</span>
<span id="cb20-126">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_family_enum_gap"</span>, AMBIG_FAMILY_BEST_N)</span>
<span id="cb20-127"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the dispersion comparison ----------------------------------------------------</span></span>
<span id="cb20-128">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_grid_order"</span>, DISP_GRID_ORDER, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb20-129">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"van Leer TVD on a smooth profile is second order"</span>)</span>
<span id="cb20-130">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_grid_order_upwind"</span>, DISP_GRID_ORDER_UPWIND, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb20-131">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind, pre-asymptotic over 200 to 1600 cells; first order "</span></span>
<span id="cb20-132">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptotically"</span>)</span>
<span id="cb20-133">bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_tvd_newton_vs_deferred"</span>, DISP_TVD_VS_DEFERRED, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>,</span>
<span id="cb20-134">      note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the same discrete equations by two solvers (deferred correction to a sweep "</span></span>
<span id="cb20-135">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"change of 1e-13, Newton to a step of 1e-12); the gap is the round-off "</span></span>
<span id="cb20-136">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"floor of the exit value"</span>)</span>
<span id="cb20-137">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_N16_kt2"</span>, DISP_DIFF_N16_KT2)</span>
<span id="cb20-138">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_max"</span>, DISP_MAX_DIFF)</span>
<span id="cb20-139">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_order_in_N"</span>, DISP_DIFF_ORDER_IN_N)</span>
<span id="cb20-140">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_Pe_ratio_N64"</span>, PE_RATIO_N64)</span>
<span id="cb20-141">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_Pe_ratio_N4_kt5"</span>, PE_RATIO_N4_KT5)</span>
<span id="cb20-142">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_window_max"</span>, DISP_WINDOW_MAX)</span>
<span id="cb20-143">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_Pe_var_offset_N64"</span>, PE_VAR_OFFSET_N64)</span>
<span id="cb20-144">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_relerr_N4"</span>, OUTFLOW_N4)</span>
<span id="cb20-145">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_relerr_N2"</span>, OUTFLOW_N2)</span>
<span id="cb20-146">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_decay_order_in_N"</span>, OUTFLOW_ORDER)</span>
<span id="cb20-147">value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep_vs_rootfind_relerr"</span>, EMAX_SWEEP_RELERR)</span>
<span id="cb20-148"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims: "</span></span>
<span id="cb20-149">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(c[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'kind'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.values())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb20-150">                  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exact"</span>)))</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>82 claims: 45 value, 37 bound, 0 exact</code></pre>
</div>
</div>
</section>
<section id="the-defect-injection-table" class="level3">
<h3 class="anchored" data-anchor-id="the-defect-injection-table">The defect-injection table</h3>
<p>Rebuilt for this physics; nothing in it travelled from another page. Each row breaks one thing on purpose, <strong>re-runs</strong> the computation behind one claim with the defect in place, and hands the result to <code>claims.breaks</code>, which records whether the claim’s own check (its tolerance or its bound) catches it. A row that moves its claim by less than the claim’s tolerance is not coverage; the table keeps such rows, marked as not caught, when what they show is itself a finding. Every claim that is not structural must be failed by at least one row, and the last cell of the page raises otherwise.</p>
<div id="ac3d5bef" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:57.962790Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:57.962661Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:58.708663Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:58.707965Z&quot;}}" data-execution_count="19">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> eye_array</span>
<span id="cb22-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.sparse.linalg <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> splu</span>
<span id="cb22-3"></span>
<span id="cb22-4">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb22-5"></span>
<span id="cb22-6"></span>
<span id="cb22-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(name, metric, value, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>):</span>
<span id="cb22-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One injected defect: ``value`` is what claim ``metric`` becomes with it."""</span></span>
<span id="cb22-9">    caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> claims.breaks(name, metric, value)</span>
<span id="cb22-10">    BREAK.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(defect<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>name, metric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>metric, clean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>claims[metric], broken<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>value,</span>
<span id="cb22-11">                      caught<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>caught, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>note))</span>
<span id="cb22-12"></span>
<span id="cb22-13"></span>
<span id="cb22-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the printed-intermediate chains ---------------------------------------</span></span>
<span id="cb22-15">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1: scale sigma, not sigma^2, with L"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_1_sigma2_dev"</span>,</span>
<span id="cb22-16">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E141_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E141_S2_P), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves the answer by two and a half bottles"</span>)</span>
<span id="cb22-17">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1: sigma^2 scaled with L^2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_1_sigma2_sq_dev"</span>,</span>
<span id="cb22-18">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((L2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S1SQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E141_S2SQ_P))</span>
<span id="cb22-19">_Lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> L1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> L2</span>
<span id="cb22-20">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.1: pipeline lengths swapped"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_1_wrong_power_gap"</span>,</span>
<span id="cb22-21">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(S1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _Lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(_Lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S1SQ)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(_Lr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> S1SQ))</span>
<span id="cb22-22">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2: spread ~ distance, not spread^2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_2_L_dev"</span>,</span>
<span id="cb22-23">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E142_WRONG_POWER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E142_L_P), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"moves the source two hundred miles up the Ohio"</span>)</span>
<span id="cb22-24">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2: closed form with the spread ratio not squared"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_2_two_routes"</span>,</span>
<span id="cb22-25">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(E142_L <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SC)))</span>
<span id="cb22-26">_Lsw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (SC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb22-27">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.2: the two printed spreads swapped"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_2_wrong_power_gap"</span>,</span>
<span id="cb22-28">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> SC <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> SP) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _Lsw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_Lsw))</span>
<span id="cb22-29">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: N from Delta(sigma), not Delta(sigma^2)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_N_dev"</span>,</span>
<span id="cb22-30">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.sqrt(V_OUT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(V_IN)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N4_P))</span>
<span id="cb22-31">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: ignore the input signal (t_out^2/var_out)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_N_dev"</span>,</span>
<span id="cb22-32">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(TB_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> V_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N4_P), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"this is the point of Eq. 4"</span>)</span>
<span id="cb22-33">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4/Eq. 5: means ADDED instead of subtracted"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_delta_tbar_dev"</span>,</span>
<span id="cb22-34">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((TB_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> TB_IN) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DTB_P))</span>
<span id="cb22-35">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4/Eq. 5: variances ADDED instead of subtracted"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_delta_var_dev"</span>,</span>
<span id="cb22-36">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((V_OUT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> V_IN) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DV_P))</span>
<span id="cb22-37">_pre_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (np.exp(gammaln(N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> N4)</span>
<span id="cb22-38">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: prefactor with N! instead of (N-1)!"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_prefactor_reldev"</span>,</span>
<span id="cb22-39">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_pre_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> PRE_P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> PRE_P)</span>
<span id="cb22-40">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: closed-form prefactor with N!, quadrature route unchanged"</span>,</span>
<span id="cb22-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_prefactor_two_routes"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_pre_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E144_PRE_QUAD) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_PRE_QUAD)</span>
<span id="cb22-42">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: exponent 1/tbar instead of N/tbar"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_exponent_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> EXP_P))</span>
<span id="cb22-43">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: sampled maximum instead of root-found"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_Emax"</span>, E144_EMAX_SAMPLED,</span>
<span id="cb22-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"small, and still a grid max: that IS the finding (sweep_vs_rootfind_relerr)"</span>)</span>
<span id="cb22-45">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"E14.4: peak of the curve with N! in the prefactor"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_Emax"</span>,</span>
<span id="cb22-46">    _pre_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E144_TMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> E144_TMAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> TB4))</span>
<span id="cb22-47">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig E14.4b: peak of the printed curve taken from the UNROUNDED coefficients"</span>,</span>
<span id="cb22-48">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"e14_4_Emax_printed"</span>, E144_EMAX, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the fifth-digit difference the claim exists for"</span>)</span>
<span id="cb22-49">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig E14.4b: tick judged against the UNROUNDED E(t)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_e144_tick_ratio"</span>,</span>
<span id="cb22-50">    TICK_P <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the tick belongs to the curve the book PRINTS, 3.2922e-6 and 0.0667"</span>)</span>
<span id="cb22-51"></span>
<span id="cb22-52"></span>
<span id="cb22-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Eq. 3 itself, which everything downstream of it depends on ----------------</span></span>
<span id="cb22-54"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _E_theta_bad(th, N):</span>
<span id="cb22-55">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. 3 with N! where the book writes (N-1)!: the classic transcription slip."""</span></span>
<span id="cb22-56">    th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.maximum(np.asarray(th, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-300</span>)</span>
<span id="cb22-57">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> np.exp(np.log(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.log(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> gammaln(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb22-58"></span>
<span id="cb22-59"></span>
<span id="cb22-60">_ebad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _E_theta_bad(_th, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb22-61">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3: (N-1)! written as N!"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_area_max_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_simp(_ebad)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb22-62">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3: (N-1)! written as N! (mean)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_mean_max_dev"</span>,</span>
<span id="cb22-63">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_simp(_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _ebad)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb22-64">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3: (N-1)! written as N! (variance)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq3_var_quadrature_dev"</span>,</span>
<span id="cb22-65">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_simp((_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _ebad)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb22-66">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3: (N-1)! written as N! (maximum against the printed closed form)"</span>,</span>
<span id="cb22-67">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Emax_max_reldev"</span>,</span>
<span id="cb22-68">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_E_theta_bad(theta_max_root(N), N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Emax_printed(N)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Emax_printed(N)</span>
<span id="cb22-69">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NS))</span>
<span id="cb22-70">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3: (N-1)! written as N! (maximum at N = 4)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Emax_at_N4"</span>,</span>
<span id="cb22-71">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_E_theta_bad(theta_max_root(N4), N4)))</span>
<span id="cb22-72">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 3: theta_max read on the PER-TANK time theta_i = N theta"</span>,</span>
<span id="cb22-73">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_theta_max_max_dev"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4))</span>
<span id="cb22-74"></span>
<span id="cb22-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Fig. 14.3 ------------------------------------------------------------------</span></span>
<span id="cb22-76">_stir_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> N: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Emax_printed(N)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Emax_printed(N)</span>
<span id="cb22-77">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.3: Stirling with sqrt(2 pi N), not sqrt(2 pi (N-1))"</span>,</span>
<span id="cb22-78">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_stirling_threshold_N"</span>,</span>
<span id="cb22-79">    brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> N: _stir_bad(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig14.3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirling_error_bound"</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span>))</span>
<span id="cb22-80">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.3: Stirling with sqrt(2 pi N), at N = 5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_stirling_err_N5"</span>, _stir_bad(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb22-81">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.3: Stirling with sqrt(2 pi N), at N = 6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_stirling_err_N6"</span>, _stir_bad(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>))</span>
<span id="cb22-82">_bad_infl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th, N: N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> th) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span></span>
<span id="cb22-83">_lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th: _bad_infl(th, N4), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-15</span>)</span>
<span id="cb22-84">_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> th: _bad_infl(th, N4), (N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">60.0</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb22-85">_tm4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> theta_max_root(N4)</span>
<span id="cb22-86">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.3: inflection quadratic with N(N-2), not (N-1)(N-2)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_width_max_dev"</span>,</span>
<span id="cb22-87">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _lo) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ((N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb22-88">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.3: inflection quadratic with N(N-2) (lower height)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Einf_lo_N4"</span>,</span>
<span id="cb22-89">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_theta(_lo, N4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E_theta(_tm4, N4)))</span>
<span id="cb22-90">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.3: inflection quadratic with N(N-2) (upper height)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fig143_Einf_hi_N4"</span>,</span>
<span id="cb22-91">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_theta(_hi, N4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E_theta(_tm4, N4)))</span>
<span id="cb22-92"></span>
<span id="cb22-93"></span>
<span id="cb22-94"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Eq. 8's truncation, which the book's own brace prescribes ----------------</span></span>
<span id="cb22-95"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _F_bad(th, N):</span>
<span id="cb22-96">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. 8 summed to N terms instead of the printed N-1."""</span></span>
<span id="cb22-97">    x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.asarray(th, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb22-98">    term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.ones_like(x)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> term.copy()</span>
<span id="cb22-99">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> j <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb22-100">        term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> term <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> j</span>
<span id="cb22-101">        total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> term</span>
<span id="cb22-102">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>x) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> total</span>
<span id="cb22-103"></span>
<span id="cb22-104"></span>
<span id="cb22-105">_thb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40001</span>)</span>
<span id="cb22-106">_eb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> E_theta(_thb, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb22-107">_cumb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.concatenate([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.cumsum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (_eb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _eb[:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (_thb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _thb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))])</span>
<span id="cb22-108">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 8: series summed to N terms instead of N-1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_F_vs_integral_max_dev"</span>,</span>
<span id="cb22-109">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_F_bad(_thb, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _cumb))))</span>
<span id="cb22-110">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 8: series summed to N terms, one-tank branch"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq8_one_tank_branch_dev"</span>,</span>
<span id="cb22-111">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_F_bad(_thF, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>_thF))))))</span>
<span id="cb22-112"></span>
<span id="cb22-113"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the printed small-deviation asymptote --------------------------------------</span></span>
<span id="cb22-114">_asym_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((eq9(n, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)</span>
<span id="cb22-115">                      <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ASYM_NS])</span>
<span id="cb22-116">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote: (k tbar)^2/N instead of (k tbar)^2/(2N)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote_reldev_N320"</span>,</span>
<span id="cb22-117">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_asym_bad[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb22-118">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote: (k tbar)^2/N instead of (k tbar)^2/(2N) (order)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"asymptote_order_in_N"</span>,</span>
<span id="cb22-119">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(ASYM_NS), np.log(_asym_bad), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb22-120"></span>
<span id="cb22-121"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the pymrm assembly ---------------------------------------------------------</span></span>
<span id="cb22-122">_eq9_ref <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> eq9(N4, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)</span>
<span id="cb22-123">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: zero-gradient outflow bc (the PDE choice)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq9_max_dev"</span>,</span>
<span id="cb22-124">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cascade(N4, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zerograd"</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _eq9_ref),</span>
<span id="cb22-125">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"a MODELLING error, not an accuracy one"</span>)</span>
<span id="cb22-126">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: geometrically graded cells (tanks unequal)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq9_max_dev"</span>,</span>
<span id="cb22-127">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cascade(N4, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>,</span>
<span id="cb22-128">                faces<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.concatenate([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.cumsum(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> np.arange(N4))</span>
<span id="cb22-129">                                      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> np.arange(N4))])).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-130">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _eq9_ref), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the model still solves; it solves something else"</span>)</span>
<span id="cb22-131">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: construct_div nu = 1 (cylindrical)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq9_max_dev"</span>,</span>
<span id="cb22-132">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cascade(N4, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _eq9_ref),</span>
<span id="cb22-133">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COLLAPSE, not a shift: the exit goes to exactly 0"</span>)</span>
<span id="cb22-134">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: velocity reversed (downwind)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq9_max_dev"</span>,</span>
<span id="cb22-135">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cascade(N4, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, v_sign<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _eq9_ref),</span>
<span id="cb22-136">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COLLAPSE, as above"</span>)</span>
<span id="cb22-137">_zg, _own <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N4, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zerograd"</span>), Cascade(N4, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirred"</span>)</span>
<span id="cb22-138">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm: {"outflow": True} replaced by the zero-gradient bc'</span>,</span>
<span id="cb22-139">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_vs_sink_construction"</span>,</span>
<span id="cb22-140">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_zg.jac_const <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _own.jac_const).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb22-141">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_zg.g_const <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _own.g_const)))))</span>
<span id="cb22-142">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: implicit Euler instead of Crank-Nicolson (time order)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_order_cn"</span>,</span>
<span id="cb22-143">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> NTS),</span>
<span id="cb22-144">                     np.log([rtd_error(N4, TB4, nt, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NTS]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb22-145">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: Crank-Nicolson where implicit Euler was meant (time order)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_order_ie"</span>,</span>
<span id="cb22-146">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> NTS),</span>
<span id="cb22-147">                     np.log([rtd_error(N4, TB4, nt, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> nt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NTS]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb22-148">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: implicit Euler at the production step"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_max_dev"</span>,</span>
<span id="cb22-149">    rtd_error(N4, TB4, NT_PROD, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb22-150"></span>
<span id="cb22-151"></span>
<span id="cb22-152"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _area(ts, es):</span>
<span id="cb22-153">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ts[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-154">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (es[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> es[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> es[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> es[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>:<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()))</span>
<span id="cb22-155"></span>
<span id="cb22-156"></span>
<span id="cb22-157">_zg_ts, _zg_es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N4, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TB4, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zerograd"</span>).pulse_response(TMAX_PROD, NT_PROD)</span>
<span id="cb22-158">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: RTD area with the zero-gradient outflow bc"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_area_dev"</span>,</span>
<span id="cb22-159">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_area(_zg_ts, _zg_es) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb22-160">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: RTD closure with the zero-gradient outflow bc"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_area_residual"</span>,</span>
<span id="cb22-161">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_area(_zg_ts, _zg_es) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> RTD_TAIL))</span>
<span id="cb22-162">_nu_ts, _nu_es <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N4, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>TB4, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>).pulse_response(TMAX_PROD, NT_PROD)</span>
<span id="cb22-163">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: RTD area with construct_div nu = 1 (cylindrical)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rtd_area_dev"</span>,</span>
<span id="cb22-164">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_area(_nu_ts, _nu_es) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb22-165">_so <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SO[(SO.N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> N4) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (SO.kC0tbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-166">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm: Eq. 10 nested N-1 times instead of N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq10_max_dev"</span>,</span>
<span id="cb22-167">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_so.pymrm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq10(N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> N4, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)))</span>
<span id="cb22-168">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 10 nested N-1 times instead of N (micro against macro)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"macro_micro_max_gap"</span>,</span>
<span id="cb22-169">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r.eq11_macro <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, r.kC0tbar, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb22-170">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq10(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, r.kC0tbar, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r.N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SO.itertuples())))</span>
<span id="cb22-171">_k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB</span>
<span id="cb22-172">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: unequal chain with the zero-gradient outflow bc"</span>,</span>
<span id="cb22-173">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_pymrm_vs_product_dev"</span>,</span>
<span id="cb22-174">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(Cascade(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(T_UN), tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>DTB, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"zerograd"</span>,</span>
<span id="cb22-175">                faces<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.concatenate([[<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.cumsum(T_UN) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T_UN.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()])).first_order(_k)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-176">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.prod(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> _k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T_UN)))</span>
<span id="cb22-177"></span>
<span id="cb22-178"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the outflow penalty: the sink construction with its sink forgotten -------</span></span>
<span id="cb22-179"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> _no_sink(N):</span>
<span id="cb22-180">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Exit face suppressed (b=1, d=0) and the outflow sink forgotten."""</span></span>
<span id="cb22-181">    cs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, outlet<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stirred"</span>)</span>
<span id="cb22-182">    jac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cs.jac_const.tolil()</span>
<span id="cb22-183">    jac[N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, N <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(cs.u) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> cs.dz[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb22-184">    jac <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> jac.tocsc() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> eye_array(N, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">format</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"csc"</span>)</span>
<span id="cb22-185">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> splu(jac.tocsc()).solve(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>cs.g_const)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb22-186"></span>
<span id="cb22-187"></span>
<span id="cb22-188">_ns_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {N: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_no_sink(N) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb22-189">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> Cascade(N, tbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, c_in<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>).first_order(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OUTFLOW.N}</span>
<span id="cb22-190">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow: face suppressed but the sink forgotten, N = 2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_relerr_N2"</span>, _ns_bad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb22-191">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow: face suppressed but the sink forgotten, N = 4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_relerr_N4"</span>, _ns_bad[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>])</span>
<span id="cb22-192">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow: face suppressed but the sink forgotten (decay order)"</span>,</span>
<span id="cb22-193">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow_bc_decay_order_in_N"</span>,</span>
<span id="cb22-194">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(OUTFLOW.N), np.log([_ns_bad[N] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> OUTFLOW.N]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb22-195"></span>
<span id="cb22-196"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- Eq. 11 and the quadrature ----------------------------------------------------</span></span>
<span id="cb22-197">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 11: denominator tbar_N (as printed) instead of tbar^N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_normalisation_dev"</span>,</span>
<span id="cb22-198">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DEFECT_EQ11_NORM_SUB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb22-199">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 11: Simpson with 1/16 of the panels"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_vs_eq9_max_dev"</span>,</span>
<span id="cb22-200">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eq11(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t), npanel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2500</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))</span>
<span id="cb22-201"></span>
<span id="cb22-202"></span>
<span id="cb22-203">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 11: integration window cut at 3 tbar instead of 80 tbar (quadrature order)"</span>,</span>
<span id="cb22-204">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq11_quad_order"</span>,</span>
<span id="cb22-205">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.polyfit(np.log(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _pans),</span>
<span id="cb22-206">                     np.log([<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(eq11(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> t), npanel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>p, span<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.0</span>)</span>
<span id="cb22-207">                                 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _pans]), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb22-208">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the tail beyond the window does not refine away"</span>)</span>
<span id="cb22-209">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 11: subscript read as the per-tank tbar_i = tbar/N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_eq11_subscript_norm"</span>,</span>
<span id="cb22-210">    NORM_SUPER <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> _tb11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> _N11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (_tb11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _N11))</span>
<span id="cb22-211"></span>
<span id="cb22-212"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the printed defects -----------------------------------------------------------</span></span>
<span id="cb22-213">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor of two: slope read off the raw quotient at x = 0.4, not extrapolated"</span>,</span>
<span id="cb22-214">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_volume_ratio_factor"</span>, DEFECT_MID_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _vslope(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>))</span>
<span id="cb22-215">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor of two: right-hand form judged on the raw quotient at x = 0.4"</span>,</span>
<span id="cb22-216">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_volume_ratio_right_form"</span>, DEFECT_RIGHT_SLOPE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _vslope(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>))</span>
<span id="cb22-217">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.7: threshold N &gt; 50 mapped with the rule AS PRINTED"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_threshold_dev"</span>,</span>
<span id="cb22-218">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(DEFECT_FIG147_THRESHOLD_DUL_PRINTED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> DUL_LIMIT))</span>
<span id="cb22-219">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.7: coefficient taken off the D/uL side of Ch. 13's variance"</span>,</span>
<span id="cb22-220">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_from_ch13"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(SIG_COEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> HALF))</span>
<span id="cb22-221">_ktd_i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _ktd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _Nd</span>
<span id="cb22-222">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.7: printed-rule cost with the per-tank k tbar_i in place of k tbar"</span>,</span>
<span id="cb22-223">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_printed_rule_reldev"</span>,</span>
<span id="cb22-224">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(DEFECT_FIG147_PE_PRINTED, _ktd_i) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(_Nd, _ktd_i)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq9(_Nd, _ktd_i))</span>
<span id="cb22-225">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.7: de-inverted rule with Pe = N instead of 2N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect_fig147_derived_rule_reldev"</span>,</span>
<span id="cb22-226">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_Nd), _ktd) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _tis_d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _tis_d)</span>
<span id="cb22-227"></span>
<span id="cb22-228"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- additivity ------------------------------------------------------------------------</span></span>
<span id="cb22-229">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 4: moment integrals truncated at 340 s instead of 800 s"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_mean_add_reldev"</span>,</span>
<span id="cb22-230">    EQ4_MEAN_DEV_SHORT, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"what this metric actually measures is the window"</span>)</span>
<span id="cb22-231">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 4: moment integrals truncated at 340 s instead of 800 s (variance)"</span>,</span>
<span id="cb22-232">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_var_add_reldev"</span>, EQ4_VAR_DEV_SHORT)</span>
<span id="cb22-233">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Eq. 4: moment-match the composite by TANK COUNT (N = 5), not by the moments"</span>,</span>
<span id="cb22-234">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq4_unequal_shape_gap"</span>,</span>
<span id="cb22-235">    max_brent(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(convolve_E(np.array([t]), MA, MB, tA, tB)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb22-236">                            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(t, MA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> MB, MEAN_UNEQ))),</span>
<span id="cb22-237">              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, EQ4_WINDOW) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> CONV_UNEQ_PEAK)</span>
<span id="cb22-238"></span>
<span id="cb22-239"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the headline ------------------------------------------------------------------------</span></span>
<span id="cb22-240">_T5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.full(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>)</span>
<span id="cb22-241">_amb_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb22-242"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> kt <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> AMB.ktbar:</span>
<span id="cb22-243">    _kk <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB</span>
<span id="cb22-244">    a1, b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_EQ, DTB).first_order(_kk)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], chain(_T5, DTB).first_order(_kk)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-245">    _amb_bad.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ktbar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>kt, conc_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(b1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> a1,</span>
<span id="cb22-246">                         conv_gap<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b1) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> a1)))</span>
<span id="cb22-247">_amb_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(_amb_bad)</span>
<span id="cb22-248">_k10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> AMBIG_KT_HEADLINE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB</span>
<span id="cb22-249">_c_eq10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_EQ, DTB).first_order(_k10)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-250">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: alternative chain sized by COUNT (5 equal tanks)"</span>,</span>
<span id="cb22-251">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_first_order_max_gap"</span>,</span>
<span id="cb22-252">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_amb_bad.loc[_amb_bad.ktbar <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> AMBIG_KT_HEADLINE, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"conc_gap"</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb22-253">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: alternative chain sized by COUNT, at k tbar = 50"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_conc_gap_kt50"</span>,</span>
<span id="cb22-254">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_amb_bad.conc_gap.iloc[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb22-255">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: alternative chain sized by COUNT, conversion"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_conversion_max_gap"</span>,</span>
<span id="cb22-256">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_amb_bad.conv_gap.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()))</span>
<span id="cb22-257">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: alternative chain sized by COUNT, variance"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_var_dev"</span>,</span>
<span id="cb22-258">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((_T5 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> (T_EQ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()))</span>
<span id="cb22-259">_a2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> chain(T_EQ, DTB).order_n(_k10, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb22-260">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: alternative chain sized by COUNT, second order"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_second_order_max_gap"</span>,</span>
<span id="cb22-261">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(chain(_T5, DTB).order_n(_k10, order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _a2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _a2)</span>
<span id="cb22-262">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity: RTD of the alternative chain taken as 5 EQUAL tanks"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_rtd_peak_gap"</span>,</span>
<span id="cb22-263">    max_brent(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, DTB)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(t, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, DTB))),</span>
<span id="cb22-264">              <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">260.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX)</span>
<span id="cb22-265">_sup_bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> kt: (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> np.sqrt(V_OUT))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(V_OUT))</span>
<span id="cb22-266">                           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> conc_of(T_EQ, kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> conc_of(T_EQ, kt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> DTB))</span>
<span id="cb22-267">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"family bound: input variance not subtracted (S = var_out, not Delta var)"</span>,</span>
<span id="cb22-268">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_family_sup_gap"</span>, _sup_bad(AMBIG_KT_HEADLINE))</span>
<span id="cb22-269">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"family bound: input variance not subtracted, at k tbar = 2"</span>,</span>
<span id="cb22-270">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_family_sup_gap_kt2"</span>, _sup_bad(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb22-271">_lo40 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(conc_of(ts, _k10) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">41</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> m <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n)</span>
<span id="cb22-272">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ts <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> two_value_chains(n, m))</span>
<span id="cb22-273">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"family enumeration stopped at 40 stages instead of 400"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_family_enum_gap"</span>,</span>
<span id="cb22-274">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_lo40 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> _c_eq10) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> _c_eq10)</span>
<span id="cb22-275"></span>
<span id="cb22-276"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- the dispersion comparison and Fig. 14.7's printed rule ---------------------------------</span></span>
<span id="cb22-277">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: no van Leer limiter (grid order)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_grid_order"</span>, DISP_GRID_ORDER_UPWIND)</span>
<span id="cb22-278">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: van Leer where bare upwind was meant (grid order)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_grid_order_upwind"</span>,</span>
<span id="cb22-279">    DISP_GRID_ORDER)</span>
<span id="cb22-280">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: deferred correction stopped after one sweep"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_tvd_newton_vs_deferred"</span>,</span>
<span id="cb22-281">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit_deferred(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>, tol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> dispersion_exit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)))</span>
<span id="cb22-282">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: Pe = N instead of 2N"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_N16_kt2"</span>,</span>
<span id="cb22-283">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>))</span>
<span id="cb22-284">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Fig 14.7: its rule AS PRINTED, N = 1/2 (D/uL), at N = 16"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_N16_kt2"</span>,</span>
<span id="cb22-285">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(HALF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">16.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>),</span>
<span id="cb22-286">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"printed defect (a), injected"</span>)</span>
<span id="cb22-287">_Nw, _kw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(DISP_ROW_WORST.N), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(DISP_ROW_WORST.ktbar)</span>
<span id="cb22-288">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: Pe = N instead of 2N, worst case"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_max"</span>,</span>
<span id="cb22-289">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_Nw), _kw) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(_Nw, _kw)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq9(_Nw, _kw))</span>
<span id="cb22-290">_gN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(N), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq9(N, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> N <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _sub.N]</span>
<span id="cb22-291">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: Pe = N instead of 2N (decay in N)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_order_in_N"</span>,</span>
<span id="cb22-292">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.polyfit(np.log(_sub.N), np.log(_gN), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]))</span>
<span id="cb22-293">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: Pe = N instead of 2N (N &gt;= 16, k tbar &lt;= 2)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_reldiff_window_max"</span>,</span>
<span id="cb22-294">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(dispersion_exit(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(r.N), r.ktbar) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.N), r.ktbar)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> eq9(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.N), r.ktbar)</span>
<span id="cb22-295">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _win.itertuples()))</span>
<span id="cb22-296">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: Pe_eff root-found on 200 first-order upwind cells"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_Pe_ratio_N64"</span>,</span>
<span id="cb22-297">    brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pe: dispersion_exit(Pe, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, limiter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>),</span>
<span id="cb22-298">           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>))</span>
<span id="cb22-299">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: Pe_eff matched to Eq. 9 with N - 1 tanks"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_Pe_ratio_N4_kt5"</span>,</span>
<span id="cb22-300">    brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> Pe: dispersion_exit(Pe, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>, n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> eq9(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5.0</span>),</span>
<span id="cb22-301">           <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">400.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>))</span>
<span id="cb22-302">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dispersion: variance matched on the open-vessel 2/Pe, not the closed vessel"</span>,</span>
<span id="cb22-303">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disp_Pe_var_offset_N64"</span>,</span>
<span id="cb22-304">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> brentq(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> p: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-3</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span>, xtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>)),</span>
<span id="cb22-305">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the open-vessel rule gives Pe = 2N exactly, which is the point"</span>)</span>
<span id="cb22-306">_grid10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> TB4, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10001</span>)</span>
<span id="cb22-307">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep of E14.4's curve on 10001 points instead of 1001"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sweep_vs_rootfind_relerr"</span>,</span>
<span id="cb22-308">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(E_time(_grid10, N4, TB4).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> E144_EMAX) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> E144_EMAX)</span>
<span id="cb22-309"></span>
<span id="cb22-310">BT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAK)</span>
<span id="cb22-311">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.width"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb22-312">pd.set_option(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"display.max_colwidth"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">58</span>)</span>
<span id="cb22-313">display(BT[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"defect"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"metric"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"caught"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"note"</span>]])</span>
<span id="cb22-314"></span>
<span id="cb22-315"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Coverage, from the rows' own verdicts: every claim that is not structural must</span></span>
<span id="cb22-316"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># be failed by at least one row (claims.report() raises otherwise).</span></span>
<span id="cb22-317">_caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(BT[BT.caught].metric)</span>
<span id="cb22-318">_structural <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> c.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>))</span>
<span id="cb22-319">_open <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sorted</span>(k <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _caught <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _structural)</span>
<span id="cb22-320"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BT)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BT.caught.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> fail the claim they target, "</span></span>
<span id="cb22-321">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(BT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(BT.caught.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> do not (each says why in its note)."</span>)</span>
<span id="cb22-322"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_caught)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims are failed by at least one row; "</span></span>
<span id="cb22-323">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_structural)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> are structural: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(_structural)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb22-324"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claims with no failing row:"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(_open) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>)</span>
<span id="cb22-325"></span>
<span id="cb22-326">_asm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> BT[BT.metric <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_eq9_max_dev"</span>]</span>
<span id="cb22-327">_res <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _asm[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>_asm.note.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"COLLAPSE"</span>)]</span>
<span id="cb22-328">ASSEMBLY_N_COLLAPSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_asm) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(_res))</span>
<span id="cb22-329">ASSEMBLY_MIN_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_res.broken.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())</span>
<span id="cb22-330">ASSEMBLY_MAX_SHIFT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(_res.broken.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>())</span>
<span id="cb22-331">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb22-332"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**What the assembly rows are worth.** Four rows break the pymrm assembly, and</span></span>
<span id="cb22-333"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">they are not equal in value. </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASSEMBLY_N_COLLAPSE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of them &amp;mdash; `nu=1` and a</span></span>
<span id="cb22-334"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reversed velocity &amp;mdash; drive the exit concentration to exactly zero: the model</span></span>
<span id="cb22-335"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">*collapses* rather than shifts, so they show the claim reacting, not resolving.</span></span>
<span id="cb22-336"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">The two that resolve are the zero-gradient outflow and the graded cells, and they</span></span>
<span id="cb22-337"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">carry the row on their own: they move `pymrm_eq9_max_dev` to</span></span>
<span id="cb22-338"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASSEMBLY_MIN_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">** and **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ASSEMBLY_MAX_SHIFT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**, against its bound of</span></span>
<span id="cb22-339"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-12</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$. Those are the two numbers to quote.</span></span>
<span id="cb22-340"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>


<table class="dataframe caption-top table table-sm table-striped small" data-border="1">
<thead>
<tr class="header">
<th data-quarto-table-cell-role="th"></th>
<th data-quarto-table-cell-role="th">defect</th>
<th data-quarto-table-cell-role="th">metric</th>
<th data-quarto-table-cell-role="th">caught</th>
<th data-quarto-table-cell-role="th">note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<th data-quarto-table-cell-role="th">0</th>
<td>E14.1: scale sigma, not sigma^2, with L</td>
<td>e14_1_sigma2_dev</td>
<td>True</td>
<td>moves the answer by two and a half bottles</td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">1</th>
<td>E14.1: sigma^2 scaled with L^2</td>
<td>e14_1_sigma2_sq_dev</td>
<td>True</td>
<td></td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">2</th>
<td>E14.1: pipeline lengths swapped</td>
<td>e14_1_wrong_power_gap</td>
<td>True</td>
<td></td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">3</th>
<td>E14.2: spread ~ distance, not spread^2</td>
<td>e14_2_L_dev</td>
<td>True</td>
<td>moves the source two hundred miles up the Ohio</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">4</th>
<td>E14.2: closed form with the spread ratio not squared</td>
<td>e14_2_two_routes</td>
<td>True</td>
<td></td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">...</th>
<td>...</td>
<td>...</td>
<td>...</td>
<td>...</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">79</th>
<td>dispersion: Pe = N instead of 2N (N &gt;= 16, k tbar &lt;= 2)</td>
<td>disp_reldiff_window_max</td>
<td>True</td>
<td></td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">80</th>
<td>dispersion: Pe_eff root-found on 200 first-order upwin...</td>
<td>disp_Pe_ratio_N64</td>
<td>True</td>
<td></td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">81</th>
<td>dispersion: Pe_eff matched to Eq. 9 with N - 1 tanks</td>
<td>disp_Pe_ratio_N4_kt5</td>
<td>True</td>
<td></td>
</tr>
<tr class="even">
<th data-quarto-table-cell-role="th">82</th>
<td>dispersion: variance matched on the open-vessel 2/Pe, ...</td>
<td>disp_Pe_var_offset_N64</td>
<td>True</td>
<td>the open-vessel rule gives Pe = 2N exactly, which is t...</td>
</tr>
<tr class="odd">
<th data-quarto-table-cell-role="th">83</th>
<td>sweep of E14.4's curve on 10001 points instead of 1001</td>
<td>sweep_vs_rootfind_relerr</td>
<td>True</td>
<td></td>
</tr>
</tbody>
</table>

<p>84 rows × 4 columns</p>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>84 rows; 83 fail the claim they target, 1 do not (each says why in its note).
77 of 82 claims are failed by at least one row; 5 are structural: ambiguity_mean_dev, eq3_variance_identity, eq4_equal_convolution_dev, eq8_F_endpoint_dev, rtd_convolution_dev.
claims with no failing row: none</code></pre>
</div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>What the assembly rows are worth.</strong> Four rows break the pymrm assembly, and they are not equal in value. 2 of them — <code>nu=1</code> and a reversed velocity — drive the exit concentration to exactly zero: the model <em>collapses</em> rather than shifts, so they show the claim reacting, not resolving. The two that resolve are the zero-gradient outflow and the graded cells, and they carry the row on their own: they move <code>pymrm_eq9_max_dev</code> to <strong>7.6e-03</strong> and <strong>1.1e-02</strong>, against its bound of <img src="https://latex.codecogs.com/png.latex?10%5E%7B-12%7D">. Those are the two numbers to quote.</p>
</div>
</div>
</section>
<section id="what-the-checks-can-and-cannot-do" class="level3">
<h3 class="anchored" data-anchor-id="what-the-checks-can-and-cannot-do">What the checks can and cannot do</h3>
<p><strong>Structural, and labelled as such.</strong></p>
<ul>
<li><code>pymrm_eq9_max_dev</code>. The <img src="https://latex.codecogs.com/png.latex?N">-cell upwind cascade is <em>algebraically identical</em> to Eq. 9; agreement at round-off is an identity, not evidence about the physics. What it can still catch is every way of assembling it wrongly, and four break rows do exactly that — the zero-gradient outflow, <code>nu=1</code>, a reversed velocity and graded cells — with the range of shifts printed just above. It is therefore a bound with basis identity, not a structural claim.</li>
<li><code>outflow_bc_vs_sink_construction</code>. pymrm’s <code>{"outflow": True}</code> and the page’s own sink construction are the same operator; the check keeps the page’s derivation as proof of the library boundary, and the zero-gradient row breaks it.</li>
<li><code>eq4_equal_convolution_dev</code> <strong>and <code>rtd_convolution_dev</code></strong>. These are the same identity at two stage counts: Gamma <img src="https://latex.codecogs.com/png.latex?%5Cstar"> Gamma at equal scale <em>is</em> Gamma. Neither can detect anything physical, and neither says anything about the quadrature either. For equal tank sizes the integrand <img src="https://latex.codecogs.com/png.latex?E_M(s)E_N(t-s)"> is <img src="https://latex.codecogs.com/png.latex?s%5E%7BM-1%7D(t-s)%5E%7BN-1%7De%5E%7B-t/%5Cbar%20t_i%7D">, a polynomial of degree <img src="https://latex.codecogs.com/png.latex?M+N-2%20%5Cle%203"> times a factor constant in <img src="https://latex.codecogs.com/png.latex?s">, and Simpson is exact on cubics: the same round-off comes back on 20 panels as on 2000, and it survives the <img src="https://latex.codecogs.com/png.latex?(N-1)!%5Cto%20N!"> slip because the Beta integral absorbs it. Both are registered as structural. The claim that does test this machinery is <code>eq4_unequal_shape_gap</code>, the same convolution applied where the identity does <em>not</em> hold and where the quadrature is genuinely refined.</li>
<li><code>eq3_variance_identity</code>. <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t%5E%7B%5C,2%7D/N"> and <img src="https://latex.codecogs.com/png.latex?N%5Cbar%20t_i%5E%7B%5C,2%7D"> are the same number by the definition of <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t_i">; the check confirms the transcription of Eq. 3’s two right-hand columns and nothing else. Structural; the claim that integrates the density is <code>eq3_var_quadrature_dev</code>.</li>
<li><code>eq8_F_endpoint_dev</code>. <img src="https://latex.codecogs.com/png.latex?e%5E%7B-N%5Ctheta%7D"> underflows to exactly 0 at <img src="https://latex.codecogs.com/png.latex?%5Ctheta%20=%2010%5E6">, so <img src="https://latex.codecogs.com/png.latex?F(%5Cinfty)%20=%201"> in floating point whatever the series is. Structural; <code>eq8_F_vs_integral_max_dev</code> is the claim that tests the series.</li>
<li><code>ambiguity_mean_dev</code> and <code>ambiguity_var_dev</code>. Zero by construction and asserted in code: the five-stage chain is <em>chosen</em> to match the two moments. They are reported so that a reader can see the match is exact rather than approximate. The mean is structural (five equal tanks of 12 s have the same mean, so no plausible slip moves it); the variance is failed by the row that sizes the chain by count.</li>
</ul>
<p><strong>Second, independent computations.</strong> Four headlines are computed twice with no shared assembly. The pairings below are the ones the code actually computes, and each names the metric that reports it:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
<col style="width: 25%">
</colgroup>
<thead>
<tr class="header">
<th>quantity</th>
<th>route 1</th>
<th>route 2</th>
<th>metric</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>E14.2’s <img src="https://latex.codecogs.com/png.latex?L"></td>
<td><code>brentq</code> on the printed ratio</td>
<td>closed form <img src="https://latex.codecogs.com/png.latex?119/(1-(10.5/14)%5E2)"></td>
<td><code>e14_2_two_routes</code></td>
</tr>
<tr class="even">
<td>E14.4’s prefactor</td>
<td><img src="https://latex.codecogs.com/png.latex?N%5EN/((N-1)!%5Cbar%20t%5E%7B%5C,N%7D)"></td>
<td>numerical normalisation of <img src="https://latex.codecogs.com/png.latex?t%5E3e%5E%7B-4t/60%7D"></td>
<td><code>e14_4_prefactor_two_routes</code></td>
</tr>
<tr class="odd">
<td>first-order conversion</td>
<td>Eq. 11’s quadrature <img src="https://latex.codecogs.com/png.latex?%5Cint%20e%5E%7B-kt%7DE%5C,dt"></td>
<td>Eq. 9’s algebra</td>
<td><code>eq11_vs_eq9_max_dev</code></td>
</tr>
<tr class="even">
<td>the <img src="https://latex.codecogs.com/png.latex?N">-tank RTD</td>
<td>pymrm Crank–Nicolson march</td>
<td>Eq. 3’s closed form</td>
<td><code>rtd_max_dev</code></td>
</tr>
</tbody>
</table>
<p>The third is the strongest: a quadrature over Eq. 3 has no way of knowing that the answer must be <img src="https://latex.codecogs.com/png.latex?(1+k%5Cbar%20t/N)%5E%7B-N%7D">, and it would not agree if Eq. 3, Eq. 11’s denominator, or the quadrature were wrong. The Simpson convolution <img src="https://latex.codecogs.com/png.latex?E_M%5Cstar%20E_N"> is <strong>not</strong> on this list: for equal tanks it is an identity that Simpson integrates exactly (see above), so it is not a second route to anything. <code>pymrm_eq9_max_dev</code> is not on it either — the cascade <em>is</em> Eq. 9, so that pair shares its algebra rather than avoiding it.</p>
<p><strong>Refinement axes.</strong> There is deliberately <strong>no grid axis</strong> for the cascade — the cell count is Levenspiel’s <img src="https://latex.codecogs.com/png.latex?N">, and refining it changes the model rather than the error. The axes that do carry numerical error are all measured: the time step (order 2 with Crank–Nicolson, 1 with implicit Euler), the Simpson panel count for Eq. 11, and — in the dispersion comparison only, where there really is a discretisation — the grid, at order 2 with van Leer TVD and about 1 without.</p>
<p><strong>Every printed branch is exercised somewhere it is live.</strong> Eq. 9 and Eq. 10 are evaluated at <img src="https://latex.codecogs.com/png.latex?N"> = 1, 2, 3, 4, 6, 10, 20 and 40, so Eq. 10’s radical nest runs at depths 0, 1, 2, 3, 5, 9, 19 and 39 — eight depths spanning that range, not every integer in it. Eq. 8’s series is summed at <img src="https://latex.codecogs.com/png.latex?N"> = 1 (its “for one tank use the first term” branch), 2, 3, 5, 10 and 30. Eq. 11 is evaluated on both of its branches: first order, where Levenspiel says it must equal Eq. 9, and second order, where it must not. Eq. 4 is exercised both where it is exact (equal tanks) and where its parenthesis matters (unequal blocks), and <strong>Eq. 5</strong> — the one-shot tracer relation <img src="https://latex.codecogs.com/png.latex?%5CDelta%5Csigma%5E2%20=%20(%5CDelta%5Cbar%20t)%5E2/N">, book p.&nbsp;324 — is the most exercised relation on the page: run backwards it <em>is</em> E14.4’s fit, and section 8 is a statement about what it leaves undetermined.</p>
<p>The printed relations <strong>not</strong> exercised anywhere are Fig. 14.8’s graphical construction for arbitrary kinetics (p.&nbsp;328), which is a drawing rather than a formula, and the closed-recirculation superpositions <strong>Eqs. 6a–c and 7a–c</strong> (p.&nbsp;325). Both are named in <em>The published model</em>, and neither is claimed as tested. (Eqs. 6–7 are recirculation results; Eq. 5 is not.)</p>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<div id="7340c373" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:58.710525Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:58.710310Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:58.715925Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:58.715295Z&quot;}}" data-execution_count="20">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1">display(Markdown(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"""</span></span>
<span id="cb24-2"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**To the physics, nothing.** Chapter 14 is right. Its three worked examples</span></span>
<span id="cb24-3"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">reproduce with zero deviation, its Fig. 14.3 annotations reproduce to below</span></span>
<span id="cb24-4"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-12</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(THETA_MAX_DEV, WIDTH_DEV)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), its Eq. 8, Eq. 9 and Eq. 10 are correctly</span></span>
<span id="cb24-5"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">transcribed and internally consistent, and its assertion that the model coincides</span></span>
<span id="cb24-6"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">with the dispersion model for small deviations from plug flow is confirmed and</span></span>
<span id="cb24-7"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">quantified. A 1999 textbook chapter is not the place to look for physics errors,</span></span>
<span id="cb24-8"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and none was found.</span></span>
<span id="cb24-9"></span>
<span id="cb24-10"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Four things are new here, and none of them is an improvement to the model:</span></span>
<span id="cb24-11"></span>
<span id="cb24-12"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**1. The identity with the upwind scheme, and the correction of the chapter's own</span></span>
<span id="cb24-13"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">conversion rule.** $N$ equal tanks in series *is* `construct_convflux_upwind` +</span></span>
<span id="cb24-14"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`construct_div` on $N$ cells, exactly (below $10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-12</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ against Eq. 9 over</span></span>
<span id="cb24-15"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(FO)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cases, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PYMRM_EQ9_DEV<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), and the equivalent Peclet number $2N$ follows from the scheme's</span></span>
<span id="cb24-16"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">numerical diffusion $u</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Delta z/2$. Chapter 14 does print a rule of its own, on</span></span>
<span id="cb24-17"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. 14.7 &amp;mdash; $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HALF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">mathbf</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">D</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/uL)$ &amp;mdash; and it is **inverted**;</span></span>
<span id="cb24-18"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the derivation here is the same rule the right way up, and the book's own Ch. 13</span></span>
<span id="cb24-19"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">settles it in two independent ways. Read as printed the rule is</span></span>
<span id="cb24-20"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_PRINTED_RELDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % wrong in conversion at $N = 64$,</span></span>
<span id="cb24-21"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = 2$, against </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FIG147_DERIVED_RELDEV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % de-inverted. With</span></span>
<span id="cb24-22"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the rule fixed, the page then measures where it stops holding &amp;mdash;</span></span>
<span id="cb24-23"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_WINDOW_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at worst for $N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">ge 16,</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">le 2$, but</span></span>
<span id="cb24-24"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_MAX_DIFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % at $N = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(DISP_ROW_WORST.N)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$,</span></span>
<span id="cb24-25"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DISP_ROW_WORST<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ktbar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$.</span></span>
<span id="cb24-26"></span>
<span id="cb24-27"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**2. The measurement of what a two-moment fit is worth.** The five-stage chain</span></span>
<span id="cb24-28"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">9, 9, 9, 9, 24 s matches E14.4's $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t$ and $</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sigma^2$ exactly</span></span>
<span id="cb24-29"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(AMBIG_MEAN_DEV, AMBIG_VAR_DEV)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) and differs in **outlet concentration**</span></span>
<span id="cb24-30"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">by **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FIRST_MAX <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $k</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">bar t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_KT_HEADLINE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$ (in</span></span>
<span id="cb24-31"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">*conversion*, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_CONV_HL <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % &amp;mdash; the two are not the same statement</span></span>
<span id="cb24-32"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and the page prints both). That chain is a lower bound: over every chain matching</span></span>
<span id="cb24-33"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">the same two moments the closed-form supremum is</span></span>
<span id="cb24-34"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>AMBIG_FAMILY_SUP_GAP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %**, i.e. E14.4's two numbers pin the outlet</span></span>
<span id="cb24-35"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">concentration only to within a factor of</span></span>
<span id="cb24-36"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> AMBIG_FAMILY_SUP_GAP)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> there. Neither number is in the chapter,</span></span>
<span id="cb24-37"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">and together they are the practical answer to "how much can I trust an $N$ fitted</span></span>
<span id="cb24-38"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">this way".</span></span>
<span id="cb24-39"></span>
<span id="cb24-40"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**3. Five printed defects**, each proved from the book's own arithmetic: the</span></span>
<span id="cb24-41"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**inverted dispersion rule** on Fig. 14.7 (the consequential one), the factor of</span></span>
<span id="cb24-42"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DEFECT_FACTOR<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> in $V_</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">N</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\\</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">text</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">tanks</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/V_p$, the transposed digit on</span></span>
<span id="cb24-43"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Fig. E14.4b's axis (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>TICK_P<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against a printed-curve maximum of</span></span>
<span id="cb24-44"><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>E144_EMAX_PRINTED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), "272 moles", and a variance printed in seconds. Plus one</span></span>
<span id="cb24-45"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">typesetting ambiguity in Eq. 11's denominator, settled by the book's own E14.4.</span></span>
<span id="cb24-46"></span>
<span id="cb24-47"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">**4. A caution about outflow boundaries.** The usual PDE</span></span>
<span id="cb24-48"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">outflow, zero-gradient, reconstructs the exit face to second order: right for a</span></span>
<span id="cb24-49"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">discretised PDE, wrong for a model whose cell count is a physical parameter, and</span></span>
<span id="cb24-50"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">wrong by **</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_N4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %** at $N=4$ while decaying like</span></span>
<span id="cb24-51"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$N^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_ORDER<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, which is close enough to what ordinary discretisation</span></span>
<span id="cb24-52"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">error looks like to be dismissed as one. pymrm provides `</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outflow"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb24-53"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(pitfall P6), which `Cascade` uses. The page also builds the same boundary by hand</span></span>
<span id="cb24-54"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">(suppress the boundary flux, add the outflow as a `construct_coefficient_matrix`</span></span>
<span id="cb24-55"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">sink on the last cell) and shows that the two are the same operator, entry for</span></span>
<span id="cb24-56"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">entry (below $10^</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">{{</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-14</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">}}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$, here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>OUTFLOW_VS_SINK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">).</span></span>
<span id="cb24-57"><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"""</span>))</span></code></pre></div></div>
<div class="cell-output cell-output-display cell-output-markdown">
<p><strong>To the physics, nothing.</strong> Chapter 14 is right. Its three worked examples reproduce with zero deviation, its Fig. 14.3 annotations reproduce to below <img src="https://latex.codecogs.com/png.latex?10%5E%7B-12%7D"> (here 3e-15), its Eq. 8, Eq. 9 and Eq. 10 are correctly transcribed and internally consistent, and its assertion that the model coincides with the dispersion model for small deviations from plug flow is confirmed and quantified. A 1999 textbook chapter is not the place to look for physics errors, and none was found.</p>
<p>Four things are new here, and none of them is an improvement to the model:</p>
<p><strong>1. The identity with the upwind scheme, and the correction of the chapter’s own conversion rule.</strong> <img src="https://latex.codecogs.com/png.latex?N"> equal tanks in series <em>is</em> <code>construct_convflux_upwind</code> + <code>construct_div</code> on <img src="https://latex.codecogs.com/png.latex?N"> cells, exactly (below <img src="https://latex.codecogs.com/png.latex?10%5E%7B-12%7D"> against Eq. 9 over 48 cases, here 2e-15), and the equivalent Peclet number <img src="https://latex.codecogs.com/png.latex?2N"> follows from the scheme’s numerical diffusion <img src="https://latex.codecogs.com/png.latex?u%5CDelta%20z/2">. Chapter 14 does print a rule of its own, on Fig. 14.7 — <img src="https://latex.codecogs.com/png.latex?N%20=%200.5(%5Cmathbf%7BD%7D/uL)"> — and it is <strong>inverted</strong>; the derivation here is the same rule the right way up, and the book’s own Ch. 13 settles it in two independent ways. Read as printed the rule is 138 % wrong in conversion at <img src="https://latex.codecogs.com/png.latex?N%20=%2064">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%202">, against 0.053 % de-inverted. With the rule fixed, the page then measures where it stops holding — 0.71 % at worst for <img src="https://latex.codecogs.com/png.latex?N%5Cge%2016,%5C%20k%5Cbar%20t%5Cle%202">, but 44 % at <img src="https://latex.codecogs.com/png.latex?N%20=%202">, <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%205">.</p>
<p><strong>2. The measurement of what a two-moment fit is worth.</strong> The five-stage chain 9, 9, 9, 9, 24 s matches E14.4’s <img src="https://latex.codecogs.com/png.latex?%5Cbar%20t"> and <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2"> exactly (here 0e+00) and differs in <strong>outlet concentration</strong> by <strong>23.2 %</strong> at <img src="https://latex.codecogs.com/png.latex?k%5Cbar%20t%20=%2010"> (in <em>conversion</em>, 0.16 % — the two are not the same statement and the page prints both). That chain is a lower bound: over every chain matching the same two moments the closed-form supremum is <strong>83.1 %</strong>, i.e.&nbsp;E14.4’s two numbers pin the outlet concentration only to within a factor of 5.93 there. Neither number is in the chapter, and together they are the practical answer to “how much can I trust an <img src="https://latex.codecogs.com/png.latex?N"> fitted this way”.</p>
<p><strong>3. Five printed defects</strong>, each proved from the book’s own arithmetic: the <strong>inverted dispersion rule</strong> on Fig. 14.7 (the consequential one), the factor of 2 in <img src="https://latex.codecogs.com/png.latex?V_%7BN%5Ctext%7Btanks%7D%7D/V_p">, the transposed digit on Fig. E14.4b’s axis (0.105 against a printed-curve maximum of 0.01491), “272 moles”, and a variance printed in seconds. Plus one typesetting ambiguity in Eq. 11’s denominator, settled by the book’s own E14.4.</p>
<p><strong>4. A caution about outflow boundaries.</strong> The usual PDE outflow, zero-gradient, reconstructs the exit face to second order: right for a discretised PDE, wrong for a model whose cell count is a physical parameter, and wrong by <strong>3.8 %</strong> at <img src="https://latex.codecogs.com/png.latex?N=4"> while decaying like <img src="https://latex.codecogs.com/png.latex?N%5E%7B-0.87%7D">, which is close enough to what ordinary discretisation error looks like to be dismissed as one. pymrm provides <code>{"outflow": True}</code> (pitfall P6), which <code>Cascade</code> uses. The page also builds the same boundary by hand (suppress the boundary flux, add the outflow as a <code>construct_coefficient_matrix</code> sink on the last cell) and shows that the two are the same operator, entry for entry (below <img src="https://latex.codecogs.com/png.latex?10%5E%7B-14%7D">, here 0.0e+00).</p>
</div>
</div>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>When to reach for this page.</strong> Any staged process where a chain of well-mixed compartments is the model rather than a discretisation: multistage extractors and absorbers, a bank of crystallisers, an anaerobic digester train, compartment models in pharmacokinetics, or the “<img src="https://latex.codecogs.com/png.latex?N"> tanks” that a measured tracer curve is routinely collapsed to. <code>Cascade</code> in this page’s <code>model.py</code> takes any <code>faces</code>, so unequal stages cost nothing extra, and <code>order_n</code> takes any pointwise rate; <code>dispersion_exit</code> is the closed dispersion vessel with TVD convection.</p>
<p><strong>What to carry over.</strong></p>
<ul>
<li><strong>Do not use a zero-gradient outflow condition when the cells are tanks.</strong> It reconstructs the exit face to second order and quietly changes the last stage’s balance; the table in <em>Validation</em> gives the penalty against <img src="https://latex.codecogs.com/png.latex?N">. This is the mirror image of <a href="../A2.6-gunn-dispersion-correlations/"><code>A2.6</code></a>’s outlet trap — there the <em>cell-centre</em> read was wrong and the face read right; here the face reconstruction is wrong and the cell value right — and the rule that covers both is: ask what the model says the exit stream is, then read that. In pymrm, a stirred exit is <code>{"outflow": True}</code> (pitfall P6).</li>
<li><strong>Steady TVD: <code>ConvFluxTVD</code> and Newton, not deferred correction.</strong> The limited fluxes come with their exact Jacobian, and <code>newton(..., damping="monotone")</code> converges in a few steps (pitfall P10). Deferred correction happened to converge on this smooth one-dimensional profile; it is a fixed-point iteration and can stall elsewhere.</li>
<li><strong><code>NumJac((N, 1))</code>, never <code>NumJac((N,))</code>.</strong> With a bare 1-D shape the default stencil declares every tank coupled to every other and builds a dense Jacobian. It is in <code>AGENTS.md</code> and it is live in this page’s <code>order_n</code>.</li>
<li><strong>Root-find extrema and thresholds.</strong> The margin printed in <em>Validation</em> is the reason: a 1001-point sweep of E14.4’s own curve gets close enough to the true maximum to pass for converged while still being a grid value. Fig. 14.3’s inflection points and the 2 % Stirling threshold are root-found for the same reason.</li>
<li><strong>If you fit <img src="https://latex.codecogs.com/png.latex?N"> from two moments, say what it is worth.</strong> Report the conversion the fit implies <em>and</em> the spread over chains that match the same two moments. Section 8 shows the cheap version — one alternative chain — and section 8b the complete one: the extremal chain has at most <strong>two</strong> distinct tank sizes (a two-line Lagrange argument), so the envelope is an enumeration rather than a search, and its supremum is the closed form <img src="https://latex.codecogs.com/png.latex?%5Cln(1+k%5Csqrt%7BS%7D)%20+%20k(T-%5Csqrt%7BS%7D)"> with <img src="https://latex.codecogs.com/png.latex?T%20=%20%5Csum%20t_i">, <img src="https://latex.codecogs.com/png.latex?S%20=%20%5Csum%20t_i%5E2">. That bound transfers to any staged model fitted on a mean and a variance.</li>
<li><strong>Say whether a gap is in concentration or in conversion.</strong> They differ by more than an order of magnitude here, in opposite directions along the sweep, and quoting the larger one under the other one’s name is the easiest overstatement on this page to make.</li>
</ul>
<p><strong>What this page cannot conclude.</strong></p>
<ul>
<li><strong>Nothing here is validated against experiment.</strong> Chapter 14 contains no measurement of any kind. Every comparison is against the book’s own arithmetic or against an analytical limit; the page is tier 6, and calling it validation would be wrong.</li>
<li><strong>Independence is assumed, not tested.</strong> Levenspiel’s own footnote says laminar flow often fails it. Nothing on this page can detect a vessel whose fluid carries memory from stage to stage, and the additivity check would pass anyway.</li>
<li><strong>The equal-tank assumption is untestable from an RTD’s first two moments</strong> — that is the headline, and it cuts both ways: this page cannot say that Levenspiel’s vessel <em>is</em> four equal tanks either, only that four equal tanks and the five-stage chain are indistinguishable by his method.</li>
<li><strong>Fig. 14.3’s <img src="https://latex.codecogs.com/png.latex?E_%7B%5Ctheta,%5Ctext%7Binf%7D%7D"> annotation is not settled.</strong> The two inflection points have different heights and the figure draws one level; both are reported and neither is scored.</li>
<li><strong>The dispersion comparison depends on a matching rule.</strong> <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BPe%7D%20=%202N"> is what the scheme’s numerical diffusion gives and also what Levenspiel’s own small-deviation <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2_%5Ctheta%20=%202(%5Cmathbf%7BD%7D/uL)"> gives, exactly. Matching on the <em>closed-vessel</em> variance, or on the conversion, gives Péclet numbers a little below <img src="https://latex.codecogs.com/png.latex?2N"> — an <img src="https://latex.codecogs.com/png.latex?O(1)"> offset, printed as <code>disp_Pe_var_offset_N64</code> and as the root-found <code>Pe_eff</code> column, so the three rules agree to <img src="https://latex.codecogs.com/png.latex?O(1/N)"> relatively and not exactly. Nothing here establishes that either model describes a real vessel.</li>
<li><strong>Four of the five printed defects are typographic; the fifth is not.</strong> Fig. 14.7’s inverted rule is a modelling statement, and a reader who applies it gets a different reactor. All five are argued from the book’s own numbers, and the page adjusts nothing: it re-derives every affected result from the correct form and reports the printed one beside it.</li>
</ul>
<div id="7b04785c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-10-30T12:06:58.717809Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-10-30T12:06:58.717684Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-10-30T12:06:58.726172Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-10-30T12:06:58.725409Z&quot;}}" data-execution_count="21">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb25-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Prose numbers written in the Markdown cells, checked against their claims</span></span>
<span id="cb25-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (one unit in the last written place). The numbers in the generated text above</span></span>
<span id="cb25-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># come from the claims themselves.</span></span>
<span id="cb25-4">claims.says(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"23.2 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ambiguity_first_order_max_gap"</span>)   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># title cell and description</span></span>
<span id="cb25-5"></span>
<span id="cb25-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb25-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises when a claim fails its own check or has no break row that fails it.</span></span>
<span id="cb25-8">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for A2.4:
  e14_1_sigma2_sq_dev               = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  e14_1_sigma2_dev                  = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  e14_1_wrong_power_gap             = 0.25             value  rtol 0.05
  e14_2_L_dev                       = (here 0.0e+00)   bound  bound &lt;= 1e-09 [tolerance]
  e14_2_two_routes                  = (here 0.0e+00)   bound  bound &lt;= 1e-09 [tolerance]
  e14_2_wrong_power_gap             = 0.75             value  rtol 0.05
  e14_4_delta_tbar_dev              = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  e14_4_delta_var_dev               = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  e14_4_N_dev                       = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  e14_4_prefactor_reldev            = 5.75e-06         value  rtol 0.05
  e14_4_prefactor_two_routes        = (here 8.9e-14)   bound  bound &lt;= 1e-10 [tolerance]
  e14_4_exponent_dev                = 3.3333e-05       value  rtol 0.05
  e14_4_Emax                        = 0.014936         value  rtol 0.05
  e14_4_Emax_printed                = 0.014914         value  rtol 0.0001
  fig143_theta_max_max_dev          = (here 2.2e-16)   bound  bound &lt;= 1e-12 [tolerance]
  fig143_width_max_dev              = (here 2.7e-15)   bound  bound &lt;= 1e-12 [tolerance]
  fig143_Emax_max_reldev            = (here 0.0e+00)   bound  bound &lt;= 1e-12 [tolerance]
  fig143_area_max_dev               = (here 2.6e-14)   bound  bound &lt;= 1e-10 [tolerance]
  fig143_mean_max_dev               = (here 2.6e-14)   bound  bound &lt;= 1e-10 [tolerance]
  fig143_stirling_threshold_N       = 5.2004           value  rtol 0.05
  fig143_stirling_err_N5            = 0.021008         value  rtol 0.05
  fig143_stirling_err_N6            = 0.016784         value  rtol 0.05
  fig143_Einf_lo_N4                 = 0.42674          value  rtol 0.05
  fig143_Einf_hi_N4                 = 0.69433          value  rtol 0.05
  fig143_Emax_at_N4                 = 0.89617          value  rtol 0.05
  eq3_variance_identity             = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  eq3_var_quadrature_dev            = (here 5.3e-16)   bound  bound &lt;= 1e-10 [tolerance]
  eq8_F_vs_integral_max_dev         = 1.6043e-08       value  rtol 0.05
  eq8_F_endpoint_dev                = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  eq8_one_tank_branch_dev           = (here 0.0e+00)   bound  bound &lt;= 1e-14 [identity]
  eq4_equal_convolution_dev         = (here 6.9e-18)   bound  bound &lt;= 1e-14 [identity]
  eq4_mean_add_reldev               = 6.7248e-08       value  rtol 0.05
  eq4_var_add_reldev                = 2.9386e-07       value  rtol 0.05
  eq4_unequal_shape_gap             = 0.018483         value  rtol 0.05
  outflow_bc_vs_sink_construction   = (here 0.0e+00)   bound  bound &lt;= 1e-14 [identity]
  pymrm_eq9_max_dev                 = (here 2.4e-15)   bound  bound &lt;= 1e-12 [identity]
  pymrm_eq10_max_dev                = (here 3.2e-14)   bound  bound &lt;= 1e-11 [tolerance]
  rtd_max_dev                       = 3.6545e-08       value  rtol 0.05
  rtd_area_dev                      = 3.2036e-06       value  rtol 0.05
  rtd_area_residual                 = (here 8.7e-11)   bound  bound &lt;= 1e-08 [chosen]
  rtd_order_cn                      = (here 2.0e+00)   bound  bound [1.9, 2.1] [theory]
  rtd_order_ie                      = (here 9.9e-01)   bound  bound [0.9, 1.1] [theory]
  rtd_convolution_dev               = (here 6.9e-18)   bound  bound &lt;= 1e-14 [identity]
  eq11_vs_eq9_max_dev               = (here 1.5e-10)   bound  bound &lt;= 1e-08 [chosen]
  eq11_normalisation_dev            = (here 2.3e-11)   bound  bound &lt;= 1e-09 [chosen]
  eq11_quad_order                   = (here 4.0e+00)   bound  bound [3.8, 4.2] [theory]
  macro_micro_max_gap               = 0.25427          value  rtol 0.05
  asymptote_order_in_N              = (here 9.9e-01)   bound  bound [0.9, 1.1] [theory]
  asymptote_reldev_N320             = 0.0013001        value  rtol 0.05
  defect_volume_ratio_factor        = 2                value  rtol 0.001
  defect_volume_ratio_right_form    = 1                value  rtol 0.001
  defect_eq11_subscript_norm        = 2.16e+05         value  rtol 0.05
  defect_e144_tick_ratio            = 7.0404           value  rtol 0.0001
  defect_fig147_printed_rule_reldev = 1.3846           value  rtol 0.05
  defect_fig147_derived_rule_reldev = 0.00053382       value  rtol 0.05
  defect_fig147_threshold_dev       = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  defect_fig147_from_ch13           = (here 0.0e+00)   bound  bound &lt;= 1e-12 [chosen]
  ambiguity_mean_dev                = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  ambiguity_var_dev                 = (here 0.0e+00)   bound  bound &lt;= 1e-12 [identity]
  ambiguity_first_order_max_gap     = 0.23168          value  rtol 0.05
  ambiguity_conc_gap_kt50           = 0.697            value  rtol 0.05
  ambiguity_conversion_max_gap      = 0.0037577        value  rtol 0.05
  ambiguity_second_order_max_gap    = 0.060852         value  rtol 0.05
  ambiguity_rtd_peak_gap            = 0.068575         value  rtol 0.05
  ambiguity_pymrm_vs_product_dev    = (here 8.3e-17)   bound  bound &lt;= 1e-14 [identity]
  ambiguity_family_sup_gap          = 0.83148          value  rtol 0.05
  ambiguity_family_sup_gap_kt2      = 0.068805         value  rtol 0.05
  ambiguity_family_enum_gap         = 0.82706          value  rtol 0.05
  disp_grid_order                   = (here 2.1e+00)   bound  bound [1.8, 2.3] [theory]
  disp_grid_order_upwind            = (here 1.3e+00)   bound  bound [0.9, 1.5] [chosen]
  disp_tvd_newton_vs_deferred       = (here 1.4e-11)   bound  bound &lt;= 1e-09 [tolerance]
  disp_reldiff_N16_kt2              = 0.0071007        value  rtol 0.05
  disp_reldiff_max                  = 0.44441          value  rtol 0.05
  disp_reldiff_order_in_N           = 1.7857           value  rtol 0.05
  disp_Pe_ratio_N64                 = 0.98952          value  rtol 0.05
  disp_Pe_ratio_N4_kt5              = 0.62131          value  rtol 0.05
  disp_reldiff_window_max           = 0.0071007        value  rtol 0.05
  disp_Pe_var_offset_N64            = 1.0079           value  rtol 0.05
  outflow_bc_relerr_N4              = 0.038462         value  rtol 0.05
  outflow_bc_relerr_N2              = 0.058824         value  rtol 0.05
  outflow_bc_decay_order_in_N       = 0.86656          value  rtol 0.05
  sweep_vs_rootfind_relerr          = 1.0648e-05       value  rtol 0.05</code></pre>
</div>
</div>


</section>
</section>

 ]]></description>
  <category>sec:A</category>
  <category>struct:S1</category>
  <category>struct:S3</category>
  <category>struct:S5</category>
  <category>tier:T0</category>
  <category>data:tier6</category>
  <category>phase:liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A2.4-tanks-in-series/</guid>
  <pubDate>Fri, 07 Aug 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Ranz-Marshall: the only constant this paper tests is the 2.0, and the authors’ own water data miss it</title>
  <link>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.5-ranz-marshall-froessling/</link>
  <description><![CDATA[ 




<section id="ranz-marshall-the-only-constant-this-paper-tests-is-the-2.0" class="level1">
<h1>Ranz-Marshall: the only constant this paper tests is the 2.0</h1>
<p><strong>Catalog ID:</strong> <code>A3.5</code> · <strong>Structures:</strong> <code>S3</code> (pointwise algebra, plus a 1-D spherical BVP) · <strong>Tier:</strong> T0</p>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D%20=%202.0%20+%200.60%5C,N_%7BPr%7D%5E%7B1/3%7DN_%7BRe%7D%5E%7B1/2%7D,%0A%5Cqquad%20N_%7BNu%7D'%20=%202.0%20+%200.60%5C,N_%7BSc%7D%5E%7B1/3%7DN_%7BRe%7D%5E%7B1/2%7D"></p>
<p>Two of the most-used equations in chemical engineering, and they contain four numbers with four different epistemic statuses:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 50%">
<col style="width: 50%">
</colgroup>
<thead>
<tr class="header">
<th>constant</th>
<th>status in the papers</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>2.0</code></td>
<td><strong>theoretical.</strong> Part I derives it (eq. 7) from the conduction/diffusion field around a sphere at rest. Nothing was fitted.</td>
</tr>
<tr class="even">
<td><code>0.60</code></td>
<td><strong>fitted</strong>, to Figures 6, 7 and 9, that is, to Tables 1, 2, 3 and 4, the same tables anyone would compare against.</td>
</tr>
<tr class="odd">
<td><code>1/2</code></td>
<td><strong>assumed.</strong> Froessling’s boundary-layer form, carried over.</td>
</tr>
<tr class="even">
<td><code>1/3</code></td>
<td><strong>assumed.</strong> Same, and not identifiable from Tables 1–4, every run of which is in air. Part II tests it graphically in Figure 12, which this page does not digitise.</td>
</tr>
</tbody>
</table>
<p>So a page that reports “the correlation reproduces the paper’s data to a few per cent” has reported a goodness of fit and nothing else. This page keeps the four apart and asks what the data can actually decide.</p>
<p><strong>What comes out.</strong> The intercept is the only testable constant, and the paper’s data test it three separate ways: an outcome the paper reports in words rather than in numbers. Extrapolated to <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D=0"> by a free two-parameter fit, with the standard error of the intercept from the fit’s own scatter, Table 1’s heat-transfer runs give <strong>2.0582 ± 0.0538</strong> (+2.9 %, 1.1 standard errors above 2.0) and Table 4’s benzene mass-transfer runs <strong>2.0523 ± 0.1245</strong> (+2.6 %, 0.4 standard errors): both consistent with the theoretical 2.0. Table 1’s water mass-transfer runs give <strong>1.7322 ± 0.0870</strong>, -13.4 %, <strong>3.1 standard errors below it</strong>, beyond the two-sided 5 % point of Student’s t. The still-air row says the same thing more bluntly: it prints <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D=2.23"> and <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'=1.79"> for a situation in which eqs. (21) and (22) both say 2.0, a ratio of <strong>1.2458</strong> where the correlation demands exactly 1.</p>
<p><strong>The authors saw this, and said so, qualitatively.</strong> Part II, folio 173, first column:</p>
<blockquote class="blockquote">
<p>“The points for heat transfer extrapolate close to the theoretical minimum value. Experimental values obtained for <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> at <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D%20=%200"> were slightly greater than 2.0, and the small difference is attributed to free convection. … <strong>Data for mass transfer show a steeper slope and a lower intercept</strong>, but the disagreement is always less than 10 per cent at a given <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> and is usually much less than 5 per cent. Factors which may have contributed to errors in the data and anomalies in the heat- and mass-transfer analogy were: <strong>(1) inaccurate values of diffusivity</strong>; (2) <img src="https://latex.codecogs.com/png.latex?p_%7BAi%7D"> may not have been the saturation vapor pressure; (3) the partial pressure of water vapor in the air may not have been zero at low air rates …”</p>
</blockquote>
<p>So the direction, and the cause this page finds most consistent with the numbers, are the authors’ own. <strong>What is added here is the arithmetic they did not do</strong>, and it changes what the sentence means:</p>
<ul>
<li>the deficit is <strong>-13.4 %</strong> on the intercept, not “less than 10 per cent”: their bound is about the <em>curves</em> at a given <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D">, where the fitted 0.60 absorbs most of it, not about the extrapolated intercept;</li>
<li>3.1 standard errors of the fitted intercept, so it is not “small”;</li>
<li>it is species-specific: benzene, whose diffusivity came from Hirschfelder, Bird and Spotz rather than from the authors’ own Figure 5, lands where the <em>heat</em> data land; only water misses;</li>
<li><img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'%5Cpropto%201/D_v">, so closing the water gap needs a diffusivity smaller by 1.117, which is exactly the 0.204 sq.cm/sec Part II prints, and calls “a low value compared with other methods of determination”.</li>
</ul>
<p>And that puts the numbers against two claims the papers do make. Part I’s abstract says the study “confirmed the analogy between heat and mass transfer at low Reynolds numbers, and <strong>verified the simple expression for the Nusselt number at zero Reynolds number</strong>”, while the paper’s own still-air pair has an analogy ratio of 1.2458. Folio 174 says the correlation’s success carries “an implication that the calculated value of the diffusivity of water vapor in air may be <strong>more accurate than any reported in the literature</strong>”, while the same data, read at the intercept, say that diffusivity is 1.117 too large. The gap is not an oversight of the authors’. The published <em>conclusions</em> drawn from it are what these numbers sit against.</p>
<p><strong>And pymrm.</strong> The 2.0 is a boundary-value problem, so it is computed here rather than quoted: a spherical shell with <code>construct_div(nu=2)</code>, one linear solve per grid on a ladder of nested grids, second order, whose Richardson limit lies below 1e-6 from the exact 2. The same solver, with <code>construct_convflux_upwind</code> added, answers the question Ranz raised in 1993 about the radial-convection factor, and shows which of the two readings of the paper’s own definition of <img src="https://latex.codecogs.com/png.latex?p_f"> is the right one.</p>
<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p>Ranz and Marshall published “Evaporation from Drops” in two parts in <em>Chemical Engineering Progress</em> 48 in 1952, out of W. R. Marshall’s spray-drying programme at Wisconsin. One drop, about a millimetre across, hangs from a microburet in an upward air stream; liquid is fed in fast enough to hold the diameter constant, and the feed rate is the evaporation rate. A 0.5-mil thermocouple inside the drop gives its temperature. That is the whole experiment, and it is why the paper is still read: it is a <em>single-particle</em> measurement in a field that otherwise had to infer transfer coefficients from beds and sprays.</p>
<p><strong>The page-range discrepancy, recorded both ways.</strong> Part I’s scan frames carry two folio lines, one above the black edge of the leaf, one inside it at the foot, differing by exactly two. Four of the six frames show both legibly (139/141, 140/142, 141/143 and 144/146); on the fourth frame the upper line is cut off at the leaf edge and on the fifth there is no upper line at all, so those two pairs are inferred from the sequence rather than read. Part II settles which belongs to the page: its first page has a <em>blank</em> top margin and prints <code>Vol. 48, No. 4 | Chemical Engineering Progress | Page 173</code> at the <strong>foot</strong> of the text block. In this issue the folio is a footer. The line at the top of a Part I frame is therefore the preceding leaf’s footer, caught in the same frame, and <strong>Part I’s own folios are 141–146</strong>, which is the universal citation and the one Ranz himself gives in his 1993 ISI <em>Citation Classic</em> (“Chem. Eng. Progr. 48:141-6; 173-80, 1952”). The 139–144 reading on file comes from reading the upper line as a running head. <strong>Every page reference on this page is the folio printed at the foot of the page the value appears on.</strong> Part II is 173–180 either way.</p>
<p><strong>Neither file has a text layer at all</strong> (<code>pdftotext</code> returns one byte per page), so every digit here was read off 400 dpi renders (the files’ native resolution: <code>pdfimages -list</code> reports JPEG RGB tiles at 400 × 400 ppi, so rendering larger only interpolates), with each numeric column cropped and magnified on its own.</p>
<p><strong>Two files on disk are not this paper</strong> and are named here so nobody re-opens them hoping: <code>MISC-Ranz1993-citation-classic-commentary-CurrContents22.pdf</code> is a one-page 1993 reminiscence carrying none of the correlations, and <code>Charlesworth1960-evaporation-drops-dissolved-solids-AIChEJ6-9.pdf</code> is a companion study about crust formation in drops containing dissolved solids. The 1993 file is quoted once on this page, for a caveat only its author could give.</p>
</section>
<section id="the-published-model" class="level2">
<h2 class="anchored" data-anchor-id="the-published-model">The published model</h2>
<p><strong>Part I, eq. (7): the theory.</strong> With the fluid at rest (<img src="https://latex.codecogs.com/png.latex?v_%5Ctheta%20=%20v_r%20=%200">), eqs. (1), (2), (5) and (6) collapse to</p>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D%20=%20N_%7BNu%7D'%20=%202.0.%20%5Ctag%7B7%7D"></p>
<p>That is steady conduction (or diffusion) from a sphere into an unbounded stagnant medium, and it is the only piece of the correlation that is derived.</p>
<p><strong>Part I, eqs. (8) and (9): the form, from Froessling.</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'%20=%202.0%20+%20K_1%20(N_%7BSc%7D)%5Em%20(N_%7BRe%7D)%5En,%20%5Cqquad%0A%20%20N_%7BNu%7D%20%20=%202.0%20+%20K_2%20(N_%7BPr%7D)%5Ep%20(N_%7BRe%7D)%5Eq"></p>
<p>with, in the paper’s own words, “<img src="https://latex.codecogs.com/png.latex?K_1%20=%20K_2">, <img src="https://latex.codecogs.com/png.latex?p%20=%20m%20=%201/3">, and <img src="https://latex.codecogs.com/png.latex?q%20=%20n%20=%201/2">.” Ranz went to Pittsburgh to read the only copy of Froessling’s 1938 paper in the United States and translated it himself (he tells that story in the 1993 commentary, not in the papers); the exponents are Froessling’s, adopted here, not measured here.</p>
<p><strong>Part II, eqs. (21) and (22): the constant.</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D%20=%202.0%20+%200.60%5C,N_%7BPr%7D%5E%7B1/3%7DN_%7BRe%7D%5E%7B1/2%7D,%20%5Cqquad%0A%20%20N_%7BNu%7D'%20=%202.0%20+%200.60%5C,N_%7BSc%7D%5E%7B1/3%7DN_%7BRe%7D%5E%7B1/2%7D"></p>
<p><strong>Part II, eq. (24), and a constant the papers do not flag as such.</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?h%20=%20h_c%20=%20%5Cfrac%7Bk%7D%7BD_p%7D%5Cleft(2.0%20+%200.54%5C,N_%7BRe%7D%5E%7B1/2%7D%5Cright),%0A%5Cqquad%5Ctext%7B%22restricted%20to%20aqueous%20drops%22.%7D"></p>
<p><code>0.54</code> is <code>0.60</code> times <img src="https://latex.codecogs.com/png.latex?Pr%5E%7B1/3%7D"> for air, so the three printed numbers together pin the Prandtl number the authors used: <img src="https://latex.codecogs.com/png.latex?(0.54/0.60)%5E3"> = <strong>0.729</strong>. That is a <strong>definition, not a check</strong>: nothing independent is compared with it, and nothing can be, because this page’s own rule forbids importing a property value. It is worth having anyway: it means the whole heat-transfer analysis can be done without importing one.</p>
<p><strong>How the Nusselt numbers were measured</strong> (Part I, eqs. 16, 19, 20). At finite velocity from the feed rate; in still air from the slope of <img src="https://latex.codecogs.com/png.latex?D_p%5E2"> against time,</p>
<p><img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D%20=%20-%5Ctfrac14%5Cfrac%7B%5Clambda_v%5Crho_l%7D%7B%5CDelta%20t%5C,k%7D%5Cfrac%7B%5Cmathrm%7Bd%7DD_p%5E2%7D%7B%5Cmathrm%7Bd%7D%5Ctau%7D,%0A%5Cqquad%0AN_%7BNu%7D'%20=%20-%5Ctfrac14%5Cfrac%7B%5Crho_l%20M_m%20p_f%7D%7B%5CDelta%20p_A%20D_v%20%5Crho_%7Bgm%7D%7D%5Cfrac%7B%5Cmathrm%7Bd%7DD_p%5E2%7D%7B%5Cmathrm%7Bd%7D%5Ctau%7D."></p>
<p>The <img src="https://latex.codecogs.com/png.latex?p_f"> in that second expression is the object Ranz singled out forty-one years later, and Part II’s notation defines it only as the “average value of <img src="https://latex.codecogs.com/png.latex?(%5Cpi%20-%20p_A)"> across transfer path”, without saying <em>which</em> average. The validation section settles it.</p>
</section>
<section id="parameters-and-assumptions" class="level2">
<h2 class="anchored" data-anchor-id="parameters-and-assumptions">Parameters and assumptions</h2>
<p><strong>Theirs.</strong> Quasi-steady transfer around an isolated sphere; the drop surface at a single temperature <img src="https://latex.codecogs.com/png.latex?t_i"> and saturated at <img src="https://latex.codecogs.com/png.latex?p_%7BAi%7D%20=%20p_%7BAi%7D(t_i)">; the transfer path of uniform temperature and velocity; the drop spherical (Part II notes the diameter along the capillary axis was about 8 % greater than across it, and <img src="https://latex.codecogs.com/png.latex?D_p"> is the arithmetic mean of the two); radiation, sensible heat of the feed and conduction along the capillary removed as corrections (Part I eq. 18); no thermal diffusion or Dufour effect (“negligible in this study”).</p>
<p><strong>Ours.</strong> Nothing added. Every transfer number used here is the paper’s own <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D">, <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> and <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> column; no property of air, water or benzene is imported from outside the two papers, and the one Prandtl number that appears is back-calculated from the paper’s own eq. (24). The pymrm sections use a unit diffusivity and a unit sphere, because both answers are dimensionless.</p>
<p><strong>What is out of scope, and why.</strong> Figures 5 (transport properties), 12 (the five-decade master correlation), 13 (free convection) and 14 (vapour pressure over NH₄NO₃ solutions) carry content that exists only as curves. No maintainer figure review is available for this case, so <strong>no point is read off any of them</strong> and no number on this page comes from one. Figure 12 is <em>named</em> twice below, once for what its printed legend lists and once for the sentence on folio 174 that comments on it; that is reading type, not reading a curve, and nothing numerical follows from it. Three consequences are stated rather than worked around: the free-convection exponent <img src="https://latex.codecogs.com/png.latex?1/4"> of eqs. (10) and (11) is <strong>never exercised on this page</strong>, because the only zero-Reynolds datum in any table is the single still-air row; Table 6’s calculated evaporation rates cannot be reproduced, because they need the vapour-pressure curve of Figure 14; and the paper’s own test of the Prandtl exponent, which lives entirely in Figure 12, is neither reproduced nor contradicted here. Table 5 (drop temperature against Reynolds number) is not used either: it carries no transfer coefficient.</p>
</section>
<section id="the-data" class="level2">
<h2 class="anchored" data-anchor-id="the-data">The data</h2>
<p>Five files, all transcribed from the papers’ own tables: <strong>tier 3, table transcription, no digitisation anywhere.</strong></p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>file</th>
<th>what it is</th>
<th>rows</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>…-table1.csv</code></td>
<td>Part II Table 1, water drops in dry air, folio 174</td>
<td>18 forced + 1 still-air</td>
</tr>
<tr class="even">
<td><code>…-table2.csv</code></td>
<td>Part II Table 2, water drops in 66–90 °C air, folio 175</td>
<td>9</td>
</tr>
<tr class="odd">
<td><code>…-table3.csv</code></td>
<td>Part II Table 3, water drops in 85–221 °C air, from the motion-picture record, folio 175</td>
<td>9</td>
</tr>
<tr class="even">
<td><code>…-table4.csv</code></td>
<td>Part II Table 4, <strong>benzene</strong> drops, folio 176</td>
<td>13</td>
</tr>
<tr class="odd">
<td><code>…-printed-constants.csv</code></td>
<td>every constant either part prints, with its role</td>
<td>24</td>
</tr>
</tbody>
</table>
<p>Four things about these rows that the analysis has to respect.</p>
<ol type="1">
<li><strong>The 0.60 was fitted to all of them.</strong> Figures 6, 7 and 9 are exactly Tables 1–4. <strong>There is no held-out set for the correlation anywhere in either part</strong>, and this page never claims one: where it needs an out-of-range test it refits the coefficient on Table 1’s room-temperature runs alone and then applies it to Table 3. (There <em>is</em> a held-out set for the reference-temperature convention: Table 3 again, which prints no Reynolds column and so cannot enter that fit. It is used below, and its scope is stated where it is used.)</li>
<li><strong>Three <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> cells are unreadable.</strong> An ink blot on the microfilm covers the mass-transfer entries of Table 1 runs 12, 13 and 14. They are left empty, not guessed; the mass-transfer fits use the 15 rows that remain, and the break table shows what filling them in by eye would do.</li>
<li><strong>One digit in Table 4 is settled by arithmetic, not by the glyph.</strong> Run 11’s <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> is degraded on the film. It is recorded as <strong>10.0</strong>, and the reason is in the mass-transfer cell below: both of Table 4’s transfer numbers come from the same measured rate, so their ratio depends only on the printed temperatures and pressure, and the neighbouring rows bracket run 11 tightly enough to exclude every other reading, including the 10.6 that the glyph’s counter position alone would suggest.</li>
<li><strong>Table 4 has no corrected <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> column at all</strong>, because for benzene the sensible-heat term is about 20 % of the heat flow and the authors did not attempt one. Apparent and corrected Nusselt numbers are never mixed on this page.</li>
</ol>
<p>The Reynolds column is the transcription check, and it turns out to be more than that. The tables define <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D%20=%20D_p%20v_o%5Crho/%5Cmu"> and print <img src="https://latex.codecogs.com/png.latex?D_p">, <img src="https://latex.codecogs.com/png.latex?v_o">, the air and drop temperatures and the pressure beside it, so it is over-determined: every printed Reynolds number with a measured drop temperature (the cell below prints the count) must lie on one <img src="https://latex.codecogs.com/png.latex?%5Crho/%5Cmu(T,P)"> law. <strong>Neither part says at what temperature the air properties in those columns were evaluated.</strong> The one place either part states a reference temperature is for the single still-air run, and that statement is reconciled below with what the columns give; so the next cell leaves <img src="https://latex.codecogs.com/png.latex?T_%7B%5Crm%20ref%7D"> as an unknown and lets those rows answer it.</p>
<div id="32ab5158" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:21.508831Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:21.508578Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:21.523686Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:21.522815Z&quot;}}" data-execution_count="1">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Bootstrap: the pymrm this page was checked with, and the gallery files it was</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># published with. Works in a checkout, in CI and on a fresh Colab VM.</span></span>
<span id="cb1-3">GALLERY_REF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery-2026.11.10.3"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># replaced by the release tag at publication</span></span>
<span id="cb1-4">PYMRM <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&gt;=3.4.0,&lt;4"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals meta.yaml pymrm_min_version, up to the next major</span></span>
<span id="cb1-5">PAGE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A3.5-ranz-marshall-froessling"</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># equals the page directory</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> os, sys, urllib.request</span>
<span id="cb1-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pathlib <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> Path</span>
<span id="cb1-9">_shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">next</span>((p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (Path.cwd(), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>Path.cwd().parents)</span>
<span id="cb1-10">                <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>).is_file()), <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-11"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> _shared <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb1-12">    _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (Path(os.environ.get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"XDG_CACHE_HOME"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">or</span> Path.home() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".cache"</span>)</span>
<span id="cb1-13">               <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm-gallery"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> GALLERY_REF)</span>
<span id="cb1-14">    _shared.mkdir(parents<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, exist_ok<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb1-15">    urllib.request.urlretrieve(</span>
<span id="cb1-16">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://raw.githubusercontent.com/computational-chemical-engineering/"</span></span>
<span id="cb1-17">        <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"pymrm-gallery/</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>GALLERY_REF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">/shared/gallery_bootstrap.py"</span>,</span>
<span id="cb1-18">        _shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap.py"</span>)</span>
<span id="cb1-19">sys.path.insert(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(_shared))</span>
<span id="cb1-20">sys.modules.pop(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gallery_bootstrap"</span>, <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb1-21"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_bootstrap <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> setup</span>
<span id="cb1-22">setup(PAGE, PYMRM, GALLERY_REF)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon stops the cell echoing the path</span></span></code></pre></div></div>
</div>
<div id="840d13d8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:21.526058Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:21.525702Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.541730Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.540773Z&quot;}}" data-execution_count="2">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb2-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> pandas <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> pd</span>
<span id="cb2-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb2-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.integrate <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> quad</span>
<span id="cb2-5"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.optimize <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> curve_fit, minimize_scalar</span>
<span id="cb2-6"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy.stats <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> t <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> student_t</span>
<span id="cb2-7"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> pymrm.checks <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> find_roots, observed_orders</span>
<span id="cb2-8"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> gallery_utils <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> load_data, load_meta, cite_data, Claims</span>
<span id="cb2-9"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> model <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> (nu_shell, sh_stefan, sh_closed, pf_log, pf_arith, corr_excess,</span>
<span id="cb2-10">                   stefan_threshold, stefan_threshold_lambertw)</span>
<span id="cb2-11"></span>
<span id="cb2-12">plt.rcParams.update({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"figure.dpi"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">110</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"axes.grid"</span>: <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid.alpha"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3</span>})</span>
<span id="cb2-13">claims <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Claims(PAGE.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>])</span>
<span id="cb2-14">A <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}                                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every computed number the claims read</span></span>
<span id="cb2-15"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"environment ready"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>environment ready</code></pre>
</div>
</div>
<div id="cfe9f584" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.543669Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.543231Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.569959Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.569225Z&quot;}}" data-execution_count="3">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb4-1">TABLES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"t</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>: <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"ranz-marshall-1952-table</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>i<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.csv"</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)}</span>
<span id="cb4-2">D0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: load_data(f, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLES.items()}</span>
<span id="cb4-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the same tables as printed strings, for the rounding half-widths (a trailing zero</span></span>
<span id="cb4-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is a printed digit)</span></span>
<span id="cb4-5">D0.update({k <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>: load_data(f, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, f <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TABLES.items()})</span>
<span id="cb4-6">K <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ranz-marshall-1952-printed-constants.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>)</span>
<span id="cb4-7">KS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> load_data(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ranz-marshall-1952-printed-constants.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE, dtype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>).set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quantity"</span>)</span>
<span id="cb4-8"></span>
<span id="cb4-9"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(cite_data(load_meta(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ranz-marshall-1952-table1.csv"</span>, page<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PAGE)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-10"></span>
<span id="cb4-11"></span>
<span id="cb4-12"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> split(D, n_re<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb4-13">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The still-air row, the forced-convection rows of Table 1, Table 4, and the</span></span>
<span id="cb4-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    rows with a readable N_Nu'. ``sqRe`` is N_Re to the Reynolds exponent."""</span></span>
<span id="cb4-15">    t1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>]</span>
<span id="cb4-16">    still <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb4-17">    t1f <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1[t1.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>].copy()</span>
<span id="cb4-18">    t4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4"</span>].copy()</span>
<span id="cb4-19">    t1f[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sqRe"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1f.Re.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n_re</span>
<span id="cb4-20">    t4[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sqRe"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4.Re.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n_re</span>
<span id="cb4-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> still, t1f, t4, t1f.Nu_prime.notna().to_numpy()</span>
<span id="cb4-22"></span>
<span id="cb4-23"></span>
<span id="cb4-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> half_unit(s):</span>
<span id="cb4-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Half a unit in the last printed place of the decimal string ``s``."""</span></span>
<span id="cb4-26">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(s).strip()</span>
<span id="cb4-27">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(s.split(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> s <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb4-28"></span>
<span id="cb4-29"></span>
<span id="cb4-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The still-air row is not a forced-convection run and never joins a regression.</span></span>
<span id="cb4-31">still, t1f, t4, mass_ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> split(D0)</span>
<span id="cb4-32">t2, t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t2"</span>], D0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>]</span>
<span id="cb4-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 1: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t1f)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> forced-convection runs, Re </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Re<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t1f<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Re<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb4-34">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"plus one still-air row"</span>)</span>
<span id="cb4-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"         mass-transfer column usable on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>mass_ok<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t1f)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb4-36">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(ink damage on runs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>(t1f.run[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>mass_ok])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb4-37"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 2: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> runs, air </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C"</span>)</span>
<span id="cb4-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 3: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, air </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, "</span></span>
<span id="cb4-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"abscissa printed"</span>)</span>
<span id="cb4-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 4: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t4)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> benzene runs, Re </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Re<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t4<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Re<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb4-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"still air: N_Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Nu_apparent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, N_Nu' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Nu_prime<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb4-42">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"P = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>press_mmHg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm Hg"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Ranz, W. E.; Marshall, W. R., Jr. (1952) — Chemical Engineering Progress 48(4) 173-180 (April 1952), 'Evaporation from Drops, Part II' — table 

Table 1: 18 forced-convection runs, Re 2.11 to 195, plus one still-air row
         mass-transfer column usable on 15 of 18 (ink damage on runs [12, 13, 14])
Table 2: 9 runs, air 66.4-90 C
Table 3: 9 rows, air 85-221 C, abscissa printed
Table 4: 13 benzene runs, Re 3.7 to 220
still air: N_Nu = 2.23, N_Nu' = 1.79, P = 741 mm Hg</code></pre>
</div>
</div>
<section id="the-constants-with-their-roles" class="level3">
<h3 class="anchored" data-anchor-id="the-constants-with-their-roles">The constants, with their roles</h3>
<div id="5c41476d" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.571382Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.571172Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.580325Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.579660Z&quot;}}" data-execution_count="4">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb6-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Every printed constant, by its name in the CSV. Every function below takes this</span></span>
<span id="cb6-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># dictionary, so a misread constant is one call (the break table does exactly that).</span></span>
<span id="cb6-3">P0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(K.loc[k, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> K.index}</span>
<span id="cb6-4"></span>
<span id="cb6-5"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(K[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"role"</span>]].to_string(), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-6"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roles:"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(K.role.value_counts()))</span>
<span id="cb6-7"></span>
<span id="cb6-8"></span>
<span id="cb6-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pr_implied(P):</span>
<span id="cb6-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (24) collapses eqs. (21) for air: 0.54 = 0.60 Pr^(1/3) fixes the Prandtl</span></span>
<span id="cb6-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    number the authors used. A DEFINITION, not a check: nothing independent is</span></span>
<span id="cb6-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    compared with it, because the page imports no property value."""</span></span>
<span id="cb6-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aqueous_collapsed_coefficient"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_coefficient_K"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (</span>
<span id="cb6-14">        <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>])</span>
<span id="cb6-15"></span>
<span id="cb6-16"></span>
<span id="cb6-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> nu_corr(Re, P):</span>
<span id="cb6-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (24), the aqueous collapsed form 2.0 + 0.54 Re^(1/2)."""</span></span>
<span id="cb6-19">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>]</span>
<span id="cb6-20">            <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aqueous_collapsed_coefficient"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.asarray(Re, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>])</span>
<span id="cb6-21"></span>
<span id="cb6-22"></span>
<span id="cb6-23"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> nu_from_abscissa(X, P, Kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb6-24">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (21) on the paper's own printed abscissa N_Re^(1/2) N_Pr^(1/3)."""</span></span>
<span id="cb6-25">    Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_coefficient_K"</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> Kc <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> Kc</span>
<span id="cb6-26">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.asarray(X, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb6-27"></span>
<span id="cb6-28"></span>
<span id="cb6-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pct(model, data):</span>
<span id="cb6-30">    model, data <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(model, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>), np.asarray(data, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>)</span>
<span id="cb6-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (model <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> data) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> data</span>
<span id="cb6-32"></span>
<span id="cb6-33"></span>
<span id="cb6-34"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> rms_pct(model, data):</span>
<span id="cb6-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(pct(model, data) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb6-36"></span>
<span id="cb6-37"></span>
<span id="cb6-38">A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pr_air_implied_by_eq24"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pr_implied(P0)</span>
<span id="cb6-39"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eq. (24)'s </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'aqueous_collapsed_coefficient'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against eqs. (21)'s "</span></span>
<span id="cb6-40">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'correlation_coefficient_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> with the printed 1/3 exponent"</span>)</span>
<span id="cb6-41"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  =&gt; the Prandtl number of air the authors used: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pr_air_implied_by_eq24'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb6-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (a DEFINITION, not an agreement: it is (0.54/0.60)^3 and this page never"</span>)</span>
<span id="cb6-43"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   compares it with a tabulated Prandtl number, because importing one is"</span>)</span>
<span id="cb6-44"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   exactly what the page refuses to do.)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>                                      value         role
quantity                                                
correlation_intercept              2.000000  theoretical
correlation_coefficient_K          0.600000       fitted
exponent_Pr_Sc                     0.333333      assumed
exponent_Re                        0.500000      assumed
exponent_Gr_free_convection        0.250000      assumed
freeconv_coefficient               0.600000       fitted
aqueous_collapsed_coefficient      0.540000      derived
stillair_Nu_measured               2.230000     measured
stillair_Nuprime_measured          1.790000     measured
Dv_backed_out_cm2_s                0.204000      derived
Dv_backout_temperature_K         290.000000     measured
Dv_backout_pressure_mmHg         741.000000     measured
test80_Nu_apparent                 5.830000     measured
test80_correction_sensible_heat    0.028000      derived
test80_correction_radiation        0.006000      derived
test80_correction_capillary        0.011000      derived
test80_Nu_corrected                5.570000      derived
eq19_eq20_prefactor                0.250000      derived
k_water_20C_cal_s_cm_C             0.001430     measured
k_water_over_k_air                25.000000     measured
benzene_melting_point_F           42.000000     measured
table6_Re                         66.600000     measured
table6_Dp_cm                       0.106000     measured
table3_pressure_mmHg             743.000000     measured 

roles: {'measured': np.int64(11), 'derived': np.int64(7), 'assumed': np.int64(3), 'fitted': np.int64(2), 'theoretical': np.int64(1)}

eq. (24)'s 0.54 against eqs. (21)'s 0.6 with the printed 1/3 exponent
  =&gt; the Prandtl number of air the authors used: 0.72900
  (a DEFINITION, not an agreement: it is (0.54/0.60)^3 and this page never
   compares it with a tabulated Prandtl number, because importing one is
   exactly what the page refuses to do.)</code></pre>
</div>
</div>
</section>
<section id="the-transcription-check" class="level3">
<h3 class="anchored" data-anchor-id="the-transcription-check">The transcription check</h3>
<p>A single two-parameter law <img src="https://latex.codecogs.com/png.latex?%5Crho/%5Cmu%20=%20C%5C,P%5C,T_%7B%5Crm%20ref%7D%5E%7B%5C,n%7D"> against every printed Reynolds number in Tables 1, 2 and 4 that has a measured drop temperature, with the reference temperature written <img src="https://latex.codecogs.com/png.latex?T_%7B%5Crm%20ref%7D%20=%20T_a%20+%20w%5C,(T_d%20-%20T_a)"> and <img src="https://latex.codecogs.com/png.latex?w"> left free. Then a nearly fit-free companion: nine rows of Table 1 sit at one pressure inside 0.7 °C of each other in air temperature, so their nine <img src="https://latex.codecogs.com/png.latex?Re/v"> values are very nearly one number, and the cell says how nearly, because <em>nearly</em> is the whole content of the check.</p>
<div id="227cce00" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.581848Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.581717Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.681627Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.680767Z&quot;}}" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb8-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The Reynolds column is over-determined by the columns beside it: the tables</span></span>
<span id="cb8-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># define N_Re = D_p v rho / mu and print D_p, v, air temperature and pressure, so</span></span>
<span id="cb8-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Re/(D_p v P) is a function of temperature alone. Fit</span></span>
<span id="cb8-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     ln( Re / (D_p v P) ) = c0 + c1 ln T_ref</span></span>
<span id="cb8-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and look at the residuals. A misread digit cannot hide there. But WHICH T_ref?</span></span>
<span id="cb8-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Neither part states the convention for the TABLES. (Part II states one for the</span></span>
<span id="cb8-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># single still-air run, "an average temperature of 290 deg K.", and that statement</span></span>
<span id="cb8-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># is reconciled with the recovered value at the end of this cell.) So the reference</span></span>
<span id="cb8-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># temperature is left as an unknown weight w between the air and the drop:</span></span>
<span id="cb8-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#     T_ref = T_air + w (T_drop - T_air),   w = 0 free stream, w = 1/2 film, w = 1 drop.</span></span>
<span id="cb8-11"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> re_frame(df):</span>
<span id="cb8-12">    d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[(df.Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> df.drop_temp_C.notna()]</span>
<span id="cb8-13">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D"</span>: d.D_p_cm, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"v"</span>: d.air_vel_cm_s, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ta"</span>: d.air_temp_C,</span>
<span id="cb8-14">                         <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Td"</span>: d.drop_temp_C, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>: d.press_mmHg, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re"</span>: d.Re})</span>
<span id="cb8-15"></span>
<span id="cb8-16"></span>
<span id="cb8-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> re_data(D):</span>
<span id="cb8-18">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Every row of Tables 1, 2 and 4 with a measured drop temperature, and ln(Re/(D v P))."""</span></span>
<span id="cb8-19">    R <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.concat([re_frame(D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>]).assign(tab<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), re_frame(D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t2"</span>]).assign(tab<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb8-20">                   re_frame(D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4"</span>]).assign(tab<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)], ignore_index<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb8-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> R, np.log(R.Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (R.D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R.v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R.P)).to_numpy()</span>
<span id="cb8-22"></span>
<span id="cb8-23"></span>
<span id="cb8-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> t_ref(F, w):</span>
<span id="cb8-25">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> (F.Ta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (F.Td <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> F.Ta) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>).to_numpy()</span>
<span id="cb8-26"></span>
<span id="cb8-27"></span>
<span id="cb8-28"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> re_fit(w, R, y):</span>
<span id="cb8-29">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Least squares of y on [1, ln T_ref(w)]: exponent, its standard error, residuals."""</span></span>
<span id="cb8-30">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([np.ones(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(y)), np.log(t_ref(R, w))])</span>
<span id="cb8-31">    c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, y, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb8-32">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c</span>
<span id="cb8-33">    se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.linalg.inv(X.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> X)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]))</span>
<span id="cb8-34">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), se, r</span>
<span id="cb8-35"></span>
<span id="cb8-36"></span>
<span id="cb8-37"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> re_rms(w, R, y):</span>
<span id="cb8-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(np.mean(re_fit(w, R, y)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)))</span>
<span id="cb8-39"></span>
<span id="cb8-40"></span>
<span id="cb8-41"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> d_ssr_dw(w, R, y):</span>
<span id="cb8-42">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Exact derivative of the residual sum of squares in w. The coefficients are</span></span>
<span id="cb8-43"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    optimal at every w, so only the explicit dependence counts:</span></span>
<span id="cb8-44"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    dSSR/dw = -2 c1 sum(r (T_d - T_a)/T_ref)."""</span></span>
<span id="cb8-45">    c1, _, r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re_fit(w, R, y)</span>
<span id="cb8-46">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (R.Td <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> R.Ta).to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t_ref(R, w)))</span>
<span id="cb8-47"></span>
<span id="cb8-48"></span>
<span id="cb8-49"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> reynolds(D, P, w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, band<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.05</span>):</span>
<span id="cb8-50">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The rho/mu law, its reference temperature, and the checks that hang on it."""</span></span>
<span id="cb8-51">    still, t1f, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> split(D, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>])</span>
<span id="cb8-52">    R, y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re_data(D)</span>
<span id="cb8-53">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> w <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>:</span>
<span id="cb8-54">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the minimum of the rms over w is the root of the exact derivative on [0, 1]</span></span>
<span id="cb8-55">        roots <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> ww: d_ssr_dw(ww, R, y), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]</span>
<span id="cb8-56">        roots <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> roots <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> re_rms(r, R, y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(re_rms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, R, y), re_rms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, R, y))]</span>
<span id="cb8-57">        w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(roots[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(roots) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan</span>
<span id="cb8-58">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_R"</span>: R, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_y"</span>: y, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_w"</span>: w}</span>
<span id="cb8-59">    n_best, se_best, r_best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re_fit(w, R, y) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (np.nan, np.nan, y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.nan)</span>
<span id="cb8-60">    n_air, se_air, r_air <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re_fit(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, R, y)</span>
<span id="cb8-61">    out.update(re_reference_temperature_weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>w, re_law_T_exponent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_best,</span>
<span id="cb8-62">               re_law_T_exponent_se<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>se_best,</span>
<span id="cb8-63">               re_law_resid_rms_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(np.mean(r_best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb8-64">               re_law_resid_max_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r_best))),</span>
<span id="cb8-65">               re_law_resid_rms_pct_free_stream<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(np.mean(r_air <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))),</span>
<span id="cb8-66">               re_law_T_exponent_free_stream<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n_air, _se_air<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>se_air, _r_best<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r_best)</span>
<span id="cb8-67">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the band of w within 5 % of the best rms: the two roots of rms(w) = 1.05 rms(w*)</span></span>
<span id="cb8-68">    target <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> band <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(np.mean(r_best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb8-69">    edges <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> find_roots(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> ww: re_rms(ww, R, y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> target, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, n_scan<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">64</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"roots"</span>]</span>
<span id="cb8-70">    lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (edges <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(edges) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (np.nan, np.nan))</span>
<span id="cb8-71">    out.update(re_reference_weight_band<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo), _lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>lo, _hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hi,</span>
<span id="cb8-72">               re_band_holds_045_and_055<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(lo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>),</span>
<span id="cb8-73">               _band_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lo, hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.55</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(lo) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan)</span>
<span id="cb8-74">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># every row's N_Re re-evaluated at the free stream instead of at T_ref(w)</span></span>
<span id="cb8-75">    ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((R.Ta <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>).to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> t_ref(R, w)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n_best</span>
<span id="cb8-76">    nu_now, nu_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nu_corr(R.Re.to_numpy(), P), nu_corr(R.Re.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ratio, P)</span>
<span id="cb8-77">    out.update(re_freestream_worst_Re_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))),</span>
<span id="cb8-78">               re_freestream_worst_Nu_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(nu_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> nu_now <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))))</span>
<span id="cb8-79">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># nine rows of Table 1 at one pressure: Re/v is nearly one number</span></span>
<span id="cb8-80">    iso <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1f[t1f.press_mmHg <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">738</span>]</span>
<span id="cb8-81">    r_v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (iso.Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> iso.air_vel_cm_s).to_numpy()</span>
<span id="cb8-82">    rm_iso <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_ref(pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ta"</span>: iso.air_temp_C, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Td"</span>: iso.drop_temp_C}), w) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> n_best</span>
<span id="cb8-83">    s1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1s"</span>].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>).loc[iso.run.astype(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>)]</span>
<span id="cb8-84">    hw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.array([half_unit(a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(a) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> half_unit(b) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b)</span>
<span id="cb8-85">                         <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(s1.Re, s1.air_vel_cm_s)])</span>
<span id="cb8-86">    spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.ptp(r_v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r_v.mean())</span>
<span id="cb8-87">    t_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.ptp(rm_iso) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rm_iso.mean())</span>
<span id="cb8-88">    rnd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sort(hw)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> np.sort(hw)[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a peak-to-peak bound: two rows</span></span>
<span id="cb8-89">    out.update(t1_iso_Re_over_v_spread_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>spread, t1_iso_expected_spread_from_T_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_eff,</span>
<span id="cb8-90">               t1_iso_rounding_ptp_bound_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rnd, _iso<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>iso, _r_v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r_v, _hw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>hw,</span>
<span id="cb8-91">               _T_iso<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>t_ref(pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ta"</span>: iso.air_temp_C, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Td"</span>: iso.drop_temp_C}), w),</span>
<span id="cb8-92">               t1_iso_spread_below_T_effect<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> t_eff),</span>
<span id="cb8-93">               _iso_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> spread) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> spread,</span>
<span id="cb8-94">               t1_iso_spread_inside_T_plus_rounding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(spread <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> t_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rnd),</span>
<span id="cb8-95">               _iso_margin2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(t_eff <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rnd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> spread) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> spread)</span>
<span id="cb8-96">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the one reference temperature Part II states, for the still-air run</span></span>
<span id="cb8-97">    T_film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(still.air_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (still.drop_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> still.air_temp_C) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span>)</span>
<span id="cb8-98">    out.update(stillair_film_minus_stated_K<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_film <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dv_backout_temperature_K"</span>],</span>
<span id="cb8-99">               _T_film<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T_film, _still<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>still)</span>
<span id="cb8-100">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb8-101"></span>
<span id="cb8-102"></span>
<span id="cb8-103">RE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reynolds(D0, P0)</span>
<span id="cb8-104">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> RE.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb8-105">R_ALL, Y_ALL, W <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_R"</span>], RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_y"</span>], RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_w"</span>]</span>
<span id="cb8-106"></span>
<span id="cb8-107"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R_ALL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> printed Reynolds numbers (every row with a measured drop"</span>)</span>
<span id="cb8-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"temperature) against one rho/mu = C P T_ref^n law.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-109"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'w'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reference temperature'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'exponent n'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'+-'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-110">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rms'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'worst'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-111"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"air (free stream)"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"one-third film"</span>),</span>
<span id="cb8-112">               (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"film (mean)"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop surface"</span>)):</span>
<span id="cb8-113">    n_, se_, r_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> re_fit(w, R_ALL, Y_ALL)</span>
<span id="cb8-114">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}{</span>n_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.3f}{</span>se_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb8-115">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(np.mean(r_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r_))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb8-116"></span>
<span id="cb8-117"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  the minimum, a root of the exact derivative dSSR/dw on [0, 1]: w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb8-118"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the arithmetic mean of the air and drop temperatures to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(W<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb8-119"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  There the exponent is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_T_exponent'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_T_exponent_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb8-120">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R_ALL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R_ALL) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> dof),"</span>)</span>
<span id="cb8-121"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  what kinetic theory gives for air (mu ~ T^0.7 and rho ~ P/T give n ~ -1.7); at the"</span>)</span>
<span id="cb8-122"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  free stream it is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_T_exponent_free_stream'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_se_air'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb8-123">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>((A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_T_exponent_free_stream'</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_se_air'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> standard errors away"</span>)</span>
<span id="cb8-124"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  from it. The residual falls from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_resid_rms_pct_free_stream'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % "</span></span>
<span id="cb8-125">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_resid_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb8-126"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  The band of w within 5 % of the best residual (two roots) is "</span></span>
<span id="cb8-127">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_lo'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_hi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">],"</span>)</span>
<span id="cb8-128"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  width </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_reference_weight_band'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: the film rule is identified, but a 0.45 or"</span>)</span>
<span id="cb8-129"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a 0.55 rule lies inside the band too (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_band_holds_045_and_055'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)."</span>)</span>
<span id="cb8-130"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  THE PAPERS DO NOT STATE THIS CONVENTION FOR THE TABLES; it is recovered"</span>)</span>
<span id="cb8-131"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  here from the printed columns alone, and it matters downstream."</span>)</span>
<span id="cb8-132"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Re-evaluating every row's Reynolds number at the free stream instead of"</span>)</span>
<span id="cb8-133"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the film shifts it by up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_freestream_worst_Re_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, and the N_Nu "</span></span>
<span id="cb8-134">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"that eq. (24)"</span>)</span>
<span id="cb8-135"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  then predicts by up to </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_freestream_worst_Nu_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. See Reuse."</span>)</span>
<span id="cb8-136">_r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_r_best"</span>]</span>
<span id="cb8-137"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>):</span>
<span id="cb8-138">    sel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (R_ALL.tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> tab).to_numpy()</span>
<span id="cb8-139">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    Table </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>tab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>sel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, rms "</span></span>
<span id="cb8-140">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(np.mean(_r[sel]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, worst "</span></span>
<span id="cb8-141">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_r[sel]))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb8-142">worst_i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmax(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_r)))       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># names the row; the value is the metric above</span></span>
<span id="cb8-143"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  worst single row: Table </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_ALL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>tab[worst_i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, v = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_ALL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>v[worst_i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cm/s, "</span></span>
<span id="cb8-144">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Re = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>R_ALL<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Re[worst_i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, off by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_r[worst_i]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb8-145"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (Table 2's runs 1-4 are excluded throughout: they print no drop temperature,"</span>)</span>
<span id="cb8-146"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   the table's own note saying adiabatic saturation was assumed instead.)"</span>)</span>
<span id="cb8-147"></span>
<span id="cb8-148"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># A NEARLY fit-free version of the same check. Table 1's runs 6-14 share a pressure</span></span>
<span id="cb8-149"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and sit inside 0.7 C of each other in air temperature, so their nine Re/v values</span></span>
<span id="cb8-150"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># are very nearly one number. Not exactly one number: their DROP temperatures spread</span></span>
<span id="cb8-151"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the film temperature over about 1 K, which at the fitted exponent is a real</span></span>
<span id="cb8-152"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># effect of its own. And the quantity being bounded is a nine-row peak-to-peak, so</span></span>
<span id="cb8-153"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the bound it is compared with is a peak-to-peak bound, the two largest half-widths.</span></span>
<span id="cb8-154">iso <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_iso"</span>]</span>
<span id="cb8-155"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table 1 runs </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>iso<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>run<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>iso<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>run<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (all 738 mm Hg, "</span></span>
<span id="cb8-156">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>iso<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>iso<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C air): Re/v = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_r_v'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb8-157"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed peak-to-peak spread            </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_iso_Re_over_v_spread_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb8-158"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  film temperature moves over these rows  "</span></span>
<span id="cb8-159">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_T_iso'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_T_iso'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K, which at n = "</span></span>
<span id="cb8-160">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'re_law_T_exponent'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is"</span>)</span>
<span id="cb8-161"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a real spread in rho/mu of              </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_iso_expected_spread_from_T_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb8-162"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  rounding alone allows, peak-to-peak,    </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_iso_rounding_ptp_bound_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %  "</span></span>
<span id="cb8-163">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(worst single row +-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_hw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)"</span>)</span>
<span id="cb8-164"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed spread below the temperature effect alone: "</span></span>
<span id="cb8-165">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_iso_spread_below_T_effect'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; inside temperature plus rounding: "</span></span>
<span id="cb8-166">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_iso_spread_inside_T_plus_rounding'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb8-167"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  So this is NOT a reference-temperature-free check. What it is, is a"</span>)</span>
<span id="cb8-168"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  gross-transcription detector: a misread digit in Re or v shows up as a"</span>)</span>
<span id="cb8-169"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  single outlier, and the break table exercises exactly that."</span>)</span>
<span id="cb8-170"></span>
<span id="cb8-171"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHAT THE PAPER ITSELF SAYS ABOUT THE REFERENCE TEMPERATURE. Part II states the</span></span>
<span id="cb8-172"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># convention once, for the still-air run: D_v = 0.204 sq.cm./sec. "at an average</span></span>
<span id="cb8-173"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># temperature of 290 deg K." Table 1's still-air row prints the air and the drop</span></span>
<span id="cb8-174"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># temperature that go with it, so the two can be reconciled.</span></span>
<span id="cb8-175">T_STATED, P_STATED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dv_backout_temperature_K"</span>], P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dv_backout_pressure_mmHg"</span>]</span>
<span id="cb8-176"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  AND THE PAPER STATES IT ONCE ITSELF. Part II gives D_v = "</span></span>
<span id="cb8-177">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Dv_backed_out_cm2_s'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sq.cm/sec"</span>)</span>
<span id="cb8-178"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  'at an average temperature of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_STATED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> deg K. and a pressure of "</span></span>
<span id="cb8-179">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_STATED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm. Hg.'"</span>)</span>
<span id="cb8-180"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Table 1's still-air row prints air </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C and drop "</span></span>
<span id="cb8-181">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>drop_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>press_mmHg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm Hg."</span>)</span>
<span id="cb8-182"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    free stream        </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span>)</span>
<span id="cb8-183"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    film (w = 1/2)     </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_T_film'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K   &lt;- the authors' 'average'"</span>)</span>
<span id="cb8-184"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    drop surface       </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>drop_temp_C <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">273.15</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span>)</span>
<span id="cb8-185"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    stated             </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_STATED<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K,  difference from the film "</span></span>
<span id="cb8-186">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'stillair_film_minus_stated_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K"</span>)</span>
<span id="cb8-187"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  and the stated pressure equals the row's own printed pressure: "</span></span>
<span id="cb8-188">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P_STATED <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> still<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>press_mmHg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb8-189"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  So w = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> is not only a minimisation: for the one run where the"</span>)</span>
<span id="cb8-190"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  authors say which average they took, they took the film temperature."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>36 printed Reynolds numbers (every row with a measured drop
temperature) against one rho/mu = C P T_ref^n law.

       w   reference temperature   exponent n      +-      rms    worst
   0.000       air (free stream)       -1.323   0.033   1.141 %   3.301 %
   0.333          one-third film       -1.587   0.027   0.787 %   2.544 %
   0.500             film (mean)       -1.766   0.027   0.695 %   2.463 %
   1.000            drop surface       -2.569   0.121   2.102 %   3.882 %

  the minimum, a root of the exact derivative dSSR/dw on [0, 1]: w = 0.4996,
  the arithmetic mean of the air and drop temperatures to 0.08 %.
  There the exponent is -1.765 +- 0.027 (n = 36, 34 dof),
  what kinetic theory gives for air (mu ~ T^0.7 and rho ~ P/T give n ~ -1.7); at the
  free stream it is -1.323 +- 0.033, 11 standard errors away
  from it. The residual falls from 1.141 % to 0.695 %.
  The band of w within 5 % of the best residual (two roots) is [0.405, 0.582],
  width 0.178: the film rule is identified, but a 0.45 or
  a 0.55 rule lies inside the band too (True).

  THE PAPERS DO NOT STATE THIS CONVENTION FOR THE TABLES; it is recovered
  here from the printed columns alone, and it matters downstream.
  Re-evaluating every row's Reynolds number at the free stream instead of
  the film shifts it by up to 15.5 %, and the N_Nu that eq. (24)
  then predicts by up to 5.4 %. See Reuse.
    Table 1: 18 rows, rms 0.126 %, worst 0.288 %
    Table 2:  5 rows, rms 1.374 %, worst 2.462 %
    Table 4: 13 rows, rms 0.767 %, worst 2.045 %
  worst single row: Table 2, v = 17.6 cm/s, Re = 9, off by -2.46 %
  (Table 2's runs 1-4 are excluded throughout: they print no drop temperature,
   the table's own note saying adiabatic saturation was assumed instead.)

Table 1 runs 6-14 (all 738 mm Hg, 24.3-25.0 C air): Re/v = 0.62789
  observed peak-to-peak spread             0.492 %
  film temperature moves over these rows  289.11-290.06 K, which at n = -1.765 is
  a real spread in rho/mu of               0.578 %
  rounding alone allows, peak-to-peak,     0.612 %  (worst single row +-0.385 %)
  observed spread below the temperature effect alone: True; inside temperature plus rounding: True.
  So this is NOT a reference-temperature-free check. What it is, is a
  gross-transcription detector: a misread digit in Re or v shows up as a
  single outlier, and the break table exercises exactly that.

  AND THE PAPER STATES IT ONCE ITSELF. Part II gives D_v = 0.204 sq.cm/sec
  'at an average temperature of 290 deg K. and a pressure of 741 mm. Hg.'
  Table 1's still-air row prints air 24.9 C and drop 9.1 C at 741 mm Hg.
    free stream         298.05 K
    film (w = 1/2)      290.15 K   &lt;- the authors' 'average'
    drop surface        282.25 K
    stated              290.00 K,  difference from the film +0.15 K
  and the stated pressure equals the row's own printed pressure: True.
  So w = 0.4996 is not only a minimisation: for the one run where the
  authors say which average they took, they took the film temperature.</code></pre>
</div>
</div>
<p><strong>The residual is smallest at <img src="https://latex.codecogs.com/png.latex?w"> = 0.4996</strong>, a root of the exact derivative of the residual sum of squares, i.e.&nbsp;the arithmetic mean of the air and the drop temperatures. That is not a small preference. At the film temperature the fitted exponent is <strong>-1.765 ± 0.027</strong>, what kinetic theory gives for air, since <img src="https://latex.codecogs.com/png.latex?%5Cmu%5Csim%20T%5E%7B0.7%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Crho%5Csim%20P/T"> make <img src="https://latex.codecogs.com/png.latex?%5Crho/%5Cmu%5Csim%20P%5C,T%5E%7B-1.7%7D">, and the residual over all rows is 0.69 %; at the free stream the exponent is -1.32, many of its standard errors from <img src="https://latex.codecogs.com/png.latex?-1.7"> (the count is printed above), and the residual is 1.14 %. Table 1’s own rows come back to the per-table rms and worst printed above once the film temperature is used: four-figure Reynolds numbers reproduced from four other printed columns by a two-parameter law.</p>
<p><strong>And the papers state it once themselves, for the one run where they had to.</strong> Part II’s still-air paragraph gives <img src="https://latex.codecogs.com/png.latex?D_v%20=%200.204"> sq.cm/sec “at an average temperature of 290° K. and a pressure of 741 mm. Hg.” Table 1’s still-air row prints the air and drop temperatures that go with it, and their mean is 0.15 K above the stated value, with the stated pressure equal to the row’s own printed pressure. So for the single run whose reference temperature the authors write down, the average they took <em>is</em> the film temperature. The recovered <img src="https://latex.codecogs.com/png.latex?w"> is not only a minimisation; it agrees with the one printed statement of the convention in either part.</p>
<p>That leaves the <em>tables’</em> convention genuinely unstated (no part says at what temperature the Reynolds columns of Tables 1, 2 and 4 were evaluated), and it carries into anyone’s reuse of the correlation: evaluating <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> at the free stream instead of the film would move it by up to 15.5 % on these very rows, and the <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> that eq. (24) then predicts by up to 5.4 %.</p>
<p>The identification has a width and the page states it: the band of <img src="https://latex.codecogs.com/png.latex?w"> within 5 % of the best residual, between the two roots of rms<img src="https://latex.codecogs.com/png.latex?(w)%20=%201.05%5C,">rms<img src="https://latex.codecogs.com/png.latex?(w%5E*)">, is 0.178 wide, so a <img src="https://latex.codecogs.com/png.latex?0.45"> or a <img src="https://latex.codecogs.com/png.latex?0.55"> rule would not be distinguishable from <img src="https://latex.codecogs.com/png.latex?1/2">. What <em>is</em> distinguishable is the free stream, and the drop surface.</p>
<p><strong>The <img src="https://latex.codecogs.com/png.latex?Re/v"> check needs a reference temperature too.</strong> Nine rows at one pressure and one air temperature do not give one number: their <em>drop</em> temperatures spread the film temperature over about a kelvin, which at the fitted exponent is a 0.578 % effect on <img src="https://latex.codecogs.com/png.latex?%5Crho/%5Cmu">, on its own larger than the whole 0.492 % spread observed. And the observed quantity is a nine-row peak-to-peak, so the bound it must be judged against is a peak-to-peak bound, 0.612 % from rounding alone (the two largest half-widths), not one row’s half-width. Read that way the check passes comfortably and is a <strong>gross-transcription detector</strong>, not a reference-temperature-free identity.</p>
</section>
<section id="the-convention-has-an-out-of-sample-test-on-rows-the-fit-could-not-see" class="level3">
<h3 class="anchored" data-anchor-id="the-convention-has-an-out-of-sample-test-on-rows-the-fit-could-not-see">The convention has an out-of-sample test, on rows the fit could not see</h3>
<p>Table 3 prints no Reynolds column at all, so none of its rows can enter the fit above. It does print <img src="https://latex.codecogs.com/png.latex?D_p">, <img src="https://latex.codecogs.com/png.latex?v">, both temperatures and (in its footnote) the pressure, so the recovered law can be asked to <em>predict</em> the abscissa Table 3 does print, at reference temperatures above every one the law was fitted on (both ranges are printed below).</p>
<div id="5257e0b9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.683616Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.683340Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.788732Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.787985Z&quot;}}" data-execution_count="6">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb10-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE FIT HAS AN OUT-OF-SAMPLE </span><span class="al" style="color: #AD0000;
background-color: null;
font-style: inherit;">TEST</span><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">. Table 3 prints NO Reynolds column at all,</span></span>
<span id="cb10-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># only the abscissa N_Re^(1/2) N_Pr^(1/3), so not one of its rows can enter the fit</span></span>
<span id="cb10-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># above, which used the rows of Tables 1, 2 and 4. But it prints D_p, v, the air</span></span>
<span id="cb10-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and drop temperatures, and its footnote prints the pressure, so the recovered law</span></span>
<span id="cb10-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># can PREDICT its abscissa and be scored against the printed one, at reference</span></span>
<span id="cb10-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># temperatures beyond every one the law was fitted on.</span></span>
<span id="cb10-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> t3_abscissa(w, D, P, R, y):</span>
<span id="cb10-8">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 3's abscissa predicted from the rho/mu law refitted at this w."""</span></span>
<span id="cb10-9">    d3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>]</span>
<span id="cb10-10">    c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.polyfit(np.log(t_ref(R, w)), y, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)                 <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># [slope, intercept]</span></span>
<span id="cb10-11">    T3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_ref(pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ta"</span>: d3.air_temp_C, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Td"</span>: d3.drop_temp_C}), w)</span>
<span id="cb10-12">    Re3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (np.exp(c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> T3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> c[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d3.D_p_corresponding_cm.to_numpy()</span>
<span id="cb10-13">           <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> d3.air_vel_cm_s.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_pressure_mmHg"</span>])</span>
<span id="cb10-14">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> Re3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pr_implied(P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>]</span>
<span id="cb10-15"></span>
<span id="cb10-16"></span>
<span id="cb10-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> t3_rms(w, D, P, R, y):</span>
<span id="cb10-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> rms_pct(t3_abscissa(w, D, P, R, y), D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>].Re_half_Pr_third.to_numpy())</span>
<span id="cb10-19"></span>
<span id="cb10-20"></span>
<span id="cb10-21">W_SCAN <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">101</span>)</span>
<span id="cb10-22"></span>
<span id="cb10-23"></span>
<span id="cb10-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> table3_heldout(D, P, w, R, y):</span>
<span id="cb10-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 3 scored at the recovered w, at both ends, and its own best w: a scan of</span></span>
<span id="cb10-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    101 points over [0, 1], refined by a bounded minimisation between the neighbours</span></span>
<span id="cb10-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    of the smallest scan value."""</span></span>
<span id="cb10-28">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([t3_rms(ww, D, P, R, y) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> ww <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> W_SCAN])</span>
<span id="cb10-29">    i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.argmin(s))</span>
<span id="cb10-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(W_SCAN) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>):</span>
<span id="cb10-31">        best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.nan                       <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># at or beyond the end of [0, 1]</span></span>
<span id="cb10-32">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span>:</span>
<span id="cb10-33">        best <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(minimize_scalar(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> ww: t3_rms(ww, D, P, R, y),</span>
<span id="cb10-34">                                     bounds<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(W_SCAN[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], W_SCAN[i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]), method<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bounded"</span>,</span>
<span id="cb10-35">                                     options<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>{<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xatol"</span>: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-10</span>}).x)</span>
<span id="cb10-36">    T_fit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_ref(R, w)</span>
<span id="cb10-37">    T_t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t_ref(pd.DataFrame({<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ta"</span>: D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>].air_temp_C, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Td"</span>: D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>].drop_temp_C}), w)</span>
<span id="cb10-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct"</span>: t3_rms(w, D, P, R, y) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> np.isfinite(w) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.nan,</span>
<span id="cb10-39">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_extrapolation_K"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(T_t3.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> T_fit.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_T"</span>: (T_fit, T_t3),</span>
<span id="cb10-40">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct_free_stream"</span>: t3_rms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, D, P, R, y),</span>
<span id="cb10-41">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct_drop_surface"</span>: t3_rms(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, D, P, R, y),</span>
<span id="cb10-42">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_w"</span>: best}</span>
<span id="cb10-43"></span>
<span id="cb10-44"></span>
<span id="cb10-45">TH <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table3_heldout(D0, P0, W, R_ALL, Y_ALL)</span>
<span id="cb10-46">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> TH.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb10-47">T_fit, T_t3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> TH[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_T"</span>]</span>
<span id="cb10-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reference temperatures the law was FITTED on : "</span></span>
<span id="cb10-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(R_ALL)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows)"</span>)</span>
<span id="cb10-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"reference temperatures Table 3 asks it about : "</span></span>
<span id="cb10-51">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, NONE in the fit)"</span>)</span>
<span id="cb10-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the two ranges overlap: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>T_t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> T_fit<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the extrapolation reaches "</span></span>
<span id="cb10-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_extrapolation_K'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> K beyond the fit.</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-54"></span>
<span id="cb10-55">X3p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.Re_half_Pr_third.to_numpy()</span>
<span id="cb10-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'w'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'reference temperature'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Table 3 abscissa rms'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;22}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'worst'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb10-57"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> w, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"air (free stream)"</span>), (W, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the RECOVERED value"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop surface"</span>)):</span>
<span id="cb10-58">    r_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct(t3_abscissa(w, D0, P0, R_ALL, Y_ALL), X3p)</span>
<span id="cb10-59">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>w<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.3f}{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;24}{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sqrt(np.mean(r_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:19.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(r_))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb10-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  and the w that best reproduces Table 3 ON ITS OWN (scan of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(W_SCAN)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> points "</span></span>
<span id="cb10-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"on [0, 1], refined) is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_heldout_w'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb10-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  against the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>W<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> recovered from the other three tables. This is a test of"</span>)</span>
<span id="cb10-63"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  the reference-temperature convention only: the 0.60 was fitted to Table 3"</span>)</span>
<span id="cb10-64"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (Figure 9), so nothing here is out of sample for the CORRELATION."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>reference temperatures the law was FITTED on : 280.8 - 329.1 K  (36 rows)
reference temperatures Table 3 asks it about : 330.4 - 409.7 K  (9 rows, NONE in the fit)
  the two ranges overlap: False; the extrapolation reaches 81 K beyond the fit.

       w   reference temperature  Table 3 abscissa rms     worst
   0.000       air (free stream)              1.769 %    2.906 %
   0.500     the RECOVERED value              0.823 %    1.526 %
   1.000            drop surface              7.201 %   11.011 %

  and the w that best reproduces Table 3 ON ITS OWN (scan of 101 points on [0, 1], refined) is 0.5140,
  against the 0.4996 recovered from the other three tables. This is a test of
  the reference-temperature convention only: the 0.60 was fitted to Table 3
  (Figure 9), so nothing here is out of sample for the CORRELATION.</code></pre>
</div>
</div>
<p><strong>0.82 % rms</strong> at the recovered <img src="https://latex.codecogs.com/png.latex?w">, against <strong>1.77 %</strong> at the free stream and <strong>7.20 %</strong> at the drop surface; and the <img src="https://latex.codecogs.com/png.latex?w"> that best reproduces Table 3 <em>on its own</em> is <strong>0.5140</strong>, against the 0.4996 the other three tables give. That is out-of-sample confirmation of the reference-temperature convention on nine rows the fit never saw, 81 K beyond every temperature it did see, and it simultaneously confirms Table 3’s transcription.</p>
<p>Two limits on what that buys, stated because the page is careful about fit-versus-test everywhere else. It is a test of the <strong>reference-temperature convention only</strong>: the 0.60 was fitted to Table 3 through Figure 9, so nothing here is out of sample for the <em>correlation</em>. And it inherits the assumption that <img src="https://latex.codecogs.com/png.latex?N_%7BPr%7D"> for air is the constant 0.729 that eq. (24) implies, which is the same assumption the abscissa itself carries.</p>
</section>
</section>
<section id="pymrm-implementation" class="level2">
<h2 class="anchored" data-anchor-id="pymrm-implementation">PyMRM implementation</h2>
<p>The algebra above needs no solver. What does need one is eq. (7), the <code>2.0</code>, which is a one-dimensional spherical boundary-value problem, and the radial convection Ranz flagged in 1993, which is the same problem with a convective flux added. Both are built with <code>construct_grad</code>, <code>construct_div(nu=2)</code> and <code>construct_convflux_upwind</code>, on a geometric radial grid because the answer is set by the shell nearest the drop while the far field has to reach many drop radii; the geometric faces nest when the cell count doubles, so the ladders below are refinement studies of one discretisation. Both problems are linear for a given total flow, so each grid costs one sparse solve.</p>
<p>Those two cells are further down, after the results, because the results are what the paper is about. The implementation notes worth having in advance:</p>
<ul>
<li><code>construct_div(..., nu=2)</code> is the spherical geometry; the break table solves the same problem with <code>nu = 1</code>.</li>
<li>Both boundaries are Dirichlet, <code>{"a": 0, "b": 1, "d": ...}</code> at each end, written in the code next to the physical condition each imposes.</li>
<li>The surface flux is read with <code>compute_boundary_values</code> under the solve’s own boundary conditions, and checked against the flux through the outer face times the area ratio: the discrete divergence telescopes, so the two agree to the residual of the solve.</li>
<li>The Stefan problem’s total molar flow is the one root of “the flow the solve produces equals the flow it was given”, found with <code>pymrm.checks.find_roots</code> on a bracket that contains the exact flow, raising unless there is exactly one.</li>
</ul>
</section>
<section id="results" class="level2">
<h2 class="anchored" data-anchor-id="results">Results</h2>
<section id="heat-transfer-the-fit-and-the-part-of-it-that-was-not-free" class="level3">
<h3 class="anchored" data-anchor-id="heat-transfer-the-fit-and-the-part-of-it-that-was-not-free">Heat transfer: the fit, and the part of it that was not free</h3>
<p>The 0.60 was fitted to these rows, so the rms below is a goodness of fit and is labelled one. The intercept is the exception, and it is reported separately.</p>
<div id="87a65936" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.790684Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.790500Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.802188Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.801512Z&quot;}}" data-execution_count="7">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb12-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># HEAT TRANSFER, Table 1. The correlation's 0.60 was fitted to these rows</span></span>
<span id="cb12-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (Figs. 6 and 7), so what follows is a goodness of fit, EXCEPT for the</span></span>
<span id="cb12-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># intercept, which is theoretical and was never fitted to anything.</span></span>
<span id="cb12-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ols(x, v):</span>
<span id="cb12-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Straight line v = a + b x by least squares: (a, b), their standard errors from</span></span>
<span id="cb12-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the residual scatter, and the degrees of freedom."""</span></span>
<span id="cb12-7">    X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.column_stack([np.ones_like(x), x])</span>
<span id="cb12-8">    c, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linalg.lstsq(X, v, rcond<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>)</span>
<span id="cb12-9">    r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> X <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> c</span>
<span id="cb12-10">    dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(v) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span></span>
<span id="cb12-11">    se <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(np.diag(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.linalg.inv(X.T <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">@</span> X)))</span>
<span id="cb12-12">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> c, se, dof</span>
<span id="cb12-13"></span>
<span id="cb12-14"></span>
<span id="cb12-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> heat(D, P, include_still<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb12-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Table 1's corrected N_Nu against N_Re^(1/2): free and fixed-intercept fits,</span></span>
<span id="cb12-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the released Reynolds exponent, and the goodness of fit against null baselines."""</span></span>
<span id="cb12-18">    still, t1f, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> split(D, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>])</span>
<span id="cb12-19">    A2, Kaq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aqueous_collapsed_coefficient"</span>]</span>
<span id="cb12-20">    sq, Nu, Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1f.sqRe.to_numpy(), t1f.Nu_corrected.to_numpy(), t1f.Re.to_numpy()</span>
<span id="cb12-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> include_still:                                  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a defect: the still-air row joins</span></span>
<span id="cb12-22">        sq, Nu, Re <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.r_[sq, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>], np.r_[Nu, still.Nu_apparent], np.r_[Re, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>]</span>
<span id="cb12-23">    (a, b), se, dof <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(sq, Nu)</span>
<span id="cb12-24">    b_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A2)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># intercept held at 2.0</span></span>
<span id="cb12-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the Reynolds exponent released: N_Nu = 2.0 + K Re^q, (K, q) fitted to the n rows</span></span>
<span id="cb12-26">    (Kq, q), cov <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> curve_fit(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> R_, k_, q_: A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> k_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> R_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> q_, Re, Nu,</span>
<span id="cb12-27">                             p0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[Kaq, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>]])</span>
<span id="cb12-28">    nulls <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"constant N_Nu (the mean)"</span>: np.full_like(Nu, Nu.mean()),</span>
<span id="cb12-29">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the intercept alone, N_Nu = 2.0"</span>: np.full_like(Nu, A2),</span>
<span id="cb12-30">             <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"no intercept, N_Nu = 0.54 Re^(1/2)"</span>: Kaq <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sq}</span>
<span id="cb12-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_free"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(a), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_slope_free"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(b),</span>
<span id="cb12-32">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_se"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(se[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dof"</span>: dof, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_n"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Nu),</span>
<span id="cb12-33">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_slope_at_A2"</span>: b_fixed,</span>
<span id="cb12-34">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered"</span>: b_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pr_implied(P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>],</span>
<span id="cb12-35">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered_dev_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (b_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pr_implied(P) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>]</span>
<span id="cb12-36">                                                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_coefficient_K"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb12-37">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_fitted"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(q),</span>
<span id="cb12-38">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_se"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb12-39">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_t"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(cov[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb12-40">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_eq24_rms_pct"</span>: rms_pct(nu_corr(Re, P), Nu),</span>
<span id="cb12-41">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_eq24_max_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pct(nu_corr(Re, P), Nu)))),</span>
<span id="cb12-42">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_freefit_rms_pct"</span>: rms_pct(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sq, Nu),</span>
<span id="cb12-43">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_null_best_rms_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(rms_pct(v, Nu) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> nulls.values()),</span>
<span id="cb12-44">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_nulls"</span>: {k: rms_pct(v, Nu) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> nulls.items()}}</span>
<span id="cb12-45"></span>
<span id="cb12-46"></span>
<span id="cb12-47">HT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> heat(D0, P0)</span>
<span id="cb12-48">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> HT.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb12-49">A2_, K_FIT, K_AQ, N_RE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>], P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_coefficient_K"</span>],</span>
<span id="cb12-50">                          P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aqueous_collapsed_coefficient"</span>], P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>])</span>
<span id="cb12-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Table 1, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> forced-convection runs, N_Nu (corrected) against N_Re^(1/2)"</span>)</span>
<span id="cb12-52"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  free two-parameter fit : N_Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_intercept_free'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb12-53">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(+- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_intercept_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_slope_free'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Re^(1/2)"</span></span>
<span id="cb12-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   [n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_dof'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> dof]"</span>)</span>
<span id="cb12-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  intercept held at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   : N_Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_slope_at_A2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Re^(1/2)"</span>)</span>
<span id="cb12-56"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  eq. (24) as printed    : N_Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> + </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_AQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Re^(1/2)"</span>)</span>
<span id="cb12-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  so the coefficient these rows give, taken back through Pr^(1/3), is "</span></span>
<span id="cb12-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"K = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_K_recovered'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against the printed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_FIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb12-59">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_K_recovered'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %)"</span>)</span>
<span id="cb12-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Reynolds exponent released (K and q fitted to the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, intercept held"</span></span>
<span id="cb12-61">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">):"</span>)</span>
<span id="cb12-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  q = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_Re_exponent_fitted'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_Re_exponent_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb12-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"against the assumed </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_RE<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_Re_exponent_t'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> standard errors"</span></span>
<span id="cb12-64">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_dof'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> dof, two-sided 5 % point </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>student_t<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.975</span>, HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_dof'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb12-65"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  eq. (24) against the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows : rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_eq24_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, "</span></span>
<span id="cb12-66">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_eq24_max_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %   [IN-SAMPLE]"</span>)</span>
<span id="cb12-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  free two-parameter fit       : rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_freefit_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb12-68"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_nulls"</span>].items():</span>
<span id="cb12-69">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  null: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>name<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:36s}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Table 1, 18 forced-convection runs, N_Nu (corrected) against N_Re^(1/2)
  free two-parameter fit : N_Nu = 2.0582 (+- 0.0538) + 0.5361 Re^(1/2)   [n = 18, 16 dof]
  intercept held at 2   : N_Nu = 2 + 0.5418 Re^(1/2)
  eq. (24) as printed    : N_Nu = 2 + 0.54 Re^(1/2)
  so the coefficient these rows give, taken back through Pr^(1/3), is K = 0.6020 against the printed 0.6 (+0.34 %)

  Reynolds exponent released (K and q fitted to the 18 rows, intercept held at 2):
  q = 0.4933 +- 0.0079 against the assumed 0.5, -0.84 standard errors (16 dof, two-sided 5 % point 2.12)

  eq. (24) against the 18 rows : rms 1.716 %, worst 3.654 %   [IN-SAMPLE]
  free two-parameter fit       : rms 1.457 %
  null: constant N_Nu (the mean)             rms  49.88 %
  null: the intercept alone, N_Nu = 2.0      rms  65.64 %
  null: no intercept, N_Nu = 0.54 Re^(1/2)   rms  39.81 %</code></pre>
</div>
</div>
<p>Three things to take from that.</p>
<p>The coefficient these 18 rows give, taken back through the paper’s own Prandtl number, is <strong>0.6020</strong> against the printed 0.60, +0.34 %. Table 1 alone reproduces the constant the authors fitted to four tables.</p>
<p>Released (the coefficient and the exponent fitted together, the intercept held at 2.0), the Reynolds exponent comes out <strong>0.4933 ± 0.0079</strong> against Froessling’s assumed 1/2, 0.84 standard errors away. So of the two assumed exponents, the one on <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> <em>is</em> supported by these data. The one on <img src="https://latex.codecogs.com/png.latex?N_%7BPr%7D"> <strong>cannot be identified from the transcribed tables</strong>: every heat-transfer run in Tables 1, 2 and 3 is in air, so <img src="https://latex.codecogs.com/png.latex?N_%7BPr%7D%5E%7B1/3%7D"> is a constant absorbed into the 0.60. That is stated here, not buried: it is the exponent a reader is most likely to assume was measured.</p>
<p>Part II does test it, and this page does not. Figure 12’s legend, under <strong>HEAT TRANSFER DATA</strong>, lists <code>AIR TO WATER (PRESENT WORK)</code>, <code>STEEL TO OIL (17)</code>, <code>STEEL TO WATER (17)</code> and <code>STEEL TO AIR (17)</code>: Kramers’s spheres in oil and in water, i.e.&nbsp;non-air Prandtl numbers, plotted on the <img src="https://latex.codecogs.com/png.latex?N_%7BPr%7D%5E%7B1/3%7DN_%7BRe%7D%5E%7B1/2%7D"> abscissa; and folio 174 concludes that “the over-all success of this correlation gives credence to the values of the exponents on <img src="https://latex.codecogs.com/png.latex?N_%7BPr%7D">, <img src="https://latex.codecogs.com/png.latex?N_%7BSc%7D">, and <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D">”. That test is <strong>graphical</strong>, it lives in a figure this page deliberately does not digitise, and so it is neither reproduced nor contradicted here. The honest statement is: <em>untested by anything transcribed on this page; tested graphically in the paper’s own Figure 12.</em></p>
<p>And the fit is worth something: 1.72 % rms against a best null of 39.8 %.</p>
</section>
<section id="mass-transfer-where-the-intercept-stops-working" class="level3">
<h3 class="anchored" data-anchor-id="mass-transfer-where-the-intercept-stops-working">Mass transfer: where the intercept stops working</h3>
<div id="2586aea3" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.803993Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.803864Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.821242Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.820479Z&quot;}}" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb14-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># MASS TRANSFER. Two species, and they do not agree about the intercept.</span></span>
<span id="cb14-2"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> ratio_bracket(row, s_row):</span>
<span id="cb14-3">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""N_Nu'/N_Nu of one Table 4 row, low and high ends from the printed rounding."""</span></span>
<span id="cb14-4">    hp, ha <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_unit(s_row.Nu_prime), half_unit(s_row.Nu_apparent)</span>
<span id="cb14-5">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> ((row.Nu_prime <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> hp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (row.Nu_apparent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> ha),</span>
<span id="cb14-6">            (row.Nu_prime <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> hp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (row.Nu_apparent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> ha))</span>
<span id="cb14-7"></span>
<span id="cb14-8"></span>
<span id="cb14-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> mass(D, P, heat_out):</span>
<span id="cb14-10">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Free and fixed-intercept fits of N_Nu' for water (Table 1) and benzene (Table 4),</span></span>
<span id="cb14-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the intercepts against the theoretical 2.0 in standard errors, and Table 4's ratio</span></span>
<span id="cb14-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    identity on runs 10-12."""</span></span>
<span id="cb14-13">    _, t1f, t4, ok <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> split(D, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>])</span>
<span id="cb14-14">    A2, m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>]</span>
<span id="cb14-15">    sqm, Nup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1f.sqRe.to_numpy()[ok], t1f.Nu_prime.to_numpy()[ok]</span>
<span id="cb14-16">    sqb, Nub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4.sqRe.to_numpy(), t4.Nu_prime.to_numpy()</span>
<span id="cb14-17">    (am, bm), sem, dofm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(sqm, Nup)</span>
<span id="cb14-18">    (ab, bb), seb, dofb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(sqb, Nub)</span>
<span id="cb14-19">    bm_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sqm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Nup <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A2)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sqm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb14-20">    bb_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sqb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (Nub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A2)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(sqb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>))</span>
<span id="cb14-21">    ah, seh, dofh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> heat_out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_free"</span>], heat_out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_se"</span>], heat_out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dof"</span>]</span>
<span id="cb14-22">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_free"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(am), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_slope_free"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bm),</span>
<span id="cb14-23">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_se"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(sem[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb14-24">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_free"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ab), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_slope_free"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bb),</span>
<span id="cb14-25">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_se"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(seb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb14-26">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_dev_water_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb14-27">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_dev_benzene_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb14-28">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_dev_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ah <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb14-29">           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># (intercept - 2.0)/standard error: Student t with n - 2 dof under "it is 2.0"</span></span>
<span id="cb14-30">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_water"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sem[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb14-31">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_benzene"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((ab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> seb[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]),</span>
<span id="cb14-32">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_t"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((ah <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> A2) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> seh),</span>
<span id="cb14-33">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dof"</span>: {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat"</span>: dofh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"water"</span>: dofm, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"benzene"</span>: dofb},</span>
<span id="cb14-34">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_n"</span>: {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat"</span>: dofh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"water"</span>: dofm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"benzene"</span>: dofb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>},</span>
<span id="cb14-35">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_fixed"</span>: (bm_fixed, bb_fixed), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_sq"</span>: (sqm, Nup, sqb, Nub),</span>
<span id="cb14-36">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sc_ratio_benzene_over_water"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((bb_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> bm_fixed) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> m)),</span>
<span id="cb14-37">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_fit_resid_rms_pct"</span>: rms_pct(am <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> bm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sqm, Nup),</span>
<span id="cb14-38">           <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># N_Nu' ~ 1/D_v: the factor on D_v that moves the water intercept onto 2.0</span></span>
<span id="cb14-39">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dv_factor_from_intercept"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> am)}</span>
<span id="cb14-40">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Table 4 runs 10, 11 and 12: one pressure, temperatures within 0.2 K, so their</span></span>
<span id="cb14-41">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># N_Nu'/N_Nu ratios (both from the SAME measured rate) must be one number.</span></span>
<span id="cb14-42">    trio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4[t4.run.isin([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>])]</span>
<span id="cb14-43">    ratio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (trio.Nu_prime <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> trio.Nu_apparent).to_numpy()</span>
<span id="cb14-44">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_ratio_spread_runs_10_12_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.ptp(ratio) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ratio.mean())</span>
<span id="cb14-45">    s4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4s"</span>].set_index(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"run"</span>)</span>
<span id="cb14-46">    b10 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ratio_bracket(t4[t4.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], s4.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10"</span>])</span>
<span id="cb14-47">    b12 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ratio_bracket(t4[t4.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], s4.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"12"</span>])</span>
<span id="cb14-48">    r_lo, r_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(b10[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], b12[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(b10[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], b12[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb14-49">    row11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t4[t4.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb14-50">    h11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_unit(s4.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>].Nu_apparent)</span>
<span id="cb14-51">    out.update(t4_run11_Nuprime_upper_bound<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((row11.Nu_apparent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> h11) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_hi),</span>
<span id="cb14-52">               t4_run11_Nuprime_lower_bound<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>((row11.Nu_apparent <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> h11) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_lo),</span>
<span id="cb14-53">               _r_lo<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r_lo, _r_hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>r_hi, _ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>ratio, _trio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>trio, _nu11<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(row11.Nu_apparent))</span>
<span id="cb14-54">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the reading 10.6 for run 11, carried through the same fit and the same spread</span></span>
<span id="cb14-55">    alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Nub.copy()</span>
<span id="cb14-56">    alt[t4.run.to_numpy() <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ALT_RUN11</span>
<span id="cb14-57">    (ab_alt, bb_alt), _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ols(sqb, alt)</span>
<span id="cb14-58">    r_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([ratio[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], ALT_RUN11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> row11.Nu_apparent, ratio[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]])</span>
<span id="cb14-59">    out.update(t4_run11_alt_intercept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(ab_alt), _bb_alt<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(bb_alt),</span>
<span id="cb14-60">               t4_run11_alt_intercept_drift_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ab_alt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb14-61">               t4_run11_alt_ratio_spread_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.ptp(r_alt) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r_alt.mean()),</span>
<span id="cb14-62">               t4_run11_alt_outside_bracket_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ALT_RUN11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> row11.Nu_apparent</span>
<span id="cb14-63">                                                             <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> r_hi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb14-64">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb14-65"></span>
<span id="cb14-66"></span>
<span id="cb14-67">ALT_RUN11 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.6</span>            <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the other reading of run 11's degraded last glyph</span></span>
<span id="cb14-68">MS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass(D0, P0, HT)</span>
<span id="cb14-69">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MS.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb14-70">crit <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(student_t.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.975</span>, d)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dof"</span>].items()}</span>
<span id="cb14-71"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N_Nu' extrapolated to N_Re = 0 by the SAME free two-parameter fit, against the"</span>)</span>
<span id="cb14-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"theoretical intercept </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; t = (intercept - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) / standard error:</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-73"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lab, key, a_, se_, t_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (</span>
<span id="cb14-74">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat,    water,  Table 1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_free"</span>], A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_se"</span>],</span>
<span id="cb14-75">         A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_t"</span>]),</span>
<span id="cb14-76">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass,    water,  Table 1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"water"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_free"</span>], A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_se"</span>],</span>
<span id="cb14-77">         A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_water"</span>]),</span>
<span id="cb14-78">        (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass,  benzene,  Table 4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"benzene"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_free"</span>],</span>
<span id="cb14-79">         A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_se"</span>], A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_benzene"</span>])):</span>
<span id="cb14-80">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n'</span>][key]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> runs, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_dof'</span>][key]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> dof): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>a_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>se_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb14-81">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(a_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A2_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %), t = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, two-sided 5 % point </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>crit[key]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-82"></span>
<span id="cb14-83">bm_fixed, bb_fixed <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_fixed"</span>]</span>
<span id="cb14-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  slopes at fixed intercept: water </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bm_fixed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, benzene </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bb_fixed<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  through the assumed 1/3 that is a Schmidt-number ratio of "</span></span>
<span id="cb14-86">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sc_ratio_benzene_over_water'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (benzene/water in air)"</span>)</span>
<span id="cb14-87"></span>
<span id="cb14-88"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># THE ONE DEGRADED GLYPH IN TABLE 4, SETTLED BY THE TABLE'S OWN ARITHMETIC.</span></span>
<span id="cb14-89"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Both printed transfer numbers of Table 4 come from the SAME measured evaporation</span></span>
<span id="cb14-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rate (N_Nu from the heat balance, N_Nu' from eq. (16)), so their ratio is</span></span>
<span id="cb14-91"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># rate-independent and depends only on the printed air temperature, drop temperature</span></span>
<span id="cb14-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and pressure. Runs 10, 11 and 12 are printed within 0.2 K and at one pressure, so</span></span>
<span id="cb14-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># their three ratios have to be the same number.</span></span>
<span id="cb14-94">trio <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_trio"</span>]</span>
<span id="cb14-95"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Table 4 runs 10-12, air </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>trio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>trio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C,"</span></span>
<span id="cb14-96">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f" drop </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>trio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>drop_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>trio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>drop_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C, "</span></span>
<span id="cb14-97">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>trio<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>press_mmHg<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> mm Hg:"</span>)</span>
<span id="cb14-98"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> trio.iterrows():</span>
<span id="cb14-99">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  run </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(r.run)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:2d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: N_Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Nu_apparent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, N_Nu' = "</span></span>
<span id="cb14-100">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Nu_prime<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, ratio </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Nu_prime<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>r<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Nu_apparent<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb14-101"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  spread </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_ratio_spread_runs_10_12_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % across the three"</span>)</span>
<span id="cb14-102"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the rounding brackets of runs 10 and 12 intersect in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_r_lo'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb14-103">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_r_hi'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">], which puts"</span>)</span>
<span id="cb14-104"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  run 11's N_Nu' in [</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_run11_Nuprime_lower_bound'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, "</span></span>
<span id="cb14-105">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_run11_Nuprime_upper_bound'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">] against a printed N_Nu of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_nu11'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb14-106"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  The first two glyphs read '10.' unambiguously and the last is 17 px wide,"</span>)</span>
<span id="cb14-107"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  the width of this column's round digits (16-18) and not of its 1s (10-12),"</span>)</span>
<span id="cb14-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  so the value is 10.0. The reading </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALT_RUN11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> would need a ratio of "</span></span>
<span id="cb14-109">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALT_RUN11<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_nu11'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb14-110"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_run11_alt_outside_bracket_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % outside the bracket."</span>)</span>
<span id="cb14-111"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  Had </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>ALT_RUN11<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> been kept: intercept </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_benzene_intercept_free'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb14-112">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_run11_alt_intercept'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, slope </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_benzene_slope_free'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> -&gt; "</span></span>
<span id="cb14-113">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_bb_alt'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">,"</span>)</span>
<span id="cb14-114"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  a drift of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_run11_alt_intercept_drift_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %; the ratio spread would go "</span></span>
<span id="cb14-115">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_ratio_spread_runs_10_12_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % -&gt; </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t4_run11_alt_ratio_spread_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>N_Nu' extrapolated to N_Re = 0 by the SAME free two-parameter fit, against the
theoretical intercept 2; t = (intercept - 2) / standard error:

  heat,    water,  Table 1 (18 runs, 16 dof): 2.0582 +- 0.0538 ( +2.91 %), t = +1.08, two-sided 5 % point 2.12
  mass,    water,  Table 1 (15 runs, 13 dof): 1.7322 +- 0.0870 (-13.39 %), t = -3.08, two-sided 5 % point 2.16
  mass,  benzene,  Table 4 (13 runs, 11 dof): 2.0523 +- 0.1245 ( +2.61 %), t = +0.42, two-sided 5 % point 2.20

  slopes at fixed intercept: water 0.5286, benzene 0.7466
  through the assumed 1/3 that is a Schmidt-number ratio of 2.818 (benzene/water in air)

Table 4 runs 10-12, air 20-20.2 C, drop -1.1--1 C, 733 mm Hg:
  run 10: N_Nu =  7.1, N_Nu' =   8.9, ratio 1.2535
  run 11: N_Nu =  7.9, N_Nu' =  10.0, ratio 1.2658
  run 12: N_Nu =  8.7, N_Nu' =  10.9, ratio 1.2529
  spread 1.03 % across the three
  the rounding brackets of runs 10 and 12 intersect in [1.2400, 1.2659], which puts
  run 11's N_Nu' in [9.73, 10.06] against a printed N_Nu of 7.9.
  The first two glyphs read '10.' unambiguously and the last is 17 px wide,
  the width of this column's round digits (16-18) and not of its 1s (10-12),
  so the value is 10.0. The reading 10.6 would need a ratio of 1.3418,
  6.0 % outside the bracket.

  Had 10.6 been kept: intercept 2.0523 -&gt; 2.0222, slope 0.7411 -&gt; 0.7510,
  a drift of 1.5 %; the ratio spread would go 1.03 % -&gt; 6.93 %.</code></pre>
</div>
</div>
<p><strong>This is the page’s headline.</strong> The same free two-parameter fit, applied to three sets of runs from the same apparatus, with the standard error of each intercept from the fit’s own residual scatter and <img src="https://latex.codecogs.com/png.latex?t"> = (intercept - 2.0)/standard error:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th>set</th>
<th>runs</th>
<th>intercept at <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D=0"></th>
<th>deviation from 2.0</th>
<th><img src="https://latex.codecogs.com/png.latex?t"></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>heat, water (Table 1)</td>
<td>18</td>
<td><strong>2.0582</strong> ± 0.0538</td>
<td>+2.9 %</td>
<td>+1.08</td>
</tr>
<tr class="even">
<td>mass, benzene (Table 4)</td>
<td>13</td>
<td><strong>2.0523</strong> ± 0.1245</td>
<td>+2.6 %</td>
<td>+0.42</td>
</tr>
<tr class="odd">
<td>mass, water (Table 1)</td>
<td>15</td>
<td><strong>1.7322</strong> ± 0.0870</td>
<td><strong>-13.4 %</strong></td>
<td><strong>-3.08</strong></td>
</tr>
</tbody>
</table>
<p>Two of the three are consistent with the constant the paper derived rather than fitted, each inside the two-sided 5 % points of Student’s <img src="https://latex.codecogs.com/png.latex?t"> for its degrees of freedom, and they are the two that share nothing except the apparatus: a heat measurement and a mass measurement, water and benzene, the authors’ own conductivity and someone else’s diffusivity. The third misses by -13.4 %, beyond the 5 % point for its 13 degrees of freedom, and the next cell shows the paper’s own still-air mass-transfer measurement low in the same direction.</p>
<p><strong>The one degraded digit in Table 4, and why it is not decided by looking at it.</strong> The cell above settles run 11’s <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> from Table 4’s own arithmetic rather than from the film. Both printed transfer numbers of that table are reduced from the same measured evaporation rate, so their ratio is rate-independent and depends only on the printed air temperature, drop temperature and pressure, and runs 10, 11 and 12 are printed within 0.2 K of one another at one pressure. Runs 10 and 12 therefore bracket run 11’s <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> in <strong>[9.73, 10.06]</strong>; the first two glyphs read “10.” and the last is as wide as this column’s round digits and not as narrow as its 1s; so the value is <strong>10.0</strong>. The three ratios then agree to 1.03 %.</p>
<p>This matters as a method point, not only as a digit. The reading 10.6, from the counter position of a three-pixel white hole, moves the benzene intercept to 2.0222, a drift of 1.5 %: well inside any 5 % regression tolerance. The ratio spread goes from 1.03 % to <strong>6.93 %</strong>, which is why it is a claim in its own right with its own break row.</p>
<p>The Schmidt exponent is worth a sentence of its own. Benzene is the only second species in either part, so it is the only thing that touches the <img src="https://latex.codecogs.com/png.latex?1/3"> at all: the two fitted slopes map onto a Schmidt-number ratio of <strong>2.82</strong> (benzene/water in air). That is a <em>consequence</em> of assuming the exponent, not a test of it: closing it would need the two diffusivities, which the papers print only in Figure 5. One species pair cannot separate a coefficient from an exponent, and this page does not pretend otherwise.</p>
</section>
<section id="the-still-air-row-and-the-analogy-the-correlation-asserts" class="level3">
<h3 class="anchored" data-anchor-id="the-still-air-row-and-the-analogy-the-correlation-asserts">The still-air row, and the analogy the correlation asserts</h3>
<div id="858aeeea" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.823022Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.822842Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.834683Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.833867Z&quot;}}" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb16-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The paper's OWN measurement at N_Re = 0, from Fig. 8's D_p^2-vs-time slope</span></span>
<span id="cb16-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># through eqs. (19) and (20). These are the numbers the correlation's 2.0 is</span></span>
<span id="cb16-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># supposed to be.</span></span>
<span id="cb16-4">REPLICATES <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t2"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t2"</span>, (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)))</span>
<span id="cb16-5">REP_COLS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"evap_rate_ml_s_x1e5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_apparent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_corrected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>)</span>
<span id="cb16-6"></span>
<span id="cb16-7"></span>
<span id="cb16-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> still_air(D, P, pairs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>REPLICATES):</span>
<span id="cb16-9">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The still-air pair against the theoretical 2.0, the diffusivity factor that</span></span>
<span id="cb16-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    closes the mass side, and the scatter of the paper's replicate pairs."""</span></span>
<span id="cb16-11">    still, _, _, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> split(D, P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>])</span>
<span id="cb16-12">    A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>]</span>
<span id="cb16-13">    nu0, nup0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(still.Nu_apparent), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(still.Nu_prime)</span>
<span id="cb16-14">    reps <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb16-15">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> tab, (i, j) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs:</span>
<span id="cb16-16">        df <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[tab]</span>
<span id="cb16-17">        ri, rj <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> df[df.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> i].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], df[df.run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> j].iloc[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb16-18">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> c <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> REP_COLS:</span>
<span id="cb16-19">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pd.notna(ri[c]) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> pd.notna(rj[c]) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> ri[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>:</span>
<span id="cb16-20">                reps.append(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ri[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rj[c]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (ri[c] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> rj[c])))</span>
<span id="cb16-21">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_Nu_over_theory"</span>: nu0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A2, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_Nuprime_over_theory"</span>: nup0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A2,</span>
<span id="cb16-22">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_analogy_ratio"</span>: nu0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> nup0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dv_used_over_dv_backed_out"</span>: A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> nup0,</span>
<span id="cb16-23">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"replicate_worst_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(reps)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"replicate_mean_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(reps)),</span>
<span id="cb16-24">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_n_reps"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(reps), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_nu0"</span>: nu0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_nup0"</span>: nup0}</span>
<span id="cb16-25"></span>
<span id="cb16-26"></span>
<span id="cb16-27">SA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> still_air(D0, P0)</span>
<span id="cb16-28">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> SA.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb16-29">nu0, nup0 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> SA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_nu0"</span>], SA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_nup0"</span>]</span>
<span id="cb16-30"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"still air, measured : N_Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nu0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(nu0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb16-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"                      N_Nu' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>nup0<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(nup0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A2_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb16-32"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">eqs. (21) and (22) assert N_Nu = N_Nu' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> at N_Re = 0, i.e. a ratio of exactly 1."</span>)</span>
<span id="cb16-33"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"The paper's own still-air pair gives </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'stillair_analogy_ratio'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb16-34"></span>
<span id="cb16-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># What the diffusivity would have to be. N_Nu' is inversely proportional to D_v,</span></span>
<span id="cb16-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># so this is a statement about D_v and the paper makes it itself.</span></span>
<span id="cb16-37">DV_BACK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dv_backed_out_cm2_s"</span>]</span>
<span id="cb16-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">N_Nu' ~ 1/D_v, so forcing N_Nu' = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> on the still-air run needs a D_v "</span></span>
<span id="cb16-39">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"smaller by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dv_used_over_dv_backed_out'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb16-40"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"That is the </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DV_BACK<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> sq.cm/sec the paper prints, and calls "</span></span>
<span id="cb16-41">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"'a low value compared with other methods of determination'."</span>)</span>
<span id="cb16-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Implied D_v behind Table 1's mass column: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>DV_BACK<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dv_used_over_dv_backed_out'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb16-43">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"sq.cm/sec (an inference from two printed numbers, not a printed value)."</span>)</span>
<span id="cb16-44"></span>
<span id="cb16-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># How big is 10 %? The only repeatability either part offers, and the scatter of</span></span>
<span id="cb16-46"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the fits themselves, which is what the intercept's standard error is built from.</span></span>
<span id="cb16-47"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Replicate pairs (Table 1 runs 8/9; Table 2 runs 3/4 and 6/7), "</span></span>
<span id="cb16-48">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>SA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n_reps'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> paired quantities:"</span>)</span>
<span id="cb16-49"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  mean disagreement </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'replicate_mean_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'replicate_worst_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb16-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the water mass fit's own residual scatter is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_mass_fit_resid_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % rms,"</span>)</span>
<span id="cb16-51"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_mass_fit_resid_rms_pct'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'replicate_mean_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> times the replicate mean; "</span></span>
<span id="cb16-52">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the intercept's standard error,"</span>)</span>
<span id="cb16-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_mass_intercept_se'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_mass_intercept_se'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">), "</span></span>
<span id="cb16-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"is built from that scatter and from the"</span>)</span>
<span id="cb16-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  extrapolation to N_Re = 0, so the water deficit is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'mass_intercept_t_water'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> "</span></span>
<span id="cb16-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"standard errors, not a multiple of the replicate scatter."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>still air, measured : N_Nu = 2.23  (+11.5 % on 2)
                      N_Nu' = 1.79  (-10.5 % on 2)

eqs. (21) and (22) assert N_Nu = N_Nu' = 2 at N_Re = 0, i.e. a ratio of exactly 1.
The paper's own still-air pair gives 1.2458.

N_Nu' ~ 1/D_v, so forcing N_Nu' = 2 on the still-air run needs a D_v smaller by 1.1173.
That is the 0.204 sq.cm/sec the paper prints, and calls 'a low value compared with other methods of determination'.
Implied D_v behind Table 1's mass column: 0.22793 sq.cm/sec (an inference from two printed numbers, not a printed value).

Replicate pairs (Table 1 runs 8/9; Table 2 runs 3/4 and 6/7), 12 paired quantities:
  mean disagreement 0.68 %, worst 1.87 %
  the water mass fit's own residual scatter is 1.44 % rms,
  2.1 times the replicate mean; the intercept's standard error,
  0.0870 (4.4 % of 2), is built from that scatter and from the
  extrapolation to N_Re = 0, so the water deficit is 3.1 standard errors, not a multiple of the replicate scatter.</code></pre>
</div>
</div>
<p>At <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D=0"> eqs. (21) and (22) are the same equation, so the paper’s own still-air pair should have a ratio of exactly 1. It is <strong>1.2458</strong>, against a run-to-run repeatability of 0.68 % mean and 1.87 % worst, measured on the paper’s three replicate pairs.</p>
<p>The paper explains the heat side itself: at <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D=0"> free convection is present and lifts <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> above 2.0. That explanation survives here, and gains support it did not have: the <em>forced</em>-convection runs extrapolate to 2.0582, consistent with 2.0, so the excess is a still-air effect and not a bias in the heat measurement.</p>
<p>The mass side is not a still-air effect: the forced-convection runs carry it too (1.7322). Here the authors give the cause but not the size. Their list of “factors which may have contributed to errors in the data and anomalies in the heat- and mass-transfer analogy” opens with “inaccurate values of diffusivity”, and every ingredient needed to price that is printed. <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'%5Cpropto%201/D_v">, so the still-air row needs a diffusivity smaller by 1.117, and Part II prints exactly that number (0.204 sq.cm/sec at 290 K and 741 mm Hg) as what the still-air data give <em>if</em> <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'=2.0"> is imposed, and calls it low against other determinations; the forced-convection intercept needs a factor of 1.155. Part I says its calculated water-vapour diffusivities are “approximately 10 per cent lower than that indicated by the S.T.P. value given by the International Critical Tables”.</p>
<p>What is not in either part is the arithmetic, and with it, the conflict. The authors’ own bound on the anomaly is “always less than 10 per cent at a given <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D">”, which is a statement about the two <em>curves</em>, where the fitted 0.60 absorbs most of the offset; at the intercept, where nothing was fitted, the gap is -13.4 %, 3.08 standard errors. The yardstick is the intercept’s standard error, not the replicate scatter: the water fit’s own residual scatter is 1.44 % rms, about twice the replicate mean, and the extrapolation to <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D=0"> widens it further. And where they conclude on folio 174 that the correlation’s success implies their calculated <img src="https://latex.codecogs.com/png.latex?D_v"> “may be more accurate than any reported in the literature”, the intercept says that same <img src="https://latex.codecogs.com/png.latex?D_v"> is 1.155 too large. Both readings cannot stand; this page does not claim to say which is right, only that the paper’s own tables decide against the stronger of the two published claims.</p>
</section>
<section id="table-3-the-high-temperature-rows-and-what-they-cost-the-correlation" class="level3">
<h3 class="anchored" data-anchor-id="table-3-the-high-temperature-rows-and-what-they-cost-the-correlation">Table 3: the high-temperature rows, and what they cost the correlation</h3>
<div id="072186b1" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.836097Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.835968Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:22.850448Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:22.849672Z&quot;}}" data-execution_count="10">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb18-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># TABLE 3: the only high-temperature transfer data in either part, and the only</span></span>
<span id="cb18-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># table that prints the correlation's abscissa, so it can be evaluated with no</span></span>
<span id="cb18-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># property data whatsoever.</span></span>
<span id="cb18-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> table3(D, P, heat_out):</span>
<span id="cb18-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Eq. (21) on Table 3's printed abscissa, and the two within-pair identities.</span></span>
<span id="cb18-6"></span>
<span id="cb18-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    Table 3's nine rows are FOUR motion-picture runs read at two drop diameters</span></span>
<span id="cb18-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    (pairs A-D) plus one single row (E, skipped). Within a pair only D_p moves, so</span></span>
<span id="cb18-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    the abscissa scales as D_p^(1/2) and N_Nu as the printed -dD_p^2/dtau. Each</span></span>
<span id="cb18-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    identity's printing allowance is the sum of the relative half-units of the</span></span>
<span id="cb18-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    printed numbers it uses (read as strings)."""</span></span>
<span id="cb18-12">    d3, s3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>], D[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3s"</span>]</span>
<span id="cb18-13">    X3, Nu3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d3.Re_half_Pr_third.to_numpy(), d3.Nu.to_numpy()</span>
<span id="cb18-14">    model <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nu_from_abscissa(X3, P)</span>
<span id="cb18-15">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_rms_pct"</span>: rms_pct(model, Nu3),</span>
<span id="cb18-16">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_max_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(pct(model, Nu3)))),</span>
<span id="cb18-17">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_bias_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.mean(pct(model, Nu3))),</span>
<span id="cb18-18">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_bias_se_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.std(pct(model, Nu3), ddof<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(Nu3))),</span>
<span id="cb18-19">           <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_from_t1_rms_pct"</span>: rms_pct(nu_from_abscissa(X3, P, Kc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>heat_out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered"</span>]),</span>
<span id="cb18-20">                                         Nu3)}</span>
<span id="cb18-21">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_over_t1_rms_factor"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_rms_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> heat_out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_eq24_rms_pct"</span>]</span>
<span id="cb18-22">    A2, Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_coefficient_K"</span>]</span>
<span id="cb18-23">    rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb18-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> g, d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d3.groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"motion_picture_pair"</span>):</span>
<span id="cb18-25">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(d) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>:</span>
<span id="cb18-26">            <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span></span>
<span id="cb18-27">        ih, il <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.index[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], d.index[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb18-28">        hi, lo, sh, sl <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> d.loc[ih], d.loc[il], s3.loc[ih], s3.loc[il]</span>
<span id="cb18-29">        hrel <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> s, col, x: half_unit(s[col]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> x</span>
<span id="cb18-30">        rx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hi.Re_half_Pr_third <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lo.Re_half_Pr_third</span>
<span id="cb18-31">        rdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(hi.D_p_corresponding_cm <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lo.D_p_corresponding_cm)</span>
<span id="cb18-32">        ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (hrel(sh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_half_Pr_third"</span>, hi.Re_half_Pr_third)</span>
<span id="cb18-33">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> hrel(sl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re_half_Pr_third"</span>, lo.Re_half_Pr_third)</span>
<span id="cb18-34">              <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (hrel(sh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_p_corresponding_cm"</span>, hi.D_p_corresponding_cm)</span>
<span id="cb18-35">                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> hrel(sl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_p_corresponding_cm"</span>, lo.D_p_corresponding_cm)))</span>
<span id="cb18-36">        rn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hi.Nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lo.Nu</span>
<span id="cb18-37">        rd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hi.neg_dDp2_dtau_cm2_s_x1e4 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> lo.neg_dDp2_dtau_cm2_s_x1e4</span>
<span id="cb18-38">        a_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> hrel(sh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu"</span>, hi.Nu) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> hrel(sl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu"</span>, lo.Nu)</span>
<span id="cb18-39">        an <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> a_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> (hrel(sh, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"neg_dDp2_dtau_cm2_s_x1e4"</span>, hi.neg_dDp2_dtau_cm2_s_x1e4)</span>
<span id="cb18-40">                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> hrel(sl, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"neg_dDp2_dtau_cm2_s_x1e4"</span>, lo.neg_dDp2_dtau_cm2_s_x1e4))</span>
<span id="cb18-41">        rp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> hi.Re_half_Pr_third) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lo.Re_half_Pr_third)</span>
<span id="cb18-42">        a_pred <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (half_unit(sh.Re_half_Pr_third) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> hi.Re_half_Pr_third)</span>
<span id="cb18-43">                       <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> half_unit(sl.Re_half_Pr_third) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (A2 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Kc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> lo.Re_half_Pr_third))</span>
<span id="cb18-44">        rows.append(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(pair<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>g, rx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rx, rdp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rdp, dev_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (rx <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rdp <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), allow_x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ax,</span>
<span id="cb18-45">                         rn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rn, rd<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>rd, dev_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (rn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> rd <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), allow_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> an,</span>
<span id="cb18-46">                         rp<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rp), d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (rn <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(rp) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb18-47">                         allow_d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (a_meas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> a_pred), a_meas<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_meas,</span>
<span id="cb18-48">                         a_pred<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> a_pred))</span>
<span id="cb18-49">    pr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(rows)</span>
<span id="cb18-50">    gap_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (pr.allow_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pr.dev_x.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pr.allow_x</span>
<span id="cb18-51">    gap_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (pr.allow_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pr.dev_n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>()) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> pr.allow_n</span>
<span id="cb18-52">    out.update(t3_pair_abscissa_max_dev_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pr.dev_x.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb18-53">               t3_pair_nu_ratio_max_dev_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pr.dev_n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb18-54">               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the N_Nu ratio eq. (21) predicts against the printed one, as a per-cent</span></span>
<span id="cb18-55">               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># difference, not a ratio of logarithms (pair B's abscissa moves only from</span></span>
<span id="cb18-56">               <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2.0 to 2.1, so a log ratio would divide by a two-figure rounding)</span></span>
<span id="cb18-57">               t3_pair_worst_nu_ratio_error_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(pr.d.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()),</span>
<span id="cb18-58">               t3_pair_identities_within_rounding<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>((gap_x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>() <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> (gap_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>).<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>()),</span>
<span id="cb18-59">               _ident_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(gap_x.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(), gap_n.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>().<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>())),</span>
<span id="cb18-60">               _pairs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>pr)</span>
<span id="cb18-61">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb18-62"></span>
<span id="cb18-63"></span>
<span id="cb18-64">T3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table3(D0, P0, HT)</span>
<span id="cb18-65">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> T3.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb18-66">pairs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> T3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_pairs"</span>]</span>
<span id="cb18-67"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"eq. (21) on Table 3's own printed abscissa (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, air "</span></span>
<span id="cb18-68">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>t3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>air_temp_C<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>()<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> C):"</span>)</span>
<span id="cb18-69"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_eq21_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, worst </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_eq21_max_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, "</span></span>
<span id="cb18-70">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"mean bias </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_eq21_bias_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % +- </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_eq21_bias_se_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % "</span></span>
<span id="cb18-71">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(standard error of the mean of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(t3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows)"</span>)</span>
<span id="cb18-72"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  same rows with K refitted on Table 1 alone (K = "</span></span>
<span id="cb18-73">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_K_recovered'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">): rms </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_from_t1_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %"</span>)</span>
<span id="cb18-74"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  against Table 1's own in-sample rms of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_eq24_rms_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %, "</span></span>
<span id="cb18-75">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"a factor </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_over_t1_rms_factor'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-76"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Within-pair identities (same run, two diameters), deviations against the printing allowance:"</span>)</span>
<span id="cb18-77"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pair'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'X ratio'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'sqrt(Dp)'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;9}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'allow'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   "</span></span>
<span id="cb18-78">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Nu ratio'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;8}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'-dDp2'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'dev'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;7}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'allow'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;6}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb18-79"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs.iterrows():</span>
<span id="cb18-80">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;5}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rx<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rdp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:9.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dev_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">% </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>allow_x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">%   "</span></span>
<span id="cb18-81">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:8.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rd<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:7.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>dev_n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+6.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">% </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>allow_n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">%"</span>)</span>
<span id="cb18-82"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  both identities inside their allowance in every pair: "</span></span>
<span id="cb18-83">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t3_pair_identities_within_rounding'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; the table is self-consistent."</span>)</span>
<span id="cb18-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">The N_Nu ratio inside a run, measured against what eq. (21) predicts:"</span>)</span>
<span id="cb18-85"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _, p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> pairs.iterrows():</span>
<span id="cb18-86">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"    pair </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>pair<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: measured </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rn<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, eq. (21) </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rp<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>d<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %  "</span></span>
<span id="cb18-87">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(printing allows </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_meas<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on the measured ratio, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>p<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>a_pred<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % on the "</span></span>
<span id="cb18-88">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"predicted one)"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>eq. (21) on Table 3's own printed abscissa (9 rows, air 85-221 C):
  rms 11.05 %, worst 19.11 %, mean bias +6.44 % +- 3.17 % (standard error of the mean of 9 rows)
  same rows with K refitted on Table 1 alone (K = 0.6020): rms 11.19 %
  against Table 1's own in-sample rms of 1.716 %, a factor 6.4

Within-pair identities (same run, two diameters), deviations against the printing allowance:
   pair   X ratio  sqrt(Dp)     dev  allow   Nu ratio   -dDp2     dev  allow
      A    1.1000    1.0942  +0.53%  2.01%     1.2727  1.2705  +0.17%  2.06%
      B    1.0500    1.0690  -1.78%  5.84%     1.2414  1.2535  -0.97%  4.38%
      C    1.2857    1.2865  -0.06%  2.28%     1.2667  1.2619  +0.38%  4.12%
      D    1.2105    1.2111  -0.04%  3.10%     1.0500  1.0312  +1.82%  5.52%
  both identities inside their allowance in every pair: True; the table is self-consistent.

The N_Nu ratio inside a run, measured against what eq. (21) predicts:
    pair A: measured 1.2727, eq. (21) 1.0677, +19.2 %  (printing allows 1.6 % on the measured ratio, 0.9 % on the predicted one)
    pair B: measured 1.2414, eq. (21) 1.0187, +21.9 %  (printing allows 3.1 % on the measured ratio, 1.9 % on the predicted one)
    pair C: measured 1.2667, eq. (21) 1.1791, +7.4 %  (printing allows 2.0 % on the measured ratio, 1.0 % on the predicted one)
    pair D: measured 1.0500, eq. (21) 1.1121, -5.6 %  (printing allows 2.4 % on the measured ratio, 1.3 % on the predicted one)</code></pre>
</div>
</div>
<p>Table 3 is inside Figure 9 and so inside the fit, and it still comes out at <strong>11.0 % rms and 19.1 % worst</strong>, with a +6.4 % ± 3.2 % mean bias (standard error of the mean of the nine rows), a factor 6.4 on Table 1’s 1.72 % rms. Refitting the coefficient on Table 1’s room-temperature runs alone and predicting Table 3 changes almost nothing (11.2 %), which says the disagreement is not about the constant.</p>
<p>The within-pair identities say where it <em>is</em>. Table 3’s nine rows are <strong>four</strong> motion-picture runs read at two drop diameters each (pairs A-D) <strong>plus one single row</strong> (E, which the pairing loop skips), so within a pair the air velocity, air temperature and drop temperature are held fixed and only <img src="https://latex.codecogs.com/png.latex?D_p"> moves. Both identities that follow, the abscissa scaling as <img src="https://latex.codecogs.com/png.latex?D_p%5E%7B1/2%7D"> and <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> scaling as the printed <img src="https://latex.codecogs.com/png.latex?-%5Cmathrm%7Bd%7DD_p%5E2/%5Cmathrm%7Bd%7D%5Ctau">, hold to 1.78 % and 1.82 %, inside the printing allowance of every pair (the sum of the relative half-units of the printed numbers each ratio uses). The table is self-consistent. What fails is the correlation: inside a single run, at fixed everything-else, the measured <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> ratio differs from what <img src="https://latex.codecogs.com/png.latex?2.0+0.60X"> predicts by up to <strong>21.9 %</strong>, with the measurement the steeper of the two in 3 of the 4 pairs, and every pair’s difference larger than its printing allowance.</p>
<div id="12eefac9" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:22.852335Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:22.852150Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:23.367915Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:23.367200Z&quot;}}" data-execution_count="11">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb20-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Each species goes on the abscissa its OWN free fit implies, which is the only way</span></span>
<span id="cb20-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># to put two Schmidt numbers on one axis without importing a diffusivity that the</span></span>
<span id="cb20-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># papers print only as a figure. The intercepts are unaffected by that choice.</span></span>
<span id="cb20-4">sq, Nu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t1f.sqRe.to_numpy(), t1f.Nu_corrected.to_numpy()</span>
<span id="cb20-5">sqm, Nup, sqb, Nub <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_sq"</span>]</span>
<span id="cb20-6">X3, Nu3 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> t3.Re_half_Pr_third.to_numpy(), t3.Nu.to_numpy()</span>
<span id="cb20-7">a_free, am_free, ab_free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_free"</span>], A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_free"</span>],</span>
<span id="cb20-8">                            A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_free"</span>])</span>
<span id="cb20-9">Xh <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pr_air_implied_by_eq24"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sq   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># heat, water: the paper's own Pr</span></span>
<span id="cb20-10">Xw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_slope_free"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> K_FIT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sqm                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mass, water</span></span>
<span id="cb20-11">Xb <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_slope_free"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> K_FIT) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> sqb                   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mass, benzene</span></span>
<span id="cb20-12"></span>
<span id="cb20-13">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">14.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.5</span>))</span>
<span id="cb20-14">xs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>)</span>
<span id="cb20-15"></span>
<span id="cb20-16">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(xs, nu_from_abscissa(xs, P0), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">21</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">60</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-17">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].axhline(A2_, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"theoretical limit </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-18">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(Xh, Nu, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1, water, 20-25 C air"</span>)</span>
<span id="cb20-19">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(X3, Nu3, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:red"</span>,</span>
<span id="cb20-20">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3, water, 85-221 C air"</span>)</span>
<span id="cb20-21">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, nu0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still air, measured"</span>)</span>
<span id="cb20-22">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_{Re}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{1/2} N_{Pr}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{1/3}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_{Nu}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb20-23">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat transfer"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>))</span>
<span id="cb20-24">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb20-25"></span>
<span id="cb20-26">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(xs, nu_from_abscissa(xs, P0), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"eq</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">22</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">2</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">0</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">.</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">60</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\,</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-27">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].axhline(A2_, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)</span>
<span id="cb20-28">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(Xw, Nup, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1, water"</span>)</span>
<span id="cb20-29">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(Xb, Nub, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4, benzene"</span>)</span>
<span id="cb20-30">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(xs, am_free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xs, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>,</span>
<span id="cb20-31">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free fit, water"</span>)</span>
<span id="cb20-32">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(xs, ab_free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xs, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>,</span>
<span id="cb20-33">           label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free fit, benzene"</span>)</span>
<span id="cb20-34">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, nup0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still air, measured"</span>)</span>
<span id="cb20-35">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_{Sc}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{1/3} N_{Re}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">^</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">{1/2}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> </span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">(</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">each species on its own fitted scale</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">)</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb20-36">          ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_{Nu}'</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass transfer"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>))</span>
<span id="cb20-37">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"upper left"</span>)</span>
<span id="cb20-38"></span>
<span id="cb20-39">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(xs, nu_from_abscissa(xs, P0), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"k-"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb20-40">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].axhline(A2_, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6"</span>, ls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">":"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>)</span>
<span id="cb20-41">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(Xh, Nu, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.6</span>)</span>
<span id="cb20-42">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(Xw, Nup, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"o"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>)</span>
<span id="cb20-43">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(Xb, Nub, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, mfc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>)</span>
<span id="cb20-44">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(xs, a_free  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xs, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>)</span>
<span id="cb20-45">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(xs, am_free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xs, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>)</span>
<span id="cb20-46">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(xs, ab_free <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> xs, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"--"</span>, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>)</span>
<span id="cb20-47">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, nu0,  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>)</span>
<span id="cb20-48">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, nup0, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:orange"</span>)</span>
<span id="cb20-49"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> v, c, lab <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((a_free, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:purple"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat, water"</span>),</span>
<span id="cb20-50">                  (am_free, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:blue"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass, water"</span>),</span>
<span id="cb20-51">                  (ab_free, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tab:green"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass, benzene"</span>)):</span>
<span id="cb20-52">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].plot(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, v, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"x"</span>, ms<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, mew<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>c, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>lab<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.3f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb20-53">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">set</span>(xlabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">X</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>, ylabel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">r"</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_{Nu}</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;"> or </span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">N_{Nu}'</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">$</span><span class="vs" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>,</span>
<span id="cb20-54">          title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the intercept, magnified"</span>, xlim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>), ylim<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb20-55">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>].legend(fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>, loc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lower right"</span>, title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated to $X=0$"</span>,</span>
<span id="cb20-56">             title_fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb20-57">fig.tight_layout()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span> plt.show()</span>
<span id="cb20-58"></span>
<span id="cb20-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Right-hand panel: the three free two-parameter fits extrapolated to X = 0."</span>)</span>
<span id="cb20-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The stars are the paper's own still-air measurements, which are separate"</span>)</span>
<span id="cb20-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"experiments and are NOT in any of the three fits."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.5-ranz-marshall-froessling/index_files/figure-html/cell-12-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
<div class="cell-output cell-output-stdout">
<pre><code>Right-hand panel: the three free two-parameter fits extrapolated to X = 0.
The stars are the paper's own still-air measurements, which are separate
experiments and are NOT in any of the three fits.</code></pre>
</div>
</div>
</section>
</section>
<section id="validation" class="level2">
<h2 class="anchored" data-anchor-id="validation">Validation</h2>
<section id="the-theoretical-2.0-recomputed-and-checked-against-the-exact-answer" class="level3">
<h3 class="anchored" data-anchor-id="the-theoretical-2.0-recomputed-and-checked-against-the-exact-answer">1. The theoretical 2.0, recomputed, and checked against the exact answer</h3>
<p>Part I’s eq. (7) is asserted, not solved, and it is the only constant in the correlation worth solving for. pymrm solves the spherical BVP on a ladder of nested geometric grids, and the orders come from successive differences (<code>pymrm.checks.observed_orders</code>), which need no exact answer. In a shell of outer radius <img src="https://latex.codecogs.com/png.latex?b"> the exact answer is <img src="https://latex.codecogs.com/png.latex?2/(1-a/b)">, so the floor <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D(1-a/b)"> is exactly 2 at every <img src="https://latex.codecogs.com/png.latex?b"> and only the grid needs refining. The series-resistance integral <img src="https://latex.codecogs.com/png.latex?%5Cint_a%5E%5Cinfty%20%5Cmathrm%7Bd%7Dr/4%5Cpi%20r%5E2%20k"> is then evaluated by adaptive quadrature, sharing no grid, no assembly and no linear solve; but <img src="https://latex.codecogs.com/png.latex?2/(4%5Cpi%5Cint_1%5E%5Cinfty%0A%5Cmathrm%7Bd%7Dr/4%5Cpi%20r%5E2)"> is <strong>identically 2</strong> for any working quadrature, so it is the <em>exact</em> answer obtained numerically. What follows is a finite-volume solve measured against the analytic limit, not two independent estimates that happen to agree.</p>
<div id="69fe4405" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:23.370429Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:23.370298Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:23.391784Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:23.391326Z&quot;}}" data-execution_count="12">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb22-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># WHERE THE 2.0 COMES FROM. Part I obtains it from eqs. (1), (2), (5) and (6)</span></span>
<span id="cb22-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># with the fluid at rest: steady conduction (or diffusion) out of a sphere into a</span></span>
<span id="cb22-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># stagnant medium. That is a one-dimensional spherical BVP and it is linear, so</span></span>
<span id="cb22-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pymrm answers it with one sparse solve per grid: construct_div(..., nu=2) for the</span></span>
<span id="cb22-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># spherical geometry, on geometric faces (they nest when the cell count doubles),</span></span>
<span id="cb22-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the surface gradient read with compute_boundary_values.</span></span>
<span id="cb22-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#</span></span>
<span id="cb22-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># In a shell of outer radius b the exact answer is Nu = 2/(1 - a/b), so the floor</span></span>
<span id="cb22-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Nu (1 - a/b) is exactly 2 at every b: the domain size is removed in closed form</span></span>
<span id="cb22-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and only the grid is refined.</span></span>
<span id="cb22-11">RATIO <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e4</span></span>
<span id="cb22-12">NS_COND <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1600</span>)</span>
<span id="cb22-13"></span>
<span id="cb22-14"></span>
<span id="cb22-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> resistance_route(upper<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.inf):</span>
<span id="cb22-16">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The same limit as a series of shell resistances, integral of dr/(4 pi r^2 k)</span></span>
<span id="cb22-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    from a to the far field, by adaptive quadrature. It shares no grid, no assembly</span></span>
<span id="cb22-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    and no linear solve with the finite volumes; for upper = infinity it is exactly</span></span>
<span id="cb22-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    2 for any working quadrature, so it is the exact answer obtained numerically."""</span></span>
<span id="cb22-20">    r_tot, _ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> quad(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> r: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, upper,</span>
<span id="cb22-21">                    epsabs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>, epsrel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-14</span>)</span>
<span id="cb22-22">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> r_tot)</span>
<span id="cb22-23"></span>
<span id="cb22-24"></span>
<span id="cb22-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> conduction_study(P, ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NS_COND, ratio<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RATIO, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, outer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dirichlet"</span>, geometric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>,</span>
<span id="cb22-26">                     upper<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>np.inf):</span>
<span id="cb22-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The stagnant floor on a ladder of nested grids, its Richardson limit, the</span></span>
<span id="cb22-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    surface-against-shell flux identity, and the resistance-integral route."""</span></span>
<span id="cb22-29">    floor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: nu_shell(n, ratio, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, outer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>outer, geometric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>geometric) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ratio)</span>
<span id="cb22-30">    oo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(floor, ns)</span>
<span id="cb22-31">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>])</span>
<span id="cb22-32">    surf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nu_shell(ns[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], ratio, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, outer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>outer, geometric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>geometric)</span>
<span id="cb22-33">    shell <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> nu_shell(ns[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], ratio, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, outer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>outer, geometric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>geometric, at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shell"</span>)</span>
<span id="cb22-34">    nu_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> resistance_route(upper)</span>
<span id="cb22-35">    lim <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"extrapolated"</span>])</span>
<span id="cb22-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_order_min"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])),</span>
<span id="cb22-37">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_order_max"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])),</span>
<span id="cb22-38">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_Nu_infinity"</span>: lim,</span>
<span id="cb22-39">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_dev_from_2"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(lim <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>])),</span>
<span id="cb22-40">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_shell_gap"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(surf <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> shell <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> shell <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> np.inf,</span>
<span id="cb22-41">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_b10_excess_pct"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (nu_shell(ns[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>, nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>nu, outer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>outer,</span>
<span id="cb22-42">                                                                     geometric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>geometric) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb22-43">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_quadrature_route"</span>: nu_q,</span>
<span id="cb22-44">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_two_routes_rel_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(nu_q <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> lim) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span>),</span>
<span id="cb22-45">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_finest_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_oo"</span>: oo}</span>
<span id="cb22-46"></span>
<span id="cb22-47"></span>
<span id="cb22-48">CD <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> conduction_study(P0)</span>
<span id="cb22-49">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CD.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb22-50"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"the floor Nu (1 - a/b) at b/a = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>RATIO<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.0e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, nested geometric grids:"</span>)</span>
<span id="cb22-51"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(NS_COND, CD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_oo"</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>]):</span>
<span id="cb22-52">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  n = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:5d}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   Nu (1 - a/b) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">   rel </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>v <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.3e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  observed orders (successive differences) "</span></span>
<span id="cb22-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> CD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_oo'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Richardson limit </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_conduction_Nu_infinity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.10f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; from the printed "</span></span>
<span id="cb22-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'correlation_intercept'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: below 1e-6 (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_conduction_dev_from_2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb22-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  surface flux against shell flux x (b/a)^2 at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NS_COND[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells: below 1e-9 "</span></span>
<span id="cb22-58">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_conduction_shell_gap'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb22-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  quadrature of the resistance integral : Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nu_quadrature_route'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-60"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  finite volumes, Richardson limit      : Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_conduction_Nu_infinity'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.12f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb22-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the two routes differ by below 1e-6 relative (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'nu_two_routes_rel_diff'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb22-62"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  a far field at ten radii: Nu = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_conduction_b10_excess_pct'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x 2, "</span></span>
<span id="cb22-63">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm_conduction_b10_excess_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % above the unbounded limit"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>the floor Nu (1 - a/b) at b/a = 1e+04, nested geometric grids:
  n =    50   Nu (1 - a/b) = 1.9809866780   rel -9.507e-03
  n =   100   Nu (1 - a/b) = 1.9954833441   rel -2.258e-03
  n =   200   Nu (1 - a/b) = 1.9989040875   rel -5.480e-04
  n =   400   Nu (1 - a/b) = 1.9997303942   rel -1.348e-04
  n =   800   Nu (1 - a/b) = 1.9999331581   rel -3.342e-05
  n =  1600   Nu (1 - a/b) = 1.9999833603   rel -8.320e-06
  observed orders (successive differences) 2.0833, 2.0496, 2.0269, 2.0140
  Richardson limit 1.9999998799; from the printed 2: below 1e-6 (here 1.2e-07)
  surface flux against shell flux x (b/a)^2 at 1600 cells: below 1e-9 (here 5.2e-13)

  quadrature of the resistance integral : Nu = 2.000000000000
  finite volumes, Richardson limit      : Nu = 1.999999879857
  the two routes differ by below 1e-6 relative (here 6.0e-08)

  a far field at ten radii: Nu = 1.1111 x 2, 11.1 % above the unbounded limit</code></pre>
</div>
</div>
<p>Second order on the grid, with the orders printed above approaching 2 from above, and the Richardson limit of the ladder lies below 1e-6 from the exact 2. The flux through the outer shell, times the area ratio, matches the surface flux to the residual of the solve, which is the round-off scale every ladder difference is compared with. Every row of the break table below perturbs an input and watches a number move, which shows sensitivity and never correctness; this comparison with the exact answer is what shows correctness.</p>
<p>Note what the domain is for. Stopping the far field at <img src="https://latex.codecogs.com/png.latex?b/a%20=%2010"> and calling the answer 2.0 would be wrong by 11.1 %, and no grid refinement would reveal it; it is the failure mode a grid-convergence study is blind to.</p>
</section>
<section id="radial-convection-and-which-average-p_f-is" class="level3">
<h3 class="anchored" data-anchor-id="radial-convection-and-which-average-p_f-is">2. Radial convection, and which average <img src="https://latex.codecogs.com/png.latex?p_f"> is</h3>
<p>Ranz, 1993:</p>
<blockquote class="blockquote">
<p>“A serious limitation on extended applications, unfortunately not emphasized in the original papers, has always been crude accounting (i.e., the use of the <img src="https://latex.codecogs.com/png.latex?D_f"> factor) for the radial convection at a spherical boundary caused by diffusion at the same boundary.”</p>
</blockquote>
<p>There is no <img src="https://latex.codecogs.com/png.latex?D_f"> in the notation of either part. The object that does that accounting is <img src="https://latex.codecogs.com/png.latex?p_f">, and Part II’s notation (folio 180) defines it only as the “average value of <img src="https://latex.codecogs.com/png.latex?(%5Cpi%20-%20p_A)"> across transfer path”; the identification is an inference and is labelled one here. Which average it is has a right answer, and the solver gives it.</p>
<div id="3924d7ff" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:23.393617Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:23.393487Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:25.840732Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:25.839848Z&quot;}}" data-execution_count="13">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb24-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># RANZ'S OWN CAVEAT. In 1993 he wrote that a serious limitation of the papers,</span></span>
<span id="cb24-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># "unfortunately not emphasized in the original papers", was the crude accounting</span></span>
<span id="cb24-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># for "the radial convection at a spherical boundary caused by diffusion at the</span></span>
<span id="cb24-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># same boundary". The object that does that accounting is p_f, defined in Part</span></span>
<span id="cb24-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># II's notation only as the "average value of (pi - p_A) across transfer path",</span></span>
<span id="cb24-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># and which average is not said.</span></span>
<span id="cb24-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#</span></span>
<span id="cb24-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Solve the actual problem: species A diffusing out of the sphere through stagnant</span></span>
<span id="cb24-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># B, so the mixture itself moves radially. Diffusion by construct_grad, the radial</span></span>
<span id="cb24-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># convection by construct_convflux_upwind (first-order upwind), geometry by</span></span>
<span id="cb24-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># construct_div(nu=2), and the total molar flow W the one root of "the flow the</span></span>
<span id="cb24-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># solve produces equals the flow it was given" (find_roots on the physical range).</span></span>
<span id="cb24-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># For a fixed W the problem is linear: no Newton iteration is needed.</span></span>
<span id="cb24-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#</span></span>
<span id="cb24-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The error has two parts: first order from the upwind convection and second order</span></span>
<span id="cb24-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from the diffusion, of opposite sign. Successive-difference orders approach 1</span></span>
<span id="cb24-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># from below on the ladder; the two known orders are then removed together,</span></span>
<span id="cb24-18"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># q* = (8 q(h/4) - 6 q(h/2) + q(h)) / 3, and what is left falls by about 8 per</span></span>
<span id="cb24-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># doubling.</span></span>
<span id="cb24-20">RS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0e5</span></span>
<span id="cb24-21">YS <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>)</span>
<span id="cb24-22">N_STEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span></span>
<span id="cb24-23">NS_STEF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1200</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2400</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4800</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9600</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19200</span>)</span>
<span id="cb24-24"></span>
<span id="cb24-25"></span>
<span id="cb24-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> stefan_study(ys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>YS, ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>NS_STEF, y_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>, convection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>):</span>
<span id="cb24-27">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Stefan flow against its closed form: the production grid, the ladder at</span></span>
<span id="cb24-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    y_order, the two-order Richardson limit at every y, and the balance gap."""</span></span>
<span id="cb24-29">    prod <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {y: sh_stefan(N_STEF, RS, y, convection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>convection, balance<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ys}</span>
<span id="cb24-30">    lad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {y: [sh_stefan(n, RS, y, convection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>convection)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ns[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>:]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ys}</span>
<span id="cb24-31">    oo <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> observed_orders(<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> n: sh_stefan(n, RS, y_order, convection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>convection)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], ns)</span>
<span id="cb24-32">    ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {y: (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> q[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y, q <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> lad.items()}</span>
<span id="cb24-33">    vals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.asarray(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"values"</span>])</span>
<span id="cb24-34">    gap <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(p[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> p <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> prod.values())</span>
<span id="cb24-35">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_pymrm_vs_closed_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(prod[y][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sh_closed(RS, y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-36">                                                    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ys)),</span>
<span id="cb24-37">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_min"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])),</span>
<span id="cb24-38">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_max"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(oo[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders"</span>])),</span>
<span id="cb24-39">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_extrap_vs_closed_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(ext[y] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sh_closed(RS, y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-40">                                                     <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ys)),</span>
<span id="cb24-41">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_balance_gap"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(gap),</span>
<span id="cb24-42">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_finest_diff"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(vals[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])),</span>
<span id="cb24-43">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_prod"</span>: prod, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_ext"</span>: ext, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_oo"</span>: oo}</span>
<span id="cb24-44"></span>
<span id="cb24-45"></span>
<span id="cb24-46">ST <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> stefan_study()</span>
<span id="cb24-47">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ST.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb24-48"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'y_surface'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;10}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pymrm Sh'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'closed form'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;14}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Richardson'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;13}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb24-49">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'rel'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:&gt;11}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-50"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> YS:</span>
<span id="cb24-51">    s, e, x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> ST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_prod"</span>][y][<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], sh_closed(RS, y), ST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_ext"</span>][y]</span>
<span id="cb24-52">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>y<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:10.2f}{</span>s<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}{</span>e<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:14.6f}{</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.2e}{</span>x<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:13.8f}{</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>e<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:11.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-53"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>N_STEF<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells the worst disagreement with the closed form is "</span></span>
<span id="cb24-54">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'stefan_pymrm_vs_closed_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-55"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  ladder at y = 0.20, cells </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(n) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> NS_STEF)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: observed orders "</span></span>
<span id="cb24-56">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">', '</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>join(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>o<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> o <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_oo'</span>][<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'orders'</span>])<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-57"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (first-order upwind; the opposite-signed second-order diffusion error makes"</span>)</span>
<span id="cb24-58"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"   the orders approach 1 from below)"</span>)</span>
<span id="cb24-59"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the two-order Richardson limit from </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NS_STEF[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>NS_STEF[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> cells is within "</span></span>
<span id="cb24-60">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"1e-8 of the closed form at every y (here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'stefan_extrap_vs_closed_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb24-61"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  flow through the outer face against the surface flow: below 1e-9 "</span></span>
<span id="cb24-62">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'stefan_balance_gap'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb24-63"></span>
<span id="cb24-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Now the question the notation leaves open. Ranz's N_Nu' carries a factor p_f/pi.</span></span>
<span id="cb24-65"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># If p_f is the LOGARITHMIC mean of (pi - p_A) it removes the radial-convection</span></span>
<span id="cb24-66"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># enhancement exactly and returns the theoretical 2.0; if it is the arithmetic</span></span>
<span id="cb24-67"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mean it does not.</span></span>
<span id="cb24-68">yy <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array(YS)</span>
<span id="cb24-69">sh_ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([ST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_ext"</span>][y] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> YS])</span>
<span id="cb24-70">back_log <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> sh_ext <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pf_log(yy) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RS)      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the pymrm limit, not the closed form</span></span>
<span id="cb24-71">back_arith <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([sh_closed(RS, y) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> YS]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pf_arith(yy) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RS)</span>
<span id="cb24-72"></span>
<span id="cb24-73"></span>
<span id="cb24-74"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> pf_arith_dev(y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.20</span>, weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>):</span>
<span id="cb24-75">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Per cent by which the closed-form Sh times the arithmetic-mean factor</span></span>
<span id="cb24-76"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">    1 - weight y misses 2 at surface mole fraction y."""</span></span>
<span id="cb24-77">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(sh_closed(RS, y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> weight <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> y) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> RS) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb24-78"></span>
<span id="cb24-79"></span>
<span id="cb24-80">A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pf_arith_dev_at_y020_pct"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pf_arith_dev()</span>
<span id="cb24-81"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">  pymrm Sh (Richardson) x p_f/pi, p_f the LOG mean -&gt; "</span></span>
<span id="cb24-82">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>array2string(back_log, precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-83"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  (with the CLOSED FORM in place of the pymrm Sh that product is exactly 2 for"</span>)</span>
<span id="cb24-84"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   every y, an algebraic identity, so it is not a claim; the line above is the"</span>)</span>
<span id="cb24-85"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   pymrm solve asked the same question, and its distance from 2 is the"</span>)</span>
<span id="cb24-86"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"   Richardson-limit disagreement above, not a second number.)"</span>)</span>
<span id="cb24-87"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  closed-form Sh x p_f/pi, p_f the ARITHMETIC mean -&gt; "</span></span>
<span id="cb24-88">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>array2string(back_arith, precision<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-89"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  the arithmetic mean is </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pf_arith_dev_at_y020_pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % out at y = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>YS[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb24-90"></span>
<span id="cb24-91"></span>
<span id="cb24-92"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># How large is the effect at all? Each threshold is the one root of</span></span>
<span id="cb24-93"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># corr_excess(y) = target, and the same y has a closed form through Lambert's W.</span></span>
<span id="cb24-94"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> thresholds(targets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>), branch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>):</span>
<span id="cb24-95">    ys_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [stefan_threshold(t_) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> targets]</span>
<span id="cb24-96">    lw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [stefan_threshold_lambertw(t_, branch) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> targets]</span>
<span id="cb24-97">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"stefan_y_for_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pct"</span>: y <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, y <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"01"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10"</span>), ys_)}</span>
<span id="cb24-98">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_threshold_vs_lambertw"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> b) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> a, b <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>(ys_, lw)))</span>
<span id="cb24-99">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb24-100"></span>
<span id="cb24-101"></span>
<span id="cb24-102">A.update(thresholds())</span>
<span id="cb24-103"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, t_ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">zip</span>((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"01"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10"</span>), (<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>)):</span>
<span id="cb24-104">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  radial convection raises Sh by </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>t_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:4.0f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % once the surface mole "</span></span>
<span id="cb24-105">          <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"fraction reaches y = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'stefan_y_for_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pct'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb24-106"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  root against Lambert-W closed form: below 1e-12 "</span></span>
<span id="cb24-107">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"(here </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'stefan_threshold_vs_lambertw'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb24-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">  Placing this paper's runs on that axis needs vapour pressures, which"</span>)</span>
<span id="cb24-109"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  Part II prints only as Figure 14, out of scope. The correction is stated"</span>)</span>
<span id="cb24-110"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  as a function of y and not evaluated at their conditions."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code> y_surface      pymrm Sh   closed form        rel   Richardson        rel
      0.01      2.009995      2.010087  -4.58e-05   2.01008727  -3.38e-10
      0.05      2.052058      2.051752   1.49e-04   2.05175229  -3.20e-10
      0.10      2.108085      2.107231   4.05e-04   2.10723138  -2.90e-10
      0.20      2.233605      2.231458   9.62e-04   2.23145783  -2.83e-10

  at 600 cells the worst disagreement with the closed form is 9.62e-04
  ladder at y = 0.20, cells 600, 1200, 2400, 4800, 9600, 19200: observed orders 0.8753, 0.9420, 0.9720, 0.9862
  (first-order upwind; the opposite-signed second-order diffusion error makes
   the orders approach 1 from below)
  the two-order Richardson limit from 4800-19200 cells is within 1e-8 of the closed form at every y (here 3.4e-10)
  flow through the outer face against the surface flow: below 1e-9 (here 2.0e-13)

  pymrm Sh (Richardson) x p_f/pi, p_f the LOG mean -&gt; [1.999999999 1.999999999 1.999999999 1.999999999]
  (with the CLOSED FORM in place of the pymrm Sh that product is exactly 2 for
   every y, an algebraic identity, so it is not a claim; the line above is the
   pymrm solve asked the same question, and its distance from 2 is the
   Richardson-limit disagreement above, not a second number.)
  closed-form Sh x p_f/pi, p_f the ARITHMETIC mean -&gt; [2.000017 2.000438 2.00185  2.008292]
  the arithmetic mean is 0.41 % out at y = 0.2.
  radial convection raises Sh by    1 % once the surface mole fraction reaches y = 0.019736
  radial convection raises Sh by    5 % once the surface mole fraction reaches y = 0.093702
  radial convection raises Sh by   10 % once the surface mole fraction reaches y = 0.176134
  root against Lambert-W closed form: below 1e-12 (here 7.5e-15)

  Placing this paper's runs on that axis needs vapour pressures, which
  Part II prints only as Figure 14, out of scope. The correction is stated
  as a function of y and not evaluated at their conditions.</code></pre>
</div>
</div>
<p>The logarithmic mean returns Ranz’s <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> to 2.0 at rest: with the pymrm solution in place of the closed form, the product’s distance from 2 is the Richardson-limit disagreement, below 1e-8, and not a second number, because the log mean cancels the closed form identically. The arithmetic mean does not, and is 0.41 % out by <img src="https://latex.codecogs.com/png.latex?y%20=%200.20">, far outside both the production-grid disagreement of 9.62e-4 and the limit. So <img src="https://latex.codecogs.com/png.latex?p_f"> <strong>must</strong> be the log mean, and read that way the paper’s mass-transfer accounting for radial convection is <em>exact</em>, not crude, for the isothermal spherical stagnant film. What it does not do is appear anywhere in the heat balance, which is where a Stefan flow also carries enthalpy; that asymmetry is the most likely reading of the 1993 remark, and it is offered as a reading, not as a result.</p>
<p>The size of the effect: the radial convection lifts <img src="https://latex.codecogs.com/png.latex?Sh"> by 1 % at a surface mole fraction of 1.97 %, 5 % at 9.37 % and 10 % at 17.61 %, each the one root of the closed-form excess on the physical range, and each matching its Lambert-W closed form. Placing this paper’s runs on that axis needs vapour pressures that exist only in Figure 14, so it is not done.</p>
</section>
<section id="the-papers-own-arithmetic" class="level3">
<h3 class="anchored" data-anchor-id="the-papers-own-arithmetic">3. The paper’s own arithmetic</h3>
<div id="d6e3022c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:25.842089Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:25.841958Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:25.847891Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:25.847078Z&quot;}}" data-execution_count="14">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb26-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PRINTED ARITHMETIC, checked and not repaired.</span></span>
<span id="cb26-2"></span>
<span id="cb26-3"></span>
<span id="cb26-4"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> printed_arithmetic(P):</span>
<span id="cb26-5">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Part I's test No. 80: 5.83 (1 - 0.028 - 0.006 - 0.011) against the printed 5.57."""</span></span>
<span id="cb26-6">    n_app, n_cor <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_Nu_apparent"</span>], P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_Nu_corrected"</span>]</span>
<span id="cb26-7">    rec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n_app <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_sensible_heat"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_radiation"</span>]</span>
<span id="cb26-8">                   <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> P[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_capillary"</span>])</span>
<span id="cb26-9">    h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> half_unit(KS.loc[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_Nu_corrected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>])     <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the printed string</span></span>
<span id="cb26-10">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_printed_vs_recomputed_rel"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n_cor) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> n_cor),</span>
<span id="cb26-11">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_within_printed_precision"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n_cor) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> h),</span>
<span id="cb26-12">            <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_test80_margin"</span>: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(h <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(rec <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> n_cor)) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> h), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_rec"</span>: rec}</span>
<span id="cb26-13"></span>
<span id="cb26-14"></span>
<span id="cb26-15">PA <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> printed_arithmetic(P0)</span>
<span id="cb26-16">A.update({k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PA.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)})</span>
<span id="cb26-17"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Part I, test No. 80:  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_Nu_apparent'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> (1 - "</span></span>
<span id="cb26-18">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_correction_sensible_heat'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_correction_radiation'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> - "</span></span>
<span id="cb26-19">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_correction_capillary'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">) = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>PA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_rec'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.6f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb26-20"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  printed: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_Nu_corrected'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">.  Relative difference "</span></span>
<span id="cb26-21">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_printed_vs_recomputed_rel'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2e}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">; inside half a unit of the printed last "</span></span>
<span id="cb26-22">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"digit: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_within_printed_precision'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)</span>
<span id="cb26-23">_c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_sensible_heat"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_radiation"</span>]</span>
<span id="cb26-24">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_capillary"</span>])</span>
<span id="cb26-25"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  (the three corrections together remove </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>_c<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> % of the apparent N_Nu, and the "</span></span>
<span id="cb26-26">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"largest of them, sensible heat, </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>P0[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'test80_correction_sensible_heat'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.1f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %.)"</span>)</span>
<span id="cb26-27"></span>
<span id="cb26-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Eq. (24) against eqs. (21): consistent only for one Prandtl number.</span></span>
<span id="cb26-29"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">Part II eq. (24) vs eqs. (21): </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_AQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_FIT<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> x Pr^(1/3) requires "</span></span>
<span id="cb26-30">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Pr = </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'pr_air_implied_by_eq24'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.5f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> for air."</span>)</span>
<span id="cb26-31"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  Table 1's own </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'_n'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows, intercept held at </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A2_<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">, give a coefficient of "</span></span>
<span id="cb26-32">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_slope_at_A2'</span>]<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.4f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> against that </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>K_AQ<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:g}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: "</span></span>
<span id="cb26-33">      <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_slope_at_A2'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_AQ<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %."</span>)</span>
<span id="cb26-34"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  This is not a second result: K_recovered = b_fixed x K/K_AQ identically, so"</span>)</span>
<span id="cb26-35"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"  b_fixed/K_AQ - 1 is K_recovered/K - 1, which the heat section reported as"</span>)</span>
<span id="cb26-36"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>(A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'t1_heat_K_recovered'</span>]<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>K_FIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:+.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> %. It is one claim, not two."</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Part I, test No. 80:  5.83 (1 - 0.028 - 0.006 - 0.011) = 5.567650
  printed: 5.57.  Relative difference 4.22e-04; inside half a unit of the printed last digit: True.
  (the three corrections together remove 4.5 % of the apparent N_Nu, and the largest of them, sensible heat, 2.8 %.)

Part II eq. (24) vs eqs. (21): 0.54 = 0.6 x Pr^(1/3) requires Pr = 0.72900 for air.
  Table 1's own 18 rows, intercept held at 2, give a coefficient of 0.5418 against that 0.54: +0.34 %.
  This is not a second result: K_recovered = b_fixed x K/K_AQ identically, so
  b_fixed/K_AQ - 1 is K_recovered/K - 1, which the heat section reported as
  +0.34 %. It is one claim, not two.</code></pre>
</div>
</div>
<p>No printed defect found. Test No.&nbsp;80 recomputes to 4.2e-04 relative, inside half a unit of the printed 5.57’s last digit; and eq. (24)’s 0.54 is within 0.34 % of what Table 1’s own 18 rows give with the intercept held at 2.0. Both were checked because both <em>could</em> have failed; this section reports that they did not, rather than omitting a check that came out clean.</p>
<p>That second number is <strong>not a second result</strong>. <img src="https://latex.codecogs.com/png.latex?K_%7B%5Crm%20recovered%7D%20%5Cequiv%20b_%7B%5Crm%20fixed%7D%0A%5Ctimes%200.60/0.54"> identically, so “eq. (24)’s 0.54 against Table 1” and the heat section’s “<img src="https://latex.codecogs.com/png.latex?K"> = 0.6020 against the printed 0.60” are one statement written two ways, and it is registered as one claim.</p>
</section>
<section id="claims" class="level3">
<h3 class="anchored" data-anchor-id="claims">4. Claims</h3>
<p>Every number the page states, with how it is checked. Arithmetic on the printed tables is held to <code>FIXED</code>; results that pass through a fit iterated to a tolerance or through a solver are held to <code>SOLV</code>. Orders, residuals, identities and the verdicts on the intercepts are bounds with their basis; statements over a set are exact claims with their margin.</p>
<div id="691ca425" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:25.849462Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:25.849245Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:25.860382Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:25.859679Z&quot;}}" data-execution_count="15">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb28-1">FIXED, SOLV <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span></span>
<span id="cb28-2">CRIT <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(student_t.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.975</span>, d)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, d <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> MS[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dof"</span>].items()}</span>
<span id="cb28-3">CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_q"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(student_t.ppf(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.975</span>, HT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_dof"</span>]))</span>
<span id="cb28-4"></span>
<span id="cb28-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># arithmetic on the printed tables and constants (fits by linear least squares,</span></span>
<span id="cb28-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># roots of exact derivatives, closed forms)</span></span>
<span id="cb28-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pr_air_implied_by_eq24"</span>,</span>
<span id="cb28-8">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_T_exponent_se"</span>,</span>
<span id="cb28-9">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_resid_rms_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_resid_rms_pct_free_stream"</span>,</span>
<span id="cb28-10">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_T_exponent_free_stream"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_reference_weight_band"</span>,</span>
<span id="cb28-11">          </span>
<span id="cb28-12">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_Re_over_v_spread_pct"</span>, </span>
<span id="cb28-13">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_rounding_ptp_bound_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_film_minus_stated_K"</span>,</span>
<span id="cb28-14">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct_free_stream"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct_drop_surface"</span>,</span>
<span id="cb28-15">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_extrapolation_K"</span>,</span>
<span id="cb28-16">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_free"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_se"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_slope_free"</span>,</span>
<span id="cb28-17">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_slope_at_A2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered_dev_pct"</span>,</span>
<span id="cb28-18">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_eq24_rms_pct"</span>,</span>
<span id="cb28-19">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_eq24_max_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_freefit_rms_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_null_best_rms_pct"</span>,</span>
<span id="cb28-20">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_free"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_se"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_slope_free"</span>,</span>
<span id="cb28-21">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_fit_resid_rms_pct"</span>,</span>
<span id="cb28-22">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_free"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_se"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_slope_free"</span>,</span>
<span id="cb28-23">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_dev_water_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_dev_benzene_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_dev_pct"</span>,</span>
<span id="cb28-24">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sc_ratio_benzene_over_water"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_ratio_spread_runs_10_12_pct"</span>,</span>
<span id="cb28-25">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_Nuprime_upper_bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_Nuprime_lower_bound"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_intercept"</span>,</span>
<span id="cb28-26">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_intercept_drift_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_ratio_spread_pct"</span>,</span>
<span id="cb28-27">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_outside_bracket_pct"</span>,</span>
<span id="cb28-28">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_Nu_over_theory"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_Nuprime_over_theory"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_analogy_ratio"</span>,</span>
<span id="cb28-29">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dv_used_over_dv_backed_out"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dv_factor_from_intercept"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"replicate_worst_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"replicate_mean_pct"</span>,</span>
<span id="cb28-30">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_rms_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_max_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_bias_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_bias_se_pct"</span>,</span>
<span id="cb28-31">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_from_t1_rms_pct"</span>,</span>
<span id="cb28-32">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_over_t1_rms_factor"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_abscissa_max_dev_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_nu_ratio_max_dev_pct"</span>,</span>
<span id="cb28-33">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_worst_nu_ratio_error_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pf_arith_dev_at_y020_pct"</span>,</span>
<span id="cb28-34">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_y_for_01pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_y_for_05pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_y_for_10pct"</span>,</span>
<span id="cb28-35">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_printed_vs_recomputed_rel"</span>):</span>
<span id="cb28-36">    claims.value(k, A[k], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FIXED)</span>
<span id="cb28-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a nonlinear least-squares fit, iterated to curve_fit's tolerance; and the values</span></span>
<span id="cb28-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># downstream of the reference-temperature weight w, whose measured spread across BLAS</span></span>
<span id="cb28-39"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># kernels (docs/reproducibility/spread.json) reaches 1e-7 relative</span></span>
<span id="cb28-40"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_fitted"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_se"</span>,</span>
<span id="cb28-41">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_reference_temperature_weight"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_T_exponent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_resid_max_pct"</span>,</span>
<span id="cb28-42">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_freestream_worst_Re_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_freestream_worst_Nu_pct"</span>,</span>
<span id="cb28-43">          <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_expected_spread_from_T_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_w"</span>):</span>
<span id="cb28-44">    claims.value(k, A[k], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SOLV)</span>
<span id="cb28-45"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the verdicts: (intercept - 2.0)/standard error, Student t under "the intercept is 2.0"</span></span>
<span id="cb28-46">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_water"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_water"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"water"</span>],</span>
<span id="cb28-47">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"beyond the two-sided 5 % point of Student t, 13 dof"</span>)</span>
<span id="cb28-48">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_t"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_t"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat"</span>],</span>
<span id="cb28-49">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inside the two-sided 5 % points of Student t, 16 dof"</span>)</span>
<span id="cb28-50">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_benzene"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_benzene"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"benzene"</span>],</span>
<span id="cb28-51">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"benzene"</span>], basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb28-52">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inside the two-sided 5 % points of Student t, 11 dof"</span>)</span>
<span id="cb28-53">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_t"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_t"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_q"</span>],</span>
<span id="cb28-54">             <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>CRIT[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_q"</span>], basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"chosen"</span>,</span>
<span id="cb28-55">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"released exponent against 1/2 inside the two-sided 5 % points, 16 dof"</span>)</span>
<span id="cb28-56"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># statements over a set</span></span>
<span id="cb28-57">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_band_holds_045_and_055"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_band_holds_045_and_055"</span>], margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_band_margin"</span>],</span>
<span id="cb28-58">             min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both w = 0.45 and 0.55 inside the 5 % band; margin in w"</span>)</span>
<span id="cb28-59">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_spread_below_T_effect"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_spread_below_T_effect"</span>],</span>
<span id="cb28-60">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_iso_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb28-61">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed Re/v spread below the film-temperature effect alone; margin relative"</span>)</span>
<span id="cb28-62">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_spread_inside_T_plus_rounding"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_spread_inside_T_plus_rounding"</span>],</span>
<span id="cb28-63">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>RE[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_iso_margin2"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb28-64">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"observed spread inside temperature effect plus rounding; margin relative"</span>)</span>
<span id="cb28-65">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_identities_within_rounding"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_identities_within_rounding"</span>],</span>
<span id="cb28-66">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>T3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_ident_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>,</span>
<span id="cb28-67">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"both within-pair identities inside their printing allowance in every pair"</span>)</span>
<span id="cb28-68">STEEP <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (T3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_pairs"</span>].d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> T3[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_pairs"</span>].allow_d).to_numpy()</span>
<span id="cb28-69">claims.count(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pairs_measurement_steeper"</span>, STEEP, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>, min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, relative<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>,</span>
<span id="cb28-70">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pairs whose measured N_Nu ratio exceeds eq. (21)'s; each difference in units "</span></span>
<span id="cb28-71">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"of its printing allowance, margin at least one allowance"</span>)</span>
<span id="cb28-72">claims.exact(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_within_printed_precision"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_within_printed_precision"</span>],</span>
<span id="cb28-73">             margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>PA[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_test80_margin"</span>], min_margin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.05</span>,</span>
<span id="cb28-74">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"recomputed test No. 80 within half a unit of the printed last digit"</span>)</span>
<span id="cb28-75"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pymrm: the stagnant sphere</span></span>
<span id="cb28-76">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_Nu_infinity"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_Nu_infinity"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>FIXED)</span>
<span id="cb28-77">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_b10_excess_pct"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_b10_excess_pct"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SOLV)</span>
<span id="cb28-78">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_order_min"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_order_min"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.95</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-79">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order on nested geometric cells"</span>)</span>
<span id="cb28-80">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_order_max"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_order_max"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.15</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-81">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"second order on nested geometric cells, approached from above"</span>)</span>
<span id="cb28-82">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_dev_from_2"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_dev_from_2"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>,</span>
<span id="cb28-83">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Richardson limit of a second-order ladder; the next-order terms"</span>)</span>
<span id="cb28-84">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_shell_gap"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_shell_gap"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>,</span>
<span id="cb28-85">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the discrete divergence telescopes; the gap is the solve's residual"</span>)</span>
<span id="cb28-86">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_quadrature_route"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_quadrature_route"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>,</span>
<span id="cb28-87">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2/(4 pi integral of dr/(4 pi r^2)) is 2 for any working quadrature"</span>)</span>
<span id="cb28-88">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_two_routes_rel_diff"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"nu_two_routes_rel_diff"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-6</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-89">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the Richardson limit against the exact 2; the next-order terms"</span>)</span>
<span id="cb28-90"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># pymrm: Stefan flow</span></span>
<span id="cb28-91">claims.value(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_pymrm_vs_closed_rel"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_pymrm_vs_closed_rel"</span>], rtol<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>SOLV)</span>
<span id="cb28-92">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_min"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_min"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.85</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-93">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind, approached from below (second-order diffusion error of "</span></span>
<span id="cb28-94">                  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"opposite sign)"</span>)</span>
<span id="cb28-95">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_max"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_max"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-96">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first-order upwind, approached from below"</span>)</span>
<span id="cb28-97">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_extrap_vs_closed_rel"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_extrap_vs_closed_rel"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-8</span>,</span>
<span id="cb28-98">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"orders 1 and 2 removed together; the third-order residue"</span>)</span>
<span id="cb28-99">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_balance_gap"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_balance_gap"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span>,</span>
<span id="cb28-100">             structural<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"r^2 times the radial flux is the same on every face of the "</span></span>
<span id="cb28-101">                                   <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"discrete balance; the gap is the solve's residual"</span>)</span>
<span id="cb28-102">FINEST_OVER_ROUNDOFF <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(CD[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_finest_diff"</span>], ST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_finest_diff"</span>])</span>
<span id="cb28-103">                        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_shell_gap"</span>], A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_balance_gap"</span>]))</span>
<span id="cb28-104">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder_finest_over_roundoff"</span>, FINEST_OVER_ROUNDOFF, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span>, basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theory"</span>,</span>
<span id="cb28-105">             note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the finest ladder differences far above the solves' residual"</span>)</span>
<span id="cb28-106">claims.bound(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_threshold_vs_lambertw"</span>, A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_threshold_vs_lambertw"</span>], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>,</span>
<span id="cb28-107">             basis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"tolerance"</span>, note<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"root xtol 1e-15; Lambert W to round-off"</span>)</span>
<span id="cb28-108"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(claims.metrics)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> claims registered"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>96 claims registered</code></pre>
</div>
</div>
</section>
<section id="the-defect-injection-table" class="level3">
<h3 class="anchored" data-anchor-id="the-defect-injection-table">5. The defect-injection table</h3>
<p>Every claim above needs a row that fails its own check. The data claims come from <code>analyse(D, P)</code>, the whole analysis of sections 1 to 3 as one function of the tables and the printed-constant dictionary: each row misreads one printed number (a table cell, a column, a constant) or switches one analysis choice through an argument, and reruns everything, so every claim the defect reaches is tested. The pymrm claims get rows of their own, each a call argument of the study: the geometry code, the outer condition, the grid, the ladder, the convection, the far field of the quadrature, the targets and the Lambert-W branch. A quantity that cannot be computed under a defect records <code>nan</code>, which fails its claim.</p>
<div id="b5abfa3c" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:25.861862Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:25.861736Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:34.684293Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:34.683386Z&quot;}}" data-execution_count="16">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb30-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> public(d):</span>
<span id="cb30-2">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {k: v <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> d.items() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> k.startswith(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>)}</span>
<span id="cb30-3"></span>
<span id="cb30-4"></span>
<span id="cb30-5"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> analyse(D, P, w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>, include_still<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>):</span>
<span id="cb30-6">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Sections 1 to 3 rerun in full on tables D and constants P."""</span></span>
<span id="cb30-7">    re_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reynolds(D, P, w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>w)</span>
<span id="cb30-8">    out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pr_air_implied_by_eq24"</span>: pr_implied(P), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>public(re_)}</span>
<span id="cb30-9">    out.update(public(table3_heldout(D, P, re_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_w"</span>], re_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_R"</span>], re_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_y"</span>])))</span>
<span id="cb30-10">    ht <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> heat(D, P, include_still<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>include_still)</span>
<span id="cb30-11">    ms <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mass(D, P, ht)</span>
<span id="cb30-12">    t3_ <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> table3(D, P, ht)</span>
<span id="cb30-13">    out.update({<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>public(ht), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>public(ms), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>public(still_air(D, P)), <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>public(t3_),</span>
<span id="cb30-14">                <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>public(printed_arithmetic(P))})</span>
<span id="cb30-15">    out[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pairs_measurement_steeper"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">int</span>(np.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">sum</span>(t3_[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_pairs"</span>].d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))</span>
<span id="cb30-16">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> out</span>
<span id="cb30-17"></span>
<span id="cb30-18"></span>
<span id="cb30-19">BREAK <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> []</span>
<span id="cb30-20"></span>
<span id="cb30-21"></span>
<span id="cb30-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> brk(row, name, broken):</span>
<span id="cb30-23">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""One injected defect: ``broken`` is what claim ``name`` becomes with it."""</span></span>
<span id="cb30-24">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(broken, (<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>, np.floating)) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> np.isfinite(broken):</span>
<span id="cb30-25">        broken <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.nan</span>
<span id="cb30-26">    BREAK.append((row, name, claims.breaks(row, name, broken)))</span>
<span id="cb30-27"></span>
<span id="cb30-28"></span>
<span id="cb30-29"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> data_row(label, D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>D0, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>P0, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw):</span>
<span id="cb30-30">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""Rerun the analysis under one defect; register every claim it reaches."""</span></span>
<span id="cb30-31">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">try</span>:</span>
<span id="cb30-32">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> analyse(D, P, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb30-33">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">except</span> <span class="pp" style="color: #AD0000;
background-color: null;
font-style: inherit;">Exception</span> <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> exc:                      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># a defect that leaves no solution</span></span>
<span id="cb30-34">        <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>label<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: no result (</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">type</span>(exc)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">__name__</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">); every data claim records nan"</span>)</span>
<span id="cb30-35">        a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {k: np.nan <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A}</span>
<span id="cb30-36">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics:</span>
<span id="cb30-37">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> a:</span>
<span id="cb30-38">            brk(label, name, a[name])</span>
<span id="cb30-39"></span>
<span id="cb30-40"></span>
<span id="cb30-41"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> with_cell(tab, run, col, val, D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span>):</span>
<span id="cb30-42">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The tables with one printed cell misread, in the numbers and in the strings."""</span></span>
<span id="cb30-43">    D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(D0 <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> D <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">None</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> D)</span>
<span id="cb30-44">    D[tab], D[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D[tab].copy(), D[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>].copy()</span>
<span id="cb30-45">    D[tab].loc[D[tab].run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> run, col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">float</span>(val)</span>
<span id="cb30-46">    D[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>].loc[D[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>].run <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(run), col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(val)</span>
<span id="cb30-47">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> D</span>
<span id="cb30-48"></span>
<span id="cb30-49"></span>
<span id="cb30-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> with_col(tab, col, val):</span>
<span id="cb30-51">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""The tables with one column misread: a value, or another column copied in."""</span></span>
<span id="cb30-52">    D <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(D0)</span>
<span id="cb30-53">    D[tab], D[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> D0[tab].copy(), D0[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>].copy()</span>
<span id="cb30-54">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (D[tab], D[tab <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"s"</span>]):</span>
<span id="cb30-55">        t[col] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> val(t) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">callable</span>(val) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> (val <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> t <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">is</span> D[tab] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">str</span>(val))</span>
<span id="cb30-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> D</span>
<span id="cb30-57"></span>
<span id="cb30-58"></span>
<span id="cb30-59"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> with_p(key, val):</span>
<span id="cb30-60">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">return</span> {<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>P0, key: val}</span>
<span id="cb30-61"></span>
<span id="cb30-62"></span>
<span id="cb30-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the baseline reproduces itself (a sanity check of analyse, not a row)</span></span>
<span id="cb30-64">_base <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> analyse(D0, P0)</span>
<span id="cb30-65"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">all</span>(_base[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> A[k] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _base <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(A[k], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"analyse drifts"</span></span>
<span id="cb30-66"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">assert</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">abs</span>(_base[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> A[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> _base</span>
<span id="cb30-67">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> A <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">isinstance</span>(A[k], <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">bool</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> A[k] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-12</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"analyse drifts"</span></span>
<span id="cb30-68"></span>
<span id="cb30-69">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 run 1 N_Re read 195.1 instead of 159.1"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Re"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"195.1"</span>))</span>
<span id="cb30-70">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 drop diameter read 0.954 instead of 0.0954 on every row"</span>,</span>
<span id="cb30-71">         with_col(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_p_cm"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.954</span>))</span>
<span id="cb30-72">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 run 14 air velocity read 3.4 instead of 3.37"</span>,</span>
<span id="cb30-73">         with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"air_vel_cm_s"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.4"</span>))</span>
<span id="cb30-74">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 drop temperatures replaced by the air temperatures"</span>,</span>
<span id="cb30-75">         with_col(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop_temp_C"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: t.air_temp_C))</span>
<span id="cb30-76">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 run 6 air velocity read 92.5 instead of 95.2"</span>,</span>
<span id="cb30-77">         with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"air_vel_cm_s"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"92.5"</span>))</span>
<span id="cb30-78">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 drop temperatures replaced by its air temperatures"</span>,</span>
<span id="cb30-79">         with_col(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop_temp_C"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: t.air_temp_C))</span>
<span id="cb30-80">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reference temperature fixed at the free stream (w = 0)"</span>, w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span>)</span>
<span id="cb30-81">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 apparent N_Nu used for the corrected column"</span>,</span>
<span id="cb30-82">         with_col(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_corrected"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: t.Nu_apparent))</span>
<span id="cb30-83">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still-air row swept into the heat regression"</span>, include_still<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>)</span>
<span id="cb30-84">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 run 18 N_Nu read 6.56 instead of 9.56"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_corrected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6.56"</span>))</span>
<span id="cb30-85">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1 run 18 N_Nu' read 4.48 instead of 9.48"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.48"</span>))</span>
<span id="cb30-86">_guess <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.32"</span>)</span>
<span id="cb30-87"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> run, v <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">13</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.05"</span>), (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">14</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.96"</span>)):</span>
<span id="cb30-88">    _guess <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, run, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, v, D<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>_guess)</span>
<span id="cb30-89">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"the three ink-damaged N_Nu' cells filled in by guesswork"</span>, _guess)</span>
<span id="cb30-90">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 N_Nu' column replaced by its N_Nu column"</span>,</span>
<span id="cb30-91">         with_col(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">lambda</span> t: t.Nu_apparent))</span>
<span id="cb30-92">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 run 11 N_Nu' read 10.6 instead of 10.0"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">11</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10.6"</span>))</span>
<span id="cb30-93">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 4 run 12 N_Nu' read 10.0 instead of 10.9"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10.0"</span>))</span>
<span id="cb30-94">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still-air N_Nu read 3.23 instead of 2.23"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_apparent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.23"</span>))</span>
<span id="cb30-95">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still-air N_Nu' read 1.19 instead of 1.79"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_prime"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.19"</span>))</span>
<span id="cb30-96">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 2 run 4 corrected N_Nu read 5.9 instead of 5.4"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t2"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu_corrected"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.9"</span>))</span>
<span id="cb30-97">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 run 7 diameter read 0.101 instead of 0.088"</span>,</span>
<span id="cb30-98">         with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D_p_corresponding_cm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.101"</span>))</span>
<span id="cb30-99">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 run 1 N_Nu read 4.0 instead of 7.0"</span>, with_cell(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Nu"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.0"</span>))</span>
<span id="cb30-100">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theoretical intercept 2.0 read as 1.7"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>))</span>
<span id="cb30-101">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fitted coefficient 0.60 read as 6.0"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_coefficient_K"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.0</span>))</span>
<span id="cb30-102">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Reynolds exponent 1/2 read as 1/3"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Re"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>))</span>
<span id="cb30-103">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Prandtl exponent 1/3 read as 1/2"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"exponent_Pr_Sc"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>))</span>
<span id="cb30-104">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"eq. (24) coefficient 0.54 read as 0.60"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aqueous_collapsed_coefficient"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.60</span>))</span>
<span id="cb30-105">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"still-air reference temperature 290 K read as 280 K"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dv_backout_temperature_K"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">280.0</span>))</span>
<span id="cb30-106">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 3 pressure 743 mm Hg read as 473"</span>, P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"table3_pressure_mmHg"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">473.0</span>))</span>
<span id="cb30-107">data_row(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test No. 80 capillary correction 0.011 read as 0.001"</span>,</span>
<span id="cb30-108">         P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_correction_capillary"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>))</span>
<span id="cb30-109"></span>
<span id="cb30-110"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- pymrm: the stagnant sphere ----------------------------------------------------------</span></span>
<span id="cb30-111">_cd_rows <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {}</span>
<span id="cb30-112"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> row, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sphere solved with nu = 1 (cylinder)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(nu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb30-113">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sphere outer boundary closed (no flux)"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(outer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"noflux"</span>)),</span>
<span id="cb30-114">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform radial cells instead of geometric"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(geometric<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)),</span>
<span id="cb30-115">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder started at 6 cells"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(ns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">48</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">96</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">192</span>))),</span>
<span id="cb30-116">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"resistance integral stopped at 10 radii"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(upper<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.0</span>)),</span>
<span id="cb30-117">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theoretical intercept 2.0 read as 1.7 in the sphere check"</span>,</span>
<span id="cb30-118">                 <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(P<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>with_p(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"correlation_intercept"</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.7</span>)))):</span>
<span id="cb30-119">    kw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> {<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"P"</span>: P0, <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw}</span>
<span id="cb30-120">    _cd_rows[row] <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> conduction_study(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb30-121">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics:</span>
<span id="cb30-122">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> s:</span>
<span id="cb30-123">            brk(row, name, s[name])</span>
<span id="cb30-124">_s1 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> _cd_rows[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sphere solved with nu = 1 (cylinder)"</span>]</span>
<span id="cb30-125">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sphere solved with nu = 1 (cylinder)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ladder_finest_over_roundoff"</span>,</span>
<span id="cb30-126">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(_s1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_finest_diff"</span>], ST[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_finest_diff"</span>])</span>
<span id="cb30-127">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(_s1[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_shell_gap"</span>], A[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_balance_gap"</span>]))</span>
<span id="cb30-128"></span>
<span id="cb30-129"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># --- pymrm: Stefan flow --------------------------------------------------------------------</span></span>
<span id="cb30-130"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> row, kw <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> ((<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"radial convection switched off in the Stefan solve"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(convection<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>)),</span>
<span id="cb30-131">                (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stefan order ladder run at y = 0.01"</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">dict</span>(y_order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>))):</span>
<span id="cb30-132">    s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> stefan_study(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>kw)</span>
<span id="cb30-133">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_pymrm_vs_closed_rel"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_min"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_order_max"</span>,</span>
<span id="cb30-134">                 <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_extrap_vs_closed_rel"</span>):</span>
<span id="cb30-135">        brk(row, name, s[name])</span>
<span id="cb30-136">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"p_f arithmetic mean taken as 1 - y"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pf_arith_dev_at_y020_pct"</span>, pf_arith_dev(weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.0</span>))</span>
<span id="cb30-137">_th <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> thresholds(targets<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.07</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.15</span>))</span>
<span id="cb30-138"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> k <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"01"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"05"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10"</span>):</span>
<span id="cb30-139">    brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"thresholds solved for 2, 7 and 15 </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">% i</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">nstead of 1, 5 and 10 %"</span>, <span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"stefan_y_for_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pct"</span>,</span>
<span id="cb30-140">        _th[<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"stefan_y_for_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>k<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">pct"</span>])</span>
<span id="cb30-141">brk(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lambert W on the branch W_-1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_threshold_vs_lambertw"</span>,</span>
<span id="cb30-142">    thresholds(branch<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_threshold_vs_lambertw"</span>])</span>
<span id="cb30-143"></span>
<span id="cb30-144">bt <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pd.DataFrame(BREAK, columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"claim"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"caught"</span>])</span>
<span id="cb30-145">caught <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> bt[bt.caught].groupby(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"row"</span>, sort<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">False</span>).claim.<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">apply</span>(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">list</span>)</span>
<span id="cb30-146"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(bt.row.unique())<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> rows; claims each row fails:"</span>)</span>
<span id="cb30-147"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> row, names <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> caught.items():</span>
<span id="cb30-148">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"  </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>row<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(names)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-149">    <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"      "</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>.join(names))</span>
<span id="cb30-150">idle <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> bt.row.unique() <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> r <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> caught.index]</span>
<span id="cb30-151"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="ch" style="color: #20794D;
background-color: null;
font-style: inherit;">\n</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">rows that fail no claim: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>idle <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> idle <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb30-152">missing <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [n <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> claims.metrics</span>
<span id="cb30-153">           <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> claims.metrics[n].get(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"structural"</span>) <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">and</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> bt[(bt.claim <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> n) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> bt.caught].shape[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]]</span>
<span id="cb30-154"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"claims no row fails: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>missing <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> missing <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>39 rows; claims each row fails:
  Table 1 run 1 N_Re read 195.1 instead of 159.1: 41
      re_law_T_exponent_se, re_law_resid_rms_pct, re_law_resid_rms_pct_free_stream, re_law_T_exponent_free_stream, re_reference_weight_band, t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t3_extrapolation_K, t1_heat_intercept_free, t1_heat_intercept_se, t1_heat_slope_free, t1_heat_slope_at_A2, t1_heat_K_recovered, t1_heat_K_recovered_dev_pct, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, t1_heat_freefit_rms_pct, t1_heat_null_best_rms_pct, t1_mass_intercept_free, t1_mass_intercept_se, t1_mass_slope_free, t1_mass_fit_resid_rms_pct, mass_intercept_dev_water_pct, heat_intercept_dev_pct, sc_ratio_benzene_over_water, dv_factor_from_intercept, t3_from_t1_rms_pct, t3_over_t1_rms_factor, t1_heat_Re_exponent_fitted, t1_heat_Re_exponent_se, re_reference_temperature_weight, re_law_T_exponent, re_law_resid_max_pct, re_freestream_worst_Re_pct, re_freestream_worst_Nu_pct, t1_iso_expected_spread_from_T_pct, t3_heldout_rms_pct, t3_heldout_w, mass_intercept_t_water, re_band_holds_045_and_055, t1_iso_spread_below_T_effect
  Table 1 drop diameter read 0.954 instead of 0.0954 on every row: 19
      re_law_T_exponent_se, re_law_resid_rms_pct, re_law_resid_rms_pct_free_stream, re_law_T_exponent_free_stream, re_reference_weight_band, t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t3_extrapolation_K, re_reference_temperature_weight, re_law_T_exponent, re_law_resid_max_pct, re_freestream_worst_Re_pct, re_freestream_worst_Nu_pct, t1_iso_expected_spread_from_T_pct, t3_heldout_rms_pct, t3_heldout_w, re_band_holds_045_and_055, t1_iso_spread_below_T_effect, t1_iso_spread_inside_T_plus_rounding
  Table 1 run 14 air velocity read 3.4 instead of 3.37: 19
      re_law_T_exponent_se, re_law_resid_rms_pct, re_law_resid_rms_pct_free_stream, re_law_T_exponent_free_stream, re_reference_weight_band, t1_iso_Re_over_v_spread_pct, t1_iso_rounding_ptp_bound_pct, t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t3_extrapolation_K, re_reference_temperature_weight, re_law_T_exponent, re_law_resid_max_pct, re_freestream_worst_Re_pct, re_freestream_worst_Nu_pct, t1_iso_expected_spread_from_T_pct, t3_heldout_rms_pct, t3_heldout_w, t1_iso_spread_below_T_effect
  Table 1 drop temperatures replaced by the air temperatures: 16
      re_law_T_exponent_se, re_law_resid_rms_pct, re_reference_weight_band, stillair_film_minus_stated_K, t3_heldout_rms_pct_drop_surface, t3_extrapolation_K, re_reference_temperature_weight, re_law_T_exponent, re_law_resid_max_pct, re_freestream_worst_Re_pct, re_freestream_worst_Nu_pct, t1_iso_expected_spread_from_T_pct, t3_heldout_rms_pct, t3_heldout_w, re_band_holds_045_and_055, t1_iso_spread_below_T_effect
  Table 1 run 6 air velocity read 92.5 instead of 95.2: 19
      re_law_T_exponent_se, re_law_resid_rms_pct, re_law_resid_rms_pct_free_stream, re_law_T_exponent_free_stream, re_reference_weight_band, t1_iso_Re_over_v_spread_pct, t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t3_extrapolation_K, re_reference_temperature_weight, re_law_T_exponent, re_law_resid_max_pct, re_freestream_worst_Re_pct, re_freestream_worst_Nu_pct, t1_iso_expected_spread_from_T_pct, t3_heldout_rms_pct, t3_heldout_w, t1_iso_spread_below_T_effect, t1_iso_spread_inside_T_plus_rounding
  Table 3 drop temperatures replaced by its air temperatures: 4
      t3_heldout_rms_pct_drop_surface, t3_extrapolation_K, t3_heldout_rms_pct, t3_heldout_w
  reference temperature fixed at the free stream (w = 0): 13
      re_law_T_exponent_se, re_law_resid_rms_pct, re_reference_weight_band, t3_extrapolation_K, re_reference_temperature_weight, re_law_T_exponent, re_law_resid_max_pct, re_freestream_worst_Re_pct, re_freestream_worst_Nu_pct, t1_iso_expected_spread_from_T_pct, t3_heldout_rms_pct, re_band_holds_045_and_055, t1_iso_spread_below_T_effect
  Table 1 apparent N_Nu used for the corrected column: 17
      t1_heat_intercept_free, t1_heat_intercept_se, t1_heat_slope_free, t1_heat_slope_at_A2, t1_heat_K_recovered, t1_heat_K_recovered_dev_pct, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, t1_heat_freefit_rms_pct, t1_heat_null_best_rms_pct, heat_intercept_dev_pct, replicate_mean_pct, t3_from_t1_rms_pct, t3_over_t1_rms_factor, t1_heat_Re_exponent_fitted, t1_heat_Re_exponent_se, heat_intercept_t
  still-air row swept into the heat regression: 10
      t1_heat_intercept_free, t1_heat_intercept_se, t1_heat_slope_free, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, t1_heat_freefit_rms_pct, t1_heat_null_best_rms_pct, heat_intercept_dev_pct, t3_over_t1_rms_factor, t1_heat_Re_exponent_se
  Table 1 run 18 N_Nu read 6.56 instead of 9.56: 15
      t1_heat_intercept_free, t1_heat_intercept_se, t1_heat_slope_free, t1_heat_slope_at_A2, t1_heat_K_recovered, t1_heat_K_recovered_dev_pct, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, t1_heat_freefit_rms_pct, t1_heat_null_best_rms_pct, heat_intercept_dev_pct, t3_from_t1_rms_pct, t3_over_t1_rms_factor, t1_heat_Re_exponent_fitted, t1_heat_Re_exponent_se
  Table 1 run 18 N_Nu' read 4.48 instead of 9.48: 8
      t1_mass_intercept_free, t1_mass_intercept_se, t1_mass_slope_free, t1_mass_fit_resid_rms_pct, mass_intercept_dev_water_pct, sc_ratio_benzene_over_water, dv_factor_from_intercept, mass_intercept_t_water
  the three ink-damaged N_Nu' cells filled in by guesswork: 8
      t1_mass_intercept_free, t1_mass_intercept_se, t1_mass_slope_free, t1_mass_fit_resid_rms_pct, mass_intercept_dev_water_pct, sc_ratio_benzene_over_water, dv_factor_from_intercept, mass_intercept_t_water
  Table 4 N_Nu' column replaced by its N_Nu column: 13
      t4_benzene_intercept_free, t4_benzene_intercept_se, t4_benzene_slope_free, mass_intercept_dev_benzene_pct, sc_ratio_benzene_over_water, t4_ratio_spread_runs_10_12_pct, t4_run11_Nuprime_upper_bound, t4_run11_Nuprime_lower_bound, t4_run11_alt_intercept, t4_run11_alt_intercept_drift_pct, t4_run11_alt_ratio_spread_pct, t4_run11_alt_outside_bracket_pct, mass_intercept_t_benzene
  Table 4 run 11 N_Nu' read 10.6 instead of 10.0: 7
      t4_benzene_intercept_free, t4_benzene_intercept_se, t4_benzene_slope_free, mass_intercept_dev_benzene_pct, sc_ratio_benzene_over_water, t4_ratio_spread_runs_10_12_pct, t4_run11_alt_intercept_drift_pct
  Table 4 run 12 N_Nu' read 10.0 instead of 10.9: 12
      t4_benzene_intercept_free, t4_benzene_intercept_se, t4_benzene_slope_free, mass_intercept_dev_benzene_pct, sc_ratio_benzene_over_water, t4_ratio_spread_runs_10_12_pct, t4_run11_Nuprime_upper_bound, t4_run11_Nuprime_lower_bound, t4_run11_alt_intercept, t4_run11_alt_intercept_drift_pct, t4_run11_alt_ratio_spread_pct, t4_run11_alt_outside_bracket_pct
  still-air N_Nu read 3.23 instead of 2.23: 2
      stillair_Nu_over_theory, stillair_analogy_ratio
  still-air N_Nu' read 1.19 instead of 1.79: 3
      stillair_Nuprime_over_theory, stillair_analogy_ratio, dv_used_over_dv_backed_out
  Table 2 run 4 corrected N_Nu read 5.9 instead of 5.4: 2
      replicate_worst_pct, replicate_mean_pct
  Table 3 run 7 diameter read 0.101 instead of 0.088: 6
      t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t3_pair_abscissa_max_dev_pct, t3_heldout_rms_pct, t3_heldout_w, t3_pair_identities_within_rounding
  Table 3 run 1 N_Nu read 4.0 instead of 7.0: 10
      t3_eq21_rms_pct, t3_eq21_max_pct, t3_eq21_bias_pct, t3_eq21_bias_se_pct, t3_from_t1_rms_pct, t3_over_t1_rms_factor, t3_pair_nu_ratio_max_dev_pct, t3_pair_worst_nu_ratio_error_pct, t3_pair_identities_within_rounding, t3_pairs_measurement_steeper
  theoretical intercept 2.0 read as 1.7: 27
      t1_heat_slope_at_A2, t1_heat_K_recovered, t1_heat_K_recovered_dev_pct, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, mass_intercept_dev_water_pct, mass_intercept_dev_benzene_pct, heat_intercept_dev_pct, sc_ratio_benzene_over_water, stillair_Nu_over_theory, stillair_Nuprime_over_theory, dv_used_over_dv_backed_out, dv_factor_from_intercept, t3_eq21_rms_pct, t3_eq21_max_pct, t3_eq21_bias_pct, t3_eq21_bias_se_pct, t3_from_t1_rms_pct, t3_over_t1_rms_factor, t3_pair_worst_nu_ratio_error_pct, t1_heat_Re_exponent_fitted, t1_heat_Re_exponent_se, re_freestream_worst_Nu_pct, mass_intercept_t_water, heat_intercept_t, mass_intercept_t_benzene, t1_heat_Re_exponent_t
  fitted coefficient 0.60 read as 6.0: 14
      pr_air_implied_by_eq24, t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t1_heat_K_recovered, t3_eq21_rms_pct, t3_eq21_max_pct, t3_eq21_bias_pct, t3_eq21_bias_se_pct, t3_from_t1_rms_pct, t3_over_t1_rms_factor, t3_pair_worst_nu_ratio_error_pct, t3_heldout_rms_pct, t3_heldout_w, t3_pairs_measurement_steeper
  Reynolds exponent 1/2 read as 1/3: 34
      t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t1_heat_intercept_free, t1_heat_intercept_se, t1_heat_slope_free, t1_heat_slope_at_A2, t1_heat_K_recovered, t1_heat_K_recovered_dev_pct, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, t1_heat_freefit_rms_pct, t1_heat_null_best_rms_pct, t1_mass_intercept_free, t1_mass_intercept_se, t1_mass_slope_free, t1_mass_fit_resid_rms_pct, t4_benzene_intercept_free, t4_benzene_intercept_se, t4_benzene_slope_free, mass_intercept_dev_water_pct, mass_intercept_dev_benzene_pct, heat_intercept_dev_pct, sc_ratio_benzene_over_water, t4_run11_alt_intercept, t4_run11_alt_intercept_drift_pct, dv_factor_from_intercept, t3_from_t1_rms_pct, t3_over_t1_rms_factor, re_freestream_worst_Nu_pct, t3_heldout_rms_pct, t3_heldout_w, heat_intercept_t, mass_intercept_t_benzene, t1_heat_Re_exponent_t
  Prandtl exponent 1/3 read as 1/2: 2
      pr_air_implied_by_eq24, sc_ratio_benzene_over_water
  eq. (24) coefficient 0.54 read as 0.60: 13
      pr_air_implied_by_eq24, t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t1_heat_K_recovered, t1_heat_K_recovered_dev_pct, t1_heat_eq24_rms_pct, t1_heat_eq24_max_pct, t1_heat_null_best_rms_pct, t3_from_t1_rms_pct, t3_over_t1_rms_factor, re_freestream_worst_Nu_pct, t3_heldout_rms_pct, t3_heldout_w
  still-air reference temperature 290 K read as 280 K: 1
      stillair_film_minus_stated_K
  Table 3 pressure 743 mm Hg read as 473: 4
      t3_heldout_rms_pct_free_stream, t3_heldout_rms_pct_drop_surface, t3_heldout_rms_pct, t3_heldout_w
  test No. 80 capillary correction 0.011 read as 0.001: 2
      test80_printed_vs_recomputed_rel, test80_within_printed_precision
  sphere solved with nu = 1 (cylinder): 6
      pymrm_conduction_Nu_infinity, pymrm_conduction_b10_excess_pct, pymrm_conduction_dev_from_2, pymrm_conduction_shell_gap, nu_two_routes_rel_diff, ladder_finest_over_roundoff
  sphere outer boundary closed (no flux): 7
      pymrm_conduction_Nu_infinity, pymrm_conduction_b10_excess_pct, pymrm_conduction_order_min, pymrm_conduction_order_max, pymrm_conduction_dev_from_2, pymrm_conduction_shell_gap, nu_two_routes_rel_diff
  uniform radial cells instead of geometric: 4
      pymrm_conduction_Nu_infinity, pymrm_conduction_order_min, pymrm_conduction_dev_from_2, nu_two_routes_rel_diff
  ladder started at 6 cells: 5
      pymrm_conduction_Nu_infinity, pymrm_conduction_b10_excess_pct, pymrm_conduction_order_min, pymrm_conduction_dev_from_2, nu_two_routes_rel_diff
  resistance integral stopped at 10 radii: 2
      nu_quadrature_route, nu_two_routes_rel_diff
  theoretical intercept 2.0 read as 1.7 in the sphere check: 1
      pymrm_conduction_dev_from_2
  radial convection switched off in the Stefan solve: 3
      stefan_pymrm_vs_closed_rel, stefan_order_max, stefan_extrap_vs_closed_rel
  Stefan order ladder run at y = 0.01: 2
      stefan_order_min, stefan_order_max
  p_f arithmetic mean taken as 1 - y: 1
      pf_arith_dev_at_y020_pct
  thresholds solved for 2, 7 and 15 % instead of 1, 5 and 10 %: 3
      stefan_y_for_01pct, stefan_y_for_05pct, stefan_y_for_10pct
  Lambert W on the branch W_-1: 1
      stefan_threshold_vs_lambertw

rows that fail no claim: none
claims no row fails: none</code></pre>
</div>
</div>
<p><strong>What the break table cannot do.</strong> Every row perturbs an input and watches a claim fail. That establishes sensitivity. It cannot catch a baseline that is wrong by accident: a value limited by a grid, read at the wrong place, or right for the wrong reason. Four defences are used instead: the finite-volume 2.0 is measured <strong>against the exact answer</strong>, not against a second estimate; every threshold and minimum is a <strong>root</strong> (of the closed-form excess, of the exact derivative of the residual), not a sampled value; the datasets are checked against <strong>over-determinations the papers cannot avoid</strong> (the Reynolds column against the columns beside it, and Table 4’s <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'/N_%7BNu%7D"> ratio against its own temperature columns); and the recovered reference temperature is checked <strong>out of sample</strong>, on Table 3’s nine rows, and against the one place the papers state the convention themselves.</p>
<p><strong>A constraint, not a perturbation, decides Table 4’s run 11.</strong> Read as 10.6, the digit moves the benzene intercept by only 1.5 %, inside any 5 % regression tolerance. What excludes it is the row’s <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'/N_%7BNu%7D"> ratio, which must match its neighbours’ and would not, 6.93 % against 1.03 %. A break table tells you which numbers are load-bearing; only a constraint tells you whether one is wrong.</p>
</section>
</section>
<section id="what-pymrm-adds" class="level2">
<h2 class="anchored" data-anchor-id="what-pymrm-adds">What pymrm adds</h2>
<p><strong>Not the correlation.</strong> Eqs. (21) and (22) are algebra and need no solver; this page says so rather than dressing an evaluation up as a simulation. Two things are pymrm’s, and two need no solver at all.</p>
<ol type="1">
<li><p><strong>The <code>2.0</code> becomes a computation instead of a citation.</strong> Part I asserts eq. (7); pymrm solves the spherical BVP it comes from, a linear problem with one sparse solve per grid, on a ladder of nested grids whose second-order Richardson limit lies below 1e-6 from the exact 2. That matters practically, not decoratively: the same solve says a finite far field of ten radii shifts the “2” by 11.1 %, which is the correction anyone applying Ranz-Marshall inside a dense spray or a packed bed needs and which the correlation itself cannot express. (<code>A3.4</code>, Wakao-Funazkri, is the page for packed beds; this one does not go there.)</p></li>
<li><p><strong>A number on the radial-convection factor Ranz said the papers underplayed.</strong> Adding <code>construct_convflux_upwind</code> to the same spherical solve, with the total flow a root of the flux balance, turns “which average is <img src="https://latex.codecogs.com/png.latex?p_f">?”, a genuine ambiguity in Part II’s own notation, into a settled question: the logarithmic mean, to below 1e-8 once the first-order upwind error and the second-order diffusion error are removed together; the arithmetic mean is 0.41 % out at <img src="https://latex.codecogs.com/png.latex?y%20=%200.20">.</p></li>
<li><p><strong>The fit/test split, which is the actual result and needed no solver.</strong> Separating the theoretical 2.0 from the fitted 0.60 and the assumed exponents, and then extrapolating three independent sets of runs to <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D=0"> with the intercept’s standard error, is what turns “the correlation fits the data to a few per cent” into “two of the three are consistent with 2.0 and the third misses by -13.4 %, 3.08 standard errors, in the direction the authors’ own first-listed error term predicts”. The authors state the direction (“Data for mass transfer show a steeper slope and a lower intercept”) and name the cause (“(1) inaccurate values of diffusivity”). What is new here is the <strong>size</strong>, per species, with its standard error, and the resulting tension with the two conclusions they <em>did</em> draw from it: the abstract’s “verified the simple expression for the Nusselt number at zero Reynolds number”, and folio 174’s implication that their <img src="https://latex.codecogs.com/png.latex?D_v"> “may be more accurate than any reported in the literature”.</p></li>
<li><p><strong>A convention recovered from the tables, and then tested out of sample, with no solver.</strong> The Reynolds column is over-determined by the columns printed beside it; asking it at what temperature the air properties were evaluated returns <img src="https://latex.codecogs.com/png.latex?w"> = 0.4996, the film temperature. Two things then corroborate it independently: Part II’s own statement of a reference temperature for the still-air run (0.15 K from the row’s film temperature), and Table 3, nine rows with no Reynolds column, which therefore cannot have entered the fit, predicted to 0.82 % against 1.77 % at the free stream.</p></li>
</ol>
</section>
<section id="reuse" class="level2">
<h2 class="anchored" data-anchor-id="reuse">Reuse</h2>
<p><strong>Use <code>Nu = 2 + 0.6 Re^(1/2) Pr^(1/3)</code> for an isolated sphere or drop in a moving fluid at 0 &lt; Re &lt; 200.</strong> That is what the paper’s own abstract claims (“a Reynolds number range of 0 to 200”), and it covers Tables 1–3; note that Table 4’s last benzene run is printed at <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D%20=%20220">, so the tables reach slightly past the stated range. <strong>Part I’s abstract</strong>, not Part II, says the results “could be extrapolated with remarkable accuracy five times beyond the experimental range of Reynolds numbers”; Part II puts it as “remarkably accurate even when extrapolated five times beyond the experimental range in which they were determined” (folio 174). Either way that claim rests on Figure 12, which is not transcribed here, so this page neither supports nor contradicts it.</p>
<p><strong>Five warnings, all of them measured above.</strong></p>
<ul>
<li><strong>Evaluate the air properties at the film temperature, the mean of the air and drop temperatures.</strong> Neither part states this for the tables; it is recovered on this page from the printed Reynolds column, at <img src="https://latex.codecogs.com/png.latex?w"> = 0.4996 with the fitted temperature exponent landing on kinetic theory’s <img src="https://latex.codecogs.com/png.latex?-1.7">, and it is corroborated both by the one reference temperature Part II does print (0.15 K from the row’s film temperature) and out of sample on Table 3. Using the free-stream temperature instead moves <img src="https://latex.codecogs.com/png.latex?N_%7BRe%7D"> by up to 15.5 % on the paper’s own rows and the predicted <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D"> by up to 5.4 %.</li>
<li><strong>The Prandtl exponent is not testable from anything transcribed here, but the paper does test it, graphically.</strong> Every run in Tables 1–4 is in air, so the <img src="https://latex.codecogs.com/png.latex?1/3"> cannot be identified from these rows. Figure 12 carries Kramers’s steel-to-oil and steel-to-water points on the <img src="https://latex.codecogs.com/png.latex?N_%7BPr%7D%5E%7B1/3%7DN_%7BRe%7D%5E%7B1/2%7D"> abscissa and folio 174 credits the exponents on that basis. That figure is not digitised here, so if your fluid is not air the <img src="https://latex.codecogs.com/png.latex?1/3"> reaches you supported by a plot this page did not check, not by nothing; and the coefficient and the exponent are still not separable from these tables.</li>
<li><strong>Expect roughly 10 % at high air temperature.</strong> Table 3 (85–221 °C) sits 11.0 % rms from the correlation <em>while inside its own fit set</em>, against 1.72 % for the room-temperature runs.</li>
<li><strong>The heat and mass forms are not interchangeable at low Reynolds number.</strong> The paper’s own still-air pair has a ratio of 1.2458 where the two equations demand identity.</li>
<li><strong>If you use the mass-transfer form, watch which diffusivity you pair it with.</strong> <img src="https://latex.codecogs.com/png.latex?N_%7BNu%7D'"> was reduced from rate data using the authors’ own <img src="https://latex.codecogs.com/png.latex?D_v">; adopting a different one rescales the whole correlation. A diffusivity 1.155 times too large would produce the -13.4 % intercept deficit found here; the page measures that size, not that this is its cause. The authors list “inaccurate values of diffusivity” first among the causes of the anomaly themselves, and separately conclude that their <img src="https://latex.codecogs.com/png.latex?D_v"> may be the most accurate available; those two statements pull in opposite directions and this page cannot settle which is right.</li>
</ul>
<p><strong>Do not use this page for</strong>: free convection (the <img src="https://latex.codecogs.com/png.latex?N_%7BGr%7D%5E%7B1/4%7D"> form of eqs. 10 and 11 is never exercised here; say so if you cite it); drops containing dissolved or suspended solids (Part II’s second half, whose calculated rates need Figure 14); or packed beds, which is <code>A3.4</code>.</p>
<p><strong>Datasets are reusable on their own.</strong> All five carry <code>columns:</code> blocks and provenance sidecars, and all five are table transcriptions, so nothing in them depends on a figure reading or on this page’s argument.</p>
<section id="prose-numbers" class="level3">
<h3 class="anchored" data-anchor-id="prose-numbers">6. Prose numbers</h3>
<p>Every number the Markdown above writes from a computed value, checked against its claim to one unit in its last written place.</p>
<div id="37be0bc8" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:34.686250Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:34.686003Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:34.692693Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:34.692145Z&quot;}}" data-execution_count="17">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb32-1">PROSE <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [</span>
<span id="cb32-2">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0582"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_free"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0538"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_intercept_se"</span>),</span>
<span id="cb32-3">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+2.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_t"</span>),</span>
<span id="cb32-4">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0523"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_free"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.1245"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_benzene_intercept_se"</span>),</span>
<span id="cb32-5">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+2.6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_dev_benzene_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_benzene"</span>),</span>
<span id="cb32-6">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.7322"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_free"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0870"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_intercept_se"</span>),</span>
<span id="cb32-7">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-13.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_dev_water_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-3.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_water"</span>),</span>
<span id="cb32-8">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.2458"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_analogy_ratio"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.117"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dv_used_over_dv_backed_out"</span>),</span>
<span id="cb32-9">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-6"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_dev_from_2"</span>),</span>
<span id="cb32-10">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4996"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_reference_temperature_weight"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1.765"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_T_exponent"</span>),</span>
<span id="cb32-11">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.027"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_T_exponent_se"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.69"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_resid_rms_pct"</span>),</span>
<span id="cb32-12">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-1.32"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_T_exponent_free_stream"</span>),</span>
<span id="cb32-13">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.14"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_law_resid_rms_pct_free_stream"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.15"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stillair_film_minus_stated_K"</span>),</span>
<span id="cb32-14">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_freestream_worst_Re_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_freestream_worst_Nu_pct"</span>),</span>
<span id="cb32-15">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.178"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"re_reference_weight_band"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.578"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_expected_spread_from_T_pct"</span>),</span>
<span id="cb32-16">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.492"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_Re_over_v_spread_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.612"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_iso_rounding_ptp_bound_pct"</span>),</span>
<span id="cb32-17">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.82"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.77"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct_free_stream"</span>),</span>
<span id="cb32-18">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7.20"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_rms_pct_drop_surface"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.5140"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_heldout_w"</span>),</span>
<span id="cb32-19">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"81"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_extrapolation_K"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.729"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pr_air_implied_by_eq24"</span>),</span>
<span id="cb32-20">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.6020"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.4933"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_fitted"</span>),</span>
<span id="cb32-21">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.0079"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_se"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-0.84"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_Re_exponent_t"</span>),</span>
<span id="cb32-22">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.72"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_eq24_rms_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"39.8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_null_best_rms_pct"</span>),</span>
<span id="cb32-23">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+1.08"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"heat_intercept_t"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.42"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_benzene"</span>),</span>
<span id="cb32-24">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-3.08"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mass_intercept_t_water"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.73"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_Nuprime_lower_bound"</span>),</span>
<span id="cb32-25">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"10.06"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_Nuprime_upper_bound"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.03"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_ratio_spread_runs_10_12_pct"</span>),</span>
<span id="cb32-26">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.0222"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_intercept"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.5"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_intercept_drift_pct"</span>),</span>
<span id="cb32-27">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6.93"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t4_run11_alt_ratio_spread_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2.82"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sc_ratio_benzene_over_water"</span>),</span>
<span id="cb32-28">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.68"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"replicate_mean_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.87"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"replicate_worst_pct"</span>),</span>
<span id="cb32-29">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.155"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dv_factor_from_intercept"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.44"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_mass_fit_resid_rms_pct"</span>),</span>
<span id="cb32-30">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.0"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_rms_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"19.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_max_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+6.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_bias_pct"</span>),</span>
<span id="cb32-31">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_eq21_bias_se_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6.4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_over_t1_rms_factor"</span>),</span>
<span id="cb32-32">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_from_t1_rms_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.78"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_abscissa_max_dev_pct"</span>),</span>
<span id="cb32-33">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.82"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_nu_ratio_max_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"21.9"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pair_worst_nu_ratio_error_pct"</span>),</span>
<span id="cb32-34">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t3_pairs_measurement_steeper"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11.1"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymrm_conduction_b10_excess_pct"</span>),</span>
<span id="cb32-35">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"below 1e-8"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_extrap_vs_closed_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.41"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pf_arith_dev_at_y020_pct"</span>),</span>
<span id="cb32-36">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.62e-4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_pymrm_vs_closed_rel"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1.97 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_y_for_01pct"</span>),</span>
<span id="cb32-37">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"9.37 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_y_for_05pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"17.61 %"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stefan_y_for_10pct"</span>),</span>
<span id="cb32-38">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4.2e-04"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"test80_printed_vs_recomputed_rel"</span>),</span>
<span id="cb32-39">    (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"+0.34"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered_dev_pct"</span>), (<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0.34"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t1_heat_K_recovered_dev_pct"</span>),</span>
<span id="cb32-40">]</span>
<span id="cb32-41">bad <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [(lit, name) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> lit, name <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> PROSE <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">not</span> claims.says(lit, name)]</span>
<span id="cb32-42"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">print</span>(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(PROSE)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> prose numbers checked; failing: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> bad <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'none'</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>74 prose numbers checked; failing: none</code></pre>
</div>
</div>
<div id="fbc085fa" class="cell" data-quarto-private-1="{&quot;key&quot;:&quot;execution&quot;,&quot;value&quot;:{&quot;iopub.execute_input&quot;:&quot;2026-11-09T16:47:34.693951Z&quot;,&quot;iopub.status.busy&quot;:&quot;2026-11-09T16:47:34.693813Z&quot;,&quot;iopub.status.idle&quot;:&quot;2026-11-09T16:47:34.701897Z&quot;,&quot;shell.execute_reply&quot;:&quot;2026-11-09T16:47:34.701140Z&quot;}}" data-execution_count="18">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb34-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Claims: prints every registered number, writes agreement.json for CI, and</span></span>
<span id="cb34-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># raises if any claim fails its check or has no break row that fails it.</span></span>
<span id="cb34-3">claims.report()<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>   <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># the semicolon keeps the notebook from echoing the payload</span></span></code></pre></div></div>
<div class="cell-output cell-output-stdout">
<pre><code>Claims for A3.5:
  pr_air_implied_by_eq24               = 0.729            value  rtol 1e-06
  re_law_T_exponent_se                 = 0.026515         value  rtol 1e-06
  re_law_resid_rms_pct                 = 0.69464          value  rtol 1e-06
  re_law_resid_rms_pct_free_stream     = 1.1413           value  rtol 1e-06
  re_law_T_exponent_free_stream        = -1.3227          value  rtol 1e-06
  re_reference_weight_band             = 0.1778           value  rtol 1e-06
  t1_iso_Re_over_v_spread_pct          = 0.49195          value  rtol 1e-06
  t1_iso_rounding_ptp_bound_pct        = 0.61218          value  rtol 1e-06
  stillair_film_minus_stated_K         = 0.15             value  rtol 1e-06
  t3_heldout_rms_pct_free_stream       = 1.7686           value  rtol 1e-06
  t3_heldout_rms_pct_drop_surface      = 7.2012           value  rtol 1e-06
  t3_extrapolation_K                   = 80.647           value  rtol 1e-06
  t1_heat_intercept_free               = 2.0582           value  rtol 1e-06
  t1_heat_intercept_se                 = 0.053788         value  rtol 1e-06
  t1_heat_slope_free                   = 0.53611          value  rtol 1e-06
  t1_heat_slope_at_A2                  = 0.54183          value  rtol 1e-06
  t1_heat_K_recovered                  = 0.60203          value  rtol 1e-06
  t1_heat_K_recovered_dev_pct          = 0.33848          value  rtol 1e-06
  t1_heat_eq24_rms_pct                 = 1.7157           value  rtol 1e-06
  t1_heat_eq24_max_pct                 = 3.6541           value  rtol 1e-06
  t1_heat_freefit_rms_pct              = 1.4574           value  rtol 1e-06
  t1_heat_null_best_rms_pct            = 39.806           value  rtol 1e-06
  t1_mass_intercept_free               = 1.7322           value  rtol 1e-06
  t1_mass_intercept_se                 = 0.087011         value  rtol 1e-06
  t1_mass_slope_free                   = 0.55396          value  rtol 1e-06
  t1_mass_fit_resid_rms_pct            = 1.4413           value  rtol 1e-06
  t4_benzene_intercept_free            = 2.0523           value  rtol 1e-06
  t4_benzene_intercept_se              = 0.1245           value  rtol 1e-06
  t4_benzene_slope_free                = 0.74106          value  rtol 1e-06
  mass_intercept_dev_water_pct         = -13.389          value  rtol 1e-06
  mass_intercept_dev_benzene_pct       = 2.6141           value  rtol 1e-06
  heat_intercept_dev_pct               = 2.9122           value  rtol 1e-06
  sc_ratio_benzene_over_water          = 2.8178           value  rtol 1e-06
  t4_ratio_spread_runs_10_12_pct       = 1.0298           value  rtol 1e-06
  t4_run11_Nuprime_upper_bound         = 10.064           value  rtol 1e-06
  t4_run11_Nuprime_lower_bound         = 9.734            value  rtol 1e-06
  t4_run11_alt_intercept               = 2.0222           value  rtol 1e-06
  t4_run11_alt_intercept_drift_pct     = 1.4671           value  rtol 1e-06
  t4_run11_alt_ratio_spread_pct        = 6.9305           value  rtol 1e-06
  t4_run11_alt_outside_bracket_pct     = 5.9939           value  rtol 1e-06
  stillair_Nu_over_theory              = 1.115            value  rtol 1e-06
  stillair_Nuprime_over_theory         = 0.895            value  rtol 1e-06
  stillair_analogy_ratio               = 1.2458           value  rtol 1e-06
  dv_used_over_dv_backed_out           = 1.1173           value  rtol 1e-06
  dv_factor_from_intercept             = 1.1546           value  rtol 1e-06
  replicate_worst_pct                  = 1.8692           value  rtol 1e-06
  replicate_mean_pct                   = 0.68129          value  rtol 1e-06
  t3_eq21_rms_pct                      = 11.047           value  rtol 1e-06
  t3_eq21_max_pct                      = 19.111           value  rtol 1e-06
  t3_eq21_bias_pct                     = 6.4422           value  rtol 1e-06
  t3_eq21_bias_se_pct                  = 3.1727           value  rtol 1e-06
  t3_from_t1_rms_pct                   = 11.191           value  rtol 1e-06
  t3_over_t1_rms_factor                = 6.4387           value  rtol 1e-06
  t3_pair_abscissa_max_dev_pct         = 1.7815           value  rtol 1e-06
  t3_pair_nu_ratio_max_dev_pct         = 1.8182           value  rtol 1e-06
  t3_pair_worst_nu_ratio_error_pct     = 21.853           value  rtol 1e-06
  pf_arith_dev_at_y020_pct             = 0.4146           value  rtol 1e-06
  stefan_y_for_01pct                   = 0.019736         value  rtol 1e-06
  stefan_y_for_05pct                   = 0.093702         value  rtol 1e-06
  stefan_y_for_10pct                   = 0.17613          value  rtol 1e-06
  test80_printed_vs_recomputed_rel     = 0.0004219        value  rtol 1e-06
  t1_heat_Re_exponent_fitted           = 0.49334          value  rtol 0.0001
  t1_heat_Re_exponent_se               = 0.0078891        value  rtol 0.0001
  re_reference_temperature_weight      = 0.49958          value  rtol 0.0001
  re_law_T_exponent                    = -1.765           value  rtol 0.0001
  re_law_resid_max_pct                 = 2.4624           value  rtol 0.0001
  re_freestream_worst_Re_pct           = 15.547           value  rtol 0.0001
  re_freestream_worst_Nu_pct           = 5.4138           value  rtol 0.0001
  t1_iso_expected_spread_from_T_pct    = 0.57849          value  rtol 0.0001
  t3_heldout_rms_pct                   = 0.82281          value  rtol 0.0001
  t3_heldout_w                         = 0.51399          value  rtol 0.0001
  mass_intercept_t_water               = (here -3.1e+00)  bound  bound &lt;= -2.16037 [chosen]
  heat_intercept_t                     = (here 1.1e+00)   bound  bound [-2.11991, 2.11991] [chosen]
  mass_intercept_t_benzene             = (here 4.2e-01)   bound  bound [-2.20099, 2.20099] [chosen]
  t1_heat_Re_exponent_t                = (here -8.4e-01)  bound  bound [-2.11991, 2.11991] [chosen]
  re_band_holds_045_and_055            = True             exact  exact, margin 0.0325
  t1_iso_spread_below_T_effect         = True             exact  exact, margin 0.176
  t1_iso_spread_inside_T_plus_rounding = True             exact  exact, margin 1.42
  t3_pair_identities_within_rounding   = True             exact  exact, margin 0.671
  t3_pairs_measurement_steeper         = 3                exact  exact, margin 1.48
  test80_within_printed_precision      = True             exact  exact, margin 0.53
  pymrm_conduction_Nu_infinity         = 2                value  rtol 1e-06
  pymrm_conduction_b10_excess_pct      = 11.111           value  rtol 0.0001
  pymrm_conduction_order_min           = (here 2.0e+00)   bound  bound &gt;= 1.95 [theory]
  pymrm_conduction_order_max           = (here 2.1e+00)   bound  bound &lt;= 2.15 [theory]
  pymrm_conduction_dev_from_2          = (here 1.2e-07)   bound  bound &lt;= 1e-06 [theory]
  pymrm_conduction_shell_gap           = (here 5.2e-13)   bound  bound &lt;= 1e-09 [identity]
  nu_quadrature_route                  = (here 2.0e+00)   bound  bound [2, 2] [identity]
  nu_two_routes_rel_diff               = (here 6.0e-08)   bound  bound &lt;= 1e-06 [theory]
  stefan_pymrm_vs_closed_rel           = 0.00096207       value  rtol 0.0001
  stefan_order_min                     = (here 8.8e-01)   bound  bound &gt;= 0.85 [theory]
  stefan_order_max                     = (here 9.9e-01)   bound  bound &lt;= 1 [theory]
  stefan_extrap_vs_closed_rel          = (here 3.4e-10)   bound  bound &lt;= 1e-08 [theory]
  stefan_balance_gap                   = (here 2.0e-13)   bound  bound &lt;= 1e-09 [identity]
  ladder_finest_over_roundoff          = (here 4.8e+07)   bound  bound &gt;= 1000 [theory]
  stefan_threshold_vs_lambertw         = (here 7.5e-15)   bound  bound &lt;= 1e-12 [tolerance]</code></pre>
</div>
</div>


</section>
</section>
</section>

 ]]></description>
  <category>sec:A</category>
  <category>struct:S3</category>
  <category>tier:T0</category>
  <category>data:tier3</category>
  <category>phase:gas-liquid</category>
  <guid>https://computational-chemical-engineering.github.io/pymrm-gallery/pages/A3.5-ranz-marshall-froessling/</guid>
  <pubDate>Fri, 07 Aug 2026 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
